Index: lldb/trunk/test/make/Makefile.rules =================================================================== --- lldb/trunk/test/make/Makefile.rules +++ lldb/trunk/test/make/Makefile.rules @@ -216,15 +216,19 @@ # 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 #----------------------------------------------------------------------