summaryrefslogtreecommitdiffstats
path: root/lldb/packages
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-10-20 18:01:19 +0000
committerChris Bieneman <beanz@apple.com>2016-10-20 18:01:19 +0000
commit53a7844383faecb8c3e0e7133bdfa8fdc0425f93 (patch)
tree168fecda34ee146b5074974ff9dcc8ba3a9e4b3f /lldb/packages
parent365be4f95ccf9ab1cf217609678159acbe6b01a5 (diff)
downloadbcm5719-llvm-53a7844383faecb8c3e0e7133bdfa8fdc0425f93.tar.gz
bcm5719-llvm-53a7844383faecb8c3e0e7133bdfa8fdc0425f93.zip
Re-landing a cleaned up implementation of r284550
This time it should actually work. The previous implementaiton was not getting the linker or compiler flag set correctly in all the right situations. By moving the check down and basing it of whether or not CXX is set I we can have the logic to add the flags exist only once for the linker and once for the compiler instead of duplicating it. llvm-svn: 284756
Diffstat (limited to 'lldb/packages')
-rw-r--r--lldb/packages/Python/lldbsuite/test/make/Makefile.rules42
1 files changed, 24 insertions, 18 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index 910dc6737c7..5abbc85e649 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -242,27 +242,23 @@ ifneq "$(DYLIB_NAME)" ""
endif
# Function that returns the counterpart C++ compiler, given $(CC) as arg.
-cxx_compiler_notdir = $(if $(findstring clang,$(1)), \
- $(subst clang,clang++,$(1)), \
- $(if $(findstring icc,$(1)), \
- $(subst icc,icpc,$(1)), \
- $(if $(findstring llvm-gcc,$(1)), \
- $(subst llvm-gcc,llvm-g++,$(1)), \
- $(if $(findstring gcc,$(1)), \
- $(subst gcc,g++,$(1)), \
- $(subst cc,c++,$(1))))))
+cxx_compiler_notdir = $(if $(findstring icc,$(1)), \
+ $(subst icc,icpc,$(1)), \
+ $(if $(findstring llvm-gcc,$(1)), \
+ $(subst llvm-gcc,llvm-g++,$(1)), \
+ $(if $(findstring gcc,$(1)), \
+ $(subst gcc,g++,$(1)), \
+ $(subst cc,c++,$(1)))))
cxx_compiler = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_compiler_notdir,$(notdir $(1)))),$(call cxx_compiler_notdir,$(1)))
# Function that returns the C++ linker, given $(CC) as arg.
-cxx_linker_notdir = $(if $(findstring clang,$(1)), \
- $(subst clang,clang++,$(1)), \
- $(if $(findstring icc,$(1)), \
- $(subst icc,icpc,$(1)), \
- $(if $(findstring llvm-gcc,$(1)), \
- $(subst llvm-gcc,llvm-g++,$(1)), \
- $(if $(findstring gcc,$(1)), \
- $(subst gcc,g++,$(1)), \
- $(subst cc,c++,$(1))))))
+cxx_linker_notdir = $(if $(findstring icc,$(1)), \
+ $(subst icc,icpc,$(1)), \
+ $(if $(findstring llvm-gcc,$(1)), \
+ $(subst llvm-gcc,llvm-g++,$(1)), \
+ $(if $(findstring gcc,$(1)), \
+ $(subst gcc,g++,$(1)), \
+ $(subst cc,c++,$(1)))))
cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1)))),$(call cxx_linker_notdir,$(1)))
ifneq "$(OS)" "Darwin"
@@ -450,6 +446,16 @@ ifneq "$(filter g++,$(CXX))" ""
endif
endif
+ifeq ($(findstring clang, $(CXX)), clang)
+ CXXFLAGS += --driver-mode=g++
+endif
+
+ifneq "$(CXX)" ""
+ ifeq ($(findstring clang, $(LD)), clang)
+ LDFLAGS += --driver-mode=g++
+ endif
+endif
+
#----------------------------------------------------------------------
# DYLIB_ONLY variable can be used to skip the building of a.out.
# See the sections below regarding dSYM file as well as the building of
OpenPOWER on IntegriCloud