aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2020-02-04 15:50:24 -0800
committerArve Hjønnevåg <arve@android.com>2020-02-12 19:06:29 +0000
commiteff737c1d973b859a2973fc5a4692620c9d90a06 (patch)
tree2d74e2a5bab31e0bee5e86e10a2083969d5dd95a
parent51d72d3adbc4a2f97f3dd9f2e80bd7f64596c06e (diff)
downloadtrusted-firmware-a-eff737c1d973b859a2973fc5a4692620c9d90a06.tar.gz
Fix clang build if CC is not in the path.
If CC points to clang the linker was set to ld.lld. Copy the diectory name from CC is it has one. Change-Id: I50aef5dddee4d2540b12b6d4e68068ad004446f7 Signed-off-by: Arve Hjønnevåg <arve@android.com>
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7e416784b..547b5843f 100644
--- a/Makefile
+++ b/Makefile
@@ -207,9 +207,10 @@ AS = $(CC) -c -x assembler-with-cpp $(TF_CFLAGS_$(ARCH))
CPP = $(CC) -E $(TF_CFLAGS_$(ARCH))
PP = $(CC) -E $(TF_CFLAGS_$(ARCH))
else ifneq ($(findstring clang,$(notdir $(CC))),)
+CLANG_CCDIR = $(if $(filter-out ./,$(dir $(CC))),$(dir $(CC)),)
TF_CFLAGS_aarch32 = $(target32-directive) $(march32-directive)
TF_CFLAGS_aarch64 = -target aarch64-elf $(march64-directive)
-LD = ld.lld
+LD = $(CLANG_CCDIR)ld.lld
ifeq (, $(shell which $(LD)))
$(error "No $(LD) in PATH, make sure it is installed or set LD to a different linker")
endif