I just tried this experiment: * Build Poky on MachineA to some directory $NEW * Copy Poky ($POKYBASE) and $NEW/sstate-cache to MachineB, in this case the path for $POKYBASE is the same on both machines but $NEW differs. MachineA:$NEW does not exist on MachineB * Try to build on Machine B, pointing SSTATE_MIRRORS to $NEW/sstate-cache This build is in $NEW2 The process fails for me building the kernel: | arm-poky-linux-gnueabi-ld: libgcc.a: No such file: No such file or directory Looking carefully, I can see that the compiler is looking for libgcc.a in the directory path $NEW that is only on MachineA.
My test was based on commit bb783afd4daa3f57fb26e2bb86f5bc9cbeb11df0
I only have one machine, and thus tried a different step: * build Poky in $DIR1, with sstate generated in ${SSTATE-CACHE} (a global one) * then with same $POKYBASE, create a new build $DIR2, with SSTATE_MIRRORS pointing to ${SSTATE-CACHE} * move $DIR1 to $DIR1.bak I think this way it's identical to what Gary did with two machines, but I didn't see such failures. so Gary, could you try latest poky master or verify whether my single-machine steps may expose same failure in your side? Or is there any step not equivalent between our cases? Mine commit is based on: commit 60ccdaa0ea128ac19113c0746c6e12bd02b2fc12 Author: Mark Hatle <mark.hatle@windriver.com> Date: Wed Nov 24 18:06:04 2010 -0600 poky-init-build-env: Enable all POSIX shells Update the script so that it will work in more then just bash. If bash is not used, it will assume the PWD is the Poky location. (This is because BASH_SOURCE is a bash-ism, and equivalent functionality is not available in other shells). This has been verified with dash (see comment in the code), ksh, zsh and of course bash. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Created attachment 82 [details] Add --sysroot to ${KERNEL_CC} to fix path problems
Gary, could you paste a little more context around the error please? Is this whilst building something in kernel space or userspace (like tracing tools)? The kernel itself shouldn't need libgcc...
I have my own kernel recipe which is very simple and based on 2.6.32. I've reproduced this error on a single machine like this: * Build Poky in /local/poky_base * Rename /local/poky_base to /local/poky_base_moved * Build Poky in /local/poky_rebuild, pointing SSTATE_MIRRORS to /local/poky_base_moved/sstate-cache * Bump PR on my kernel recipe (manually) * Rebuild - fails linking the kernel What I found is I get this error: arm-poky-linux-gnueabi-ld --sysroot=/local/poky_rebuild/tmp/sysroots/armv7a-poky-linux-gnueabi --defsym zreladdr=0x80008000 --defsym initrd_phys=0x80800000 --defsym params_phys=0x80000100 -p --no-undefined -X libgcc.a -T arch/arm/boot/compressed/vmlinux.lds arch/arm/boot/compressed/head.o arch/arm/boot/compressed/piggy.o arch/arm/boot/compressed/misc.o -o arch/arm/boot/compressed/vmlinux arm-poky-linux-gnueabi-ld: libgcc.a: No such file: No such file or directory This is derived from the bootstrap Makefile. Using grep in the arch/arm/boot tree, I found this: tmp/work/cobra3530p60-poky-linux-gnueabi/linux-am-2.6.32-1/linux-am-2.6.32/arch/arm/boot/compressed/Makefile: $(shell $(CC) $(KBUILD_CFLAGS) --print-libgcc-file-name) -T The problem with this is that $(CC) in the kernel build corresponds to ${KERNEL_CC} from meta/classes/kernel.bbclass Without the --sysroot= in that variable, it will try and find libgcc.a in the tree where GCC was built (/local/poky_base) but it's no longer there. It's pretty obvious that at least for this kernel, the dependency on libgcc.a is explicit. Adding the --sysroot= option to ${KERNEL_CC} seems like a useful way to fix the build.
fixed by 14762f71b9f839432ede0406b9443ce20b918378