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


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
 #----------------------------------------------------------------------
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to