Use objcopy provided next to the compiler on android

Differential revision: http://reviews.llvm.org/D8765

llvm-svn: 233908
This commit is contained in:
Tamas Berghammer 2015-04-02 11:09:28 +00:00
parent 2e16902084
commit dcc8e595cb
1 changed files with 15 additions and 5 deletions

View File

@ -184,6 +184,8 @@ cxx_linker_notdir = $(if $(findstring clang,$(1)), \
$(subst cc,c++,$(1))))))
cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1)))),$(call cxx_linker_notdir,$(1)))
OBJCOPY = objcopy
#----------------------------------------------------------------------
# Windows specific options
#----------------------------------------------------------------------
@ -202,7 +204,15 @@ endif
# Android specific options
#----------------------------------------------------------------------
ifeq "$(OS)" "Android"
LDFLAGS += -pie
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))
endif
#----------------------------------------------------------------------
@ -342,8 +352,8 @@ ifneq "$(MAKE_DSYM)" "NO"
endif
else
ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES"
objcopy --only-keep-debug "$(EXE)" "$(DSYM)"
objcopy --strip-debug --add-gnu-debuglink="$(DSYM)" "$(EXE)" "$(EXE)"
$(OBJCOPY) --only-keep-debug "$(EXE)" "$(DSYM)"
$(OBJCOPY) --strip-debug --add-gnu-debuglink="$(DSYM)" "$(EXE)" "$(EXE)"
endif
endif
endif
@ -392,8 +402,8 @@ endif
else
$(LD) $(LDFLAGS) $(DYLIB_OBJECTS) -shared -o "$(DYLIB_FILENAME)"
ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES"
objcopy --only-keep-debug "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME).debug"
objcopy --strip-debug --add-gnu-debuglink="$(DYLIB_FILENAME).debug" "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME)"
$(OBJCOPY) --only-keep-debug "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME).debug"
$(OBJCOPY) --strip-debug --add-gnu-debuglink="$(DYLIB_FILENAME).debug" "$(DYLIB_FILENAME)" "$(DYLIB_FILENAME)"
endif
endif