From 1baa38147a62cb9e905c8229098be2e3a7627032 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 25 Jun 2013 01:12:25 +0000 Subject: Add an autoconf option for turning on -gsplit-dwarf by default when building llvm. This saves quite a bit of time and space when linking. Please report any problems via bugzilla. Caveats: a) This will only work on linux b) This requires a fairly new binutils c) This requires a fairly new gdb git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184808 91177308-0d34-0410-b5e6-96231b3b80d8 --- Makefile.config.in | 3 +++ Makefile.rules | 5 +++++ autoconf/configure.ac | 13 +++++++++++++ configure | 30 ++++++++++++++++++++++++++---- 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/Makefile.config.in b/Makefile.config.in index fd4f6ef5d8..dcca45f36c 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -235,6 +235,9 @@ ENABLE_LIBCPP = @ENABLE_LIBCPP@ # When ENABLE_CXX11 is enabled, LLVM uses c++11 mode by default to build. ENABLE_CXX11 = @ENABLE_CXX11@ +# When ENABLE_SPLIT_DWARF is enabled, LLVM uses -gfission to build in debug mode. +ENABLE_SPLIT_DWARF = @ENABLE_SPLIT_DWARF@ + # When ENABLE_CLANG_ARCMT is enabled, clang will have ARCMigrationTool. ENABLE_CLANG_ARCMT = @ENABLE_CLANG_ARCMT@ diff --git a/Makefile.rules b/Makefile.rules index 79ee0e8486..ade5f1a8f7 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -297,8 +297,13 @@ else KEEP_SYMBOLS := 1 else BuildMode := Debug + ifeq ($(ENABLE_SPLIT_DWARF), 1) + CXX.Flags += -gsplit-dwarf + C.Flags += -gsplit-dwarf + else CXX.Flags += -g C.Flags += -g + endif KEEP_SYMBOLS := 1 endif endif diff --git a/autoconf/configure.ac b/autoconf/configure.ac index ad1fd1c632..393bd6a85a 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -510,6 +510,19 @@ case "$enableval" in *) AC_MSG_ERROR([Invalid setting for --enable-cxx11. Use "yes" or "no"]) ;; esac +dnl --enable-fission : check whether or not to use -gsplit-dwarf on the command +dnl line +AC_ARG_ENABLE(split-dwarf, + AS_HELP_STRING([--enable-split-dwarf], + [Use split-dwarf if available (default is NO)]),, + enableval=default) +case "$enableval" in + yes) AC_SUBST(ENABLE_SPLIT_DWARF,[1]) ;; + no) AC_SUBST(ENABLE_SPLIT_DWARF,[0]) ;; + default) AC_SUBST(ENABLE_SPLIT_DWARF,[0]);; + *) AC_MSG_ERROR([Invalid setting for --enable-split-dwarf. Use "yes" or "no"]) ;; +esac + dnl --enable-clang-arcmt: check whether to enable clang arcmt clang_arcmt="yes" AC_ARG_ENABLE(clang-arcmt, diff --git a/configure b/configure index ef6d92fe3b..48ff01d38b 100755 --- a/configure +++ b/configure @@ -685,6 +685,7 @@ BUILD_CXX CVSBUILD ENABLE_LIBCPP ENABLE_CXX11 +ENABLE_SPLIT_DWARF ENABLE_CLANG_ARCMT ENABLE_CLANG_STATIC_ANALYZER ENABLE_CLANG_REWRITER @@ -1406,6 +1407,7 @@ Optional Features: --enable-polly Use polly if available (default is YES) --enable-libcpp Use libc++ if available (default is NO) --enable-cxx11 Use c++11 if available (default is NO) + --enable-split-dwarf Use split-dwarf if available (default is NO) --enable-clang-arcmt Enable building of clang ARCMT (default is YES) --enable-clang-static-analyzer Enable building of clang Static Analyzer (default is @@ -5165,6 +5167,25 @@ echo "$as_me: error: Invalid setting for --enable-cxx11. Use \"yes\" or \"no\"" { (exit 1); exit 1; }; } ;; esac +# Check whether --enable-split-dwarf was given. +if test "${enable_split_dwarf+set}" = set; then + enableval=$enable_split_dwarf; +else + enableval=default +fi + +case "$enableval" in + yes) ENABLE_SPLIT_DWARF=1 + ;; + no) ENABLE_SPLIT_DWARF=0 + ;; + default) ENABLE_SPLIT_DWARF=0 +;; + *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-split-dwarf. Use \"yes\" or \"no\"" >&5 +echo "$as_me: error: Invalid setting for --enable-split-dwarf. Use \"yes\" or \"no\"" >&2;} + { (exit 1); exit 1; }; } ;; +esac + clang_arcmt="yes" # Check whether --enable-clang-arcmt was given. if test "${enable_clang_arcmt+set}" = set; then @@ -10518,7 +10539,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <conf$$subs.sed <<_ACEOF +TARGET_HAS_JIT!$TARGET_HAS_JIT$ac_delim ENABLE_DOCS!$ENABLE_DOCS$ac_delim ENABLE_DOXYGEN!$ENABLE_DOXYGEN$ac_delim LLVM_ENABLE_THREADS!$LLVM_ENABLE_THREADS$ac_delim @@ -23500,7 +23522,6 @@ LLVM_MANDIR!$LLVM_MANDIR$ac_delim LLVM_CONFIGTIME!$LLVM_CONFIGTIME$ac_delim BINDINGS_TO_BUILD!$BINDINGS_TO_BUILD$ac_delim ALL_BINDINGS!$ALL_BINDINGS$ac_delim -OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -23542,6 +23563,7 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim ENABLE_VISIBILITY_INLINES_HIDDEN!$ENABLE_VISIBILITY_INLINES_HIDDEN$ac_delim RPATH!$RPATH$ac_delim RDYNAMIC!$RDYNAMIC$ac_delim @@ -23550,7 +23572,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 6; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 7; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -- cgit v1.2.3