[U-Boot] Compiling U-Boot

Hello! I would like to compile U-Boot with custom configuration. I downloaded source from the master git repository (http://git.denx.de/?p=u-boot.git;a=summary). I am trying to compile using following commands: $ cd u-boot/ $ make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnu- at91sam9g20ek_nandflash_config $ make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnu- all
It goes on for a while, and then I get the error: crt0.S: Assembler messages: crt0.S:70: Error: register expected, not '#(184)' -- `sub sp,#(184)' make[1]: *** [crt0.o] Error 1 make[1]: Leaving directory `/root/u-boot/arch/arm/lib' make: *** [arch/arm/lib/built-in.o] Error 2
The "arm-unknown-linux-gnu-" is a toolchain prefix for my devboard. I am trying to compile on 64bit Ubuntu computer. I have also tried 32bit debian lenny virtual machine. Can I correct this error or is there something I am doing wrong?
Best regards, Alexey Smishlayev

Dear Alexey Smishlayev,
On 11/27/2013 01:26 PM, Alexey Smishlayev wrote:
Hello! I would like to compile U-Boot with custom configuration. I downloaded source from the master git repository (http://git.denx.de/?p=u-boot.git;a=summary). I am trying to compile using following commands: $ cd u-boot/ $ make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnu- at91sam9g20ek_nandflash_config $ make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnu- all
seems good to me.
It goes on for a while, and then I get the error: crt0.S: Assembler messages: crt0.S:70: Error: register expected, not '#(184)' -- `sub sp,#(184)'
make[1]: *** [crt0.o] Error 1 make[1]: Leaving directory `/root/u-boot/arch/arm/lib' make: *** [arch/arm/lib/built-in.o] Error 2
crt0.S:70 subtracts the GD_SIZE from current stack pointer. The code written seems to miss the Rn according to [1]. Could you please test to change it from to: 'sub sp, sp, #GD_SIZE'?
I wonder why my toolchain ignore this. It obviously take Rd == Rn when Rn is missing.
Best regards
Andreas Bießmann
[1] http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001m/QRC0001_UAL.pdf

Dear Andreas Bießmann,
On 2013.11.27. 15:39, Andreas Bießmann wrote:
crt0.S:70 subtracts the GD_SIZE from current stack pointer. The code written seems to miss the Rn according to [1]. Could you please test to change it from to: 'sub sp, sp, #GD_SIZE'?
Yes, thank you! Now it successfully compiles crt0.S. Although, I get another error later on the compilation:
cd /home/alexey/xtech2/u-boot-2013.10 && /usr/local/arm/gcc-4.2.3-glibc-2.3.3/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-ld -pie -T u-boot.lds --gc-sections -Bstatic -Ttext 0x21f00000 arch/arm/cpu/arm926ejs/start.o --start-group api/libapi.o arch/arm/cpu/arm926ejs/at91/libat91.o arch/arm/cpu/arm926ejs/libarm926ejs.o arch/arm/lib/libarm.o common/libcommon.o disk/libdisk.o drivers/bios_emulator/libatibiosemu.o drivers/block/libblock.o drivers/crypto/libcrypto.o drivers/dfu/libdfu.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/battery/libbattery.o drivers/power/fuel_gauge/libfuel_gauge.o drivers/power/libpower.o drivers/power/mfd/libmfd.o drivers/power/pmic/libpmic.o drivers/rtc/librtc.o drivers/serial/libserial.o drivers/sound/libsound.o drivers/spi/libspi.o drivers/tpm/libtpm.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-new/libusb_musb-new.o drivers/usb/musb/libusb_musb.o drivers/usb/phy/libusb_phy.o drivers/usb/ulpi/libusb_ulpi.o drivers/video/libvideo.o drivers/watchdog/libwatchdog.o fs/cbfs/libcbfs.o fs/cramfs/libcramfs.o fs/ext4/libext4fs.o fs/fat/libfat.o fs/fdos/libfdos.o fs/jffs2/libjffs2.o fs/libfs.o fs/reiserfs/libreiserfs.o fs/sandbox/libsandboxfs.o fs/ubifs/libubifs.o fs/yaffs2/libyaffs2.o fs/zfs/libzfs.o lib/libfdt/libfdt.o lib/libgeneric.o lib/lzma/liblzma.o lib/lzo/liblzo.o lib/rsa/librsa.o lib/zlib/libz.o net/libnet.o post/libpost.o test/libtest.o board/atmel/at91sam9260ek/libat91sam9260ek.o --end-group /home/alexey/xtech2/u-boot-2013.10/arch/arm/lib/eabi_compat.o -L /usr/local/arm/gcc-4.2.3-glibc-2.3.3/arm-unknown-linux-gnu/lib/gcc/arm-unknown-linux-gnu/4.2.3 -lgcc -Map u-boot.map -o u-boot /usr/local/arm/gcc-4.2.3-glibc-2.3.3/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-ld: -static and -shared may not be used together make: *** [u-boot] Error 1
Any clues on how to correct this one?
Best regards Alexey Smishlayev

Dear Alexey Smishlayev,
On 11/27/2013 02:53 PM, Alexey Smishlayev wrote:
On 2013.11.27. 15:39, Andreas Bießmann wrote:
crt0.S:70 subtracts the GD_SIZE from current stack pointer. The code written seems to miss the Rn according to [1]. Could you please test to change it from to: 'sub sp, sp, #GD_SIZE'?
Yes, thank you! Now it successfully compiles crt0.S. Although, I get another error later on the compilation:
<snip>
/usr/local/arm/gcc-4.2.3-glibc-2.3.3/arm-unknown-linux-gnu/lib/gcc/arm-unknown-linux-gnu/4.2.3 -lgcc -Map u-boot.map -o u-boot /usr/local/arm/gcc-4.2.3-glibc-2.3.3/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-ld: -static and -shared may not be used together make: *** [u-boot] Error 1
Any clues on how to correct this one?
this is a known issue of outdated toolchain, please update to a newer one. That would also fix your other problem then.
Best regards
Andreas Bießmann
participants (2)
-
Alexey Smishlayev
-
Andreas Bießmann