[U-Boot-Users] latest (1.3.1) doesn't compile: files missing

There are two missing files from the distribution that prevents uboot from compiling.
stddef.h is included by a few different things, but can be a blank file.
stdarg.h is included by a couple of things, and can be a trivial implementation (attached).
These are both host includes, and likely shouldn't be included at all in the boot loader code proper.
This is when building the MPC8548CDS config.
I also get link errors on this out of the box:
cd /pe/imp/u-boot-1.3.1 && powerpc-freebsd-ld -Bstatic -T /pe/imp/u-boot-1.3.1/board/cds/mpc8548cds/u-boot.lds -Ttext 0xfff80000 -n $UNDEF_SYM cpu/mpc85xx/start.o cpu/mpc85xx/resetvec.o \ --start-group lib_generic/libgeneric.a board/cds/mpc8548cds/libmpc8548cds.a cpu/mpc85xx/libmpc85xx.a lib_ppc/libppc.a fs/cramfs/libcramfs.a fs/fat/libfat.a fs/fdos/libfdos.a fs/jffs2/libjffs2.a fs/reiserfs/libreiserfs.a fs/ext2/libext2fs.a net/libnet.a disk/libdisk.a drivers/bios_emulator/libatibiosemu.a drivers/block/libblock.a drivers/hwmon/libhwmon.a drivers/i2c/libi2c.a drivers/input/libinput.a drivers/misc/libmisc.a drivers/mtd/libmtd.a drivers/mtd/nand/libnand.a drivers/mtd/nand_legacy/libnand_legacy.a drivers/mtd/onenand/libonenand.a drivers/net/libnet.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a drivers/qe/qe.a drivers/rtc/librtc.a drivers/serial/libserial.a drivers/usb/libusb.a drivers/video/libvideo.a post/libpost.a post/drivers/libpostdrivers.a post/lib_ppc/libpostppc.a post/lib_ppc/fpu/libpostppcfpu.a common/libcommon.a libfdt/libfdt.a --end-group -L /usr/powerpc-freebsd/usr/lib -lgcc \ -Map u-boot.map -o u-boot cpu/mpc85xx/resetvec.o(.debug_info+0x14): relocation truncated to fit: R_PPC_ADDR32 .resetvec+4 common/libcommon.a(env_flash.o)(.text+0xc4): In function `saveenv': /pe/imp/u-boot-1.3.1/common/env_flash.c:312: undefined reference to `flash_sect_protect' common/libcommon.a(env_flash.o)(.text+0xe0):/pe/imp/u-boot-1.3.1/common/env_flash.c:316: undefined reference to `flash_sect_erase' common/libcommon.a(env_flash.o)(.text+0x130):/pe/imp/u-boot-1.3.1/common/env_flash.c:329: undefined reference to `flash_sect_protect'
Are these to be expected with binutils 2.15 and gcc 4.2.1?
Warner

In message 20080118.185100.1159141701.imp@bsdimp.com you wrote:
There are two missing files from the distribution that prevents uboot from compiling.
What sort of toolchain are you using?
stddef.h is included by a few different things, but can be a blank file.
stdarg.h is included by a couple of things, and can be a trivial implementation (attached).
These are both host includes, and likely shouldn't be included at all in the boot loader code proper.
This is when building the MPC8548CDS config.
I also get link errors on this out of the box:
It seems you have a toolchain issue. This is not a problem with U-Boot code.
Best regards,
Wolfgang Denk

In message: 20080120010721.EA1B424764@gemini.denx.de Wolfgang Denk wd@denx.de writes: : In message 20080118.185100.1159141701.imp@bsdimp.com you wrote: : > There are two missing files from the distribution that prevents uboot : > from compiling. : : What sort of toolchain are you using?
binutils 2.15 and gcc 4.2.1. The problem turned out to be the combination: gcc 4.2.1 produced code that binutils couldn't assemble properly. That was what was causing the relocation error.
: > stddef.h is included by a few different things, but can be a blank : > file. : > : > stdarg.h is included by a couple of things, and can be a trivial : > implementation (attached). : > : > These are both host includes, and likely shouldn't be included at all : > in the boot loader code proper. : > : > This is when building the MPC8548CDS config. : > : > I also get link errors on this out of the box: : : It seems you have a toolchain issue. This is not a problem with U-Boot : code.
The two include files aren't a toolchain issue. They can't be because uboot's makefile has said not to include anything from the standard include files. These files aren't included with u-boot.
Warner

In message 20080119.204823.387223958.imp@bsdimp.com you wrote:
The two include files aren't a toolchain issue. They can't be because
They are - see previous message.
uboot's makefile has said not to include anything from the standard include files. These files aren't included with u-boot.
stddef.h is included (as include/linux/stddef.h); only host files in tools/ reference host include files.
And stdarg.h has to be provided by your compiler.
Best regards,
Wolfgang Denk

I think I should be a bit more explicit:
In message 20080120010721.EA1B424764@gemini.denx.de I wrote:
stddef.h is included by a few different things, but can be a blank file.
U-Boot already has a stddef.h (include/linux/stddef.h) which gets used for all U-Boot related compiles.
stdarg.h is included by a couple of things, and can be a trivial implementation (attached).
stdarg.h is a compiler provided file and thus has to be provided by your toolchain.
As mentioned before, I don't think that any changes to U-Boot code are necessary.
Best regards,
Wolfgang Denk
participants (2)
-
M. Warner Losh
-
Wolfgang Denk