[llvm-commits] Smaller llvm-gcc patch for _GLIBCXX_DEBUG
David A. Greene
greened at obbligato.org
Thu Jun 28 12:46:14 PDT 2007
Wow, sorry about the huge patch I just posted.
Here's a version without the patches to the two configure scripts.
Whoever applies it will have to re-run autoconf.
-Dave
-------------- next part --------------
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in (revision 361)
+++ gcc/Makefile.in (working copy)
@@ -217,26 +217,22 @@
# APPLE LOCAL begin LLVM
@checkingenabled_flag@
LLVMOBJDIR = @LLVMBASEPATH@
-ifeq ($(LLVMOBJDIR),)
-CPPFLAGS = @CPPFLAGS@
-else
-CPPFLAGS = @CPPFLAGS@ -DENABLE_LLVM -D__STDC_LIMIT_MACROS
ifdef LLVM_VERSION_INFO
CPPFLAGS += -DLLVM_VERSION_INFO='"$(LLVM_VERSION_INFO)"'
endif
-ifdef CHECKING_ENABLED
-BUILDMODE=Debug
-else
-ifdef DISABLE_LLVMASSERTIONS
-BUILDMODE=Release-Asserts
-else
-BUILDMODE=Release
-endif
-endif
+# Cray [dag] Determine BUILDMODE from configure run (--enable-llvm)
+
+BUILDMODE := @LLVMBUILDMODE@
+
LLVMBINPATH = $(LLVMOBJDIR)/$(BUILDMODE)/bin
+ifeq ($(LLVMOBJDIR),)
+CPPFLAGS = @CPPFLAGS@
+else
+CPPFLAGS := @CPPFLAGS@ -DENABLE_LLVM -D__STDC_LIMIT_MACROS $(shell $(LLVMBINPATH)/llvm-config --cppflags)
+
# Use llvm-config to get the srcdir that LLVM was configured with, to support
# srcdir != objdir builds.
LLVMSRCDIR := $(shell $(LLVMBINPATH)/llvm-config --src-root)
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac (revision 361)
+++ gcc/configure.ac (working copy)
@@ -745,16 +745,38 @@
if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then
echo Found Release LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Release"
elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then
echo Found Debug LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Debug"
elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then
echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Release-Asserts"
+ elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then
+ echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Debug-Asserts"
+ elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then
+ echo Found Release+Checks LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Release+Checks"
+ elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then
+ echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Debug+Checks"
+ elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc$EXEEXT"; then
+ echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Release-Asserts+Checks"
+ elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then
+ echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Debug-Asserts+Checks"
else
AC_MSG_ERROR([You must specify valid path to your LLVM tree with --enable-llvm=DIR])
fi
],
-[LLVMBASEPATH=""])
+[LLVMBASEPATH=""
+ LLVMBUILDMODE=""
+])
AC_SUBST(LLVMBASEPATH)
+# Cray [dag] send llvm build mode to gcc Makefiles
+AC_SUBST(LLVMBUILDMODE)
# APPLE LOCAL end LLVM
# Sanity check enable_languages in case someone does not run the toplevel
Index: libcpp/configure.ac
===================================================================
--- libcpp/configure.ac (revision 361)
+++ libcpp/configure.ac (working copy)
@@ -104,13 +104,16 @@
[Define if you want more run-time sanity checks.])
fi
+# Cray [dag]: These comments cannot be in the middle of continuation
+# lines (autoconf 2.60)
+ # APPLE LOCAL begin 4126124
+ #APPLE LOCAL begin LLVM
+ #APPLE LOCAL end LLVM
+ # APPLE LOCAL end 4126124
m4_changequote(,)
case $target in
- # APPLE LOCAL begin 4126124
alpha*-*-* | \
- #APPLE LOCAL begin LLVM
arm*-*-*eabi* | \
- #APPLE LOCAL end LLVM
arm*-*-symbianelf* | \
x86_64-*-* | \
ia64-*-* | \
@@ -126,7 +129,6 @@
sparcv9-*-solaris2* | \
sparc-*-solaris2.[789] | sparc-*-solaris2.1[0-9]* | \
sh[123456789l]*-*-*)
- # APPLE LOCAL end 4126124
need_64bit_hwint=yes ;;
*)
need_64bit_hwint=no ;;
@@ -161,10 +163,28 @@
if test -x "$LLVMBASEPATH/Release/bin/llc$EXEEXT"; then
echo Found Release LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Release"
elif test -x "$LLVMBASEPATH/Debug/bin/llc$EXEEXT"; then
echo Found Debug LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Debug"
elif test -x "$LLVMBASEPATH/Release-Asserts/bin/llc$EXEEXT"; then
echo Found Release-Asserts LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Release-Asserts"
+ elif test -x "$LLVMBASEPATH/Debug-Asserts/bin/llc$EXEEXT"; then
+ echo Found Debug-Asserts LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Debug-Asserts"
+ elif test -x "$LLVMBASEPATH/Release+Checks/bin/llc$EXEEXT"; then
+ echo Found Release+Checks LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Release+Checks"
+ elif test -x "$LLVMBASEPATH/Debug+Checks/bin/llc$EXEEXT"; then
+ echo Found Debug+Checks LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Debug+Checks"
+ elif test -x "$LLVMBASEPATH/Release-Asserts+Checks/bin/llc$EXEEXT"; then
+ echo Found Release-Asserts+Checks LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Release-Asserts+Checks"
+ elif test -x "$LLVMBASEPATH/Debug-Asserts+Checks/bin/llc$EXEEXT"; then
+ echo Found Debug-Asserts+Checks LLVM Tree in $LLVMBASEPATH
+ LLVMBUILDMODE="Debug-Asserts+Checks"
else
AC_MSG_ERROR([You must specify valid path to your LLVM tree with --enable-llvm=DIR])
fi
More information about the llvm-commits
mailing list