summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authormatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-03 17:17:07 +0000
committermatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-03 17:17:07 +0000
commit7c801b603f2af5d2d0e3ffc7b966f5274597786a (patch)
tree4343503ebcbfe34ff7e06478572708b57fff1bf4 /libcpp
parentbc80e024422258285fdc89bd85492d11d46fca5b (diff)
downloadgcc-7c801b603f2af5d2d0e3ffc7b966f5274597786a.tar.gz
libcpp/
PR bootstrap/50857 * configure.ac: Check for -fno-exceptions -fno-rtti. * configure: Regenerate. * Makefile.in (NOEXCEPTION_FLAGS): New flag. (ALL_CXXFLAGS): Use it. gcc/ PR bootstrap/50857 * configure.ac: Check for -fno-exceptions -fno-rtti. * configure: Regenerate. * Makefile.in (NOEXCEPTION_FLAGS): New flag. (ALL_CXXFLAGS): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180833 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog8
-rw-r--r--libcpp/Makefile.in4
-rwxr-xr-xlibcpp/configure42
-rw-r--r--libcpp/configure.ac4
4 files changed, 57 insertions, 1 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index c19f21bbf91..8f7d494fc91 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,11 @@
+2011-11-03 Michael Matz <matz@suse.de>
+
+ PR bootstrap/50857
+ * configure.ac: Check for -fno-exceptions -fno-rtti.
+ * configure: Regenerate.
+ * Makefile.in (NOEXCEPTION_FLAGS): New flag.
+ (ALL_CXXFLAGS): Use it.
+
2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
* internal.h (uxstrdup, ustrchr): Return const unsigned char *.
diff --git a/libcpp/Makefile.in b/libcpp/Makefile.in
index 33c44b542df..d6df46d62c9 100644
--- a/libcpp/Makefile.in
+++ b/libcpp/Makefile.in
@@ -56,6 +56,7 @@ XGETTEXT = @XGETTEXT@
CCDEPMODE = @CCDEPMODE@
CXXDEPMODE = @CXXDEPMODE@
DEPDIR = @DEPDIR@
+NOEXCEPTION_FLAGS = @noexception_flags@
datarootdir = @datarootdir@
datadir = @datadir@
@@ -72,7 +73,8 @@ INCLUDES = -I$(srcdir) -I. -I$(srcdir)/../include @INCINTL@ \
-I$(srcdir)/include
ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS)
-ALL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(INCLUDES) $(CPPFLAGS)
+ALL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(NOEXCEPTION_FLAGS) $(INCLUDES) \
+ $(CPPFLAGS)
# The name of the compiler to use.
ENABLE_BUILD_WITH_CXX = @ENABLE_BUILD_WITH_CXX@
diff --git a/libcpp/configure b/libcpp/configure
index a26a4775bf9..803daae2b2e 100755
--- a/libcpp/configure
+++ b/libcpp/configure
@@ -616,6 +616,7 @@ CCDEPMODE
DEPDIR
am__leading_dot
WERROR
+noexception_flags
WARN_PEDANTIC
c_warn
warn
@@ -4802,6 +4803,47 @@ fi
fi
+# Disable exceptions and RTTI if building with g++
+noexception_flags=
+save_CFLAGS="$CFLAGS"
+for option in -fno-exceptions -fno-rtti; do
+ as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
+$as_echo_n "checking whether $CC supports $option... " >&6; }
+if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then :
+ $as_echo_n "(cached) " >&6
+else
+ CFLAGS="$option"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$as_acx_Woption=yes"
+else
+ eval "$as_acx_Woption=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+eval ac_res=\$$as_acx_Woption
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
+ noexception_flags="$noexception_flags${noexception_flags:+ }$option"
+fi
+ done
+CFLAGS="$save_CFLAGS"
+
+
# Only enable with --enable-werror-always until existing warnings are
# corrected.
WERROR=
diff --git a/libcpp/configure.ac b/libcpp/configure.ac
index e8437680ffa..83d5bb6e827 100644
--- a/libcpp/configure.ac
+++ b/libcpp/configure.ac
@@ -39,6 +39,10 @@ ACX_PROG_CC_WARNING_OPTS([-Wstrict-prototypes -Wmissing-prototypes \
-Wold-style-definition -Wc++-compat], [c_warn])
ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
+# Disable exceptions and RTTI if building with g++
+ACX_PROG_CC_WARNING_OPTS(
+ m4_quote(m4_do([-fno-exceptions -fno-rtti])), [noexception_flags])
+
# Only enable with --enable-werror-always until existing warnings are
# corrected.
ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])