snowleopard / hadrian

Hadrian: a new build system for the Glasgow Haskell Compiler. Now merged into the GHC tree!
https://gitlab.haskell.org/ghc/ghc/tree/master/hadrian
MIT License
208 stars 39 forks source link

New linker error - relocation truncated to fit: R_X86_64_32S against `r7Eh_bytes' #641

Closed alpmestan closed 6 years ago

alpmestan commented 6 years ago

On NixOS, from a clean tree, in a ghc.nix shell, when building ghc master with hadrian master with the Cabal submodule tweaked, I encounter the following error when linking the stage 2 GHC:

| Run Ghc LinkHs Stage1: out/stage1/ghc/build/c/hschooks.o (and 6 more) => out/stage1/bin/ghc
out/stage0/bin/ghc -Wall -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-db out/stage1/lib/package.conf.d' '-package-id array-0.5.2.0' '-package-id base-4.12.0.0' '-package-id bytestring-0.10.8.2' '-package-id containers-0.6.0.1' '-package-id deepseq-1.4.4.0' '-package-id directory-1.3.2.3' '-package-id filepath-1.4.2' '-package-id ghc-8.7' '-package-id ghc-boot-8.7' '-package-id ghc-prim-0.5.3' '-package-id ghci-8.7' '-package-id haskeline-0.7.4.2' '-package-id process-1.6.3.0' '-package-id time-1.8.0.2' '-package-id transformers-0.5.5.0' '-package-id unix-2.8.0.0' -i -iout/stage1/ghc/build -iout/stage1/ghc/build/ghc/autogen -ighc/. -Iincludes -Iout/generated -Iout/stage1/ghc/build -I/nix/store/im9rpbg9smk1j74wfjyq4syhdjjxv75x-ghc-build-environment/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/ghc-8.7/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/process-1.6.3.0/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/unix-2.8.0.0/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/time-1.8.0.2/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/bytestring-0.10.8.2/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/base-4.12.0.0/include -I/nix/store/im9rpbg9smk1j74wfjyq4syhdjjxv75x-ghc-build-environment/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/integer-gmp-1.0.2.0/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/rts-1.0/include -Iout/generated -optc-Iout/generated -optP-include -optPout/stage1/ghc/build/ghc/autogen/cabal_macros.h -optc-fno-stack-protector -optP-DGHCI -odir out/stage1/ghc/build -hidir out/stage1/ghc/build -stubdir out/stage1/ghc/build -no-auto-link-packages -no-hs-main -optl-lgmp -Wnoncanonical-monad-instances -optc-Werror=unused-but-set-variable -optc-Wno-error=inline out/stage1/ghc/build/c/hschooks.o out/stage1/ghc/build/Main.o out/stage1/ghc/build/GHCi/Leak.o out/stage1/ghc/build/GHCi/UI.o out/stage1/ghc/build/GHCi/UI/Info.o out/stage1/ghc/build/GHCi/UI/Monad.o out/stage1/ghc/build/GHCi/UI/Tags.o -o out/stage1/bin/ghc -O2 -H32m -Wall -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -Wnoncanonical-monoid-instances -fno-warn-name-shadowing -XHaskell2010 -ghcversion-file=/home/alp/WT/ghc-hadrian/out/generated/ghcversion.h -Iout/stage1/compiler/build -Wcpp-undef
out/stage1/lib/../lib/x86_64-linux-ghc-8.7.20180705/ghc-8.7/libHSghc-8.7.a(Unique.o):(.text+0x338b): relocation truncated to fit: R_X86_64_32S against `r7Eh_bytes'
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
shakeArgsWith   0.000s    0%                           
Function shake  0.296s    2%                           
Database read   0.253s    1%                           
With database   0.027s    0%                           
Running rules  13.466s   95%  =========================
Total          14.040s  100%         
Error when running Shake build system:
* test
* out/stage1/bin/ghc
user error (Development.Shake.cmd, system command failed
Command: out/stage0/bin/ghc -Wall -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-db out/stage1/lib/package.conf.d' '-package-id array-0.5.2.0' '-package-id base-4.12.0.0' '-package-id bytestring-0.10.8.2' '-package-id containers-0.6.0.1' '-package-id deepseq-1.4.4.0' '-package-id directory-1.3.2.3' '-package-id filepath-1.4.2' '-package-id ghc-8.7' '-package-id ghc-boot-8.7' '-package-id ghc-prim-0.5.3' '-package-id ghci-8.7' '-package-id haskeline-0.7.4.2' '-package-id process-1.6.3.0' '-package-id time-1.8.0.2' '-package-id transformers-0.5.5.0' '-package-id unix-2.8.0.0' -i -iout/stage1/ghc/build -iout/stage1/ghc/build/ghc/autogen -ighc/. -Iincludes -Iout/generated -Iout/stage1/ghc/build -I/nix/store/im9rpbg9smk1j74wfjyq4syhdjjxv75x-ghc-build-environment/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/ghc-8.7/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/process-1.6.3.0/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/unix-2.8.0.0/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/time-1.8.0.2/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/bytestring-0.10.8.2/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/base-4.12.0.0/include -I/nix/store/im9rpbg9smk1j74wfjyq4syhdjjxv75x-ghc-build-environment/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/integer-gmp-1.0.2.0/include -I/home/alp/WT/ghc-hadrian/out/stage1/lib/x86_64-linux-ghc-8.7.20180705/rts-1.0/include -Iout/generated -optc-Iout/generated -optP-include -optPout/stage1/ghc/build/ghc/autogen/cabal_macros.h -optc-fno-stack-protector -optP-DGHCI -odir out/stage1/ghc/build -hidir out/stage1/ghc/build -stubdir out/stage1/ghc/build -no-auto-link-packages -no-hs-main -optl-lgmp -Wnoncanonical-monad-instances -optc-Werror=unused-but-set-variable -optc-Wno-error=inline out/stage1/ghc/build/c/hschooks.o out/stage1/ghc/build/Main.o out/stage1/ghc/build/GHCi/Leak.o out/stage1/ghc/build/GHCi/UI.o out/stage1/ghc/build/GHCi/UI/Info.o out/stage1/ghc/build/GHCi/UI/Monad.o out/stage1/ghc/build/GHCi/UI/Tags.o -o out/stage1/bin/ghc -O2 -H32m -Wall -Wnoncanonical-monad-instances -Wnoncanonical-monadfail-instances -Wnoncanonical-monoid-instances -fno-warn-name-shadowing -XHaskell2010 -ghcversion-file=/home/alp/WT/ghc-hadrian/out/generated/ghcversion.h -Iout/stage1/compiler/build -Wcpp-undef
Exit code: 1
Stderr:
out/stage1/lib/../lib/x86_64-linux-ghc-8.7.20180705/ghc-8.7/libHSghc-8.7.a(Unique.o):(.text+0x338b): relocation truncated to fit: R_X86_64_32S against `r7Eh_bytes'
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
)

Has anyone else seen this?