Hey
When building u-boot for an ARMv5T platform (versatileqemu_config), the Ubuntu-packaged Linaro cross-toolchain isn't suitable because it only offers an ARMv7T2 libgcc. But I'd like the build to fail when that happens rather than silently generating an u-boot.bin which will trigger a SIGILL when it hits the first non-ARMv5T instruction.
I heard that gcc/ld are supposed to check this, but I'm not sure how it's supposed to work; perhaps the way u-boot does its final link prevents this from working properly?
I tried building u-boot as follows: make O=obj-broken \ CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm \ OPTFLAGS="-marm -march=armv5te" \ versatileqemu_config
make O=obj-broken \ CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm \ OPTFLAGS="-marm -march=armv5te" \ -j2
The final link looks like this: UNDEF_SYM=`arm-linux-gnueabi-objdump -x /home/lool/git/denx/u-boot/obj-v-broken/board/armltd/versatile/libversatile.o /home/lool/git/denx/u-boot/obj-v-broken/api/libapi.o /home/lool/git/denx/u-boot/obj-v-broken/arch/arm/cpu/arm926ejs/libarm926ejs.o /home/lool/git/denx/u-boot/obj-v-broken/arch/arm/cpu/arm926ejs/versatile/libversatile.o /home/lool/git/denx/u-boot/obj-v-broken/arch/arm/lib/libarm.o /home/lool/git/denx/u-boot/obj-v-broken/common/libcommon.o /home/lool/git/denx/u-boot/obj-v-broken/disk/libdisk.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/bios_emulator/libatibiosemu.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/block/libblock.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/dma/libdma.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/fpga/libfpga.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/gpio/libgpio.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/hwmon/libhwmon.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/i2c/libi2c.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/input/libinput.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/misc/libmisc.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/mmc/libmmc.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/mtd/libmtd.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/mtd/nand/libnand.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/mtd/onenand/libonenand.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/mtd/spi/libspi_flash.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/mtd/ubi/libubi.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/net/libnet.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/net/phy/libphy.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/pci/libpci.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/pcmcia/libpcmcia.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/power/libpower.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/rtc/librtc.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/serial/libserial.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/spi/libspi.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/twserial/libtws.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/usb/eth/libusb_eth.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/usb/gadget/libusb_gadget.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/usb/host/libusb_host.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/usb/musb/libusb_musb.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/usb/phy/libusb_phy.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/video/libvideo.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/watchdog/libwatchdog.o /home/lool/git/denx/u-boot/obj-v-broken/fs/cramfs/libcramfs.o /home/lool/git/denx/u-boot/obj-v-broken/fs/ext2/libext2fs.o /home/lool/git/denx/u-boot/obj-v-broken/fs/fat/libfat.o /home/lool/git/denx/u-boot/obj-v-broken/fs/fdos/libfdos.o /home/lool/git/denx/u-boot/obj-v-broken/fs/jffs2/libjffs2.o /home/lool/git/denx/u-boot/obj-v-broken/fs/reiserfs/libreiserfs.o /home/lool/git/denx/u-boot/obj-v-broken/fs/ubifs/libubifs.o /home/lool/git/denx/u-boot/obj-v-broken/fs/yaffs2/libyaffs2.o /home/lool/git/denx/u-boot/obj-v-broken/lib/libfdt/libfdt.o /home/lool/git/denx/u-boot/obj-v-broken/lib/libgeneric.o /home/lool/git/denx/u-boot/obj-v-broken/lib/lzma/liblzma.o /home/lool/git/denx/u-boot/obj-v-broken/lib/lzo/liblzo.o /home/lool/git/denx/u-boot/obj-v-broken/lib/zlib/libz.o /home/lool/git/denx/u-boot/obj-v-broken/net/libnet.o /home/lool/git/denx/u-boot/obj-v-broken/post/libpost.o | sed -n -e 's/.*(__u_boot_cmd_.*)/-u\1/p'|sort|uniq`; cd /home/lool/git/denx/u-boot/obj-v-broken && arm-linux-gnueabi-ld -pie -T /home/lool/git/denx/u-boot/obj-v-broken/u-boot.lds -Bstatic -Ttext 0x10000 $UNDEF_SYM arch/arm/cpu/arm926ejs/start.o --start-group api/libapi.o arch/arm/cpu/arm926ejs/libarm926ejs.o arch/arm/cpu/arm926ejs/versatile/libversatile.o arch/arm/lib/libarm.o common/libcommon.o disk/libdisk.o drivers/bios_emulator/libatibiosemu.o drivers/block/libblock.o drivers/dma/libdma.o drivers/fpga/libfpga.o drivers/gpio/libgpio.o drivers/hwmon/libhwmon.o drivers/i2c/libi2c.o drivers/input/libinput.o drivers/misc/libmisc.o drivers/mmc/libmmc.o drivers/mtd/libmtd.o drivers/mtd/nand/libnand.o drivers/mtd/onenand/libonenand.o drivers/mtd/spi/libspi_flash.o drivers/mtd/ubi/libubi.o drivers/net/libnet.o drivers/net/phy/libphy.o drivers/pci/libpci.o drivers/pcmcia/libpcmcia.o drivers/power/libpower.o drivers/rtc/librtc.o drivers/serial/libserial.o drivers/spi/libspi.o drivers/twserial/libtws.o drivers/usb/eth/libusb_eth.o drivers/usb/gadget/libusb_gadget.o drivers/usb/host/libusb_host.o drivers/usb/musb/libusb_musb.o drivers/usb/phy/libusb_phy.o drivers/video/libvideo.o drivers/watchdog/libwatchdog.o fs/cramfs/libcramfs.o fs/ext2/libext2fs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o fs/reiserfs/libreiserfs.o fs/ubifs/libubifs.o fs/yaffs2/libyaffs2.o lib/libfdt/libfdt.o lib/libgeneric.o lib/lzma/liblzma.o lib/lzo/liblzo.o lib/zlib/libz.o net/libnet.o post/libpost.o board/armltd/versatile/libversatile.o --end-group /home/lool/git/denx/u-boot/obj-v-broken/arch/arm/lib/eabi_compat.o -L /usr/lib/gcc/arm-linux-gnueabi/4.6.1 -lgcc -Map u-boot.map -o u-boot
I verified that all the .o files passed above have Tag_CPU_name: "5TE" in their arm-linux-gnueabi-readelf -A output; the only problematic file is -lgcc.
Note that the final link is done with arm-linux-gnueabi-ld and doesn't set any architecture; I changed it manually to use gcc and pass the -marm -march=armv5te, and had to set -nostdlib too when using gcc: arm-linux-gnueabi-gcc -marm -march=armv5te -nostdlib -pie -T /home/lool/git/denx/u-boot/obj-v-broken/u-boot.lds -Bstatic -Ttext 0x10000 $UNDEF_SYM arch/arm/cpu/arm926ejs/start.o -Wl,--start-group api/libapi.o arch/arm/cpu/arm926ejs/libarm926ejs.o arch/arm/cpu/arm926ejs/versatile/libversatile.o arch/arm/lib/libarm.o common/libcommon.o disk/libdisk.o drivers/bios_emulator/libatibiosemu.o drivers/block/libblock.o drivers/dma/libdma.o drivers/fpga/libfpga.o drivers/gpio/libgpio.o drivers/hwmon/libhwmon.o drivers/i2c/libi2c.o drivers/input/libinput.o drivers/misc/libmisc.o drivers/mmc/libmmc.o drivers/mtd/libmtd.o drivers/mtd/nand/libnand.o drivers/mtd/onenand/libonenand.o drivers/mtd/spi/libspi_flash.o drivers/mtd/ubi/libubi.o drivers/net/libnet.o drivers/net/phy/libphy.o drivers/pci/libpci.o drivers/pcmcia/libpcmcia.o drivers/power/libpower.o drivers/rtc/librtc.o drivers/serial/libserial.o drivers/spi/libspi.o drivers/twserial/libtws.o drivers/usb/eth/libusb_eth.o drivers/usb/gadget/libusb_gadget.o drivers/usb/host/libusb_host.o drivers/usb/musb/libusb_musb.o drivers/usb/phy/libusb_phy.o drivers/video/libvideo.o drivers/watchdog/libwatchdog.o fs/cramfs/libcramfs.o fs/ext2/libext2fs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o fs/reiserfs/libreiserfs.o fs/ubifs/libubifs.o fs/yaffs2/libyaffs2.o lib/libfdt/libfdt.o lib/libgeneric.o lib/lzma/liblzma.o lib/lzo/liblzo.o lib/zlib/libz.o net/libnet.o post/libpost.o board/armltd/versatile/libversatile.o -Wl,--end-group /home/lool/git/denx/u-boot/obj-v-broken/arch/arm/lib/eabi_compat.o -L /usr/lib/gcc/arm-linux-gnueabi/4.6.1 -lgcc -Wl,-Map u-boot.map -o u-boot
But this command works and produces an u-boot ELF which has Tag_CPU_name: "7-A".
How would I break the build when libgcc isn't ARMv5T?
Thanks,
On 2011/11/10 06:04 PM, Loïc Minier wrote:
When building u-boot for an ARMv5T platform (versatileqemu_config), the Ubuntu-packaged Linaro cross-toolchain isn't suitable because it only offers an ARMv7T2 libgcc. But I'd like the build to fail when that happens rather than silently generating an u-boot.bin which will trigger a SIGILL when it hits the first non-ARMv5T instruction.
I heard that gcc/ld are supposed to check this, but I'm not sure how it's supposed to work; perhaps the way u-boot does its final link prevents this from working properly?
I tried building u-boot as follows: make O=obj-broken \ CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm \ OPTFLAGS="-marm -march=armv5te" \ versatileqemu_config
make O=obj-broken \ CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm \ OPTFLAGS="-marm -march=armv5te" \ -j2
I'd assume the Ubuntu-packaged toolchain probably doesn't have a ARMv5 multilib? You could either expand the toolchain configuration and rebuild, or more simply, use a CodeSourcery toolchain. Our default multilib is ARMv5TE.
If you truly mean v5T and not v5TE (I can't really tell from the inconsistency between your description and the listed options above), then you should use -march=armv4t, we ship v4T libraries too.
Chung-Lin
On Thu, Nov 10, 2011, Chung-Lin Tang wrote:
I'd assume the Ubuntu-packaged toolchain probably doesn't have a ARMv5 multilib? You could either expand the toolchain configuration and rebuild, or more simply, use a CodeSourcery toolchain. Our default multilib is ARMv5TE.
Sorry, I didn't make my goal very clear: I'd like to prevent other people from hitting this problem. I know what the problem is about now, but I'd have preferred for the build to fail at some stage rather than for the build to succeed and for me to run an ARMv7 binary on an ARMv5 (virtual) board. (It wasn't easy to spot that the problem came from libgcc.)
If there was a way to fail the build when ARMv5 is requested but only ARMv7 is available that'd be ideal.
(Indeed, Ubuntu prepackaged Linaro-based cross-toolchains don't offer multilib; that'd be hard in this context.)
+++ Loïc Minier [2011-11-10 17:44 +0100]:
On Thu, Nov 10, 2011, Chung-Lin Tang wrote:
I'd assume the Ubuntu-packaged toolchain probably doesn't have a ARMv5 multilib? You could either expand the toolchain configuration and rebuild, or more simply, use a CodeSourcery toolchain. Our default multilib is ARMv5TE.
Sorry, I didn't make my goal very clear: I'd like to prevent other people from hitting this problem. I know what the problem is about now, but I'd have preferred for the build to fail at some stage rather than for the build to succeed and for me to run an ARMv7 binary on an ARMv5 (virtual) board. (It wasn't easy to spot that the problem came from libgcc.)
Steve Magoun said at UDS that they (canonical OEM team I think?) had a tool to spot binaries built for the wrong ARMvX flavour. That might be useful in this case?
Wookey
On 11/10/2011 05:44 PM, Loïc Minier wrote:
(Indeed, Ubuntu prepackaged Linaro-based cross-toolchains don't offer multilib; that'd be hard in this context.)
they do, but not the ones you want. ;-P
the cross toolchain knows about arm soft float and arm hard float, but not about different processors.
On 10/11/11 10:04, Loïc Minier wrote:
Hey
When building u-boot for an ARMv5T platform (versatileqemu_config), the Ubuntu-packaged Linaro cross-toolchain isn't suitable because it only offers an ARMv7T2 libgcc. But I'd like the build to fail when that happens rather than silently generating an u-boot.bin which will trigger a SIGILL when it hits the first non-ARMv5T instruction.
I heard that gcc/ld are supposed to check this, but I'm not sure how it's supposed to work; perhaps the way u-boot does its final link prevents this from working properly?
I tried building u-boot as follows: make O=obj-broken \ CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm \ OPTFLAGS="-marm -march=armv5te" \ versatileqemu_config
make O=obj-broken \ CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm \ OPTFLAGS="-marm -march=armv5te" \ -j2
The final link looks like this: UNDEF_SYM=`arm-linux-gnueabi-objdump -x /home/lool/git/denx/u-boot/obj-v-broken/board/armltd/versatile/libversatile.o /home/lool/git/denx/u-boot/obj-v-broken/api/libapi.o /home/lool/git/denx/u-boot/obj-v-broken/arch/arm/cpu/arm926ejs/libarm926ejs.o /home/lool/git/denx/u-boot/obj-v-broken/arch/arm/cpu/arm926ejs/versatile/libversatile.o /home/lool/git/denx/u-boot/obj-v-broken/arch/arm/lib/libarm.o /home/lool/git/denx/u-boot/obj-v-broken/common/libcommon.o /home/lool/git/denx/u-boot/obj-v-broken/disk/libdisk.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/bios_emulator/libatibiosemu.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/block/libblock.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/dma/libdma.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/fpga/libfpga.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/gpio/libgpio.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/hwmon/libhwmon.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/i2c/libi2c.o /home/lool/git/denx
/u-boot/obj-v-broken/drivers/input/libinput.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/misc/libmisc.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/mmc/libmmc.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/mtd/libmtd.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/mtd/nand/libnand.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/mtd/onenand/libonenand.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/mtd/spi/libspi_flash.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/mtd/ubi/libubi.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/net/libnet.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/net/phy/libphy.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/pci/libpci.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/pcmcia/libpcmcia.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/power/libpower.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/rtc/librtc.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/serial/libserial.o /home/lool/git/denx/u-boot/obj-v-bro ken/drivers/spi/libspi.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/twserial/libtws.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/usb/eth/libusb_eth.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/usb/gadget/libusb_gadget.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/usb/host/libusb_host.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/usb/musb/libusb_musb.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/usb/phy/libusb_phy.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/video/libvideo.o /home/lool/git/denx/u-boot/obj-v-broken/drivers/watchdog/libwatchdog.o /home/lool/git/denx/u-boot/obj-v-broken/fs/cramfs/libcramfs.o /home/lool/git/denx/u-boot/obj-v-broken/fs/ext2/libext2fs.o /home/lool/git/denx/u-boot/obj-v-broken/fs/fat/libfat.o /home/lool/git/denx/u-boot/obj-v-broken/fs/fdos/libfdos.o /home/lool/git/denx/u-boot/obj-v-broken/fs/jffs2/libjffs2.o /home/lool/git/denx/u-boot/obj-v-broken/fs/reiserfs/libreiserfs.o /home/lool/git/denx/u-boot/obj-v-broken/fs/ubi fs/libubifs.o /home/lool/git/denx/u-boot/obj-v-broken/fs/yaffs2/libyaffs2.o /home/lool/git/denx/u-boot/obj-v-broken/lib/libfdt/libfdt.o /home/lool/git/denx/u-boot/obj-v-broken/lib/libgeneric.o /home/lool/git/denx/u-boot/obj-v-broken/lib/lzma/liblzma.o /home/lool/git/denx/u-boot/obj-v-broken/lib/lzo/liblzo.o /home/lool/git/denx/u-boot/obj-v-broken/lib/zlib/libz.o /home/lool/git/denx/u-boot/obj-v-broken/net/libnet.o /home/lool/git/denx/u-boot/obj-v-broken/post/libpost.o | sed -n -e 's/.*(__u_boot_cmd_.*)/-u\1/p'|sort|uniq`; cd /home/lool/git/denx/u-boot/obj-v-broken && arm-linux-gnueabi-ld -pie -T /home/lool/git/denx/u-boot/obj-v-broken/u-boot.lds -Bstatic -Ttext 0x10000 $UNDEF_SYM arch/arm/cpu/arm926ejs/start.o --start-group api/libapi.o arch/arm/cpu/arm926ejs/libarm926ejs.o arch/arm/cpu/arm926ejs/versatile/libversatile.o arch/arm/lib/libarm.o common/libcommon.o disk/libdisk.o drivers/bios_emulator/libatibiosemu.o drivers/block/libblock.o drivers/dma/libdma.o drivers/fpga/ libfpga.o drivers/gpio/libgpio.o drivers/hwmon/libhwmon.o drivers/i2c/libi2c.o drivers/input/libinput.o drivers/misc/libmisc.o drivers/mmc/libmmc.o drivers/mtd/libmtd.o drivers/mtd/nand/libnand.o drivers/mtd/onenand/libonenand.o drivers/mtd/spi/libspi_flash.o drivers/mtd/ubi/libubi.o drivers/net/libnet.o drivers/net/phy/libphy.o drivers/pci/libpci.o drivers/pcmcia/libpcmcia.o drivers/power/libpower.o drivers/rtc/librtc.o drivers/serial/libserial.o drivers/spi/libspi.o drivers/twserial/libtws.o drivers/usb/eth/libusb_eth.o drivers/usb/gadget/libusb_gadget.o drivers/usb/host/libusb_host.o drivers/usb/musb/libusb_musb.o drivers/usb/phy/libusb_phy.o drivers/video/libvideo.o drivers/watchdog/libwatchdog.o fs/cramfs/libcramfs.o fs/ext2/libext2fs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o fs/reiserfs/libreiserfs.o fs/ubifs/libubifs.o fs/yaffs2/libyaffs2.o lib/libfdt/libfdt.o lib/libgeneric.o lib/lzma/liblzma.o lib/lzo/liblzo.o lib/zlib/libz.o net/libnet.o post/libpost.o board/armltd/versatile/libversatile.o --end-group /home/lool/git/denx/u-boot/obj-v-broken/arch/arm/lib/eabi_compat.o -L /usr/lib/gcc/arm-linux-gnueabi/4.6.1 -lgcc -Map u-boot.map -o u-boot
I verified that all the .o files passed above have Tag_CPU_name: "5TE" in their arm-linux-gnueabi-readelf -A output; the only problematic file is -lgcc.
Note that the final link is done with arm-linux-gnueabi-ld and doesn't set any architecture; I changed it manually to use gcc and pass the -marm -march=armv5te, and had to set -nostdlib too when using gcc: arm-linux-gnueabi-gcc -marm -march=armv5te -nostdlib -pie -T /home/lool/git/denx/u-boot/obj-v-broken/u-boot.lds -Bstatic -Ttext 0x10000 $UNDEF_SYM arch/arm/cpu/arm926ejs/start.o -Wl,--start-group api/libapi.o arch/arm/cpu/arm926ejs/libarm926ejs.o arch/arm/cpu/arm926ejs/versatile/libversatile.o arch/arm/lib/libarm.o common/libcommon.o disk/libdisk.o drivers/bios_emulator/libatibiosemu.o drivers/block/libblock.o drivers/dma/libdma.o drivers/fpga/libfpga.o drivers/gpio/libgpio.o drivers/hwmon/libhwmon.o drivers/i2c/libi2c.o drivers/input/libinput.o drivers/misc/libmisc.o drivers/mmc/libmmc.o drivers/mtd/libmtd.o drivers/mtd/nand/libnand.o drivers/mtd/onenand/libonenand.o drivers/mtd/spi/libspi_flash.o drivers/mtd/ubi/libubi.o drivers/net/libnet.o drivers/net/phy/libphy.o drivers/pci/libpci.o drivers/pcmcia/libpcmcia.o drivers/power/libpower.o drivers/rtc/librtc.o drivers/serial/libserial.o drivers/spi/libspi.o drivers/twserial/libtws.o drivers/usb/eth/libusb_eth.o drivers/usb/
gadget/libusb_gadget.o drivers/usb/host/libusb_host.o drivers/usb/musb/libusb_musb.o drivers/usb/phy/libusb_phy.o drivers/video/libvideo.o drivers/watchdog/libwatchdog.o fs/cramfs/libcramfs.o fs/ext2/libext2fs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o fs/reiserfs/libreiserfs.o fs/ubifs/libubifs.o fs/yaffs2/libyaffs2.o lib/libfdt/libfdt.o lib/libgeneric.o lib/lzma/liblzma.o lib/lzo/liblzo.o lib/zlib/libz.o net/libnet.o post/libpost.o board/armltd/versatile/libversatile.o -Wl,--end-group /home/lool/git/denx/u-boot/obj-v-broken/arch/arm/lib/eabi_compat.o -L /usr/lib/gcc/arm-linux-gnueabi/4.6.1 -lgcc -Wl,-Map u-boot.map -o u-boot
But this command works and produces an u-boot ELF which has Tag_CPU_name: "7-A".
The build attributes were never intended to be used in executables; the format is too expensive to decode in most situations. Instead the ABI specification included an optional PHEADER that had a highly simplified indication of the executable compatibility of an image (essentially the architecture). Unfortunately this has never been added to GNU Binutils.
See PT_ARM_ARCHEXT in the ARM ELF specification (available from infocenter).
R.
How would I break the build when libgcc isn't ARMv5T?
Thanks,
-- Richard Earnshaw Email: Richard.Earnshaw@arm.com Engineering Manager Phone: +44 1223 400569 (Direct + VoiceMail) OpenSource Tools Switchboard: +44 1223 400400 ARM Ltd Fax: +44 1223 400410 110 Fulbourn Rd Web: http://www.arm.com/ Cambridge, UK. CB1 9NJ
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
On Thu, Nov 10, 2011, Richard Earnshaw wrote:
The build attributes were never intended to be used in executables; the format is too expensive to decode in most situations. Instead the ABI specification included an optional PHEADER that had a highly simplified indication of the executable compatibility of an image (essentially the architecture). Unfortunately this has never been added to GNU Binutils.
See PT_ARM_ARCHEXT in the ARM ELF specification (available from infocenter).
As a poor man's test, would it be reliable to test Tag_CPU_name on the resulting u-boot ELF binary at the end of the build? If I read you correctly, you seem to suggest that it would be too fragile?
You can't rely on finding it. Executable images are only required to have segment headers an d the attributes system uses section headers. Section headers can be removed when an image gets stripped.
On 10 Nov 2011, at 16:46, "Loïc Minier" <loic.minier@linaro.orgmailto:loic.minier@linaro.org> wrote:
On Thu, Nov 10, 2011, Richard Earnshaw wrote: The build attributes were never intended to be used in executables; the format is too expensive to decode in most situations. Instead the ABI specification included an optional PHEADER that had a highly simplified indication of the executable compatibility of an image (essentially the architecture). Unfortunately this has never been added to GNU Binutils.
See PT_ARM_ARCHEXT in the ARM ELF specification (available from infocenter).
As a poor man's test, would it be reliable to test Tag_CPU_name on the resulting u-boot ELF binary at the end of the build? If I read you correctly, you seem to suggest that it would be too fragile?
-- Loïc Minier
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
On Thu, Nov 10, 2011, Richard Earnshaw wrote:
You can't rely on finding it. Executable images are only required to have segment headers an d the attributes system uses section headers. Section headers can be removed when an image gets stripped.
but if I have it during the u-boot build, it's reliable?
If not, can I check the architecture for which libgcc was built programatically?
On 10 Nov 2011, at 23:47, "Loïc Minier" loic.minier@linaro.org wrote:
On Thu, Nov 10, 2011, Richard Earnshaw wrote:
You can't rely on finding it. Executable images are only required to have segment headers an d the attributes system uses section headers. Section headers can be removed when an image gets stripped.
but if I have it during the u-boot build, it's reliable?
I've no idea how uboot works in detail. I'm describing the global rules for elf images.
If not, can I check the architecture for which libgcc was built programatically?
If it's a static library, the you could extract one of the object files and look at its attributes. If it's a shared lib, then the same restrictions would apply as to an executable.
R.
-- Loïc Minier
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
linaro-toolchain@lists.linaro.org