[oe-commits] Khem Raj : diffstat: Add TOOLCHAIN_OPTIONS to Linker calls

git at git.openembedded.org git at git.openembedded.org
Tue Aug 25 09:48:21 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: 0d4365874d8471156672dec546d0e1ae33ac1ccb
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=0d4365874d8471156672dec546d0e1ae33ac1ccb

Author: Khem Raj <raj.khem at gmail.com>
Date:   Sun Aug 23 18:31:20 2015 -0700

diffstat: Add TOOLCHAIN_OPTIONS to Linker calls

configure in this case does a novel thing where it drops all additional
compiler options from CC variable into CFLAGS which in OE's case include
the options added by TOOLCHAIN_OPTIONS and then it does exactly same for
LD as well, the problem starts when we miss the --sysroot options and
ABI options which are part of CC variables usually in OE, in the end it
assigns LD = CC but doesnt add newly separated CFLAGS to LDFLAGS hence
the compile still works since all those needed options are getting into
compiler cmdline but link step fails especially when using gold, since
it does not find --sysroot option on cmdline it starts to complain about
missing libraries and paths

This shows up with clang more so because clang does not have implicit
sysroot that it silently passes down to linker like gcc does when
confgured with sysroot

We see errors like

arm-angstrom-linux-gnueabi-clang -c -I.
-I/mnt/home/kraj/work/angstrom/build/tmp-angstrom-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/diffstat/1.60-r0/diffstat-1.60
-DHAVE_CONFIG_H   -D__extern_always_inline=inline -D_GNU_SOURCE -O2
-pipe -g -feliminate-unused-debug-types  -march=armv7-a -mthumb
-mfloat-abi=hard -mfpu=neon -no-integrated-as
--sysroot=/mnt/home/kraj/work/angstrom/build/tmp-angstrom-glibc/sysroots/raspberrypi2
/mnt/home/kraj/work/angstrom/build/tmp-angstrom-glibc/work/armv7at2hf-vfp-neon-angstrom-linux-gnueabi/diffstat/1.60-r0/diffstat-1.60/diffstat.c
NOTE: make -j 16
arm-angstrom-linux-gnueabi-clang -Wl,-O1 -Wl,--hash-style=gnu
-Wl,--as-needed -o diffstat diffstat.o
/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: cannot open crt1.o: No such file or directory
/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: cannot open crti.o: No such file or directory
/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: cannot open crtbegin.o: No such file or directory
/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: cannot open crtend.o: No such file or directory
/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: cannot open crtn.o: No such file or directory
/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: cannot find -lgcc
/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: cannot find -lgcc
/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: cannot find -lgcc
/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: cannot find -lgcc

Signed-off-by: Khem Raj <raj.khem at gmail.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 meta/recipes-devtools/diffstat/diffstat_1.60.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-devtools/diffstat/diffstat_1.60.bb b/meta/recipes-devtools/diffstat/diffstat_1.60.bb
index 29c32a8..25ba4da 100644
--- a/meta/recipes-devtools/diffstat/diffstat_1.60.bb
+++ b/meta/recipes-devtools/diffstat/diffstat_1.60.bb
@@ -18,6 +18,8 @@ S = "${WORKDIR}/diffstat-${PV}"
 
 inherit autotools gettext ptest
 
+LDFLAGS += "${TOOLCHAIN_OPTIONS}"
+
 do_configure () {
 	if [ ! -e ${S}/acinclude.m4 ]; then
 		mv ${S}/aclocal.m4 ${S}/acinclude.m4



More information about the Openembedded-commits mailing list