]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
Fix clang build if CC is not in the path.
authorArve Hjønnevåg <arve@android.com>
Tue, 4 Feb 2020 23:50:24 +0000 (15:50 -0800)
committerArve Hjønnevåg <arve@android.com>
Wed, 12 Feb 2020 19:06:29 +0000 (19:06 +0000)
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>
Makefile

index 7e416784b0b302cd3fb3bb27c883f28964ddd4f7..547b5843f2ab8d66f7ea4acc3d47bae8d905371a 100644 (file)
--- 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