]> code.ossystems Code Review - openembedded-core.git/commit
busybox: Use CC instead of bare LD to be the Linker
authorKhem Raj <raj.khem@gmail.com>
Fri, 25 Sep 2015 13:28:05 +0000 (13:28 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 28 Sep 2015 10:58:26 +0000 (11:58 +0100)
commit117282486b68e4da468c21795ea87bfc85625885
tree19e2cce074f6e7a9e690eddf36f0f82ed8006ef8
parentc5de9b2ddb38790866bda5a88b9b7119aac0aa3f
busybox: Use CC instead of bare LD to be the Linker

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)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/busybox/busybox/0001-Use-CC-when-linking-instead-of-LD-and-use-CFLAGS-and.patch [new file with mode: 0644]
meta/recipes-core/busybox/busybox/0002-Passthrough-r-to-linker.patch [new file with mode: 0644]
meta/recipes-core/busybox/busybox_1.23.2.bb