[OE-core] [PATCH 15/17] busybox: Use CC instead of bare LD to be the Linker

Richard Purdie richard.purdie at linuxfoundation.org
Tue Sep 1 21:17:34 UTC 2015


On Mon, 2015-08-24 at 13:03 -0700, Khem Raj wrote:
> This patch was on mailing list, another patch to make sure -r is not
> passed directly but via -Wl switch is added.
> 
> This was exposed when using clang and gold linker, clang does not have
> -r switch to do relocatable objects and problem happens specific to OE
> becuase we use LD = CC
> 
> now what happens is that busybox assumes that linker will be called
> directly, and hence sprinkles linkers options in its kbuild system which
> aggregate into LDFLAGS, some of these options are happily ignored by gcc
> as well but it passes -r options rightly to linker so it all works,
> however when using clang, this falls apart since -r is not known option
> for clang so it drops this option and all obects which should be
> partially linked becomes ET_EXEC and when they are added to final link
> then gold starts to get confused
> 
> /mnt/home/kraj/work/angstrom/build/tmp-angstrom-glibc/sysroots/x86_64-linux/usr/bin/arm-angstrom-linux-gnueabi/arm-angstrom-linux-gnueabi-ld:
> error: applets/built-in.o: unsupported ELF file type 2
> clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation)

This breaks DISTRO=poky-lsb:

http://errors.yoctoproject.org/Errors/Details/15705/

(searching for busybox shows many other versions of this too)

Cheers,

Richard




More information about the Openembedded-core mailing list