From f457c98d107a93aa70598a6745ece3f97c9615f0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 23 Aug 2015 18:31:20 -0700 Subject: 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 (From OE-Core rev: ebee06dbf195b74791feb63c23a637324c1656e8) (From OE-Core rev: 9701f9551940814623ed58ef13e4c5bb29934ed6) Signed-off-by: Khem Raj Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- meta/recipes-devtools/diffstat/diffstat_1.60.bb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'meta/recipes-devtools/diffstat') diff --git a/meta/recipes-devtools/diffstat/diffstat_1.60.bb b/meta/recipes-devtools/diffstat/diffstat_1.60.bb index 29c32a8754..25ba4dac4b 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 -- cgit 1.2.3-korg