Error out on -fvtable-verify without --enable-vtable-verify
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Mon, 9 May 2016 11:54:55 +0000 (11:54 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Mon, 9 May 2016 11:54:55 +0000 (11:54 +0000)
* configure.ac (enable_vtable_verify): Handle --enable-vtable-verify.
* configure: Regenerate.
* config.in: Regenerate.
* gcc.c (VTABLE_VERIFICATION_SPEC) [!ENABLE_VTABLE_VERIFY]: Error
on -fvtable-verify.
* config/sol2.h [!ENABLE_VTABLE_VERIFY] (STARTFILE_VTV_SPEC): Define.
(ENDFILE_VTV_SPEC): Define.

From-SVN: r236029

gcc/ChangeLog
gcc/config.in
gcc/config/sol2.h
gcc/configure
gcc/configure.ac
gcc/gcc.c

index 1adf8b51ee93b746a53b8ef52d0daf9a2fe1016c..b00dc71cb1a4a3870248439869278d86d008a51e 100644 (file)
@@ -1,3 +1,13 @@
+2016-05-09  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * configure.ac (enable_vtable_verify): Handle --enable-vtable-verify.
+       * configure: Regenerate.
+       * config.in: Regenerate.
+       * gcc.c (VTABLE_VERIFICATION_SPEC) [!ENABLE_VTABLE_VERIFY]: Error
+       on -fvtable-verify.
+       * config/sol2.h [!ENABLE_VTABLE_VERIFY] (STARTFILE_VTV_SPEC): Define.
+       (ENDFILE_VTV_SPEC): Define.
+
 2016-05-09  Kaushik Phatak  <kaushik.phatak@kpit.com>
 
        * config/rl78/rl78.c (rl78_expand_prologue): Save the MDUC related
index bdde25fe12f4b7f23f3eab09ab23800628d01653..39d1e7524f8edb0ad46ae6bc72534fa60b02f4e8 100644 (file)
 #endif
 
 
+/* Define 0/1 if vtable verification feature is enabled. */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_VTABLE_VERIFY
+#endif
+
+
 /* Define to 1 if installation paths should be looked up in the Windows
    Registry. Ignored on non-Windows hosts. */
 #ifndef USED_FOR_TARGET
index 5160e1fda18763ba3fcb4a817130a730ed4e1789..50f2b383a1b7007c1d7654fbcbea56c1395a7d0d 100644 (file)
@@ -166,21 +166,26 @@ along with GCC; see the file COPYING3.  If not see
 #define STARTFILE_CRTBEGIN_SPEC        "crtbegin.o%s"
 #endif
 
+#if ENABLE_VTABLE_VERIFY
 #if SUPPORTS_INIT_PRIORITY
 #define STARTFILE_VTV_SPEC \
   "%{fvtable-verify=none:%s; \
      fvtable-verify=preinit:vtv_start_preinit.o%s; \
      fvtable-verify=std:vtv_start.o%s}"
-
 #define ENDFILE_VTV_SPEC \
   "%{fvtable-verify=none:%s; \
      fvtable-verify=preinit:vtv_end_preinit.o%s; \
      fvtable-verify=std:vtv_end.o%s}"
-#else
+#else /* !SUPPORTS_INIT_PRIORITY */
 #define STARTFILE_VTV_SPEC \
-  "%{fvtable-verify:%e-fvtable-verify is not supported in this configuration}"
+  "%{fvtable-verify=*: \
+     %e-fvtable-verify=%* is not supported in this configuration}"
 #define ENDFILE_VTV_SPEC ""
-#endif
+#endif /* !SUPPORTS_INIT_PRIORITY */
+#else /* !ENABLE_VTABLE_VERIFY */
+#define STARTFILE_VTV_SPEC ""
+#define ENDFILE_VTV_SPEC ""
+#endif /* !ENABLE_VTABLE_VERIFY */
 
 /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us.  */
 #undef STARTFILE_SPEC
index 274c397be7da9245165dca69253871763e9c5a2b..319dcc3125e3cb351080e9c7da85fa9d2dcaa893 100755 (executable)
@@ -904,6 +904,7 @@ enable_decimal_float
 enable_fixed_point
 enable_threads
 enable_tls
+enable_vtable_verify
 enable_objc_gc
 with_dwarf2
 enable_shared
@@ -1619,6 +1620,7 @@ Optional Features:
                           package
   --enable-tls            enable or disable generation of tls code overriding
                           the assembler check for tls support
+  --enable-vtable-verify  enable vtable verification feature
   --enable-objc-gc        enable the use of Boehm's garbage collector with the
                           GNU Objective-C runtime
   --disable-shared        don't provide a shared libgcc
@@ -7591,6 +7593,20 @@ else
 fi
 
 
+# Check whether --enable-vtable-verify was given.
+if test "${enable_vtable_verify+set}" = set; then :
+  enableval=$enable_vtable_verify;
+else
+  enable_vtable_verify=no
+fi
+
+vtable_verify=`if test x$enable_vtable_verify = xyes; then echo 1; else echo 0; fi`
+
+cat >>confdefs.h <<_ACEOF
+#define ENABLE_VTABLE_VERIFY $vtable_verify
+_ACEOF
+
+
 # Check whether --enable-objc-gc was given.
 if test "${enable_objc_gc+set}" = set; then :
   enableval=$enable_objc_gc; if test x$enable_objc_gc = xno; then
@@ -18458,7 +18474,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18462 "configure"
+#line 18477 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -18564,7 +18580,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 18568 "configure"
+#line 18583 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index e40d82a8306044209ec05a5e7bdbca9ea67ba21d..d55f84589432359d1345ef686ade65ac76bc1216 100644 (file)
@@ -865,6 +865,14 @@ Valid choices are 'yes' and 'no'.]) ;;
   esac
 ], [enable_tls=''])
 
+AC_ARG_ENABLE(vtable-verify,
+[AS_HELP_STRING([--enable-vtable-verify],
+               [enable vtable verification feature])],,
+[enable_vtable_verify=no])
+vtable_verify=`if test x$enable_vtable_verify = xyes; then echo 1; else echo 0; fi`
+AC_DEFINE_UNQUOTED(ENABLE_VTABLE_VERIFY, $vtable_verify,
+[Define 0/1 if vtable verification feature is enabled.])
+
 AC_ARG_ENABLE(objc-gc,
 [AS_HELP_STRING([--enable-objc-gc],
                [enable the use of Boehm's garbage collector with
index 1af59209b312ea52408690393ed80e55d093ecf3..7bcf3b375e5912b7ff95b2fb34f9b5b9f0c44ed8 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -989,9 +989,18 @@ proper position among the other output files.  */
     the vtable verification runtime functions are in libstdc++, so we use
     the spec just below this one.  */
 #ifndef VTABLE_VERIFICATION_SPEC
+#if ENABLE_VTABLE_VERIFY
 #define VTABLE_VERIFICATION_SPEC "\
 %{!nostdlib:%{fvtable-verify=std: -lvtv -u_vtable_map_vars_start -u_vtable_map_vars_end}\
     %{fvtable-verify=preinit: -lvtv -u_vtable_map_vars_start -u_vtable_map_vars_end}}"
+#else
+#define VTABLE_VERIFICATION_SPEC "\
+%{fvtable-verify=none:} \
+%{fvtable-verify=std: \
+  %e-fvtable-verify=std is not supported in this configuration} \
+%{fvtable-verify=preinit: \
+  %e-fvtable-verify=preinit is not supported in this configuration}"
+#endif
 #endif
 
 #ifndef CHKP_SPEC