summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-04-05 19:48:52 -0400
committerTom Rini <trini@konsulko.com>2023-04-25 15:31:27 -0400
commitfd0712acce928c7966c172b8014ca8007deb457c (patch)
tree11d89c1a3d5b18406167d63427624035f1a971e7 /Makefile
parentc2e5eea38a25c3b787bb243f7d9638cd6e634cd4 (diff)
downloadu-boot-fd0712acce928c7966c172b8014ca8007deb457c.tar.gz
clang: Add $(CLANG_TARGET) to LDPPFLAGS
When we invoke $(CPP) to make u-boot.lds we have LDPPFLAGS available to set other required flags here. As this file is for the target and not the host, we must ensure that CPP knows what the target architecture is. For this, pass in $(CLANG_TARGET). Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index eaaf7d267d..9d8ec9f865 100644
--- a/Makefile
+++ b/Makefile
@@ -437,6 +437,7 @@ KBUILD_LDFLAGS :=
ifeq ($(cc-name),clang)
ifneq ($(CROSS_COMPILE),)
CLANG_TARGET := --target=$(notdir $(CROSS_COMPILE:%-=%))
+LDPPFLAGS += $(CLANG_TARGET)
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
CLANG_PREFIX := --prefix=$(GCC_TOOLCHAIN_DIR)
GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)