
#11147: GHC 7.10.3 does not compile on NixOS ----------------------------------------+---------------------------------- Reporter: waern | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+---------------------------------- Comment (by rwbarton): It's not librt that isn't being linked, it's libpthread. The eventual issue is here: {{{ "inplace/bin/ghc-stage1" -o utils/hsc2hs/dist-install/build/tmp/hsc2hs -hisuf dyn_hi -osuf dyn_o -hcsuf dyn_hc -fPIC -dynamic -H32m -O -hide-all-packages -i -iutils/hsc2hs/. -iutils/hsc2hs/dist-install/build -iutils/hsc2hs/dist-install/build/autogen -Iutils/hsc2hs/dist- install/build -Iutils/hsc2hs/dist-install/build/autogen -optP-include -optPutils/hsc2hs/dist-install/build/autogen/cabal_macros.h -package-key base_HQfYBxpPvuw8OunzQu6JGM -package-key conta_2C3ZI8RgPO2LBMidXKTvIU -package-key direc_0hFG6ZxK1nk4zsyOqbNHfm -package-key filep_Ey7a1in9roBAE8bUFJ5R9m -package-key proce_52AgREEfSrnJLlkGV9YZZJ -XHaskell2010 -no-user-package-db -rtsopts -odir utils/hsc2hs/dist- install/build -hidir utils/hsc2hs/dist-install/build -stubdir utils/hsc2hs /dist-install/build -optl-L'/tmp/nix-build- ghc-7.10.3.drv-0/ghc-7.10.3/libraries/process/dist-install/build' -optl-L'/tmp/nix-build-ghc-7.10.3.drv-0/ghc-7.10.3/libraries/directory /dist-install/build' -optl-L'/tmp/nix-build- ghc-7.10.3.drv-0/ghc-7.10.3/libraries/unix/dist-install/build' -optl-L'/tmp/nix-build-ghc-7.10.3.drv-0/ghc-7.10.3/libraries/time/dist- install/build' -optl-L'/tmp/nix-build- ghc-7.10.3.drv-0/ghc-7.10.3/libraries/filepath/dist-install/build' -optl-L'/tmp/nix-build-ghc-7.10.3.drv-0/ghc-7.10.3/libraries/containers /dist-install/build' -optl-L'/tmp/nix-build- ghc-7.10.3.drv-0/ghc-7.10.3/libraries/bytestring/dist-install/build' -optl-L'/tmp/nix-build-ghc-7.10.3.drv-0/ghc-7.10.3/libraries/deepseq/dist- install/build' -optl-L'/tmp/nix-build- ghc-7.10.3.drv-0/ghc-7.10.3/libraries/array/dist-install/build' -optl-L'/tmp/nix-build-ghc-7.10.3.drv-0/ghc-7.10.3/libraries/base/dist- install/build' -optl-L'/tmp/nix-build- ghc-7.10.3.drv-0/ghc-7.10.3/libraries/integer-gmp2/dist-install/build' -optl-L'/nix/store/blp0hymd8i8m1v4cjcrkacbh6cw6ia8d-gmp-5.1.3/lib' -optl-L'/tmp/nix-build-ghc-7.10.3.drv-0/ghc-7.10.3/libraries/ghc-prim /dist-install/build' -optl-L'/tmp/nix-build- ghc-7.10.3.drv-0/ghc-7.10.3/rts/dist/build' -optl-lrt -optl-lutil -optl- ldl -optl-lgmp -optl-lm -optl-lrt -optl-ldl -fPIC -dynamic -H32m -O -hide-all-packages -i -iutils/hsc2hs/. -iutils/hsc2hs/dist-install/build -iutils/hsc2hs/dist-install/build/autogen -Iutils/hsc2hs/dist- install/build -Iutils/hsc2hs/dist-install/build/autogen -optP-include -optPutils/hsc2hs/dist-install/build/autogen/cabal_macros.h -package-key base_HQfYBxpPvuw8OunzQu6JGM -package-key conta_2C3ZI8RgPO2LBMidXKTvIU -package-key direc_0hFG6ZxK1nk4zsyOqbNHfm -package-key filep_Ey7a1in9roBAE8bUFJ5R9m -package-key proce_52AgREEfSrnJLlkGV9YZZJ -XHaskell2010 -no-user-package-db -rtsopts -fno-use-rpaths -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../proce_52AgREEfSrnJLlkGV9YZZJ' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../direc_0hFG6ZxK1nk4zsyOqbNHfm' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../unix_KZL8h98IqDM57kQSPo1mKx' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../time_FTheb6LSxyX1UABIbBXRfn' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../filep_Ey7a1in9roBAE8bUFJ5R9m' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../conta_2C3ZI8RgPO2LBMidXKTvIU' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../bytes_6VWy06pWzJq9evDvK2d4w6' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../deeps_6vMKxt5sPFR0XsbRWvvq59' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../array_67iodizgJQIIxYVTp4emlA' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../base_HQfYBxpPvuw8OunzQu6JGM' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../integ_2aU3IZNMF9a7mQ0OzsZ0dS' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../ghcpr_8TmvWUcS1U1IKHT0levwg3' -optl- Wl,-rpath -optl-Wl,'$ORIGIN/../rts' -optl-Wl,-zorigin utils/hsc2hs/dist- install/build/Main.dyn_o utils/hsc2hs/dist-install/build/C.dyn_o utils/hsc2hs/dist-install/build/Common.dyn_o utils/hsc2hs/dist- install/build/CrossCodegen.dyn_o utils/hsc2hs/dist- install/build/DirectCodegen.dyn_o utils/hsc2hs/dist- install/build/Flags.dyn_o utils/hsc2hs/dist-install/build/HSCParser.dyn_o utils/hsc2hs/dist-install/build/UtilsCodegen.dyn_o utils/hsc2hs/dist- install/build/Paths_hsc2hs.dyn_o /nix/store/5kdjp8200hazaydx0dmwn5qghqkyi3py-binutils-2.23.1/bin/ld: warning: libpthread.so.0, needed by /nix/store /483br9kb3f5igsgmb6aqsjhl2ipj2bxr-glibc-2.21/lib/librt.so, not found (try using -rpath or -rpath-link) }}} On my working system, `utils/hsc2hs/dist-install/build/tmp/hsc2hs` is built with the option `-optl-lpthread` also, which is missing from the above command line. This flag comes from the `extra-libraries` field of the `unix` package, which is populated from the configure variable `EXTRA_LIBS` via `libraries/unix/unix.buildinfo.in`. On my system `pthread` is added to that variable by this from `configure.ac`: {{{ AC_SEARCH_LIBS(sem_close, pthread, [EXTRA_LIBS="$EXTRA_LIBS $ac_lib"], [AC_MSG_NOTICE([Not found])]) }}} but in your `libraries/unix` configure output I see {{{ checking for library containing sem_close... none required }}} so that explains why later `-optl-pthread` is not provided when building `utils/hsc2hs/dist-install/build/tmp/hsc2hs`. I don't understand why on your Nix system configure apparently detected that `-lpthread` is not needed for the symbol `sem_close`. Apparently it was wrong about that. I also have no idea what this has to do with the commit that apparently broke things for you. (I am building the tip of the ghc-7.10 branch, so I also have that commit.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11147#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler