https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/ Issue: dev-lang/ghc fails to compile. Discovered on: amd64 (internal ref: tinderbox) NOTE: This machine uses a clang/LLVM toolchain. If you think that this issue is strictly related to clang/LLVM please block bug 408963. If you think that this issue isstrictly related to the LLD linker, please block bug 731004.
Created attachment 649254 [details] build.log.bz2 build log and emerge --info
Created attachment 649256 [details] other.tar.bz2 other logs
<no location info>: error: Warning: Couldn't figure out linker information! Make sure you're using GNU ld, GNU gold or the built in OS X linker, etc. ld.lld: error: unknown argument '-no-relax' collect2: error: ld returned 1 exit status `x86_64-pc-linux-gnu-gcc' failed in phase `Linker'. (Exit code: 1) make[1]: *** [libraries/ghc-prim/ghc.mk:4: libraries/ghc-prim/dist-install/build/GHC/Types.o] Error 1 It's caused by /ghc-8.0.2-no-relax-everywhere.patch patch that fails to detect that linker is not a GNU linker: index acd0d61..5830517 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -2172,5 +2172,3 @@ joinObjectFiles dflags o_files output_fn = do -- disable --relax explicitly. - ++ (if platformArch (targetPlatform dflags) - `elem` [ArchSPARC, ArchSPARC64] - && ldIsGnuLd + ++ (if ldIsGnuLd then [SysTools.Option "-Wl,-no-relax"] Probably because driver is called via -fuse-ld=lld. Or probably because bootstrap ghc was built using GNU linker.
https://gitlab.haskell.org/ghc/ghc/-/commit/53ce0db5a06598c88c6b8cb32043b878e7083dd4 removed -no-relax option.
*** Bug 734886 has been marked as a duplicate of this bug. ***
*** Bug 736104 has been marked as a duplicate of this bug. ***
*** Bug 736100 has been marked as a duplicate of this bug. ***
*** Bug 736018 has been marked as a duplicate of this bug. ***
*** Bug 736016 has been marked as a duplicate of this bug. ***
*** Bug 736010 has been marked as a duplicate of this bug. ***
*** Bug 736004 has been marked as a duplicate of this bug. ***
*** Bug 736002 has been marked as a duplicate of this bug. ***
*** Bug 735988 has been marked as a duplicate of this bug. ***