[Lldb-commits] [PATCH] D20386: Correct makefile.rules to use arm/aarch64 target specific AR and OBJCOPY

Muhammad Omair Javaid via lldb-commits lldb-commits at lists.llvm.org
Wed May 18 14:23:42 PDT 2016


omjavaid created this revision.
omjavaid added reviewers: labath, tberghammer.
omjavaid added a subscriber: lldb-commits.
Herald added subscribers: danalbert, tberghammer, rengolin, aemerson.

This patch makes sure that we are using correct target specific ar and objcopy executables.

I have added logic to extract ar and objcopy from CC compiler name in case of arm and aarch64 targets.

In case of android this is overidden by android specific logic implemented in makefile.rules.

http://reviews.llvm.org/D20386

Files:
  packages/Python/lldbsuite/test/make/Makefile.rules

Index: packages/Python/lldbsuite/test/make/Makefile.rules
===================================================================
--- packages/Python/lldbsuite/test/make/Makefile.rules
+++ packages/Python/lldbsuite/test/make/Makefile.rules
@@ -131,6 +131,7 @@
 	ARFLAGS := -static -o
 else
 	AR := $(CROSS_COMPILE)ar
+	OBJCOPY := $(CROSS_COMPILE)objcopy
 	# On non-Apple platforms, -arch becomes -m
 	ARCHFLAG := -m
 
@@ -161,10 +162,26 @@
 		override ARCH := $(subst powerpc64,64,$(ARCH))
 	endif
 	ifeq "$(ARCH)" "aarch64"
+		OBJCOPY := $(if $(findstring gcc,$(CC)), \
+			$(subst gcc,objcopy,$(CC)), \
+			$(if $(findstring clang,$(CC)), \
+				$(subst clang,objcopy,$(CC))))
+		AR := $(if $(findstring gcc,$(CC)), \
+			$(subst gcc,ar,$(CC)), \
+			$(if $(findstring clang,$(CC)), \
+				$(subst clang,ar,$(CC))))
 		override ARCH :=
 		override ARCHFLAG :=
 	endif
 	ifeq "$(ARCH)" "arm"
+		OBJCOPY := $(if $(findstring gcc,$(CC)), \
+			$(subst gcc,objcopy,$(CC)), \
+			$(if $(findstring clang,$(CC)), \
+				$(subst clang,objcopy,$(CC))))
+		AR := $(if $(findstring gcc,$(CC)), \
+			$(subst gcc,ar,$(CC)), \
+			$(if $(findstring clang,$(CC)), \
+				$(subst clang,ar,$(CC))))
 		override ARCH :=
 		override ARCHFLAG :=
 	endif
@@ -260,8 +277,6 @@
                                         $(subst cc,c++,$(1))))))
 cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1)))),$(call cxx_linker_notdir,$(1)))
 
-OBJCOPY := $(CROSS_COMPILE)objcopy
-
 #----------------------------------------------------------------------
 # Windows specific options
 #----------------------------------------------------------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20386.57679.patch
Type: text/x-patch
Size: 1668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160518/07665e15/attachment.bin>


More information about the lldb-commits mailing list