Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Apr 2015 20:35:44 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Mark Millard <markmi@dsl-only.net>
Cc:        freebsd-ppc-owner@freebsd.org, freebsd-toolchain@freebsd.org
Subject:   Re: Shorter version: -m elf32ppc_fbsd (and elf_i386_fbsd ?) vs. -Wl, -m, elf32ppc_fbsd problems (11.0-CURRENT and 10.1-STABLE)
Message-ID:  <E0A6C671-A4FF-4EE9-B260-1EF615ECA62E@bsdimp.com>
In-Reply-To: <0D8F0A9A-593E-4FEE-8F01-20799DE946B2@dsl-only.net>
References:  <0D8F0A9A-593E-4FEE-8F01-20799DE946B2@dsl-only.net>

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

--Apple-Mail=_1810AE61-2B69-432B-AADF-83D8267DB323
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8


> On Apr 9, 2015, at 7:56 PM, Mark Millard <markmi@dsl-only.net> wrote:
>=20
> =46rom share/mk/bsd.README :
>=20
> LDFLAGS         Additional loader flags. Passed to the loader via CC,
>                since that's used to link programs as well, so loader
>                specific flags need to be prefixed with -Wl, to work.
>=20
> But the following 3 powerpc (non-64) examples do not use the -Wl, =
notation:
>=20
>> LDFLAGS+=3D       -m elf32ppc_fbsd
>> /usr/src/sys/boot/ofw/Makefile.inc
>=20
>=20
>> LDFLAGS+=3D       -m elf32ppc_fbsd
>> /usr/src/sys/boot/uboot/Makefile.inc
>=20
>=20
>> LDFLAGS+=3D       -m elf32ppc_fbsd
>> /usr/src/sys/boot/powerpc/Makefile.inc
>=20
> In fact I get errors such as (for that last one when using =
powerpc64-gcc via powerpc64-xtoolchain-gcc, executed on a powerpc64):
>=20
>> powerpc64-portbld-freebsd11.0-gcc: error: elf32ppc_fbsd: No such file =
or directory
>> powerpc64-portbld-freebsd11.0-gcc: error: elf32ppc_fbsd: No such file =
or directory
>> powerpc64-portbld-freebsd11.0-gcc: error: unrecognized command line =
option '-m'
>> powerpc64-portbld-freebsd11.0-gcc: error: unrecognized command line =
option '-m'
>>=20
>> *** [boot1.elf] Error code 1
>>=20
>> make[6]: stopped in /usr/srcC/sys/boot/powerpc/boot1.chrp
>> 1 error
>=20
> I do not know if the space between -m and elf... creates a problem for =
-Wl, use or not. I would guess that
>=20
> -Wl,-m,elf32pcc_fbsd
>=20
> is the proper notation for putting the space through to the ld variant =
used. But I=E2=80=99m not to the point of testing the behavior of that =
yet.
>=20
>=20
>=20
> i386 seems to have a similar example, although I=E2=80=99m not using =
such a FreeBSD environment.
>=20
>> LD_FLAGS+=3D      -m elf_i386_fbsd
>> /usr/src/sys/boot/i386/Makefile.inc
>=20
>=20
>=20
> (This note is shorter in part because figured out more context than I =
had last time.)

I think much of this is historical accident where the boot Makefiles =
used to call ld directly, then were converted to call gcc, and gcc =
allowed the -m notation like this as a historical compatibility.

Do thinks still work if you use -Wl, notation?

Warner

--Apple-Mail=_1810AE61-2B69-432B-AADF-83D8267DB323
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

iQIcBAEBCgAGBQJVJzcBAAoJEGwc0Sh9sBEAB48P/1WVoGrkzD/Mhc2uHxc6uTR/
mJkNXIigB1rh9U/aqqzibY5hQKR2v/9BUCwC+oLEO5MsdJU6wI/y+dRx0ejuBz9L
2hT8ilOXEgnrUxM9ycEXBh47AOrTrIPk/LtjmBLkke+RqCfyH5AqeM6cTdRJ2FVc
qGEOL/SD53kOwUPRnUhcC5DytHmvuFUaOibP+8eKUfzt22J34C9NWuDehdOWYt/F
sTw/v84+oXDTZLkW5ZaF+RLH1BfeP2ed9M5NY8VES/TpL++jfejcFHgTA84d8hAu
LrgDpHKlC10+Z0rqEvtoX5wX0b4mh7kCHQdXLIs2xRL381xhWlTuWaBID4c70/+r
7yTTn0fQ2JAYf/mFV4LoW54W6T/6Oo4gC9HNohzpX6MjQBJuc2r69uVqMUoskgSj
CdDzPKuXXPsK1+ce8m6S+oQojgy7fXmrS6u+9e6AeTRsLaA0fNoUL0RKxSuE1wiz
zEDhdtScPqKarLA0oy/8K/MGbyA7v4vgedUDzAUXGuG71pd4WCzXObEQEgRrwasz
aScyTQ8rK+7N0yeUDO6HBhPQA02QufUy/BOVU3m8DAMlGf98jq2emN7mQMcY/vZS
e5n8usZ+0kFDS5TViGLkV1DlXo3+Daq3w/rFyi/X0pW+3hiOc4kJWgcyDlU6QfWw
UJ0K7jvHjk+4VhVgw00i
=ixYJ
-----END PGP SIGNATURE-----

--Apple-Mail=_1810AE61-2B69-432B-AADF-83D8267DB323--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E0A6C671-A4FF-4EE9-B260-1EF615ECA62E>