diff options
author | Omair Javaid <omair.javaid@linaro.org> | 2016-08-17 16:45:34 +0000 |
---|---|---|
committer | Omair Javaid <omair.javaid@linaro.org> | 2016-08-17 16:45:34 +0000 |
commit | a6583c5d893b51975fcdf188ba5152e23aa563a2 (patch) | |
tree | 4cb5cb8dc8fa2e0cfb1a7bccfafcc5ff38a6a96d /lldb/packages/Python/lldbsuite/test | |
parent | 721c7cba84f4f7f129a7b0c9f9df5b43b792a0b7 (diff) | |
download | bcm5719-llvm-a6583c5d893b51975fcdf188ba5152e23aa563a2.tar.gz bcm5719-llvm-a6583c5d893b51975fcdf188ba5152e23aa563a2.zip |
Correct makefile.rules to use arm/aarch64 target specific AR and OBJCOPY
Differential revision: https://reviews.llvm.org/D20386
llvm-svn: 278947
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/make/Makefile.rules | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index c37ef745e8b..3726826d4fd 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -265,7 +265,33 @@ 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 := $(CROSS_COMPILE)objcopy +ifneq "$(OS)" "Darwin" + CLANG_OR_GCC := $(strip $(if $(findstring clang,$(CC)), \ + $(findstring clang,$(CC)), \ + $(if $(findstring gcc,$(CC)), \ + $(findstring gcc,$(CC)), \ + cc))) + + CC_LASTWORD := $(strip $(lastword $(subst -, ,$(CC)))) + + replace_with = $(strip $(if $(findstring $(3),$(CC_LASTWORD)), \ + $(subst $(3),$(1),$(2)), \ + $(subst $(3),$(1),$(subst -$(CC_LASTWORD),,$(2))))) + + ifeq "$(notdir $(CC))" "$(CC)" + replace_cc_with = $(call replace_with,$(1),$(CC),$(CLANG_OR_GCC)) + else + replace_cc_with = $(join $(dir $(CC)),$(call replace_with,$(1),$(notdir $(CC)),$(CLANG_OR_GCC))) + endif + + OBJCOPY ?= $(call replace_cc_with,objcopy) + ARCHIVER ?= $(call replace_cc_with,ar) + override AR = $(ARCHIVER) +endif + +ifdef PIE + LDFLAGS += -pie +endif #---------------------------------------------------------------------- # Windows specific options @@ -285,27 +311,6 @@ ifeq "$(OS)" "Windows_NT" endif #---------------------------------------------------------------------- -# Android specific options -#---------------------------------------------------------------------- -ifeq "$(OS)" "Android" - ifdef PIE - LDFLAGS += -pie - endif - 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 - -#---------------------------------------------------------------------- # C++ standard library options #---------------------------------------------------------------------- ifeq (1,$(USE_LIBSTDCPP)) |