Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Apr 2015 14:49:51 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Mark Millard <markmi@dsl-only.net>
Cc:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: Shorter report: powerpc64-xtoolchain-gcc use fails from powerpc (non-64)
Message-ID:  <B49E8B91-B8C2-4F0C-9662-8814C16041A4@bsdimp.com>
In-Reply-To: <BB07709E-A5D3-458A-8ED7-61E64103A43C@dsl-only.net>
References:  <BB07709E-A5D3-458A-8ED7-61E64103A43C@dsl-only.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_67A6748E-28CF-4E69-985A-ECCD2F004B8E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


> On Apr 1, 2015, at 2:44 PM, Mark Millard <markmi@dsl-only.net> wrote:
>=20
> Attempting to use CROSS_TOOLCHAIN=3Dpowerpc64-gcc on powerpc (non-64) =
11.0-CURRENT with TARGET_ARCH=3Dpowerpc64 gets:
>=20
>> --- crti.o ---
>> gcc -O2 -pipe   -I/usr/srcC/lib/csu/powerpc64/../common  =
-I/usr/srcC/lib/csu/powerpc64/../../libc/include  -mlongcall -std=3Dgnu99 =
 -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
>>=20
>=20
>=20
>=20
> Read below only for analysis.
>=20
>=20
>=20
> First I'll deal with the error messages. Then I'll deal with the =
"gcc".
>=20
> The lines of crti.S in question are:
>=20
>>      .quad   .L._init,.TOC.@tocbase,0
>> ...
>>      .quad   .L._fini,.TOC.@tocbase,0
>=20
> The error messages are because __powerpc64__ is not defined when =
machine/asm.h is included so the wrong definition is used for =
_ENTRY(=E2=80=A6):

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.@tocbase,0; \
>>       .previous; \
>>       .p2align 4; \
>>       TYPE_ENTRY(name) \
>> DOT_LABEL(name):
>> ...
>> #else /* !__powerpc64__ */
>> #define _ENTRY(name) \
>>       .text; \
>>       .p2align 4; \
>>       .globl  name; \
>>       .type   name,@function; \
>>       name:
>> #define _END(name)
>> #endif /* __powerpc64__ */
>=20
> 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=E2=80=99ve not added those kinds of flags to the command =
line. There=E2=80=99s many subtle issues in the tree trying to do =
that=E2=80=A6

Warner

--Apple-Mail=_67A6748E-28CF-4E69-985A-ECCD2F004B8E
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJVHGf/AAoJEGwc0Sh9sBEAIZoP/1m2jc320czmLmlohqDGG+m4
KD82iXxH4wnBSTm5AJ9ivtpbV8rkeOu/f1Aw9l0eHPQaj9aAslvaDxDMjpX5kXaa
mZGDjzGm4FegktXIhIf8LZo4rRHNNc6fML/qeqL9QYKEQFJqXsGjrtIpRKlkX4Ah
5q3HJcA9By5rxNn/ws2Bktjpcd/2s4gG4Dd4jy9QyjBxGuVjlPU5PeIxV3e5vZ/T
RbNsrsV/Hsfi8APnI1kjFe3bp4Muu+/ER9rUKY4V2F/SGtotvhA6iwnoSFNJHaHa
46PA4+ybEXaDYTt+wwGM4FaLGvIG4mZXtBwctUnXZrH+w5oMfgxDiTCPebKmQDmR
c+o8aLpXgJr6FdfBwYeuQTM2KcZ9WpbiGSLRoeHA0DPQC/som/sFj/OIqbn08Fce
W/Wiw7BYCI1f8aRDWLH8E3xbd6maEp3WuRKLIE5fV5o/Y0Iw2p4T2EJSVcB9xMU7
T/9wh7hWfUNfV63E2uY6Qq5a4CqPzx9AFi9SkhBEp5mPadIgdjKRDMjU+6KAn/x8
PScWRX+xPCkOsLnA6eBYHqMJEAiXo/TgjH6ogyFZw7eEMiMBQHaYWoABn9vhhQ/K
EgI+zGrJk0ZlBLSbm2eGbQqXYk9Sa/djhx+vjmK5HVPKeYhN3TQodTgVs2EN5b39
PIw70mMGZkvc6Cf6wo/m
=le1J
-----END PGP SIGNATURE-----

--Apple-Mail=_67A6748E-28CF-4E69-985A-ECCD2F004B8E--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B49E8B91-B8C2-4F0C-9662-8814C16041A4>