Shorter report: powerpc64-xtoolchain-gcc use fails from powerpc (non-64)

Warner Losh imp at bsdimp.com
Wed Apr 1 21:50:03 UTC 2015


> On Apr 1, 2015, at 2:44 PM, Mark Millard <markmi at dsl-only.net> wrote:
> 
> Attempting to use CROSS_TOOLCHAIN=powerpc64-gcc on powerpc (non-64) 11.0-CURRENT with TARGET_ARCH=powerpc64 gets:
> 
>> --- crti.o ---
>> gcc -O2 -pipe   -I/usr/srcC/lib/csu/powerpc64/../common  -I/usr/srcC/lib/csu/powerpc64/../../libc/include  -mlongcall -std=gnu99  -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign    -c /usr/srcC/lib/csu/powerpc64/crti.S
>> ...
>> /usr/srcC/lib/csu/powerpc64/crti.S: Assembler messages:
>> /usr/srcC/lib/csu/powerpc64/crti.S:35: Error: junk at end of line, first unrecognized character is `@'
>> /usr/srcC/lib/csu/powerpc64/crti.S:51: Error: junk at end of line, first unrecognized character is `@'
>> *** [crti.o] Error code 1
>> 
> 
> 
> 
> Read below only for analysis.
> 
> 
> 
> First I'll deal with the error messages. Then I'll deal with the "gcc".
> 
> The lines of crti.S in question are:
> 
>>      .quad   .L._init,.TOC. at tocbase,0
>> ...
>>      .quad   .L._fini,.TOC. at tocbase,0
> 
> The error messages are because __powerpc64__ is not defined when machine/asm.h is included so the wrong definition is used for _ENTRY(…):

The gcc port needs to be fixed, with changes fed upstream.


>> #ifdef __powerpc64__
>> ...
>> #define _ENTRY(name) \
>>       .section ".text"; \
>>       .p2align 2; \
>>       .globl  name; \
>>       .section ".opd","aw"; \
>>       .p2align 3; \
>>       name: \
>>       .quad   DOT_LABEL(name),.TOC. at tocbase,0; \
>>       .previous; \
>>       .p2align 4; \
>>       TYPE_ENTRY(name) \
>> DOT_LABEL(name):
>> ...
>> #else /* !__powerpc64__ */
>> #define _ENTRY(name) \
>>       .text; \
>>       .p2align 4; \
>>       .globl  name; \
>>       .type   name, at function; \
>>       name:
>> #define _END(name)
>> #endif /* __powerpc64__ */
> 
> The (powerpc64 specific) Makefile may need to force a 64-bit usage (-m64 ?), presuming that such is supported from the 32 bit environment.

Generally, we’ve not added those kinds of flags to the command line. There’s many subtle issues in the tree trying to do that…

Warner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-ppc/attachments/20150401/0b3e7534/attachment.sig>


More information about the freebsd-ppc mailing list