[Lldb-commits] [PATCH] Use objcopy provided next to the compiler on android

Tamas Berghammer tberghammer at google.com
Thu Apr 2 04:12:16 PDT 2015


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8765

Files:
  lldb/trunk/test/make/Makefile.rules

Index: lldb/trunk/test/make/Makefile.rules
===================================================================
--- lldb/trunk/test/make/Makefile.rules
+++ lldb/trunk/test/make/Makefile.rules
@@ -184,6 +184,8 @@
                                         $(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 @@
 # 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 @@
 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 @@
 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

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8765.23141.patch
Type: text/x-patch
Size: 2206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150402/8c3d8192/attachment.bin>


More information about the lldb-commits mailing list