Call for help on testing integer-gmp2 on non-Linux archs

Hello *, As some of you may have already noticed, there's an attempt[1] in the works to reimplement integer-gmp in such a way to avoid overriding GMP's internal memory allocator functions, and thus make it possible to link GHC/integer-gmp compiled programs with other components linked to libgmp which break if GMP's memory allocation goes via GHC's GC. I also hope this will facilitate to ship GHC bindists for Windows with a dynamically linked (& unpatched!) GMP library, to reduce LGPL licencing concerns for resulting GHC compiled programs. So far, I've only been able to test the code on Linux/i386 and Linux/amd64 where it works correctly. Now it'd be interesting to know if integer-gmp2 in its current form works also on non-Linux archs, and if not, what's needed to make it work. Fwiw, I mostly suspect linker-related issues. Therefore, is anyone here interested to help out with making sure GHC+integer-gmp2 builds on Windows, OSX and so on? If so, please get into contact with me! Cheers, hvr [1]: https://ghc.haskell.org/trac/ghc/ticket/9281 https://phabricator.haskell.org/D82

I can test on Windows.
Niklas
2014-07-22 10:07 GMT+02:00 Herbert Valerio Riedel
Hello *,
As some of you may have already noticed, there's an attempt[1] in the works to reimplement integer-gmp in such a way to avoid overriding GMP's internal memory allocator functions, and thus make it possible to link GHC/integer-gmp compiled programs with other components linked to libgmp which break if GMP's memory allocation goes via GHC's GC. I also hope this will facilitate to ship GHC bindists for Windows with a dynamically linked (& unpatched!) GMP library, to reduce LGPL licencing concerns for resulting GHC compiled programs.
So far, I've only been able to test the code on Linux/i386 and Linux/amd64 where it works correctly. Now it'd be interesting to know if integer-gmp2 in its current form works also on non-Linux archs, and if not, what's needed to make it work. Fwiw, I mostly suspect linker-related issues.
Therefore, is anyone here interested to help out with making sure GHC+integer-gmp2 builds on Windows, OSX and so on? If so, please get into contact with me!
Cheers, hvr
[1]: https://ghc.haskell.org/trac/ghc/ticket/9281 https://phabricator.haskell.org/D82 _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

On 2014-07-22 at 13:33:04 +0200, Niklas Larsson wrote:
I can test on Windows.
great! Are you using the 32bit or 64bit compiler? All you'd need to do is 'git checkout' the wip/T9281 branch, add the line INTEGER_LIBRARY=integer-gmp2 at the end of mk/build.mk (and 'BuildFlavour=quick' should suffice) and try to build GHC with that. If you end up with a working stage2 compiler, and 'inplace/bin/ghc-stage2 --interactive' reports loading the package 'integer-gmp2' then everything went better than expected :) Then running the testsuite via cd testsuite/ && make WAY=normal SKIP_PERF_TESTS=YES should only fail with a few testcases due to the strings "integer-gmp2" vs. "integer-gmp" being different in the output. Thanks,, hvr

Starting a build on my MAC:
OS: 10.8.5
XCode: XCode 4 CLI-only (so _no_ full Xcode, that is, xcode-select fails)
GCC: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
GHC: 7.8.3
On Jul 22, 2014, at 2:02 PM, Herbert Valerio Riedel
On 2014-07-22 at 13:33:04 +0200, Niklas Larsson wrote:
I can test on Windows.
great! Are you using the 32bit or 64bit compiler?
All you'd need to do is 'git checkout' the wip/T9281 branch, add the line
INTEGER_LIBRARY=integer-gmp2
at the end of mk/build.mk (and 'BuildFlavour=quick' should suffice) and try to build GHC with that. If you end up with a working stage2 compiler, and 'inplace/bin/ghc-stage2 --interactive' reports loading the package 'integer-gmp2' then everything went better than expected :)
Then running the testsuite via
cd testsuite/ && make WAY=normal SKIP_PERF_TESTS=YES
should only fail with a few testcases due to the strings "integer-gmp2" vs. "integer-gmp" being different in the output.
Thanks,, hvr _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

The testsuite results are here: http://paste.ubuntu.com/7836630/
On Jul 22, 2014, at 2:11 PM, Christiaan Baaij
Starting a build on my MAC:
OS: 10.8.5 XCode: XCode 4 CLI-only (so _no_ full Xcode, that is, xcode-select fails) GCC: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) GHC: 7.8.3
On Jul 22, 2014, at 2:02 PM, Herbert Valerio Riedel
wrote: On 2014-07-22 at 13:33:04 +0200, Niklas Larsson wrote:
I can test on Windows.
great! Are you using the 32bit or 64bit compiler?
All you'd need to do is 'git checkout' the wip/T9281 branch, add the line
INTEGER_LIBRARY=integer-gmp2
at the end of mk/build.mk (and 'BuildFlavour=quick' should suffice) and try to build GHC with that. If you end up with a working stage2 compiler, and 'inplace/bin/ghc-stage2 --interactive' reports loading the package 'integer-gmp2' then everything went better than expected :)
Then running the testsuite via
cd testsuite/ && make WAY=normal SKIP_PERF_TESTS=YES
should only fail with a few testcases due to the strings "integer-gmp2" vs. "integer-gmp" being different in the output.
Thanks,, hvr _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

I can do both 32 and 64-bit builds.I started with 32 bits.
I got
"inplace/bin/ghc-stage2.exe" -hisuf hi -osuf o -hcsuf hc -static -H64m
-O0 -fasm -package-name vector -0.10.9.1 -hide-all-packages
-i -ilibraries/vector/. -ilibraries/vector/dist-install/build
-ilibraries/vec tor/dist-install/build/autogen
-Ilibraries/vector/dist-install/build
-Ilibraries/vector/dist-install/build /autogen
-Ilibraries/vector/include -Ilibraries/vector/internal
-optP-DVECTOR_BOUNDS_CHECKS -optP-includ e
-optPlibraries/vector/dist-install/build/autogen/cabal_macros.h -package
base-4.7.1.0 -package deepseq-1 .3.0.2 -package ghc-prim-0.3.1.0
-package primitive-0.5.2.1 -O2 -XHaskell98 -XCPP -XDeriveDataTypeable
-O -fasm -no-user-package-db -rtsopts -odir
libraries/vector/dist-install/build -hidir libraries/vector
/dist-install/build -stubdir libraries/vector/dist-install/build -c
libraries/vector/./Data/Vector/Fusio n/Stream/Monadic.hs -o
libraries/vector/dist-install/build/Data/Vector/Fusion/Stream/Monadic.o
"/usr/bin/ar" q
libraries/primitive/dist-install/build/libHSprimitive-0.5.2.1.a
@libraries/primitive/dist
-install/build/libHSprimitive-0.5.2.1.a.contents
/usr/bin/ar: creating
libraries/primitive/dist-install/build/libHSprimitive-0.5.2.1.a
"rm" -f
libraries/primitive/dist-install/build/libHSprimitive-0.5.2.1.a.contents
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp2 ... linking ... ghc-stage2.exe: unable to load
package `integer-gmp2'
ghc-stage2.exe:
D:\Niklas\scratch\ghc-build\msys\home\niklas\ghc\libraries\integer-gmp2\dist-install\build
\HSinteger-gmp2-0.0.1.0.o: unknown symbol `_scalbn'
I built it´with gmp-6.0.0.
2014-07-22 14:02 GMT+02:00 Herbert Valerio Riedel
On 2014-07-22 at 13:33:04 +0200, Niklas Larsson wrote:
I can test on Windows.
great! Are you using the 32bit or 64bit compiler?
All you'd need to do is 'git checkout' the wip/T9281 branch, add the line
INTEGER_LIBRARY=integer-gmp2
at the end of mk/build.mk (and 'BuildFlavour=quick' should suffice) and try to build GHC with that. If you end up with a working stage2 compiler, and 'inplace/bin/ghc-stage2 --interactive' reports loading the package 'integer-gmp2' then everything went better than expected :)
Then running the testsuite via
cd testsuite/ && make WAY=normal SKIP_PERF_TESTS=YES
should only fail with a few testcases due to the strings "integer-gmp2" vs. "integer-gmp" being different in the output.
Thanks,, hvr

Hello Niklas, On 2014-07-22 at 23:38:07 +0200, Niklas Larsson wrote:
I can do both 32 and 64-bit builds.I started with 32 bits.
Both would be interesting!
I got
[...]
Loading package ghc-prim ... linking ... done. Loading package integer-gmp2 ... linking ... ghc-stage2.exe: unable to load package `integer-gmp2' ghc-stage2.exe: D:\Niklas\scratch\ghc-build\msys\home\niklas\ghc\libraries\integer-gmp2\dist-install\build \HSinteger-gmp2-0.0.1.0.o: unknown symbol `_scalbn'
I built it´with gmp-6.0.0.
can you retry with http://git.haskell.org/ghc.git/commitdiff/237462c166a8ae7ca733bc755334c2cf47... applied? It seems like Windows requires each library which uses symbols from libm to link directly against libm. Thanks!
participants (4)
-
Christiaan Baaij
-
Herbert Valerio Riedel
-
Herbert Valerio Riedel
-
Niklas Larsson