Shorter version: -m elf32ppc_fbsd (and elf_i386_fbsd ?) vs. -Wl, -m, elf32ppc_fbsd problems (11.0-CURRENT and 10.1-STABLE)

Warner Losh imp at bsdimp.com
Fri Apr 10 04:40:15 UTC 2015


> On Apr 9, 2015, at 8:40 PM, Mark Millard <markmi at dsl-only.net> wrote:
> 
> I now see one place where "-Wl,-m,elf32ppc_fbsd" type of notation in LDFLAGS would not be handled if it ended up involved:
> 
> share/mk/sys.mk:_LDFLAGS        =       ${LDFLAGS:S/-Wl,//g}    # strip -Wl, for LD
> 
> This notation does not deal with turning the extra comma back into a space.

It should be "-Wl,-m -Wl,elf32ppc_fbsd” since that’s the same, isn’t it? That’s what it will do. And that’s correct.

Warner

> ===
> Mark Millard
> markmi at dsl-only.net
> 
> On 2015-Apr-9, at 06:56 PM, Mark Millard <markmi at dsl-only.net> wrote:
> 
> From share/mk/bsd.README :
> 
> 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.
> 
> But the following 3 powerpc (non-64) examples do not use the -Wl, notation:
> 
>> LDFLAGS+=       -m elf32ppc_fbsd
>> /usr/src/sys/boot/ofw/Makefile.inc
> 
> 
>> LDFLAGS+=       -m elf32ppc_fbsd
>> /usr/src/sys/boot/uboot/Makefile.inc
> 
> 
>> LDFLAGS+=       -m elf32ppc_fbsd
>> /usr/src/sys/boot/powerpc/Makefile.inc
> 
> In fact I get errors such as (for that last one when using powerpc64-gcc via powerpc64-xtoolchain-gcc, executed on a powerpc64):
> 
>> 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'
>> 
>> *** [boot1.elf] Error code 1
>> 
>> make[6]: stopped in /usr/srcC/sys/boot/powerpc/boot1.chrp
>> 1 error
> 
> I do not know if the space between -m and elf... creates a problem for -Wl, use or not. I would guess that
> 
> -Wl,-m,elf32pcc_fbsd
> 
> is the proper notation for putting the space through to the ld variant used. But I’m not to the point of testing the behavior of that yet.
> 
> 
> 
> i386 seems to have a similar example, although I’m not using such a FreeBSD environment.
> 
>> LD_FLAGS+=      -m elf_i386_fbsd
>> /usr/src/sys/boot/i386/Makefile.inc
> 
> 
> 
> (This note is shorter in part because figured out more context than I had last time.)
> 
> ===
> Mark Millard
> markmi at dsl-only.net
> 
> 
> _______________________________________________
> freebsd-toolchain at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
> To unsubscribe, send any mail to "freebsd-toolchain-unsubscribe at freebsd.org"

-------------- 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-toolchain/attachments/20150409/dd23dd52/attachment.sig>


More information about the freebsd-toolchain mailing list