From: Tom Rini Date: Wed, 5 Apr 2023 23:48:52 +0000 (-0400) Subject: clang: Add $(CLANG_TARGET) to LDPPFLAGS X-Git-Tag: v2023.07-rc1~8^2~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fd0712acce928c7966c172b8014ca8007deb457c;p=thirdparty%2Fu-boot.git 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 Reviewed-by: Simon Glass --- diff --git a/Makefile b/Makefile index eaaf7d267d3..9d8ec9f8655 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)/..)