From 598eeb5703730e132415645c1ef32dafa5dc5d00 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Wed, 1 Apr 2015 11:46:15 +0000 Subject: [PATCH] Try to unbreak Clang build to export LLVM_ABI_BREAKING_CHECKS, fixup for r233310. FIXME: Should ENABLE_ABI_BREAKING_CHECKS be tri-state, "ON/OFF/blank"? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233801 91177308-0d34-0410-b5e6-96231b3b80d8 --- Makefile.config.in | 5 +++++ autoconf/configure.ac | 12 ++++++++++-- cmake/modules/LLVMConfig.cmake.in | 2 ++ cmake/modules/Makefile | 7 +++++++ configure | 24 +++++++++++++++++++----- 5 files changed, 43 insertions(+), 7 deletions(-) diff --git a/Makefile.config.in b/Makefile.config.in index d34a2d51a93..a4d641040f3 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -293,6 +293,11 @@ ENABLE_TERMINFO = @ENABLE_TERMINFO@ #ENABLE_EXPENSIVE_CHECKS = 0 @ENABLE_EXPENSIVE_CHECKS@ +# --enable-abi-breaking-checks : decide whether we should compile in asserts and +# checks that make the build ABI incompatible with an llvm built without these +# checks enabled. +ENABLE_ABI_BREAKING_CHECKS = @ENABLE_ABI_BREAKING_CHECKS@ + # When DEBUG_RUNTIME is enabled, the runtime libraries will retain debug # symbols. #DEBUG_RUNTIME = 1 diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 9617543e477..10b95a0724c 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -736,9 +736,17 @@ AC_ARG_ENABLE(abi-breaking-checks,AS_HELP_STRING( case "$enableval" in with-asserts) if test ${assertions_enabled} = "yes" ; then AC_DEFINE([LLVM_ENABLE_ABI_BREAKING_CHECKS],[1],[Define to enable checks that alter the LLVM C++ ABI]) + AC_SUBST(ENABLE_ABI_BREAKING_CHECKS,[1]) + else + AC_SUBST(ENABLE_ABI_BREAKING_CHECKS,[0]) fi ;; - yes) AC_DEFINE([LLVM_ENABLE_ABI_BREAKING_CHECKS],[1],[Define to enable checks that alter the LLVM C++ ABI]) ;; - no) ;; + yes) + AC_DEFINE([LLVM_ENABLE_ABI_BREAKING_CHECKS],[1],[Define to enable checks that alter the LLVM C++ ABI]) + AC_SUBST(ENABLE_ABI_BREAKING_CHECKS,[1]) + ;; + no) + AC_SUBST(ENABLE_ABI_BREAKING_CHECKS,[0]) + ;; *) AC_MSG_ERROR([Invalid setting for --enable-abi-breaking-checks. Use "with-asserts", "yes" or "no"]) esac diff --git a/cmake/modules/LLVMConfig.cmake.in b/cmake/modules/LLVMConfig.cmake.in index 6517cdd19c6..6a614d0cf76 100644 --- a/cmake/modules/LLVMConfig.cmake.in +++ b/cmake/modules/LLVMConfig.cmake.in @@ -21,6 +21,8 @@ set(LLVM_TARGETS_WITH_JIT @LLVM_TARGETS_WITH_JIT@) set(TARGET_TRIPLE "@TARGET_TRIPLE@") +set(LLVM_ABI_BREAKING_CHECKS @LLVM_ABI_BREAKING_CHECKS@) + set(LLVM_ENABLE_ASSERTIONS @LLVM_ENABLE_ASSERTIONS@) set(LLVM_ABI_BREAKING_CHECKS @LLVM_ABI_BREAKING_CHECKS@) diff --git a/cmake/modules/Makefile b/cmake/modules/Makefile index e38f5a64258..97ee7d3df4b 100644 --- a/cmake/modules/Makefile +++ b/cmake/modules/Makefile @@ -21,6 +21,12 @@ else LLVM_ENABLE_ASSERTIONS := 1 endif +ifeq ($(ENABLE_ABI_BREAKING_CHECKS),1) + LLVM_ABI_BREAKING_CHECKS := FORCE_ON +else + LLVM_ABI_BREAKING_CHECKS := FORCE_OFF +endif + ifeq ($(REQUIRES_EH),1) LLVM_ENABLE_EH := 1 else @@ -63,6 +69,7 @@ $(PROJ_OBJ_DIR)/LLVMConfig.cmake: LLVMConfig.cmake.in Makefile $(LLVMBuildCMakeF -e 's/@LLVM_TARGETS_TO_BUILD@/'"$(TARGETS_TO_BUILD)"'/' \ -e 's/@LLVM_TARGETS_WITH_JIT@/'"$(TARGETS_WITH_JIT)"'/' \ -e 's/@TARGET_TRIPLE@/'"$(TARGET_TRIPLE)"'/' \ + -e 's/@LLVM_ABI_BREAKING_CHECKS@/'"$(LLVM_ABI_BREAKING_CHECKS)"'/' \ -e 's/@LLVM_ENABLE_ASSERTIONS@/'"$(LLVM_ENABLE_ASSERTIONS)"'/' \ -e 's/@LLVM_ENABLE_EH@/'"$(LLVM_ENABLE_EH)"'/' \ -e 's/@LLVM_ENABLE_RTTI@/'"$(LLVM_ENABLE_RTTI)"'/' \ diff --git a/configure b/configure index 4ad1f21ed3b..7ddb0f32f9b 100755 --- a/configure +++ b/configure @@ -697,6 +697,7 @@ DISABLE_ASSERTIONS ENABLE_WERROR ENABLE_EXPENSIVE_CHECKS EXPENSIVE_CHECKS +ENABLE_ABI_BREAKING_CHECKS DEBUG_RUNTIME DEBUG_SYMBOLS KEEP_SYMBOLS @@ -5042,13 +5043,25 @@ cat >>confdefs.h <<\_ACEOF #define LLVM_ENABLE_ABI_BREAKING_CHECKS 1 _ACEOF + ENABLE_ABI_BREAKING_CHECKS=1 + + else + ENABLE_ABI_BREAKING_CHECKS=0 + fi ;; yes) + cat >>confdefs.h <<\_ACEOF #define LLVM_ENABLE_ABI_BREAKING_CHECKS 1 _ACEOF - ;; - no) ;; + + ENABLE_ABI_BREAKING_CHECKS=1 + + ;; + no) + ENABLE_ABI_BREAKING_CHECKS=0 + + ;; *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-abi-breaking-checks. Use \"with-asserts\", \"yes\" or \"no\"" >&5 echo "$as_me: error: Invalid setting for --enable-abi-breaking-checks. Use \"with-asserts\", \"yes\" or \"no\"" >&2;} { (exit 1); exit 1; }; } @@ -18835,8 +18848,8 @@ DISABLE_ASSERTIONS!$DISABLE_ASSERTIONS$ac_delim ENABLE_WERROR!$ENABLE_WERROR$ac_delim ENABLE_EXPENSIVE_CHECKS!$ENABLE_EXPENSIVE_CHECKS$ac_delim EXPENSIVE_CHECKS!$EXPENSIVE_CHECKS$ac_delim +ENABLE_ABI_BREAKING_CHECKS!$ENABLE_ABI_BREAKING_CHECKS$ac_delim DEBUG_RUNTIME!$DEBUG_RUNTIME$ac_delim -DEBUG_SYMBOLS!$DEBUG_SYMBOLS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -18878,6 +18891,7 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +DEBUG_SYMBOLS!$DEBUG_SYMBOLS$ac_delim KEEP_SYMBOLS!$KEEP_SYMBOLS$ac_delim JIT!$JIT$ac_delim TARGET_HAS_JIT!$TARGET_HAS_JIT$ac_delim @@ -18974,7 +18988,6 @@ HUGE_VAL_SANITY!$HUGE_VAL_SANITY$ac_delim MMAP_FILE!$MMAP_FILE$ac_delim SHLIBEXT!$SHLIBEXT$ac_delim LLVM_PREFIX!$LLVM_PREFIX$ac_delim -LLVM_BINDIR!$LLVM_BINDIR$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -19016,6 +19029,7 @@ _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +LLVM_BINDIR!$LLVM_BINDIR$ac_delim LLVM_DATADIR!$LLVM_DATADIR$ac_delim LLVM_DOCSDIR!$LLVM_DOCSDIR$ac_delim LLVM_ETCDIR!$LLVM_ETCDIR$ac_delim @@ -19035,7 +19049,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` = 17; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 18; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5