Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jul 2010 19:09:35 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r210388 - in head: lib/clang lib/clang/libllvmcore lib/clang/libllvmsupport lib/clang/libllvmsystem usr.bin/clang/tblgen
Message-ID:  <201007221909.o6MJ9ZSd036130@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Thu Jul 22 19:09:34 2010
New Revision: 210388
URL: http://svn.freebsd.org/changeset/base/210388

Log:
  Build clang libraries by default with -fno-exceptions and with
  -fno-rtti. The clang libaries that really use exceptions and virtual
  functions can enable LLVM_REQUIRES_EH and LLVM_REQUIRES_RTTI
  respectively. This saves space on the resulting binaries and follows
  what's being done upstream.
  
  Submitted by:	Dimitry Andric <dimitry at andric.com>

Modified:
  head/lib/clang/clang.build.mk
  head/lib/clang/libllvmcore/Makefile
  head/lib/clang/libllvmsupport/Makefile
  head/lib/clang/libllvmsystem/Makefile
  head/usr.bin/clang/tblgen/Makefile

Modified: head/lib/clang/clang.build.mk
==============================================================================
--- head/lib/clang/clang.build.mk	Thu Jul 22 18:57:47 2010	(r210387)
+++ head/lib/clang/clang.build.mk	Thu Jul 22 19:09:34 2010	(r210388)
@@ -17,6 +17,17 @@ TARGET_ARCH?=	${MACHINE_ARCH}
 # XXX: 8.0, to keep __FreeBSD_cc_version happy
 CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH}-undermydesk-freebsd9.0\"
 
+.ifndef LLVM_REQUIRES_EH
+CFLAGS+=-fno-exceptions
+.else
+# If the library or program requires EH, it also requires RTTI.
+LLVM_REQUIRES_RTTI=
+.endif
+
+.ifndef LLVM_REQUIRES_RTTI
+CFLAGS+=-fno-rtti
+.endif
+
 .PATH:	${LLVM_SRCS}/${SRCDIR}
 
 TBLGEN=tblgen ${CFLAGS:M-I*}

Modified: head/lib/clang/libllvmcore/Makefile
==============================================================================
--- head/lib/clang/libllvmcore/Makefile	Thu Jul 22 18:57:47 2010	(r210387)
+++ head/lib/clang/libllvmcore/Makefile	Thu Jul 22 19:09:34 2010	(r210388)
@@ -35,6 +35,7 @@ SRCS=	AsmWriter.cpp \
 	ValueSymbolTable.cpp \
 	ValueTypes.cpp \
 	Verifier.cpp
+LLVM_REQUIRES_RTTI=
 
 TGHDRS=	Intrinsics
 

Modified: head/lib/clang/libllvmsupport/Makefile
==============================================================================
--- head/lib/clang/libllvmsupport/Makefile	Thu Jul 22 18:57:47 2010	(r210387)
+++ head/lib/clang/libllvmsupport/Makefile	Thu Jul 22 19:09:34 2010	(r210388)
@@ -48,5 +48,6 @@ SRCS=	APFloat.cpp \
 	regexec.c \
 	regfree.c \
 	regstrlcpy.c
+LLVM_REQUIRES_RTTI=
 
 .include "../clang.lib.mk"

Modified: head/lib/clang/libllvmsystem/Makefile
==============================================================================
--- head/lib/clang/libllvmsystem/Makefile	Thu Jul 22 18:57:47 2010	(r210387)
+++ head/lib/clang/libllvmsystem/Makefile	Thu Jul 22 19:09:34 2010	(r210388)
@@ -22,5 +22,6 @@ SRCS=	Alarm.cpp \
 	Threading.cpp \
 	TimeValue.cpp \
 	Valgrind.cpp
+LLVM_REQUIRES_RTTI=
 
 .include "../clang.lib.mk"

Modified: head/usr.bin/clang/tblgen/Makefile
==============================================================================
--- head/usr.bin/clang/tblgen/Makefile	Thu Jul 22 18:57:47 2010	(r210387)
+++ head/usr.bin/clang/tblgen/Makefile	Thu Jul 22 19:09:34 2010	(r210388)
@@ -40,6 +40,7 @@ SRCS=	ARMDecoderEmitter.cpp \
 	X86DisassemblerTables.cpp \
 	X86RecognizableInstr.cpp
 MAN=
+LLVM_REQUIRES_EH=
 
 LIBDEPS=llvmsupport llvmsystem
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007221909.o6MJ9ZSd036130>