re PR bootstrap/50857 (The compiler is built with exceptions and RTTI enabled)

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.

From-SVN: r180833
This commit is contained in:
Michael Matz 2011-11-03 17:17:07 +00:00
parent af8d2409be
commit e941124721
8 changed files with 117 additions and 5 deletions

View File

@ -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-03 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md: Use {} for multi-line preparation statements.
@ -45,7 +53,7 @@
known_current_type and multiple_types_encountered.
(extr_type_from_vtbl_ptr_store): New function.
(check_stmt_for_type_change): Use it, set multiple_types_encountered if
the result is different from the previous one.
the result is different from the previous one.
(detect_type_change): Renamed to detect_type_change_1. New parameter
comp_type. Set up new fields in tci, build known type jump
functions if the new type can be identified.

View File

@ -164,6 +164,8 @@ C_STRICT_WARN = @c_strict_warn@
# "extern" tags in header files.
NOCOMMON_FLAG = @nocommon_flag@
NOEXCEPTION_FLAGS = @noexception_flags@
# This is set by --disable-maintainer-mode (default) to "#"
# FIXME: 'MAINT' will always be set to an empty string, no matter if
# --disable-maintainer-mode is used or not. This is because the
@ -974,7 +976,7 @@ ALL_CFLAGS = $(T_CFLAGS) $(CFLAGS-$@) \
# The C++ version.
ALL_CXXFLAGS = $(T_CFLAGS) $(CFLAGS-$@) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
$(COVERAGE_FLAGS) $(WARN_CXXFLAGS) @DEFS@
$(COVERAGE_FLAGS) $(NOEXCEPTION_FLAGS) $(WARN_CXXFLAGS) @DEFS@
# Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro
# puts -I options in CPPFLAGS, our include files in the srcdir will always

46
gcc/configure vendored
View File

@ -771,6 +771,7 @@ valgrind_path_defines
valgrind_path
TREEBROWSER
nocommon_flag
noexception_flags
warn_cxxflags
warn_cflags
c_strict_warn
@ -6613,6 +6614,47 @@ 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"
# Enable expensive internal checks
is_release=
if test x"`cat $srcdir/DEV-PHASE`" != xexperimental; then
@ -18045,7 +18087,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 18047 "configure"
#line 18090 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -18151,7 +18193,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 18153 "configure"
#line 18196 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H

View File

@ -358,6 +358,10 @@ fi
AC_SUBST(warn_cflags)
AC_SUBST(warn_cxxflags)
# Disable exceptions and RTTI if building with g++
ACX_PROG_CC_WARNING_OPTS(
m4_quote(m4_do([-fno-exceptions -fno-rtti])), [noexception_flags])
# Enable expensive internal checks
is_release=
if test x"`cat $srcdir/DEV-PHASE`" != xexperimental; then

View File

@ -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 *.

View File

@ -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@

42
libcpp/configure vendored
View File

@ -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=

View File

@ -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])