[GHC] #16025: Makefiles bundled with source distribution fail to build cross-compiler.
#16025: Makefiles bundled with source distribution fail to build cross-compiler. -------------------------------------+------------------------------------- Reporter: vanessamchale | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (make) | Keywords: | Operating System: Unknown/Multiple Architecture: x86_64 | Type of failure: Building GHC (amd64) | failed Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When trying to build a cross-compiler with GHC 8.6.3, I ran into the following: {{{ ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) ld: libraries/ghc-prim/dist-install/build/GHC/CString.o: Relocations in generic ELF (EM: 40) libraries/ghc-prim/dist-install/build/GHC/CString.o: error adding symbols: File in wrong format echo libraries/ghc-prim/dist-install/build/GHC/CString.o libraries/ghc- prim/dist-install/build/GHC/Classes.o libraries/ghc-prim/dist- install/build/GHC/Debug.o libraries/ghc-prim/dist- install/build/GHC/IntWord64.o libraries/ghc-prim/dist- install/build/GHC/Magic.o libraries/ghc-prim/dist- install/build/GHC/PrimopWrappers.o libraries/ghc-prim/dist- install/build/GHC/Tuple.o libraries/ghc-prim/dist- install/build/GHC/Types.o libraries/ghc-prim/dist- install/build/cbits/atomic.o libraries/ghc-prim/dist- install/build/cbits/bswap.o libraries/ghc-prim/dist- install/build/cbits/clz.o libraries/ghc-prim/dist- install/build/cbits/ctz.o libraries/ghc-prim/dist- install/build/cbits/debug.o libraries/ghc-prim/dist- install/build/cbits/longlong.o libraries/ghc-prim/dist- install/build/cbits/pdep.o libraries/ghc-prim/dist- install/build/cbits/pext.o libraries/ghc-prim/dist- install/build/cbits/popcnt.o libraries/ghc-prim/dist- install/build/cbits/word2float.o >> libraries/ghc-prim/dist- install/build/libHSghc-prim-0.5.3.a.contents libraries/ghc-prim/ghc.mk:4: recipe for target 'libraries/ghc-prim/dist- install/build/HSghc-prim-0.5.3.o' failed make[1]: *** [libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.3.o] Error 1 make[1]: *** Waiting for unfinished jobs.... "arm-linux-gnueabihf-ar" q libraries/ghc-prim/dist-install/build /libHSghc-prim-0.5.3.a @libraries/ghc-prim/dist-install/build/libHSghc- prim-0.5.3.a.contents arm-linux-gnueabihf-ar: creating libraries/ghc-prim/dist-install/build /libHSghc-prim-0.5.3.a "rm" -f libraries/ghc-prim/dist-install/build/libHSghc- prim-0.5.3.a.contents Makefile:122: recipe for target 'all' failed make: *** [all] Error 2 It seems that this was due to an error in mk/config.mk, viz. LD_NO_GOLD = ld LD = arm-linux-gnueabihf-ld.gold NM = arm-linux-gnueabihf-nm AR = arm-linux-gnueabihf-ar OBJDUMP = arm-linux-gnueabihf-objdump }}} The variable {{{LD_NO_GOLD}}} should have the prefix {{{arm-linux- gnueabihf}}}. When I set {{{LD_NO_GOLD}}} to {{{arm-linux-gnueabihf-ld}}} manually, the build proceeds and works correctly. Let me know if you need any additional information. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16025> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16025: Makefiles bundled with source distribution fail to build cross-compiler. -------------------------------------+------------------------------------- Reporter: vanessamchale | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (make) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Building GHC | (amd64) failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Sigh, quite right. All of this linker wrangling is very fragile. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16025#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16025: Makefiles bundled with source distribution fail to build cross-compiler. -------------------------------------+------------------------------------- Reporter: vanessamchale | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (make) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Building GHC | (amd64) failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch Comment: Phab:D5443 fixes this, although in an admittedly rather hacky way. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16025#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16025: Makefiles bundled with source distribution fail to build cross-compiler. -------------------------------------+------------------------------------- Reporter: vanessamchale | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (make) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Building GHC | (amd64) failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"0d7fb471f368237462c700bac5500a90d29a1114/ghc" 0d7fb47/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="0d7fb471f368237462c700bac5500a90d29a1114" configure: Disable LD_NO_GOLD logic when cross-compiling This is generally terrible: see #16025. In short, we previously just blindly used an un-prefixed ld for LD_NO_GOLD. This is blatantly wrong. Ideally we would actually verify that ld.gold is indeed broken (by binutils #22266) before insisting on using another linker but sadly we cannot do so when cross- compiling since this would require running host code. For now we simply disable the LD_NO_GOLD logic when cross-compiling and hope that the user has verified that their ld.gold isn't affected by #22266. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16025#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16025: Makefiles bundled with source distribution fail to build cross-compiler. -------------------------------------+------------------------------------- Reporter: vanessamchale | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Build System | Version: 8.6.3 (make) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Building GHC | (amd64) failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.8.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16025#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC