[GHC] #11147: Linker errors related to response files change

#11147: Linker errors related to response files change -------------------------------------+------------------------------------- Reporter: waern | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.11 Keywords: | Operating System: Linux Architecture: x86 | Type of failure: Building GHC | failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Hi, Building GHC HEAD in Nix on Linux currently fails with linker errors. See https://github.com/NixOS/nixpkgs/issues/10752 The problem goes away if one reverts GHC commit 296bc70b5ff6c853f2782e9ec5aa47a52110345e. I don't know what the issue is, and I can't be 100% sure it's really a GHC problem and not a Nix one, but I thought it best to record this here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11147 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11147: Linker errors related to response files change ----------------------------------------+----------------------------- Reporter: waern | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.11 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: | ----------------------------------------+----------------------------- Changes (by waern): * cc: david.waern@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11147#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11147: Linker errors related to response files change ----------------------------------------+----------------------------- Reporter: waern | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.11 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 bgamari): Hmm, can you attach `config.log` from your installation attempt? I wonder whether configure is finding `librt`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11147#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11147: Linker errors related to response files change ----------------------------------------+----------------------------- Reporter: waern | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.11 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: | ----------------------------------------+----------------------------- Changes (by waern): * Attachment "config.log" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11147 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11147: Linker errors related to response files change ----------------------------------------+---------------------------------- Reporter: waern | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.11 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: | ----------------------------------------+---------------------------------- Changes (by bgamari): * status: new => infoneeded Comment: Can someone distill from the Github issue a concise set of instructions to reproduce this issue? I have installed nix but it's totally unclear to me how to reproduce this. At the moment I have, {{{ $ cd ~/ghc/ghc $ nix-shell -Ahaskell.packages.ghcHEAD.ghc '<nixpkgs>' error: Package ‘VisualBoyAdvance-1.7.2’ in ‘/nix/store /p1jp78n8mmk5sj9wpz5hf5jk8x8zqcdy- nixpkgs-16.03pre71923.3087ef3/nixpkgs/pkgs/misc/emulators/VisualBoyAdvance/default.nix:18’ is marked as broken, refusing to evaluate. For `nixos-rebuild` you can set { nixpkgs.config.allowBroken = true; } in configuration.nix to override this. For `nix-env` you can add { allowBroken = true; } to ~/.nixpkgs/config.nix. }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11147#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11147: Linker errors related to response files change ----------------------------------------+---------------------------------- Reporter: waern | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.11 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 simons): We have the exact same issue with GHC 7.10.3. See http://hydra.cryp.to/build/1411032/log/raw for a complete build log. Run {{{ nix-build ~/src/nixpkgs -A haskell.compiler.ghc7103 }}} to re-produce, where `~/src/nixpkgs` refers to a recent checkout of the Nixpkgs `master` branch. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11147#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11147: Linker errors related to response files change ----------------------------------------+---------------------------------- Reporter: waern | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.11 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: | ----------------------------------------+---------------------------------- Changes (by simons): * cc: simons@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11147#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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: | ----------------------------------------+---------------------------------- Changes (by simons): * version: 7.11 => 7.10.3 Old description:
Hi,
Building GHC HEAD in Nix on Linux currently fails with linker errors. See https://github.com/NixOS/nixpkgs/issues/10752
The problem goes away if one reverts GHC commit 296bc70b5ff6c853f2782e9ec5aa47a52110345e.
I don't know what the issue is, and I can't be 100% sure it's really a GHC problem and not a Nix one, but I thought it best to record this here.
New description: Building GHC 7.10.3 in Nix on Linux currently fails with linker errors. https://github.com/NixOS/nixpkgs/issues/10752 has further details. The problem goes away if one reverts GHC commit 296bc70b5ff6c853f2782e9ec5aa47a52110345e. I don't know what the issue is, and I can't be 100% sure it's really a GHC problem and not a Nix one, but I thought it best to record this here. -- Comment: It seems like ./configure detects the presence of librt, so features that depend on it are enabled, but the library is never actually linked. This issue is rather serious for us, because it prevents us from updating to GHC 7.10.3 on NixOS, i.e. we can no longer support upcoming versions of LTS Haskell without a fix for this problem. Any suggestions how to fix or work aroung this phenomenon are very welcome. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11147#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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

#11147: GHC 7.10.3 does not compile on NixOS ----------------------------------------+------------------------------ Reporter: waern | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.10.3 Resolution: wontfix | Keywords: Operating System: Linux | Architecture: x86 Type of failure: Building GHC failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ----------------------------------------+------------------------------ Changes (by bgamari): * status: infoneeded => closed * resolution: => wontfix Comment: A NixOS user has indicated that `master` works fine and the issue has been patch. Apparently the problem was due to an interaction with NixOS's GCC wrapper, {{{ <bgamari> well, there's a bug filed against 7.10.3 <bgamari> #11147 <phaskell> #11147: GHC 7.10.3 does not compile on NixOS - https://ghc.haskell.org/trac/ghc/ticket/11147 <pikajude> that was fixed <pikajude> well, it was patched <bgamari> ahh, the root cause was identified? <pikajude> bgamari: the response file support in SysTools apparently doesn't cooperate with the nix GCC wrapper }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11147#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11147: GHC 7.10.3 does not compile on NixOS ----------------------------------------+------------------------------ Reporter: waern | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Build System | Version: 7.10.3 Resolution: wontfix | 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 pikajude): For more info, see https://github.com/NixOS/nixpkgs/commit/a421e7bd4a28c69bded8b17888325e31554f... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11147#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC