Skip to contentSkip to conversation

Packages won't build after update to 2010.2

Buildroot Grant Edwards 1 participant 2 messages Mar 16, 2010

lore
Share & tools
lore
#0 lore raw

After updating to 2010.2, the updated versions of a several packages won't build. For example, busybox-1.16 fails like this:

make[1]: Leaving directory `/home/nextgen/buildroot/buildroot/output/build/busybox-1.16.0' touch /home/nextgen/buildroot/buildroot/output/build/busybox-1.16.0/.config

   /usr/bin/make -j2 CC=/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-gcc CROSS_COMPILE="/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-" \
                   CROSS="/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-" PREFIX="/home/nextgen/buildroot/buildroot/output/target" \
                   ARCH=arm \
                   EXTRA_CFLAGS="-Os -pipe -O2  --sysroot /home/nextgen/buildroot/buildroot/output/staging/ -I/home/nextgen/buildroot/buildroot/output/toolchain/linu$
   make[1]: Entering directory `/home/nextgen/buildroot/buildroot/output/build/busybox-1.16.0'
   scripts/kconfig/conf -s Config.in
   #
   # using defaults found in .config
   #
     SPLIT   include/autoconf.h -> include/config/*
     HOSTCC  applets/usage
   applets/usage.c: In function 'main':
   applets/usage.c:32: warning: ignoring return value of 'write', declared with attribute warn_unused_result
     GEN     include/bbconfigopts.h
     HOSTCC  applets/applet_tables
     GEN     include/usage_compressed.h
     GEN     include/applet_tables.h
     CC      applets/applets.o
     HOSTCC  applets/usage_pod
   applets/usage_pod.c: In function 'main':
   applets/usage_pod.c:58: warning: format not a string literal and no format arguments
     LD      applets/built-in.o
     DOC     busybox.pod
     DOC     BusyBox.txt

[1431 warnings about type punned pointers later]

     CC      util-linux/switch_root.o
     CC      util-linux/umount.o
     AR      util-linux/lib.a
     LINK    busybox_unstripped

Trying libraries: crypt m
Failed: -Wl,--start-group -lcrypt -lm -Wl,--end-group
Output of:
/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-gcc -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -$
==========
/home/nextgen/buildroot/toolchain/usr/bin/../lib/gcc/arm-linux-uclibc/4.4.3/../../../../arm-linux-uclibc/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
make[1]: *** [busybox_unstripped] Error 1
make[1]: Leaving directory `/home/nextgen/buildroot/buildroot/output/build/busybox-1.16.0'
make: *** [/home/nextgen/buildroot/buildroot/output/build/busybox-1.16.0/busybox] Error 2

I believe the failure is due to the fact that no --sysroot option is being specified in the link command. There _is_ a coorect --sysroot option during compilation (see the EXTRA_CFLAGS value at the beginning of the log), so I know that SYSROOT_DIR is set correctly.

After updating, I see other related failures building other packages (mtdutils fails during compilation because include files can't be found). Older versions of these packages always built fine.

It looks like the passing of --sysroot to external toolchains no longer works...

Signature · 3 lines
Grant Edwards               grant.b.edwards        Yow! Here I am at the flea
                                  at               market but nobody is buying
                              gmail.com            my urine sample bottles ...
#1 lore raw
Quoted 2 lines · Grant Edwards

After updating to 2010.2, the updated versions of a several packages won't build. For example, busybox-1.16 fails like this:

[...]

Quoted 7 lines

/home/nextgen/buildroot/toolchain/usr/bin/arm-linux-gcc -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -$
==========
/home/nextgen/buildroot/toolchain/usr/bin/../lib/gcc/arm-linux-uclibc/4.4.3/../../../../arm-linux-uclibc/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status

I believe the failure is due to the fact that no --sysroot option is being specified in the link command.

The patch below seems to fix the problem. I don't really understand why it worked before. That was with gcc 4.3 instead of gcc 4.4, so it could be that 4.4 is pickier about locating library files.

I'll file a bug report and submit the patch.

busybox.mk +3 -0
Index: busybox.mk
===================================================================
@@ -101,12 +101,14 @@
 	$(MAKE) CC=$(TARGET_CC) CROSS_COMPILE="$(TARGET_CROSS)" \
 		CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" \
 		ARCH=$(KERNEL_ARCH) \
+		EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
 		EXTRA_CFLAGS="$(BUSYBOX_CFLAGS)" -C $(BUSYBOX_DIR)
 ifeq ($(BR2_PREFER_IMA)$(BR2_PACKAGE_BUSYBOX_SNAPSHOT),yy)
 	rm -f $@
 	$(MAKE) CC=$(TARGET_CC) CROSS_COMPILE="$(TARGET_CROSS)" \
 		CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" \
 		ARCH=$(KERNEL_ARCH) STRIP="$(STRIPCMD)" \
+		EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
 		EXTRA_CFLAGS="$(BUSYBOX_CFLAGS)" -C $(BUSYBOX_DIR) \
 		-f scripts/Makefile.IMA
 endif
@@ -116,6 +118,7 @@
 	$(MAKE) CC=$(TARGET_CC) CROSS_COMPILE="$(TARGET_CROSS)" \
 		CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" \
 		ARCH=$(KERNEL_ARCH) \
+		EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
 		EXTRA_CFLAGS="$(BUSYBOX_CFLAGS)" -C $(BUSYBOX_DIR) install
 else
 	install -D -m 0755 $(BUSYBOX_DIR)/busybox $(TARGET_DIR)/bin/busybox