summaryrefslogtreecommitdiff
path: root/libraries/integer-gmp/gmp
Commit message (Collapse)AuthorAgeFilesLines
* ghc-bignum librarySylvain Henry2020-06-175-187/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ghc-bignum is a newer package that aims to replace the legacy integer-simple and integer-gmp packages. * it supports several backends. In particular GMP is still supported and most of the code from integer-gmp has been merged in the "gmp" backend. * the pure Haskell "native" backend is new and is much faster than the previous pure Haskell implementation provided by integer-simple * new backends are easier to write because they only have to provide a few well defined functions. All the other code is common to all backends. In particular they all share the efficient small/big number distinction previously used only in integer-gmp. * backends can all be tested against the "native" backend with a simple Cabal flag. Backends are only allowed to differ in performance, their results should be the same. * Add `integer-gmp` compat package: provide some pattern synonyms and function aliases for those in `ghc-bignum`. It is intended to avoid breaking packages that depend on `integer-gmp` internals. Update submodules: text, bytestring Metric Decrease: Conversions ManyAlternatives ManyConstructors Naperian T10359 T10547 T10678 T12150 T12227 T12234 T12425 T13035 T13719 T14936 T1969 T4801 T4830 T5237 T5549 T5837 T8766 T9020 parsing001 space_leak_001 T16190 haddock.base On ARM and i386, T17499 regresses (+6% > 5%). On x86_64 unregistered, T13701 sometimes regresses (+2.2% > 2%). Metric Increase: T17499 T13701
* Make: refactor GMP rulesSylvain Henry2020-03-141-7/+8
| | | | Document and use simpler rules for the ghc-gmp.h header.
* Use configure script to detect that we should use in-tree GMP on WindowsSylvain Henry2020-03-021-6/+0
|
* integer-gmp: Fix unused command-line argumentBen Gamari2020-02-141-1/+1
| | | | -L is only needed during linking.
* Force -fPIC for intree GMP (fix #17799)Sylvain Henry2020-02-092-46/+1
| | | | | Configure intree GMP with `--with-pic` instead of patching it. Moreover the correct patching was only done for x86_64/darwin (see #17799).
* Update Wiki URLs to point to GitLabTakenobu Tani2019-03-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This moves all URL references to Trac Wiki to their corresponding GitLab counterparts. This substitution is classified as follows: 1. Automated substitution using sed with Ben's mapping rule [1] Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy... New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy... 2. Manual substitution for URLs containing `#` index Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz 3. Manual substitution for strings starting with `Commentary` Old: Commentary/XxxYyy... New: commentary/xxx-yyy... See also !539 [1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
* Move gmp/config.mk.in to config.mk.in, fix #14972Edward Z. Yang2018-04-102-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here's how the rube goldberg machine triggered the old bug: 1. If you have a file gmp/config.mk.in, then Cabal will create a generated file in $DIST/build/gmp/config.mk 2. When you attempt to load inplace integer-gmp via GHCi, it will ask gcc (aka clang on OS X) for the file name of 'gmp', with base directory set to $DIST/build 3. There is a folder named 'gmp', and so this folder is returned as the 'library' for gmp 4. GHCi loadArchive chokes to death trying to open a library that is actually a folder This patch solves the problem by breaking the chain at (1): if we don't put config.mk in a folder named gmp, NO PROBLEM. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Test Plan: validate Reviewers: angerman, hvr, bgamari Reviewed By: angerman Subscribers: erikd, thomie, carter GHC Trac Issues: #14972 Differential Revision: https://phabricator.haskell.org/D4552
* add CCX=$(CXX) to integer-gmpMoritz Angermann2018-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This came up when trying to build GHC HEAD with nix. We do not set CCX for integer-gmp when running ./configure. We do this however for libffi. The result is, that if CCX is not set, we default to the system one, of which there might be none (as in nixos's case). This will not show on a debian+nix or similar setup, where the system `cxx` is still in place, and only shows up when the system tries hard to sandbox everything (even cxx) as nixOS does. We use `CXX`, which is set to either `clang` or `CC_STAGE1`, and also usedfor `CC`, similar to what we do for libffi.c Test Plan: ./validate Reviewers: bgamari, hvr Reviewed By: hvr Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4473
* Fixup include of gmp/config.mk to use new locationHerbert Valerio Riedel2018-03-051-1/+1
| | | | | | | | | | | | | This wasn't spotted rightaway in 8f0b2f5eadf0fcb47c581907205a9db686214a69 because the include-site deliberately ignored include-errors as a Hack with the justification below: > Hack. The file gmp/config.mk doesn't exist yet after running ./configure in > the toplevel (ghc) directory. To let some toplevel make commands such as > sdist go through, right after ./configure, don't consider this an error. This may have contributed to #14891.
* integer-gmp: Simplify gmp/configure invocationBen Gamari2018-02-021-4/+1
| | | | | | | | | | | There weas lots of historical cruft to be found here. The `export SHELLOPTS` breaks on NixOS due to bash syntax in the gcc wrapper script. Reviewers: hvr Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4347
* Turn libraries/integer-gmp/gmp/tarball into a submoduleReid Barton2017-01-307-1725/+87
| | | | | | | | | | | | | | | | | | | | | | | | | The submodule repository contains the latest version of the GMP source distribution (6.1.2) with the doc/ subdirectory removed, as described in gmp/ghc.mk. Rather than applying the old patch from gmp/tarball/patch I moved its contents into gmp/gmpsrc.patch, canceling a patch related to memory management there. Experimentally, the PIC-related patch for OS X is still necessary. The upgrade to GMP 6.1.2 fixes #7655. Test Plan: Built on OS X with in-tree gmp and tested that the command `ghc -e 'length (show (2^(5*10^6) :: Integer))'` no longer segfaults. Reviewers: mpickering, hvr, austin, bgamari Reviewed By: bgamari Subscribers: mpickering, thomie Differential Revision: https://phabricator.haskell.org/D3044 GHC Trac Issues: #7655
* Build system: Correctly pass `TARGETPLATFORM` as hostNicolas Trangez2016-02-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | When building the bundled GMP sources, the `HOSTPLATFORM` value was passed to the `--host` flag of the `./configure` call. This is incorrect: when building a cross-compiler, e.g. a compiler targeting ARM but running on X86, the host on which GMP will run is ARM, i.e. the target platform of the compiler, and the host platform (i.e. the platform on which the compiler will run) is X86. See e.g. [1] for more information about the meaning of and relation between build, host and target. [1] https://www.gnu.org/software/autoconf/manual/ autoconf-2.65/html_node/Specifying-Target-Triplets.html Test Plan: Building ARM cross-compiler with `integer-gmp` Reviewers: thomie, gracjan, austin, erikd, Phyx, hvr, bgamari Reviewed By: erikd, bgamari Subscribers: erikd, gracjan Differential Revision: https://phabricator.haskell.org/D1960
* Build system: delete half-baked Cygwin supportThomas Miedema2015-08-201-5/+0
| | | | | | | | | | | | | | | | | | | We only support building GHC on mys2 nowadays, see https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Windows. This (partially) reverts various commits from a few years ago, among which: * 5775d5142da227d65fb86994d363eb16841ee642 "Add OSTYPE build-system variable, and use it" * 3fb8c431824aa2f3bd979e35d1a283546fcfbe74 "Fix building libgmp on cygwin" * cdbb4720c424500adb57cbbef69721d0b039fa46 "Fix cmd invocation by libffi cuild system on Windows 7 cygwin" * e8121501ee3549a35e954726ccfd871ac9d51f83 "Fix dblatex and xml* tool detection on Windows" Reviewed by: austin, Phyx Differential Revision: https://phabricator.haskell.org/D1155
* Build: ./boot && ./configure && make sdist (#8723)Thomas Miedema2015-06-041-1/+4
| | | | | | | | | | | | | | | | | Make it possible to run `make sdist` right after configure, without completing a complete build first. Test Plan: I compared the contents of the created `.tar.bz2` files in the `sdistprep` directory, after running `make sdist` both before and after completing a full build, using `diff -r`. There weren't any differences (after applying the patches from D914). Note that the `.tar.bz2` files were not exactly the same size, but they aren't either when tarring and bzipping the same directory twice. It seems tarring and bzipping is not deterministic (on my system). Differential Revision: https://phabricator.haskell.org/D917
* Build system: prevent "--version: Command not found"Thomas Miedema2015-05-301-1/+4
| | | | | | | This would happen when running `make clean` before running `./configure`. [skip ci]
* Build system: check $CLEANING instead of $MAKECMDGOALSThomas Miedema2015-05-301-1/+1
| | | | | | | To check if we're cleaning, always check the $CLEANING variable, instead of sometimes $CLEANING, sometimes $MAKECMDGOALS. [skip ci]
* Drop old integer-gmp-0.5 from GHC source treeHerbert Valerio Riedel2015-03-313-75/+55
| | | | | | | | | | | | | | | | | | This completes what c774b28f76ee4c220f7c1c9fd81585e0e3af0e8a (#9281) started. `integer-gmp-1.0` was added as an additional `libraries/integer-gmp2` folder while retaining the ability to configure GHC w/ the old `integer-gmp-0.5` to have a way back, and or the ability to easily switch between old/new `integer-gmp` for benchmark/debugging purposes. This commit removes the old `libraries/integer-gmp` folder and moves `libraries/integer-gmp2` into its place, while removing any mentions of "gmp2" as well as the to support two different `integer-gmp` packages in GHC's source-tree. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D769
* Update in-tree GMP to version 5.0.4Herbert Valerio Riedel2014-11-231-0/+1584
| | | | | | | This is mostly a proof of concept for updating the in-tree GMP via patch files (and therefore w/o introducing new blobs into the Git history). NOTE: The updated GMP 5.0.4 version is only used by the integer-gmp2 backend.
* integer-gmp: do not confuse ./configure (#8783)Christian Maeder2014-05-181-1/+1
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Normalize GHC Trac URLsHerbert Valerio Riedel2014-04-191-2/+2
| | | | | | | | | | | | | | Update several old http://hackage.haskell.org/trac/ghc URLs references to the current http://ghc.haskell.org/trac/ghc URLs. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Fix in-tree GMP build (#8497) on OS X MavericksKazu Yamamoto2014-01-141-1/+9
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* Follow GHC build system changesIan Lynagh2013-07-031-1/+1
|
* Run "sh ./configure" rather than "sh configure"; part of #7992Ian Lynagh2013-06-221-2/+2
| | | | This fixes a bug with how configure re-execs itself.
* Handle dependencies for .cmm files properlyIan Lynagh2013-05-091-6/+2
|
* Build system refactoringIan Lynagh2013-04-201-12/+9
|
* Follow changes in GHC's build systemIan Lynagh2013-03-011-1/+1
|
* Fix GMP_PREFER_FRAMEWORKIan Lynagh2013-02-091-5/+5
| | | | It doesn't look like the old code could have worked
* Never try to use the system gmp on WindowsIan Lynagh2013-02-092-0/+6
| | | | | Apparently building on Windows failed when there is a system gmp available.
* Revert "integer-gmp: improve cross-compiling support GmpDerivedConstants.h"Simon Marlow2013-01-261-0/+8
| | | | | | | This reverts commit 860f2fa9a1f1ca4f8d94388723687f90d122ae81. People reported problems with it on the mailing list, so reverting until we can figure out the cause.
* integer-gmp: improve cross-compiling support GmpDerivedConstants.hSergei Trofimovich2013-01-241-8/+0
| | | | | | | | | | Before the patch GmpDerivedConstants.h was generated by running mkGmpDerivedConstants on target. Now it's generated only with help of autoconf macros. Tested on --target=ia64-unknown-linux-gnu. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Provide a way for OS X users to indicate a preference for the GMP frameworkIan Lynagh2013-01-011-0/+4
| | | | | | | | We used to always use the framework if it existed. Now the make variable GMP_PREFER_FRAMEWORK can be used to control whether the library or the framework is preferred. Fixes #7466.
* Fix building libgmp on cygwinIan Lynagh2012-03-161-0/+6
|
* Updated to a newer version of gmp; fixes #5810Ian Lynagh2012-02-031-0/+0
| | | | | | | | I didn't diagnose the problem, but with the newer GMP the problem seems fixed. There are a couple of things that look like candidates for the bug: * A few minor bugs related to portability fixed. * A bug in division code possibly causing incorrect computation was fixed.
* Use the mingw touch program on WindowsIan Lynagh2011-12-021-1/+1
|
* Follow GHC build system change to the way we call rmIan Lynagh2011-11-191-2/+2
|
* This should finally fix #5293 by fixing two bugs in GMP's configuration setupManuel M T Chakravarty2011-08-051-0/+33
| | | | | * GMP uses m4 scripts to pre-process hand coded assembly routines * These didn't properly account for OS X/i86_64 always using PIC
* Upgrade gmp, 4.2.4 -> 5.0.2Ian Lynagh2011-07-272-10/+63
|
* Follow CC var changes in makefilesIan Lynagh2011-04-231-3/+3
|
* Make and use AR_STAGE[0123] makefile varsIan Lynagh2011-04-231-2/+2
|
* Tweak build rulesIan Lynagh2011-04-221-4/+4
| | | | | | | | | We were doing echo $(HOSTPLATFORM) | sed 's/i[567]86/i486/g' but the only x86 value HOSTPLATFORM can have is i386. We now also tell GMP that its build platform is $(BUILDPLATFORM) rather than $(HOSTPLATFORM).
* Call the final build system phase "final" rather than ""Ian Lynagh2011-02-061-1/+1
|
* Update for changes in GHC's build systemIan Lynagh2011-01-221-1/+1
|
* Correct the gmp build phaseIan Lynagh2011-01-171-1/+1
|
* Tidy up gmp cleaningIan Lynagh2011-01-171-16/+23
|
* Use the stage-specific CONF_CC_OPTS variablesIan Lynagh2010-07-231-1/+1
|
* Follow variable name changesIan Lynagh2010-06-161-2/+2
|
* pass $(AR) to the GMP buildSimon Marlow2010-06-101-4/+2
|
* Fix the $(GMP_DIR) path that we removeIan Lynagh2010-04-191-1/+1
|
* Fix the buildIan Lynagh2010-02-151-1/+1
| | | | | A missing | meant that the build broke on machines that don't have libgmp available.
* Don't rely on tar supporting -j; trac #3841Ian Lynagh2010-02-141-1/+1
|