summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/test/make/Makefile.rules20
1 files changed, 12 insertions, 8 deletions
diff --git a/lldb/test/make/Makefile.rules b/lldb/test/make/Makefile.rules
index 984adcd479e..fcb67adffea 100644
--- a/lldb/test/make/Makefile.rules
+++ b/lldb/test/make/Makefile.rules
@@ -216,15 +216,19 @@ endif
# Android specific options
#----------------------------------------------------------------------
ifeq "$(OS)" "Android"
- objcopy_notdir = $(if $(findstring clang,$(1)), \
- $(subst clang,objcopy,$(1)), \
- $(if $(findstring gcc,$(1)), \
- $(subst gcc,objcopy,$(1)), \
- $(subst cc,objcopy,$(1))))))
- objcopy = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call objcopy_notdir,$(notdir $(1)))),$(call objcopy_notdir,$(1)))
-
LDFLAGS += -pie
- OBJCOPY = $(call objcopy $(CC))
+ replace_with = $(if $(findstring clang,$(1)), \
+ $(subst clang,$(2),$(1)), \
+ $(if $(findstring gcc,$(1)), \
+ $(subst gcc,$(2),$(1)), \
+ $(subst cc,$(2),$(1))))
+ ifeq "$(notdir $(CC))" "$(CC)"
+ replace_cc_with = $(call replace_with,$(CC),$(1))
+ else
+ replace_cc_with = $(join $(dir $(CC)),$(call replace_with,$(notdir $(CC)),$(1)))
+ endif
+ OBJCOPY = $(call replace_cc_with,objcopy)
+ AR = $(call replace_cc_with,ar)
endif
#----------------------------------------------------------------------
OpenPOWER on IntegriCloud