[GHC] #10671: inplace/bin/ghc-stage1 doesn't respect --with-ld override

#10671: inplace/bin/ghc-stage1 doesn't respect --with-ld override -------------------------------------+------------------------------------- Reporter: mfox | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build | Version: 7.10.1 System | Keywords: | Operating System: Linux Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- Building ghc 7.10.1 on RHEL 5.8. I need to override the old system linker which lacks features and performance. I get stage1 built but then it forgets the override. Configure: ./configure --prefix=/home/cavtools/opt/ghc-7.10.1 --with- ld=/home/cavtools/64/pkg/bin/gld --with-ar=/home/cavtools/64/pkg/bin/gar --with-ranlib=/home/cavtools/64/pkg/bin/granlib settings: [("GCC extra via C opts", " -fwrapv"), ("C compiler command", "/usr/bin/gcc"), ("C compiler flags", " -fno-stack-protector"), ("C compiler link flags", ""), ("Haskell CPP command","/usr/bin/gcc"), ("Haskell CPP flags","-E -undef -traditional "), ("ld command", "/home/cavtools/64/pkg/bin/gld"), ("ld flags", ""), ("ld supports compact unwind", "YES"), ("ld supports build-id", "YES"), ("ld supports filelist", "NO"), ("ld is GNU ld", "YES"), ("ar command", "/home/cavtools/64/pkg/bin/gar"), ("ar flags", "q"), ("ar supports at file", "YES"), ("touch command", "touch"), ("dllwrap command", "/bin/false"), ("windres command", "/bin/false"), ("libtool command", "libtool"), ("perl command", "/usr/bin/perl"), ("target os", "OSLinux"), ("target arch", "ArchX86_64"), ("target word size", "8"), ("target has GNU nonexec stack", "True"), ("target has .ident directive", "True"), ("target has subsections via symbols", "False"), ("Unregisterised", "NO"), ("LLVM llc command", "llc"), ("LLVM opt command", "opt") ] inplace/lib/settings: [("GCC extra via C opts", " -fwrapv"), ("C compiler command", "/usr/bin/gcc"), ("C compiler flags", " -fno-stack-protector"), ("C compiler link flags", ""), ("Haskell CPP command","/usr/bin/gcc"), ("Haskell CPP flags","-E -undef -traditional "), ("ld command", "/home/cavtools/64/pkg/bin/gld"), ("ld flags", ""), ("ld supports compact unwind", "YES"), ("ld supports build-id", "YES"), ("ld supports filelist", "NO"), ("ld is GNU ld", "YES"), ("ar command", "/home/cavtools/64/pkg/bin/gar"), ("ar flags", "q"), ("ar supports at file", "YES"), ("touch command", "touch"), ("dllwrap command", "/bin/false"), ("windres command", "/bin/false"), ("libtool command", "libtool"), ("perl command", "/usr/bin/perl"), ("target os", "OSLinux"), ("target arch", "ArchX86_64"), ("target word size", "8"), ("target has GNU nonexec stack", "True"), ("target has .ident directive", "True"), ("target has subsections via symbols", "False"), ("Unregisterised", "NO"), ("LLVM llc command", "llc"), ("LLVM opt command", "opt") ] Failure looks like: "inplace/bin/ghc-stage1" -hisuf p_hi -osuf p_o -hcsuf p_hc -static -prof -H32m -O -this-package-key ghcpr_8TmvWUcS1U1IKHT0levwg3 -hide-all- packages -i -ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build -ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries/ghc-prim/dist- install/build -Ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries /ghc-prim/. -optP-include -optPlibraries/ghc-prim/dist- install/build/autogen/cabal_macros.h -package-key rts -this-package-key ghc-prim -XHaskell2010 -O2 -no-user-package-db -rtsopts -odir libraries/ghc-prim/dist-install/build -hidir libraries/ghc-prim/dist- install/build -stubdir libraries/ghc-prim/dist-install/build -split-objs -c libraries/ghc-prim/./GHC/IntWord64.hs -o libraries/ghc-prim/dist- install/build/GHC/IntWord64.p_o -dyno libraries/ghc-prim/dist- install/build/GHC/IntWord64.dyn_o /usr/bin/ld: unrecognized option '--build-id=none' /usr/bin/ld: use the --help option for usage information collect2: ld returned 1 exit status But why are you using /usr/bin/ld? I told you not to use /usr/bin/ld! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10671 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10671: inplace/bin/ghc-stage1 doesn't respect --with-ld override -------------------------------------+------------------------------------- Reporter: mfox | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): That command doesn't look like it should invoke a linker at all. Were you building in parallel (`make -j`)? Can you build serially to figure out which command failed for sure? Then, if you could rerun the failing command with `-v` and paste the output here, that'd be great. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10671#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10671: inplace/bin/ghc-stage1 doesn't respect --with-ld override -------------------------------------+------------------------------------- Reporter: mfox | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by mfox): {{{ "inplace/bin/ghc-stage1" -this-package-key rts -shared -dynamic -dynload deploy -no-auto-link-packages -Lrts/dist/build -lffi -optl-Wl,-rpath -optl-Wl,'$ORIGIN' -optl-Wl,-zorigin `cat rts/dist/libs.depend` rts/dist/build/Adjustor.dyn_o rts/dist/build/Arena.dyn_o rts/dist/build/Capability.dyn_o rts/dist/build/CheckUnload.dyn_o rts/dist/build/ClosureFlags.dyn_o rts/dist/build/Disassembler.dyn_o rts/dist/build/FileLock.dyn_o rts/dist/build/Globals.dyn_o rts/dist/build/Hash.dyn_o rts/dist/build/Hpc.dyn_o rts/dist/build/HsFFI.dyn_o rts/dist/build/Inlines.dyn_o rts/dist/build/Interpreter.dyn_o rts/dist/build/LdvProfile.dyn_o rts/dist/build/Linker.dyn_o rts/dist/build/Messages.dyn_o rts/dist/build/OldARMAtomic.dyn_o rts/dist/build/Papi.dyn_o rts/dist/build/Printer.dyn_o rts/dist/build/ProfHeap.dyn_o rts/dist/build/Profiling.dyn_o rts/dist/build/Proftimer.dyn_o rts/dist/build/RaiseAsync.dyn_o rts/dist/build/RetainerProfile.dyn_o rts/dist/build/RetainerSet.dyn_o rts/dist/build/RtsAPI.dyn_o rts/dist/build/RtsDllMain.dyn_o rts/dist/build/RtsFlags.dyn_o rts/dist/build/RtsMain.dyn_o rts/dist/build/RtsMessages.dyn_o rts/dist/build/RtsStartup.dyn_o rts/dist/build/RtsUtils.dyn_o rts/dist/build/STM.dyn_o rts/dist/build/Schedule.dyn_o rts/dist/build/Sparks.dyn_o rts/dist/build/Stable.dyn_o rts/dist/build/StaticPtrTable.dyn_o rts/dist/build/Stats.dyn_o rts/dist/build/StgCRun.dyn_o rts/dist/build/StgPrimFloat.dyn_o rts/dist/build/Task.dyn_o rts/dist/build/ThreadLabels.dyn_o rts/dist/build/ThreadPaused.dyn_o rts/dist/build/Threads.dyn_o rts/dist/build/Ticky.dyn_o rts/dist/build/Timer.dyn_o rts/dist/build/Trace.dyn_o rts/dist/build/WSDeque.dyn_o rts/dist/build/Weak.dyn_o rts/dist/build/hooks/FlagDefaults.dyn_o rts/dist/build/hooks/MallocFail.dyn_o rts/dist/build/hooks/OnExit.dyn_o rts/dist/build/hooks/OutOfHeap.dyn_o rts/dist/build/hooks/StackOverflow.dyn_o rts/dist/build/sm/BlockAlloc.dyn_o rts/dist/build/sm/Compact.dyn_o rts/dist/build/sm/Evac.dyn_o rts/dist/build/sm/GC.dyn_o rts/dist/build/sm/GCAux.dyn_o rts/dist/build/sm/GCUtils.dyn_o rts/dist/build/sm/MBlock.dyn_o rts/dist/build/sm/MarkWeak.dyn_o rts/dist/build/sm/Sanity.dyn_o rts/dist/build/sm/Scav.dyn_o rts/dist/build/sm/Storage.dyn_o rts/dist/build/sm/Sweep.dyn_o rts/dist/build/eventlog/EventLog.dyn_o rts/dist/build/posix/GetEnv.dyn_o rts/dist/build/posix/GetTime.dyn_o rts/dist/build/posix/Itimer.dyn_o rts/dist/build/posix/OSMem.dyn_o rts/dist/build/posix/OSThreads.dyn_o rts/dist/build/posix/Select.dyn_o rts/dist/build/posix/Signals.dyn_o rts/dist/build/posix/TTY.dyn_o rts/dist/build/Apply.dyn_o rts/dist/build/Exception.dyn_o rts/dist/build/HeapStackCheck.dyn_o rts/dist/build/PrimOps.dyn_o rts/dist/build/StgMiscClosures.dyn_o rts/dist/build/StgStartup.dyn_o rts/dist/build/StgStdThunks.dyn_o rts/dist/build/Updates.dyn_o rts/dist/build/AutoApply.dyn_o -fPIC -dynamic -H32m -O -Iincludes -Iincludes/dist -Iincludes/dist- derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -this-package-key rts -dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -fno-use-rpaths -optl- Wl,-zorigin -o rts/dist/build/libHSrts-ghc7.10.1.so -v Glasgow Haskell Compiler, Version 7.10.1, stage 1 booted by GHC version 7.10.1 Using binary package database: /home/cavtools/src/ghc-7.10.1/inplace/lib/package.conf.d/package.cache Using binary package database: /home/cavtools/.ghc/x86_64-linux-7.10.1/package.conf.d/package.cache package HTTP-4000.2.19-452bb564befa140f2d9875a431f06774 is unusable due to missing or recursive dependencies: array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 base-4.8.0.0-6369eb7fa2a0ecb1401c3a53d41cfbb7 bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db mtl-2.2.1-9986828fc95bc8459870303efaabd81e network-2.6.0.2-5b571cbc862842e6a0b3b4f8ff195156 network- uri-2.6.0.1-4b5177daf89becaf2de36ae93281687f old- time-1.1.0.3-c6c471a5ec61ff049468f265b077486d parsec-3.1.7-0adb5f9cdf6ae0c8268c412595b3159a package mtl-2.2.1-9986828fc95bc8459870303efaabd81e is unusable due to missing or recursive dependencies: base-4.8.0.0-6369eb7fa2a0ecb1401c3a53d41cfbb7 transformers-0.4.2.0-c1a7bb855a176fe475d7b665301cd48f package network-2.6.0.2-5b571cbc862842e6a0b3b4f8ff195156 is unusable due to missing or recursive dependencies: base-4.8.0.0-6369eb7fa2a0ecb1401c3a53d41cfbb7 bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db unix-2.7.1.0-91bacaa07e5044ef0f978252f01c4a06 package network-uri-2.6.0.1-4b5177daf89becaf2de36ae93281687f is unusable due to missing or recursive dependencies: base-4.8.0.0-6369eb7fa2a0ecb1401c3a53d41cfbb7 parsec-3.1.7-0adb5f9cdf6ae0c8268c412595b3159a package old-locale-1.0.0.7-c52866273f79efea5d2d03d1e32baad2 is unusable due to missing or recursive dependencies: base-4.8.0.0-6369eb7fa2a0ecb1401c3a53d41cfbb7 package old-time-1.1.0.3-c6c471a5ec61ff049468f265b077486d is unusable due to missing or recursive dependencies: base-4.8.0.0-6369eb7fa2a0ecb1401c3a53d41cfbb7 old- locale-1.0.0.7-c52866273f79efea5d2d03d1e32baad2 package parsec-3.1.7-0adb5f9cdf6ae0c8268c412595b3159a is unusable due to missing or recursive dependencies: base-4.8.0.0-6369eb7fa2a0ecb1401c3a53d41cfbb7 bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db mtl-2.2.1-9986828fc95bc8459870303efaabd81e text-1.2.0.3-9eeb5a52cd7997b3db44037e296ae2da package random-1.1-bf46233feed8bd64cb90bcd77d1c4b8c is unusable due to missing or recursive dependencies: base-4.8.0.0-6369eb7fa2a0ecb1401c3a53d41cfbb7 time-1.5.0.1-e17a9220d438435579d2914e90774246 package stm-2.4.4-1ae235706b0ce6e6ef8d19cd83227592 is unusable due to missing or recursive dependencies: array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 base-4.8.0.0-6369eb7fa2a0ecb1401c3a53d41cfbb7 package text-1.2.0.3-9eeb5a52cd7997b3db44037e296ae2da is unusable due to missing or recursive dependencies: array-0.5.1.0-e29cdbe82692341ebb7ce6e2798294f9 base-4.8.0.0-6369eb7fa2a0ecb1401c3a53d41cfbb7 bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db deepseq-1.4.1.1-c1376f846fa170f2cc2cb2e57b203339 ghc- prim-0.4.0.0-7c945cc0c41d3b7b70f3edd125671166 integer- gmp-1.0.0.0-3c947e5fb6dca14804d9b2793c521b67 package zlib-0.5.4.2-7f8fa1baff7481f1dca70c1ad6ffca0e is unusable due to missing or recursive dependencies: base-4.8.0.0-6369eb7fa2a0ecb1401c3a53d41cfbb7 bytestring-0.10.6.0-0909f8f31271f3d75749190bf2ee35db wired-in package ghc-prim mapped to ghc-prim-0.4.0.0-inplace wired-in package integer-gmp mapped to integer-gmp-1.0.0.0-inplace wired-in package base mapped to base-4.8.0.0-inplace wired-in package rts mapped to builtin_rts wired-in package template-haskell mapped to template- haskell-2.10.0.0-inplace wired-in package ghc mapped to ghc-7.10.1-inplace wired-in package dph-seq not found. wired-in package dph-par not found. Hsc static flags: *** Linker: /usr/bin/gcc -fno-stack-protector -DTABLES_NEXT_TO_CODE '-Wl,--hash- size=31' -Wl,--reduce-memory-overheads -Wl,--no-as-needed -Wl,-rpath '-Wl,$ORIGIN' -Wl,-zorigin -Wl,-zorigin -o rts/dist/build/libHSrts- ghc7.10.1.so -shared -Wl,-h,libHSrts-ghc7.10.1.so rts/dist/build/Adjustor.dyn_o rts/dist/build/Arena.dyn_o rts/dist/build/Capability.dyn_o rts/dist/build/CheckUnload.dyn_o rts/dist/build/ClosureFlags.dyn_o rts/dist/build/Disassembler.dyn_o rts/dist/build/FileLock.dyn_o rts/dist/build/Globals.dyn_o rts/dist/build/Hash.dyn_o rts/dist/build/Hpc.dyn_o rts/dist/build/HsFFI.dyn_o rts/dist/build/Inlines.dyn_o rts/dist/build/Interpreter.dyn_o rts/dist/build/LdvProfile.dyn_o rts/dist/build/Linker.dyn_o rts/dist/build/Messages.dyn_o rts/dist/build/OldARMAtomic.dyn_o rts/dist/build/Papi.dyn_o rts/dist/build/Printer.dyn_o rts/dist/build/ProfHeap.dyn_o rts/dist/build/Profiling.dyn_o rts/dist/build/Proftimer.dyn_o rts/dist/build/RaiseAsync.dyn_o rts/dist/build/RetainerProfile.dyn_o rts/dist/build/RetainerSet.dyn_o rts/dist/build/RtsAPI.dyn_o rts/dist/build/RtsDllMain.dyn_o rts/dist/build/RtsFlags.dyn_o rts/dist/build/RtsMain.dyn_o rts/dist/build/RtsMessages.dyn_o rts/dist/build/RtsStartup.dyn_o rts/dist/build/RtsUtils.dyn_o rts/dist/build/STM.dyn_o rts/dist/build/Schedule.dyn_o rts/dist/build/Sparks.dyn_o rts/dist/build/Stable.dyn_o rts/dist/build/StaticPtrTable.dyn_o rts/dist/build/Stats.dyn_o rts/dist/build/StgCRun.dyn_o rts/dist/build/StgPrimFloat.dyn_o rts/dist/build/Task.dyn_o rts/dist/build/ThreadLabels.dyn_o rts/dist/build/ThreadPaused.dyn_o rts/dist/build/Threads.dyn_o rts/dist/build/Ticky.dyn_o rts/dist/build/Timer.dyn_o rts/dist/build/Trace.dyn_o rts/dist/build/WSDeque.dyn_o rts/dist/build/Weak.dyn_o rts/dist/build/hooks/FlagDefaults.dyn_o rts/dist/build/hooks/MallocFail.dyn_o rts/dist/build/hooks/OnExit.dyn_o rts/dist/build/hooks/OutOfHeap.dyn_o rts/dist/build/hooks/StackOverflow.dyn_o rts/dist/build/sm/BlockAlloc.dyn_o rts/dist/build/sm/Compact.dyn_o rts/dist/build/sm/Evac.dyn_o rts/dist/build/sm/GC.dyn_o rts/dist/build/sm/GCAux.dyn_o rts/dist/build/sm/GCUtils.dyn_o rts/dist/build/sm/MBlock.dyn_o rts/dist/build/sm/MarkWeak.dyn_o rts/dist/build/sm/Sanity.dyn_o rts/dist/build/sm/Scav.dyn_o rts/dist/build/sm/Storage.dyn_o rts/dist/build/sm/Sweep.dyn_o rts/dist/build/eventlog/EventLog.dyn_o rts/dist/build/posix/GetEnv.dyn_o rts/dist/build/posix/GetTime.dyn_o rts/dist/build/posix/Itimer.dyn_o rts/dist/build/posix/OSMem.dyn_o rts/dist/build/posix/OSThreads.dyn_o rts/dist/build/posix/Select.dyn_o rts/dist/build/posix/Signals.dyn_o rts/dist/build/posix/TTY.dyn_o rts/dist/build/Apply.dyn_o rts/dist/build/Exception.dyn_o rts/dist/build/HeapStackCheck.dyn_o rts/dist/build/PrimOps.dyn_o rts/dist/build/StgMiscClosures.dyn_o rts/dist/build/StgStartup.dyn_o rts/dist/build/StgStdThunks.dyn_o rts/dist/build/Updates.dyn_o rts/dist/build/AutoApply.dyn_o -lffi -lm -lrt -ldl -Lrts/dist/build -L/home/cavtools/src/ghc-7.10.1/rts/dist/build /usr/bin/ld: rts/dist/build/RtsStartup.dyn_o: relocation R_X86_64_PC32 against `exitStaticPtrTable' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: ld returned 1 exit status *** Deleting temp files: Deleting: *** Deleting temp dirs: Deleting: }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10671#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10671: inplace/bin/ghc-stage1 doesn't respect --with-ld override -------------------------------------+------------------------------------- Reporter: mfox | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by mfox): As a workaround I try to get the message through to gcc: {{{ LD=/home/cavtools/64/pkg/bin/gld make -j8 LD=/home/cavtools/64/pkg/bin/gld }}} It doesn't help. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10671#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10671: inplace/bin/ghc-stage1 doesn't respect --with-ld override -------------------------------------+------------------------------------- Reporter: mfox | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): Yes, as you can see ghc invokes gcc for the link step. You will need to work out how to tell gcc to use your custom linker, and then create a wrapper around gcc that does so and specify that as the C compiler to configure. Or perhaps there is already such a C compiler in `/home/cavtools/64/pkg/bin/`? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10671#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10671: inplace/bin/ghc-stage1 doesn't respect --with-ld override -------------------------------------+------------------------------------- Reporter: mfox | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * cc: erikd (added) Comment: I think the problem is that although `--with-ld` adds "ld command" to the settings file, it isn't used anywhere. {{{ $ git grep "ld command" compiler/ settings.in settings.in: ("ld command", "@SettingsLdCommand@"), }}} In the function `initSysTools` in `compiler/main/SysTools.hs`, the C compiler is always used as the linker: {{{ ... ; gcc_prog <- getSetting "C compiler command" ; gcc_args_str <- getSetting "C compiler flags" ... -- Other things being equal, as and ld are simply gcc ; let as_prog = gcc_prog as_args = gcc_args ld_prog = gcc_prog ld_args = gcc_args ... }}} cc erikd, since he added the `--with-ld` option in Phab:D828 (the FIND_LD macro in aclocal.m4). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10671#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10671: inplace/bin/ghc-stage1 doesn't respect --with-ld override -------------------------------------+------------------------------------- Reporter: mfox | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by erikd): Replying to [comment:5 thomie]:
In the function `initSysTools` in `compiler/main/SysTools.hs`, the C compiler is always used as the linker:
I can't remember where, but I did find that the linker is called directly somewhere or somehow. Possibly when cross-compiling? I really should have documented this when I found it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10671#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10671: inplace/bin/ghc-stage1 doesn't respect --with-ld override -------------------------------------+------------------------------------- Reporter: mfox | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 7.10.1 Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): It's used by cabal sometimes, I think it's when linking a static Haskell library. That is, cabal parses the output of `ghc --info` to determine what linker it should invoke. I don't know whether ghc ever directly invokes the linker itself. (The fact that ghc uses gcc and not ld for the link step is a bit confusing, and I'm not sure whether it is documented anywhere. For example it means that `-optl` needs to take gcc options, which are not always the same as ld options. The description of `-optl` in the man page is just "pass option to the linker".) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10671#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10671: inplace/bin/ghc-stage1 doesn't respect --with-ld override -------------------------------------+------------------------------------- Reporter: mfox | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by ezyang): * component: Build System => Compiler (Linking) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10671#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10671: inplace/bin/ghc-stage1 doesn't respect --with-ld override -------------------------------------+------------------------------------- Reporter: mfox | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.1 (Linking) | Resolution: | Keywords: Operating System: Linux | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11780 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * related: => #11780 Comment: The submitter of #11780 may have found a solution. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10671#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC