]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
build: fix building u-boot.lds with Clang as a cross-compiler
authorDmitrii Sharshakov <d3dx12.xx@gmail.com>
Sat, 1 Nov 2025 09:39:59 +0000 (10:39 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 6 Nov 2025 17:21:24 +0000 (11:21 -0600)
Make sure to pass Clang flags to the KBUILD_CPPFLAGS as well, as this
variable is used for flags during compiling for target

Skipping this leads to Clang being invoked with args for target, but
without target indication, thus defaulting to host arch:

  LDS     u-boot.lds
clang: error: ... '-mabi=' for target 'x86_64-suse-linux'
clang: error: ... '-mno-thumb' for target 'x86_64-suse-linux'
clang: error: ... '-mno-unaligned-access' for target 'x86_64-suse-linux'
clang: error: ... '-ffixed-r9' for target 'x86_64-suse-linux'
clang: error: ... '-mno-movt' for target 'x86_64-suse-linux'
make: *** [Makefile:2345: u-boot.lds] Fehler 1

Signed-off-by: Dmitrii Sharshakov <d3dx12.xx@gmail.com>
Makefile

index 750f8a84b1fcdfad7ce06fe323422f7cf6867160..c10bf71b9acaef97ff0ad7fa0c7f6b4e7c113f1f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -608,6 +608,7 @@ CLANG_FLAGS += --gcc-toolchain=$(GCC_TOOLCHAIN)
 endif
 CLANG_FLAGS    += -no-integrated-as
 KBUILD_CFLAGS  += $(CLANG_FLAGS)
+KBUILD_CPPFLAGS        += $(CLANG_FLAGS)
 KBUILD_AFLAGS  += $(CLANG_FLAGS)
 export CLANG_FLAGS
 endif