]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
Makefile: add endian link flag to u-boot-elf.o
authorDu Huanpeng <dhu@hodcarrier.org>
Wed, 30 Mar 2022 18:41:42 +0000 (02:41 +0800)
committerTom Rini <trini@konsulko.com>
Wed, 6 Apr 2022 13:21:49 +0000 (09:21 -0400)
fix compile error when using a little-endian to build with configs:
sfr_nb4-ser_ram_defconfig
comtrend_wap5813n_ram_defconfig
comtrend_ar5387un_ram_defconfig
comtrend_ct5361_ram_defconfig
comtrend_vr3032u_ram_defconfig
comtrend_ar5315u_ram_defconfig
huawei_hg556a_ram_defconfig
netgear_dgnd3700v2_ram_defconfig

Signed-off-by: Du Huanpeng <dhu@hodcarrier.org>
Makefile

index 81349a76948e2bcd91973cd2c1b12230558ed3a6..4b347d3603ae5460ef12eb5a5e9609890e43ef8f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1708,6 +1708,7 @@ u-boot-img-spl-at-end.bin: u-boot.img spl/u-boot-spl.bin FORCE
 
 quiet_cmd_u-boot-elf ?= LD      $@
        cmd_u-boot-elf ?= $(LD) u-boot-elf.o -o $@ \
+       $(if $(CONFIG_SYS_BIG_ENDIAN),-EB,-EL) \
        -T u-boot-elf.lds --defsym=$(CONFIG_PLATFORM_ELFENTRY)=$(CONFIG_SYS_TEXT_BASE) \
        -Ttext=$(CONFIG_SYS_TEXT_BASE)
 u-boot.elf: u-boot.bin u-boot-elf.lds