[GHC] #6086: Cross compilation fails using system linker for other architecture binaries

GHC ghc-devs at haskell.org
Tue Sep 9 16:42:31 UTC 2014


#6086: Cross compilation fails using system linker for other architecture binaries
----------------------------------------------+---------------------------
              Reporter:  mtjm                 |            Owner:
                  Type:  bug                  |           Status:  new
              Priority:  high                 |        Milestone:  7.8.4
             Component:  Build System         |          Version:  7.8.3
            Resolution:                       |         Keywords:
      Operating System:  Linux                |     Architecture:  arm
       Type of failure:  Building GHC failed  |       Difficulty:  Unknown
             Test Case:                       |       Blocked By:
              Blocking:                       |  Related Tickets:
Differential Revisions:                       |
----------------------------------------------+---------------------------

Comment (by cetu86):

 Thanks for that quick answer. I did as you told me, also passing the
 argument

 {{{
 --with-gcc=`which arm-unknown-linux-gnueabi-gcc`
 }}}
 to configure.
 Now it goes past the last error. But some way down the road this happens

 {{{
 /bin/sh ./libtool   --mode=compile /usr/bin/gcc -DHAVE_CONFIG_H -I. -I..
 -I. -I../include -Iinclude -I../src -DFFI_BUILDING  -I. -I../include
 -Iinclude -I../src -DFFI_BUILDING -g -fno-stack-protector -w -MT
 src/arm/sysv.lo -MMD -MP -MF $depbase.Tpo -c -o src/arm/sysv.lo
 ../src/arm/sysv.S &&\
 mv -f $depbase.Tpo $depbase.Plo
 libtool: compile:  /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include
 -Iinclude -I../src -DFFI_BUILDING -I. -I../include -Iinclude -I../src
 -DFFI_BUILDING -g -fno-stack-protector -w -MT src/arm/sysv.lo -MMD -MP -MF
 src/arm/.deps/sysv.Tpo -c ../src/arm/sysv.S  -fPIC -DPIC -o
 src/arm/.libs/sysv.o
 ../src/arm/sysv.S: Assembler messages:
 ../src/arm/sysv.S:64: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:160: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:161: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:162: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:163: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:164: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:166: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:167: Error: unknown pseudo-op: `.arm'
 ../src/arm/sysv.S:167: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:168: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:169: Error: no such instruction: `stmfd
 sp!,{r0-r3,fp,lr}'
 ../src/arm/sysv.S:170: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:171: Error: too many memory references for `mov'
 ../src/arm/sysv.S:173: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:175: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:176: Error: too many memory references for `sub'
 ../src/arm/sysv.S:178: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:179: Error: too many memory references for `mov'
 ../src/arm/sysv.S:180: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:182: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:183: Error: no such instruction: `bl ffi_prep_args'
 ../src/arm/sysv.S:185: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:186: Error: no such instruction: `ldmia sp,{r0-r3}'
 ../src/arm/sysv.S:188: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:189: Error: too many memory references for `sub'
 ../src/arm/sysv.S:190: Error: no such instruction: `ldr ip,[fp]@load
 fn()in advance'
 ../src/arm/sysv.S:191: Error: expecting operand after ','; got nothing
 ../src/arm/sysv.S:192: Error: no such instruction: `movhs lr,'
 ../src/arm/sysv.S:193: Error: too many memory references for `add'
 ../src/arm/sysv.S:195: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:196: Error: too many memory references for `mov'
 ../src/arm/sysv.S:196: Error: too many memory references for `mov'
 ../src/arm/sysv.S:198: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:199: Error: too many memory references for `mov'
 ../src/arm/sysv.S:201: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:202: Error: no such instruction: `ldr r2,[sp,'
 ../src/arm/sysv.S:204: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:205: Error: no such instruction: `ldr r3,[sp,'
 ../src/arm/sysv.S:207: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:208: Error: expecting operand after ','; got nothing
 ../src/arm/sysv.S:209: Error: no such instruction: `beq .Lepilogue'
 ../src/arm/sysv.S:211: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:212: Error: expecting operand after ','; got nothing
 ../src/arm/sysv.S:216: Error: no such instruction: `streq r0,[r2]'
 ../src/arm/sysv.S:217: Error: no such instruction: `beq .Lepilogue'
 ../src/arm/sysv.S:219: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:220: Error: expecting operand after ','; got nothing
 ../src/arm/sysv.S:224: Error: no such instruction: `stmeqia r2,{r0,r1}'
 ../src/arm/sysv.S:227: Error: no such instruction: `beq .Lepilogue'
 ../src/arm/sysv.S:229: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:230: Error: expecting operand after ','; got nothing
 ../src/arm/sysv.S:231: Error: no such instruction: `stfeqs f0,[r2]'
 ../src/arm/sysv.S:232: Error: no such instruction: `beq .Lepilogue'
 ../src/arm/sysv.S:234: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:235: Error: expecting operand after ','; got nothing
 ../src/arm/sysv.S:236: Error: no such instruction: `stfeqd f0,[r2]'
 ../src/arm/sysv.S:244: Error: no such instruction: `ldmia
 sp!,{r0-r3,fp,pc}'
 ../src/arm/sysv.S:248: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:269: Error: unknown pseudo-op: `.arm'
 ../src/arm/sysv.S:269: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:270: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:271: Error: too many memory references for `add'
 ../src/arm/sysv.S:272: Error: no such instruction: `stmfd sp!,{ip,lr}'
 ../src/arm/sysv.S:273: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:274: Error: too many memory references for `add'
 ../src/arm/sysv.S:275: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:276: Error: too many memory references for `sub'
 ../src/arm/sysv.S:277: Error: invalid char '[' beginning operand 2 `[sp'
 ../src/arm/sysv.S:278: Error: too many memory references for `add'
 ../src/arm/sysv.S:279: Error: no such instruction: `bl
 ffi_closure_SYSV_inner'
 ../src/arm/sysv.S:280: Error: expecting operand after ','; got nothing
 ../src/arm/sysv.S:281: Error: no such instruction: `beq .Lretint'
 ../src/arm/sysv.S:283: Error: expecting operand after ','; got nothing
 ../src/arm/sysv.S:287: Error: no such instruction: `beq .Lretfloat'
 ../src/arm/sysv.S:290: Error: expecting operand after ','; got nothing
 ../src/arm/sysv.S:294: Error: no such instruction: `beq .Lretdouble'
 ../src/arm/sysv.S:297: Error: expecting operand after ','; got nothing
 ../src/arm/sysv.S:301: Error: no such instruction: `beq .Lretlongdouble'
 ../src/arm/sysv.S:304: Error: expecting operand after ','; got nothing
 ../src/arm/sysv.S:305: Error: no such instruction: `beq .Lretlonglong'
 ../src/arm/sysv.S:307: Error: too many memory references for `add'
 ../src/arm/sysv.S:308: Error: no such instruction: `ldmfd sp,{sp,pc}'
 ../src/arm/sysv.S:310: Error: no such instruction: `ldr r0,[sp]'
 ../src/arm/sysv.S:311: Error: no such instruction: `b .Lclosure_epilogue'
 ../src/arm/sysv.S:313: Error: no such instruction: `ldr r0,[sp]'
 ../src/arm/sysv.S:314: Error: no such instruction: `ldr r1,[sp,'
 ../src/arm/sysv.S:315: Error: no such instruction: `b .Lclosure_epilogue'
 ../src/arm/sysv.S:319: Error: no such instruction: `ldfs f0,[sp]'
 ../src/arm/sysv.S:320: Error: no such instruction: `b .Lclosure_epilogue'
 ../src/arm/sysv.S:322: Error: no such instruction: `ldfd f0,[sp]'
 ../src/arm/sysv.S:323: Error: no such instruction: `b .Lclosure_epilogue'
 ../src/arm/sysv.S:325: Error: no such instruction: `ldfd f0,[sp]'
 ../src/arm/sysv.S:326: Error: no such instruction: `b .Lclosure_epilogue'
 ../src/arm/sysv.S:330: Error: junk at end of line, first unrecognized
 character is `@'
 ../src/arm/sysv.S:499: Error: no such instruction: `stmfd sp!,{r0-r3}'
 ../src/arm/sysv.S:500: Error: no such instruction: `ldr r0,[pc]'
 ../src/arm/sysv.S:501: Error: no such instruction: `ldr pc,[pc]'
 make[5]: *** [src/arm/sysv.lo] Error 1
 make[5]: Leaving directory `/mnt/hd/extra/haskell/ghc/libffi/build/arm-
 unknown-linux-gnueabi'
 make[4]: *** [all-recursive] Error 1
 make[4]: Leaving directory `/mnt/hd/extra/haskell/ghc/libffi/build/arm-
 unknown-linux-gnueabi'
 make[3]: *** [all] Error 2
 make[3]: Leaving directory `/mnt/hd/extra/haskell/ghc/libffi/build/arm-
 unknown-linux-gnueabi'
 make[2]: *** [all-all] Error 2
 make[1]: *** [libffi/stamp.ffi.static-shared.build] Error 2
 make: *** [quick-cross] Error 2
 }}}

 Looks like its trying to compile arm-stuff using my normal gcc, not the
 cross-gcc.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/6086#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list