[GHC] #8666: integer-gmp fails to compile on Debian Squeeze

#8666: integer-gmp fails to compile on Debian Squeeze -----------------------------------+--------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries | Version: 7.7 (other) | Operating System: Linux Keywords: | Type of failure: Compile-time crash Architecture: x86_64 (amd64) | Test Case: Difficulty: Unknown | Blocking: Blocked By: | Related Tickets: | -----------------------------------+--------------------------------------- I get an error when compiling recent HEAD on Debian Squeeze: {{{ "inplace/bin/ghc-stage1" -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -H64m -O0 -fasm -package-name integer-gmp-0.5.1.0 -hide-all- packages -i -ilibraries/integer-gmp/. -ilibraries/integer-gmp/dist- install/build -ilibraries/integer-gmp/dist-install/build/autogen -Ilibraries/integer-gmp/dist-install/build -Ilibraries/integer-gmp/dist- install/build/autogen -Ilibraries/integer-gmp/. -optP-include -optPlibraries/integer-gmp/dist-install/build/autogen/cabal_macros.h -package ghc-prim-0.3.1.0 -Wall -package-name integer-gmp -XHaskell2010 -O -fasm -no-user-package-db -rtsopts -Ilibraries/integer- gmp/mkGmpDerivedConstants/dist -odir libraries/integer-gmp/dist- install/build -hidir libraries/integer-gmp/dist-install/build -stubdir libraries/integer-gmp/dist-install/build -fno-use-rpaths -optl-Wl,-rpath -optl-Wl,'$ORIGIN/../ghc-prim-0.3.1.0' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../rts-1.0' -optl-Wl,-zorigin libraries/integer-gmp/dist- install/build/GHC/Integer.dyn_o libraries/integer-gmp/dist- install/build/GHC/Integer/GMP/Internals.dyn_o libraries/integer-gmp/dist- install/build/GHC/Integer/GMP/Prim.dyn_o libraries/integer-gmp/dist- install/build/GHC/Integer/Logarithms.dyn_o libraries/integer-gmp/dist- install/build/GHC/Integer/Logarithms/Internals.dyn_o libraries/integer-gmp /dist-install/build/GHC/Integer/Type.dyn_o libraries/integer-gmp/dist- install/build/cbits/gmp-wrappers.dyn_o libraries/integer-gmp/dist- install/build/cbits/cbits.dyn_o libraries/integer-gmp/gmp/objs/*.o -shared -dynamic -dynload deploy -no-auto-link-packages -o libraries /integer-gmp/dist-install/build/libHSinteger- gmp-0.5.1.0-ghc7.7.20140113.so Warning: -rtsopts and -with-rtsopts have no effect with -shared. Call hs_init_ghc() from your main() function to set these options. /usr/bin/ld: libraries/integer-gmp/gmp/objs/aors.o: relocation R_X86_64_32 against `__gmpz_sub' can not be used when making a shared object; recompile with -fPIC libraries/integer-gmp/gmp/objs/aors.o: could not read symbols: Bad value collect2: ld returned 1 exit status make[1]: *** [libraries/integer-gmp/dist-install/build/libHSinteger- gmp-0.5.1.0-ghc7.7.20140113.so] Error 1 make: *** [all] Error 2 }}} I can build in-tree `libgmp` by extracting it and running `./configure make`. Following Austin's and Herbert's suggestions I tried adding `-fPIC` to command line options but with no result - see attachements. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8666 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8666: integer-gmp fails to compile on Debian Squeeze ---------------------------------------+---------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Comment (by jstolarek): Another user reports the same problem with GHC 7.8.1-RC1: http://www.haskell.org/pipermail/glasgow-haskell- users/2014-February/024641.html -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8666#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8666: integer-gmp fails to compile on Debian Squeeze ---------------------------------------+---------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Comment (by iduhetonas): I had this issue when compiling with libgmp3-dev 2:4.3.2, which was in the repository of Ubuntu 10.04 Lucid. I upgraded to libgmp3-dev 2:5.0.2 in Ubuntu 12.04 Precise, did "make distclean && make maintainer-clean", and recompiled from scratch, which fixed the issue. I assume the error lies between these two versions, so make sure you're using libgmp3-dev 2:5.0.2 at least. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8666#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8666: integer-gmp fails to compile on Debian Squeeze ---------------------------------------+---------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: libraries (other) | Version: 7.7 Resolution: fixed | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Changes (by iduhetonas): * status: new => closed * resolution: => fixed Comment: User claims to no longer be experiencing the issue. http://www.haskell.org/pipermail/ghc-devs/2014-February/004051.html Marking as fixed. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8666#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8666: integer-gmp fails to compile on Debian Squeeze ---------------------------------------+---------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Changes (by jstolarek): * status: closed => new * resolution: fixed => Comment:
User claims to no longer be experiencing the issue
Wow, wait a sec. I'm not experiencing the issue because I upgraded to new Debian, not because the issue was fixed. I'm reopening the ticket. We should either have a real fix or mark this as wontfix - but the latter is not for me to decide (Herbert?). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8666#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8666: integer-gmp fails to compile on Debian Squeeze
---------------------------------------+----------------------------------
Reporter: jstolarek | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: libraries (other) | Version: 7.7
Resolution: | Keywords:
Operating System: Linux | Architecture: x86_64 (amd64)
Type of failure: Compile-time crash | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
---------------------------------------+----------------------------------
Comment (by Austin Seipp

#8666: integer-gmp fails to compile on Debian Squeeze ---------------------------------------+---------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Comment (by thoughtpolice): After looking at this, the reason for this is probably because the in-tree GMP is a bit broken, and doesn't compile correctly dynamically. In the mean time, I have pushed a patch to restore compatibility with (much) older GMP versions, meaning as long as your Debian Squeeze machines have `libgmp-dev` installed, everything should be fine. I'd appreciate it if someone could test this on HEAD (or the upcoming RC2). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8666#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8666: integer-gmp fails to compile on Debian Squeeze ---------------------------------------+---------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Comment (by thoughtpolice): (I mean, test it on Debian - I have confirmed that RHEL can use gmp 4 from the regular repositories, and GHC compiles without issue). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8666#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8666: integer-gmp fails to compile on Debian Squeeze ---------------------------------------+---------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Changes (by tibbe): * cc: tibbe (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8666#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8666: integer-gmp fails to compile on Debian Squeeze ---------------------------------------+---------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries (other) | Version: 7.7 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: Compile-time crash | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: ---------------------------------------+---------------------------------- Comment (by ocharles): I believe I am running into this bug: {{{ ollie@nixos ~/w/ghc> nix-shell --pure -I /home/ollie -p haskellPackages_ghc782.ghc haskellPackages.cabalInstall -p haskellPackages_ghc782.happy haskellPackages_ghc782.alex -p ncurses -p gnum4 [nix-shell:~/work/ghc/libraries/base]$ make make -C ../.. all_libraries/base make[1]: Entering directory `/home/ollie/work/ghc' ===--- building phase 0 make -r --no-print-directory -f ghc.mk phase=0 phase_0_builds make[2]: Nothing to be done for `phase_0_builds'. ===--- building phase 1 make -r --no-print-directory -f ghc.mk phase=1 phase_1_builds make[2]: Nothing to be done for `phase_1_builds'. ===--- building final phase make -r --no-print-directory -f ghc.mk phase=final all_libraries/base "inplace/bin/ghc-stage1" -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -H64m -O0 -fasm -package-name integer-gmp-0.5.1.0 -hide-all- packages -i -ilibraries/integer-gmp/. -ilibraries/integer-gmp/dist- install/build -ilibraries/integer-gmp/dist-install/build/autogen -Ilibraries/integer-gmp/dist-install/build -Ilibraries/integer-gmp/dist- install/build/autogen -Ilibraries/integer-gmp/include -optP-include -optPlibraries/integer-gmp/dist-install/build/autogen/cabal_macros.h -package ghc-prim-0.3.1.0 -Wall -package-name integer-gmp -XHaskell2010 -O -fasm -no-user-package-db -rtsopts -Ilibraries/integer- gmp/mkGmpDerivedConstants/dist -odir libraries/integer-gmp/dist- install/build -hidir libraries/integer-gmp/dist-install/build -stubdir libraries/integer-gmp/dist-install/build -optl-L'/home/ollie/work/ghc/libraries/ghc-prim/dist-install/build' -optl-L'/home/ollie/work/ghc/rts/dist/build' -optl-lm -optl-lrt -optl-ldl -fPIC -dynamic -H64m -O0 -fasm -package-name integer-gmp-0.5.1.0 -hide-all-packages -i -ilibraries/integer-gmp/. -ilibraries/integer-gmp /dist-install/build -ilibraries/integer-gmp/dist-install/build/autogen -Ilibraries/integer-gmp/dist-install/build -Ilibraries/integer-gmp/dist- install/build/autogen -Ilibraries/integer-gmp/include -optP-include -optPlibraries/integer-gmp/dist-install/build/autogen/cabal_macros.h -package ghc-prim-0.3.1.0 -Wall -package-name integer-gmp -XHaskell2010 -O -fasm -no-user-package-db -rtsopts -Ilibraries/integer- gmp/mkGmpDerivedConstants/dist -fno-use-rpaths -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../ghc-prim-0.3.1.0' -optl-Wl,-rpath -optl- Wl,'$ORIGIN/../rts-1.0' -optl-Wl,-zorigin libraries/integer-gmp/dist- install/build/GHC/Integer.dyn_o libraries/integer-gmp/dist- install/build/GHC/Integer/GMP/Internals.dyn_o libraries/integer-gmp/dist- install/build/GHC/Integer/GMP/Prim.dyn_o libraries/integer-gmp/dist- install/build/GHC/Integer/Logarithms.dyn_o libraries/integer-gmp/dist- install/build/GHC/Integer/Logarithms/Internals.dyn_o libraries/integer-gmp /dist-install/build/GHC/Integer/Type.dyn_o libraries/integer-gmp/dist- install/build/cbits/gmp-wrappers.dyn_o libraries/integer-gmp/dist- install/build/cbits/cbits.dyn_o libraries/integer-gmp/gmp/objs/*.o -shared -dynamic -dynload deploy -no-auto-link-packages -o libraries /integer-gmp/dist-install/build/libHSinteger- gmp-0.5.1.0-ghc7.9.20140430.so Warning: -rtsopts and -with-rtsopts have no effect with -shared. Call hs_init_ghc() from your main() function to set these options. /nix/store/xjvdpqgn2kd4rg0k30z020kxylvlbpx0-binutils-2.23.1/bin/ld: libraries/integer-gmp/gmp/objs/aors.o: relocation R_X86_64_32 against `__gmpz_add' can not be used when making a shared object; recompile with -fPIC libraries/integer-gmp/gmp/objs/aors.o: could not read symbols: Bad value collect2: error: ld returned 1 exit status make[2]: *** [libraries/integer-gmp/dist-install/build/libHSinteger- gmp-0.5.1.0-ghc7.9.20140430.so] Error 1 make[1]: *** [all_libraries/base] Error 2 make[1]: Leaving directory `/home/ollie/work/ghc' make: *** [all] Error 2 }}} If anyone has anything they'd like me to try - suggest away! I'm at revision 34db5ccf52ec2a1b5e953c282d0c52a7fc82c02a (at least in the root of the source tree), and my nixpkgs is e001ac6a9ee3e3f1d755c16d1a27e5ce75a76902 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8666#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8666: integer-gmp fails to compile on Debian Squeeze -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: libraries | Version: 7.7 (other) | Keywords: Resolution: | Architecture: x86_64 (amd64) Operating System: Linux | Difficulty: Unknown Type of failure: Compile- | Blocked By: time crash | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by rwbarton): It should suffice to do a second build of gmp with `--enable-shared=yes`, right? I see there is the beginnings of some code in `gmp/ghc.mk` to do this already, but it's very old, not sure what the story is there. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8666#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8666: integer-gmp fails to compile on Debian Squeeze -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: ekmett Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.7 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by ekmett): * cc: hvr, core-libraries-committee@… (added) Comment: What is the status of this now with Herbert's new `integer-gmp` approach? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8666#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8666: integer-gmp fails to compile on Debian Squeeze -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Core Libraries | Version: 7.7 Resolution: | Keywords: integer-gmp Operating System: Linux | Architecture: x86_64 Type of failure: Compile-time | (amd64) crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * keywords: => integer-gmp * cc: ekmett (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8666#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC