From: Omair Javaid Date: Tue, 2 Aug 2016 07:56:11 +0000 (+0000) Subject: Correct makefile.rules to use toolchain specific AR and OBJCOPY X-Git-Tag: llvmorg-4.0.0-rc1~13595 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9845320280fe3b2b2b64eb8832eb9dfbd4958555;p=platform%2Fupstream%2Fllvm.git Correct makefile.rules to use toolchain specific AR and OBJCOPY Differential revision: https://reviews.llvm.org/D20386 llvm-svn: 277429 --- diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index c37ef74..fb7bb9e 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -265,8 +265,6 @@ 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 - #---------------------------------------------------------------------- # Windows specific options #---------------------------------------------------------------------- @@ -287,24 +285,25 @@ 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) + +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) + #---------------------------------------------------------------------- # C++ standard library options #----------------------------------------------------------------------