arm64: add endianness option to LDFLAGS instead of LD
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 3 Jul 2018 01:22:00 +0000 (10:22 +0900)
committerBruno Martins <bgcngm@gmail.com>
Sun, 22 Oct 2023 14:12:33 +0000 (15:12 +0100)
With the recent syntax extension, Kconfig is now able to evaluate the
compiler / toolchain capability.

However, accumulating flags to 'LD' is not compatible with the way
it works; 'LD' must be passed to Kconfig to call $(ld-option,...)
from Kconfig files.  If you tweak 'LD' in arch Makefile depending on
CONFIG_CPU_BIG_ENDIAN, this would end up with circular dependency
between Makefile and Kconfig.

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Change-Id: I8a7654684975d45e979917e3b1c4b6249dec02ec

arch/arm64/Makefile

index 6df6a76dbce95b6b8579c91d8a2ae98884397699..a9369fe1688eb12672db1f7e425ad3f16cca28ab 100644 (file)
@@ -100,12 +100,12 @@ KBUILD_AFLAGS     += $(lseinstr) $(vdso32)
 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
 KBUILD_CPPFLAGS        += -mbig-endian
 AS             += -EB
-LD             += -EB
+LDFLAGS                += -EB -maarch64elfb
 UTS_MACHINE    := aarch64_be
 else
 KBUILD_CPPFLAGS        += -mlittle-endian
 AS             += -EL
-LD             += -EL
+LDFLAGS                += -EL -maarch64elf
 UTS_MACHINE    := aarch64
 endif