Skip to content

Commit

Permalink
Correct makefile.rules to use toolchain specific AR and OBJCOPY
Browse files Browse the repository at this point in the history
Differential revision: https://reviews.llvm.org/D20386

llvm-svn: 277429
  • Loading branch information
omjavaid committed Aug 2, 2016
1 parent dfa7683 commit 9845320
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions lldb/packages/Python/lldbsuite/test/make/Makefile.rules
Expand Up @@ -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
#----------------------------------------------------------------------
Expand All @@ -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
#----------------------------------------------------------------------
Expand Down

0 comments on commit 9845320

Please sign in to comment.