Fix OBJCOPY and AR for Android.

Summary:
Previously, OBJCOPY was empty because of the missing comma,
and ar was just `ar`.

Reviewers: ovyalov, tberghammer

Subscribers: tberghammer, lldb-commits

Differential Revision: http://reviews.llvm.org/D10175

llvm-svn: 238849
This commit is contained in:
Chaoren Lin 2015-06-02 16:43:19 +00:00
parent 31a4731370
commit 7d76a13bf3
1 changed files with 12 additions and 8 deletions

View File

@ -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
#----------------------------------------------------------------------