[GHC] #10476: Wrong ar during cross-compilation

#10476: Wrong ar during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Build | Version: 7.11 System | Operating System: Unknown/Multiple Keywords: cross- | Type of failure: Building GHC compiling | failed Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- It appears that during cross-compilation, while building stage 1 ghc, the build system uses ar for target architecture instead of ar for build/host architecture. It will cause linking errors on systems where ar for target architecture is incompatible with ar for build/host architecture (sample output attached below). {{{ (...) "rm" -f libraries/Cabal/Cabal/dist- boot/build/libHSCabal-1.22.3.0-3tdTeip89ooLNDDdwdA54s.a.contents "rm" -f libraries/bin-package-db/dist-boot/build/libHSbin-package- db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a libraries/bin-package-db/dist- boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a.contents echo libraries/bin-package-db/dist-boot/build/GHC/PackageDb.o >> libraries/bin-package-db/dist-boot/build/libHSbin-package- db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a.contents "/Users/jakub/src/haskell/PNaCl/gsoc/wrappers/i686-unknown-nacl-ar" q libraries/bin-package-db/dist-boot/build/libHSbin-package- db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a @libraries/bin-package-db/dist- boot/build/libHSbin-package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a.contents /Users/jakub/src/nacl_sdk/pepper_canary/toolchain/mac_x86_newlib/bin/i686 -nacl-ar: creating libraries/bin-package-db/dist-boot/build/libHSbin- package-db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a "rm" -f libraries/bin-package-db/dist-boot/build/libHSbin-package- db-0.0.0.0-Gk3F1vzzO3g80wuNGtok3x.a.contents (...) ld: archive has no table of contents file '/Users/jakub/src/haskell/PNaCl /ghc-pnacl/libraries/terminfo/dist- boot/build/libHSterminfo-0.4.0.1-7qZwBlx3clR8sTBilJl253.a' for architecture x86_64 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10476 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10476: Wrong ar during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- Operating System: Unknown/Multiple | compiling Type of failure: Building GHC | Architecture: failed | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): Strange, this time it really seems that there is the correct plumbing in place to distinguish the AR commands to be used by different stages, and the variables are substituted correctly in the `mk/config.mk` of my cross- compiled ghc. Will rerun the build and look for this command in the output later. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10476#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10476: Wrong ar during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: Type: bug | Status: infoneeded Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- Operating System: Unknown/Multiple | compiling Type of failure: Building GHC | Architecture: failed | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by rwbarton): * status: new => infoneeded Comment: I confirmed that my cross-compilation uses `/usr/bin/ar` at this point, so I was unable to reproduce the problem. What does your bootstrap compiler output for `ghc --info` under `("ar command",___)`? That command should end up as the value of `AR_STAGE0` in `mk/config.mk`, and then get run for `ar` here since `bin-package-db` is a stage 0 package. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10476#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10476: Wrong ar during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: Type: bug | Status: infoneeded Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- Operating System: MacOS X | compiling Type of failure: Building GHC | Architecture: failed | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by rwbarton): * os: Unknown/Multiple => MacOS X Comment: Aaaaaa never mind... from `configure.ac`: {{{ if test "x$OS_STAGE0" != "xOSDarwin"; then BOOTSTRAPPING_GHC_INFO_FIELD([AR_STAGE0],[ar command]) BOOTSTRAPPING_GHC_INFO_FIELD([AR_OPTS_STAGE0],[ar flags]) BOOTSTRAPPING_GHC_INFO_FIELD([ArSupportsAtFile_STAGE0],[ar supports at file]) else AR_STAGE0='$(AR)' AR_OPTS_STAGE0='$(AR_OPTS)' ArSupportsAtFile_STAGE0='$(ArSupportsAtFile)' fi }}} This certainly explains your problem (since you are on Darwin)... git blame points to 24746fe78024a1edab843bc710c79c55998ab134. I wonder if it is okay to remove this hack by now? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10476#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10476: Wrong ar during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- Operating System: MacOS X | compiling Type of failure: Building GHC | Architecture: failed | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by rwbarton): * status: infoneeded => new -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10476#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10476: Wrong ar during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- Operating System: MacOS X | compiling Type of failure: Building GHC | Architecture: failed | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by jakzale): Removing this hack seems to work for me (`ghc-stage1` gets compiled successfully). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10476#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10476: Wrong ar during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: jakzale Type: bug | Status: new Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- Operating System: MacOS X | compiling Type of failure: Building GHC | Architecture: failed | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by jakzale): * owner: => jakzale -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10476#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10476: Wrong ar during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: jakzale Type: bug | Status: new Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- | compiling Operating System: MacOS X | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): jakzale: can you submit a patch to Phabricator? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10476#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10476: Wrong ar during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: thomie Type: bug | Status: new Priority: low | Milestone: Component: Build System | Version: 7.11 Resolution: | Keywords: cross- | compiling Operating System: MacOS X | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: Phab:D1231 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * owner: jakzale => thomie * related: => Phab:D1231 Comment: Nevermind, I just put a patch up myself. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10476#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10476: Wrong ar during cross-compilation
-------------------------------------+-------------------------------------
Reporter: jakzale | Owner: thomie
Type: bug | Status: new
Priority: low | Milestone:
Component: Build System | Version: 7.11
Resolution: | Keywords: cross-
| compiling
Operating System: MacOS X | Architecture:
Type of failure: Building GHC | Unknown/Multiple
failed | Test Case:
Blocked By: | Blocking:
Related Tickets: Phab:D1231 | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Thomas Miedema

#10476: Wrong ar during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: thomie Type: bug | Status: merge Priority: low | Milestone: 7.10.3 Component: Build System | Version: 7.11 Resolution: | Keywords: cross- | compiling Operating System: MacOS X | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: Phab:D1231 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: new => merge * milestone: => 7.10.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10476#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10476: Wrong ar during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: thomie Type: bug | Status: closed Priority: low | Milestone: 7.10.3 Component: Build System | Version: 7.11 Resolution: fixed | Keywords: cross- | compiling Operating System: MacOS X | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: Phab:D1231 | Differential Revisions: -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-7.10`. Someone speak up before release if we suspect that Xcode 4.3 is still something we need to worry about. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10476#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10476: Wrong ar during cross-compilation -------------------------------------+------------------------------------- Reporter: jakzale | Owner: thomie Type: bug | Status: closed Priority: low | Milestone: 7.10.3 Component: Build System | Version: 7.11 Resolution: fixed | Keywords: cross- | compiling Operating System: MacOS X | Architecture: Type of failure: Building GHC | Unknown/Multiple failed | Test Case: Blocked By: | Blocking: Related Tickets: Phab:D1231 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by PHO): * cc: pho@… (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10476#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC