
#7799: Assembly error while building GHC 7.7 -------------------------------+-------------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (FFI) | Version: 7.7 Keywords: | Os: Unknown/Multiple Architecture: x86 | Failure: Building GHC failed Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -------------------------------+-------------------------------------------- Comment(by thorkilnaur): Replying to [comment:2 igloo]:
Could you test whether instead changing all 4 instances of `__i686` in `compiler/nativeGen/PIC.hs` to `__x86` works, please?
I have tried that (where, by the way, {{{___i686}}} in {{{compiler/nativeGen/PIC.hs}}} is with three leading underscores) but, unfortunately, it didn't help. And, in fact, the curious fact seems to be that the code that {{{gcc}}}, the asssembler, complains about has been generated by {{{gcc}}}, the C compiler. In an attempt to clarify, I ran the failing compile like this: {{{ $ "inplace/bin/ghc-stage1" -hisuf hi -osuf o -hcsuf hc -static -H32m -O -package-name base-4.7.0.0 -hide-all-packages -i -ilibraries/base/. -ilibraries/base/dist-install/build -ilibraries/base/dist- install/build/autogen -Ilibraries/base/dist-install/build -Ilibraries/base /dist-install/build/autogen -Ilibraries/base/include -optP- DOPTIMISE_INTEGER_GCD_LCM -optP-include -optPlibraries/base/dist- install/build/autogen/cabal_macros.h -package ghc-prim-0.3.1.0 -package integer-gmp-0.5.1.0 -package rts-1.0 -package-name base -XHaskell98 -XCPP -O2 -no-user-package-db -rtsopts -odir libraries/base/dist- install/build -hidir libraries/base/dist-install/build -stubdir libraries/base/dist-install/build -split-objs -dynamic-too -c libraries/base/./System/Posix/Internals.hs -o libraries/base/dist- install/build/System/Posix/Internals.o -dyno libraries/base/dist- install/build/System/Posix/Internals.dyn_o -v -tmpdir T7799-tmpdir -keep- tmp-files > T7799-tmpdir/ghc_T7799.out 2>&1 }}} I will attach {{{T7799-tmpdir.tar.gz}}}, the contents of the resulting {{{T7799-tmpdir}}} directory. For convenience, this contains much which is similar to the original report. {{{T7799-tmpdir/ghc_T7799.out}}} contains {{{ *** C Compiler: '/usr/bin/gcc' '-fno-stack-protector' '-DTABLES_NEXT_TO_CODE' '-x' 'c' 'T7799-tmpdir/ghc26404_0/ghc26404_1.c' '-o' 'T7799-tmpdir/ghc26404_0/ghc26404_2.s' '-fPIC' '-U __PIC__' '-D__PIC__' '-Wimplicit' '-S' '-O2' '-D__GLASGOW_HASKELL__=707' '-I' 'libraries/base /dist-install/build' '-I' 'libraries/base/dist-install/build' '-I' 'libraries/base/dist-install/build/autogen' '-I' 'libraries/base/include' '-I' '/home/tn/tn/GHCGitRepository/ghc/rts/dist/build' '-I' '/home/tn/tn/GHCGitRepository/ghc/includes' '-I' '/home/tn/tn/GHCGitRepository/ghc/includes/dist-derivedconstants/header' *** Assembler: '/usr/bin/gcc' '-fno-stack-protector' '-DTABLES_NEXT_TO_CODE' '-Ilibraries/base/dist-install/build' '-Ilibraries/base/dist- install/build' '-Ilibraries/base/dist-install/build/autogen' '-Ilibraries/base/include' '-x' 'assembler-with-cpp' '-c' 'T7799-tmpdir/ghc26404_0/ghc26404_2.s' '-o' 'T7799-tmpdir/ghc26404_0/ghc26404_0.dyn_o' ghc26404_1.c: Assembler messages: ghc26404_1.c:138:0: Error: junk `.get_pc_thunk.bx' after expression ... }}} Although the assembler error report mentions the file {{{ghc26404_1.c}}}, it can be seen that the complaints actually concerns the contents of {{{ghc26404_2.s}}}. Confirming this {{{ $ head -138 T7799-tmpdir/ghc26404_0/ghc26404_2.s | tail -1 call __i686.get_pc_thunk.bx $ }}} where the complaint is caused by the replacement shown earlier of "{{{__i686}}}" by "{{{1 }}}". Best regards Thorkil -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7799#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler