[Lldb-commits] [lldb] r182158 - Allow LLDB to be built on a system with an installed gcc/g++ that isn't the default. I recently installed gcc-4.7/g++-4.7 on Ubuntu and tried to build by specifying:

Kopec, Matt matt.kopec at intel.com
Fri May 17 14:44:35 PDT 2013


Looks like llvm/clang support this so it makes sense that lldb does. Alternatively, you can use 'update-alternatives' to manage different versions of gcc/g++ on your system.

More details here: http://stackoverflow.com/questions/7832892/how-to-change-the-default-gcc-compiler-in-ubuntu

Matt

On 2013-05-17, at 4:56 PM, Greg Clayton <gclayton at apple.com<mailto:gclayton at apple.com>> wrote:

Author: gclayton
Date: Fri May 17 15:56:55 2013
New Revision: 182158

URL: http://llvm.org/viewvc/llvm-project?rev=182158&view=rev
Log:
Allow LLDB to be built on a system with an installed gcc/g++ that isn't the default. I recently installed gcc-4.7/g++-4.7 on Ubuntu and tried to build by specifying:

CC=gcc-4.7 CXX=g++-4.7

as configure and make args, but it didn't work when being run with makefiles. This patch fixes that.


Modified:
   lldb/trunk/lib/Makefile
   lldb/trunk/source/Core/Makefile

Modified: lldb/trunk/lib/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lib/Makefile?rev=182158&r1=182157&r2=182158&view=diff
==============================================================================
--- lldb/trunk/lib/Makefile (original)
+++ lldb/trunk/lib/Makefile Fri May 17 15:56:55 2013
@@ -71,7 +71,7 @@ USEDLIBS = lldbAPI.a \
# Because GCC requires RTTI enabled for lldbCore (see source/Core/Makefile) it is
# necessary to also link the clang rewriter libraries so vtable references can
# be resolved correctly, if we are building with GCC.
-ifeq (g++,$(shell basename $(CXX)))
+ifeq (g++,$(shell basename $(CXX) | colrm 4))
  USEDLIBS += clangRewriteCore.a \
              clangRewriteFrontend.a
endif

Modified: lldb/trunk/source/Core/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Makefile?rev=182158&r1=182157&r2=182158&view=diff
==============================================================================
--- lldb/trunk/source/Core/Makefile (original)
+++ lldb/trunk/source/Core/Makefile Fri May 17 15:56:55 2013
@@ -17,7 +17,7 @@ include $(LLDB_LEVEL)/Makefile
# (cxa_demangle.cpp) uses dynamic_cast<> and GCC (at least 4.6 and 4.7)
# complain if we try to compile it with -fno-rtti.
$(info shell basename CXX is $(shell basename $(CXX)))
-ifeq (g++,$(shell basename $(CXX)))
+ifeq (g++,$(shell basename $(CXX) | colrm 4))
$(ObjDir)/cxa_demangle.o: Compile.CXX := $(filter-out -fno-rtti,$(Compile.CXX)) -frtti
endif



_______________________________________________
lldb-commits mailing list
lldb-commits at cs.uiuc.edu<mailto:lldb-commits at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits





More information about the lldb-commits mailing list