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

GHC ghc-devs at haskell.org
Tue Jun 2 20:44:14 UTC 2015


#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


More information about the ghc-tickets mailing list