Created attachment 2208 [details] Full build log I'm trying to use the /pub/releases/yocto-1.7.rc3/toolchain/x86_64 images for PowerPC to build a plain standard mainline U-Boot (lasest realease = v2014.10). -> . /opt/poky/1.7/environment-setup-ppc7400-poky-linux -> unset LDFLAGS -> make mrproper ; make CONFIG_USE_PRIVATE_LIBGCC=y TQM5200S_defconfig ; make CONFIG_USE_PRIVATE_LIBGCC=y -j8 all ... LD post/built-in.o LD lib/built-in.o LD u-boot arch/powerpc/cpu/mpc5xxx/traps.o: In function `show_regs': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/traps.c:81: undefined reference to `_restgpr_25_x' arch/powerpc/cpu/mpc5xxx/traps.o: In function `MachineCheckException': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/traps.c:134: undefined reference to `_restgpr_30_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `wait_for_pin': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/i2c.c:118: undefined reference to `_restgpr_28_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `wait_for_bb': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/i2c.c:97: undefined reference to `_restgpr_28_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `do_address': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/i2c.c:143: undefined reference to `_restgpr_31_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `send_bytes': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/i2c.c:166: undefined reference to `_restgpr_26_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `i2c_probe': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/i2c.c:343: undefined reference to `_restgpr_29_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `i2c_read': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/i2c.c:387: undefined reference to `_restgpr_25_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `i2c_write': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/i2c.c:425: undefined reference to `_restgpr_27_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `checkcpu': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/cpu.c:59: undefined reference to `_restgpr_28_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `ft_cpu_setup': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/cpu.c:137: undefined reference to `_restgpr_26_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `ide_preinit': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/ide.c:82: undefined reference to `_restgpr_31_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `mpc5xxx_ic_disable': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/interrupts.c:67: undefined reference to `_restgpr_30_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `mpc5xxx_ic_enable': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/interrupts.c:96: undefined reference to `_restgpr_30_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `interrupt_init_cpu': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/interrupts.c:221: undefined reference to `_restgpr_31_x' arch/powerpc/cpu/mpc5xxx/built-in.o: In function `irq_free_handler': /home/wd/git/u-boot/work/arch/powerpc/cpu/mpc5xxx/interrupts.c:293: undefined reference to `_restgpr_30_x' ... etc. The same problem happens both with poky-glibc-x86_64-core-image-sato-ppc7400-toolchain-1.7.sh and with poky-glibc-x86_64-core-image-sato-ppce500v2-toolchain-1.7.sh
There was possibly some breakage in the rc3 build, so re-verification with the rc5 toolchain would be best. Also, can you confirm if it works without "unset LDFLAGS" or do you get different breakage?
(In reply to comment #1) > There was possibly some breakage in the rc3 build, so re-verification with > the rc5 toolchain would be best. rc5 shows much less of these errors, but they are still present: ... LD examples/standalone/libstubs.o LD examples/standalone/hello_world LD examples/standalone/interrupt examples/standalone/hello_world.oexamples/standalone/interrupt.o: In function `: In function `interrupthello_world': ': /home/wd/git/u-boot/work/examples/standalone/hello_world.c:38: undefined reference to `/home/wd/git/u-boot/work/examples/standalone/interrupt.c:_restgpr_27_x' 56: undefined reference to `_restgpr_30_x' make[2]: *** [examples/standalone/hello_world] Error 1 make[2]: *** [examples/standalone/interrupt] Error 1 LD examples/standalone/sched examples/standalone/sched.o: In function `sched': /home/wd/git/u-boot/work/examples/standalone/sched.c:140: undefined reference to `_restgpr_16_x' examples/standalone/sched.o: In function `testthread': /home/wd/git/u-boot/work/examples/standalone/sched.c:166: undefined reference to `_restgpr_30_x' examples/standalone/sched.o: In function `thread_yield': /home/wd/git/u-boot/work/examples/standalone/sched.c:218: undefined reference to `_restgpr_21_x' make[2]: *** [examples/standalone/sched] Error 1 make[2]: Target `__build' not remade because of errors. make[1]: *** [examples/standalone] Error 2 make[1]: Target `__build' not remade because of errors. make: *** [examples] Error 2 make: Target `all' not remade because of errors. > Also, can you confirm if it works without > "unset LDFLAGS" or do you get different breakage? LDFLAGS must be unset when compiling U-Boot or the Linux kernel - both pass this directly to the linker, which will fail with linker errors like this: powerpc-linux-ld.bfd: unrecognized option '-Wl,-O1' powerpc-linux-ld.bfd: use the --help option for usage information The Yocto setting of export LDFLAGS="-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed" will only work when passed through GCC.
An answer appears to have been given by Wolfgang. Richard, Saul do you still NEEDINFO?
I had a look at this and it appears this isn't really an issue with our toolchain but more the way u-boot is using it. See for example: https://lists.ozlabs.org/pipermail/linuxppc-dev/2008-May/055727.html I'm guessing u-boot would need more pieces of libgcc internally to make this work. If I remove CONFIG_USE_PRIVATE_LIBGCC=y it builds ok. I'm therefore marking this as a not a bug (in the Yocto Project). If you believe there is a problem with the toolchain, please provide more info about cases where it works and how we'd fix this.
(In reply to comment #4) > I had a look at this and it appears this isn't really an issue with our > toolchain but more the way u-boot is using it. See for example: > > https://lists.ozlabs.org/pipermail/linuxppc-dev/2008-May/055727.html > > I'm guessing u-boot would need more pieces of libgcc internally to make this > work. If I remove CONFIG_USE_PRIVATE_LIBGCC=y it builds ok. I'm therefore > marking this as a not a bug (in the Yocto Project). If you believe there is > a problem with the toolchain, please provide more info about cases where it > works and how we'd fix this. Verified as per above comments.