Commit the vtable verification feature.

Commit the vtable verification feature.  This feature is designed to
detect, at run time, if/when the vtable pointer in a C++ object has
been corrupted, before allowing virtual calls through that pointer. 
If pointer corruption is detected, execution of the program is halted.

libstdc++-v3 ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        * fragment.am: Add XTEMPLATE_FLAGS.
        * configure.ac: Add definitions for --enable-vtable-verify.
        * acinclude.m4:  Add --enable-vtable-verify and
        --disable-vtable-verify; define --enable-vtable-verify; define
        VTV_CXXFLAGS, VTV_PCH_CXXFLAGS and VTV_CXXLINKFLAGS.
        * config/abi/pre/gnu.ver: Export symbols for vtable verification.
        * libsupc++/Makefile.am: Define vtv_sources and add it to
        libsupc___la_SOURCES and libsupc__convenience_la_SOURCES.
        * libsupc++/vtv_stubs.cc: New file.
        * include/Makefile.am: Add VTV_PCH_CXXFLAGS to PCHFLAGS.
        * src/Makefile.am: Add VTV_CXXFLAGS to AM_CXXFLAGS; add
        VTV_CXXLINKFLAGS to CXXLINK.
        * src/c++98/Makefile.am: Comment out XTEMPLATE_FLAGS; add VTV_CXXFLAGS
        to AM_CXXFLAGS; add VTV_CXXXLINKFLAGS to CXXLINK.
        * src/C++11/Makefile.am: Ditto.
        * doc/xml/manual/configure.xml: Add entry for --enable-vtable-verify.
        * scripts/testsuite_flags.in: Add cxxvtvflags to Usage; cause
        cxxvtvflags to use VTV_CXXFLAGS and VTV_CXXLINKFLAGS.
        * testsuite/lib/libstdc++.exp: Add cxxvtvflags; add code to locate
        libvtv if --enable-vtable-verify was used; set cxxvtvflags; add
        cxxvtvflags to cxx_final.
        * testsuite/18_support/bad_exception/23591_thread-1.c: Add
        -fvtable-verify=none to compiler flags.
        * testsuite/17_intro/freestanding.cc: Add -fvtable-verify=none
        to compiler flags.
        * configure: Regenerated.
        * Makefile.in: Regenerated.
        * python/Makefile.in: Regenerated.
        * include/Makefile.in: Regenerated.
        * libsupc++/Makefile.in: Regenerated.
        * config.h.in: Regenerated.
        * po/Makefile.in: Regenerated.
        * src/Makefile.in: Regenerated.
        * src/c++98/Makefile.in: Regenerated.
        * src/c++11/Makefile.in: Regenerated.
        * doc/Makefile.in: Regenerated.
        * testsuite/Makefile.in: Regenerated.

top level ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        * configure.ac: Add target-libvtv to target_libraries; disable libvtv
        on non-linux systems; add target-libvtv to noconfigdirs; add
        libsupc++/.libs to C++ library search paths.
        * configure: Regenerated.
        * Makefile.def: Add libvtv to target_modules; make libvtv depend on
        libstdc++ and libgcc.
        * Makefile.in: Regenerated.

include/ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        * vtv-change-permission.h: New file.

contrib/ChangeLog:
2013-08-06  Caroline Tice4  <cmtice@google.com>

        * gcc_update: Add libvtv files.

libgcc/ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        config.host (extra_parts): Add vtv_start.o, vtv_end.o
        vtv_start_preinit.o and vtv_end_preinit.o.
        configure.ac: Add code to check/set enable_vtable_verify.
        Makefile.in: Add rules to build vtv_*.o, if enable_vtable_verify is
        true.
        vtv_start_preinit.c: New file.
        vtv_end_preinit.c: New file.
        vtv_start.c: New file.
        vtv_end.c: New file.
        configure: Regenerated.

gcc/ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        * gcc.c (VTABLE_VERIFICATION_SPEC): New definition.
        (LINK_COMMAND_SPEC): Add VTABLE_VERIFICATION_SPEC.
        * tree-pass.h: Add pass_vtable_verify.
        * varasm.c (assemble_variable): Add code to properly set the comdat
        section and name for the .vtable_map_vars section.
        (assemble_vtyv_preinit_initializer): New function.
        (default_sectin_type_flags):  Make sure .vtable_map_vars section has
        LINK_ONCE flag.
        * output.h: Add function decl for assemble_vtv_preinit_initializer.
        * vtable-verify.c: New file.
        * vtable-verify.h: New file.
        * flag-types.h (enum vtv_priority): Defintions for flag_vtable_verify
        initialiation levels.
        * timevar.def (TV_VTABLE_VERIFICATION): New definition.
        * passes.def: Insert pass_vtable_verify.
        * aclocal.m4: Reorder includes.
        * doc/invoke.texi: Add documentation for the flags -fvtable-verify=,
	-fvtv-debug and -fvtv-counts.
        * config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Add vtv_start*.o,
as appropriate, if -fvtable-verify=... is used.
        (GNU_USER_TARGET_ENDFILE_SPEC): Add vtv_end*.o as appropriate, if
        -fvtable-verify=... is used.
        * Makefile.in (OBJS):  Add vtable-verify.o to list.
        (vtable-verify.o): Add new build rule.
        (GTFILES): Add vtable-verify.c to list.
        * common.opt (fvtable-verify=): New flag.
        (vtv_priority): Values for fvtable-verify= flag.
        (fvtv-counts): New flag.
(fvtv-debug): New flag.
        * tree.h (save_vtable_map_decl): New extern function decl.


gcc/cp/ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        * Make-lang.in (*CXX_AND_OBJCXX_OBJS):  Add vtable-class-hierarchy.o to
        list.
        (vtable-class-hierarchy.o): Add build rule.
        * cp-tree.h (vtv_start_verification_constructor_init_function): New
        extern function decl.
        (vtv_finish_verification_constructor_init_function): New extern
        function decl.
        (build_vtbl_address): New extern function decl.
        (get_mangled_vtable_map_var_name): New extern function decl.
        (vtv_compute_class_hierarchy_transitive_closure): New extern function
        decl.
        (vtv_generate_init_routine): New extern function decl.
        (vtv_save_class_info): New extern function decl.
        (vtv_recover_class_info): New extern function decl.
        (vtv_build_vtable_verify_fndecl): New extern function decl.
        * class.c (finish_struct_1): Add call to vtv_save_class_info if
        flag_vtable_verify is true.
        * config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
        * vtable-class-hierarchy.c: New file.
        * mangle.c (get_mangled_vtable_map_var_name):  New function.
        * decl2.c (start_objects): Update function comment.
        (cp_write_global_declarations): Call vtv_recover_class_info,
        vtv_compute_class_hierarchy_transitive_closure and
        vtv_build_vtable_verify_fndecl, before calling
        finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
        flag_vtable_verify is true.
        (vtv_start_verification_constructor_init_function): New function.
        (vtv_finish_verification_constructor_init_function): New function.
        * init.c (build_vtbl_address): Remove static qualifier from function.

libvtv/ChangeLog:
2013-08-06  Caroline Tice  <cmtice@google.com>

        Initial check-in of new vtable verification feature.
        * configure.ac : New file.
        * acinclude.m4 : New file.
        * Makefile.am : New file.
        * aclocal.m4 : New file.
        * configure.tgt : New file.
        * configure: New file (generated).
        * Makefile.in: New file (generated).
        * vtv_set.h : New file.
        * vtv_utils.cc : New file.
        * vtv_utils.h : New file.
        * vtv_malloc.cc : New file.
        * vtv_rts.cc : New file.
        * vtv_malloc.h : New file.
        * vtv_rts.h : New file.
        * vtv_fail.cc : New file.
        * vtv_fail.h : New file.
        * vtv_map.h : New file.
        * scripts/run-testsuite.sh : New file.
        * scripts/sum-vtv-counts.c : New file.
        * testsuite/parts-test-main.h : New file.
        * testusite/dataentry.cc : New file.
        * testsuite/temp_deriv.cc : New file.
        * testsuite/register_pair.cc : New file.
        * testsuite/virtual_inheritance.cc : New file.
        * testsuite/field-test.cc : New file.
        * testsuite/nested_vcall_test.cc : New file.
        * testsuite/template-list-iostream.cc : New file.
        * testsuite/register_pair_inserts.cc : New file.
        * testsuite/register_pair_inserts_mt.cc : New file.
        * testsuite/event.list : New file.
        * testsuite/parts-test-extra-parts-views.cc : New file.
        * testsuite/parts-test-extra-parts-views.h : New file.
        * testsuite/environment-fail-32.s : New file.
        * testsuite/parts-test-extra-parts.h : New file.
        * testsuite/temp_deriv2.cc : New file.
        * testsuite/dlopen_mt.cc : New file.
        * testsuite/event.h : New file.
        * testsuite/template-list.cc : New file.
        * testsuite/replace-fail.cc : New file.
        * testsuite/Makefile.am : New file.
        * testsuite/Makefile.in: New file (generated).
        * testsuite/mempool_negative.c : New file.
        * testsuite/parts-test-main.cc : New file.
        * testsuite/event-private.cc : New file.
        * testsuite/thunk.cc : New file.
        * testsuite/event-defintiions.cc : New file.
        * testsuite/event-private.h : New file.
        * testsuite/parts-test.list : New file.
        * testusite/register_pair_mt.cc : New file.
        * testsuite/povray-derived.cc : New file.
        * testsuite/event-main.cc : New file.
        * testsuite/environment.cc : New file.
        * testsuite/template-list2.cc : New file.
        * testsuite/thunk_vtable_map_attack.cc : New file.
        * testsuite/parts-test-extra-parts.cc : New file.
        * testsuite/environment-fail-64.s : New file.
        * testsuite/dlopen.cc : New file.
        * testsuite/so.cc : New file.
        * testsuite/temp_deriv3.cc : New file.
        * testsuite/const_vtable.cc : New file.
        * testsuite/mempool_positive.c : New file.
        * testsuite/dup_name.cc : New file.

From-SVN: r201555
This commit is contained in:
Caroline Tice 2013-08-06 20:38:59 -07:00
parent 03085d1cf9
commit 2077db1be5
137 changed files with 49131 additions and 73 deletions

View file

@ -1,3 +1,13 @@
2013-08-02 Caroline Tice <cmtice@google.com>
* configure.ac: Add target-libvtv to target_libraries; disable libvtv
on non-linux systems; add target-libvtv to noconfigdirs; add
libsupc++/.libs to C++ library search paths.
* configure: Regenerated.
* Makefile.def: Add libvtv to target_modules; make libvtv depend on
libstdc++ and libgcc.
* Makefile.in: Regenerated.
2013-07-19 Yvan Roux <yvan.roux@linaro.org>
* MAINTAINERS (Write After Approval): Add myself.

View file

@ -4,8 +4,7 @@ AutoGen definitions Makefile.tpl;
// Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
// This file was originally written by Nathanael Nerode.
//
// Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
// Free Software Foundation
// Copyright 2002-2013 Free Software Foundation
//
// This file is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -123,6 +122,10 @@ target_modules = { module= libsanitizer;
bootstrap=true;
lib_path=.libs;
raw_cxx=true; };
target_modules = { module= libvtv;
bootstrap=true;
lib_path=.libs;
raw_cxx=true; };
target_modules = { module= libssp; lib_path=.libs; };
target_modules = { module= newlib; };
target_modules = { module= libgcc; bootstrap=true; no_check=true; };
@ -516,6 +519,7 @@ dependencies = { module=configure-target-libobjc; on=configure-target-boehm-gc;
dependencies = { module=all-target-libobjc; on=all-target-boehm-gc; };
dependencies = { module=configure-target-libstdc++-v3; on=configure-target-libgomp; };
dependencies = { module=configure-target-libsanitizer; on=all-target-libstdc++-v3; };
dependencies = { module=configure-target-libvtv; on=all-target-libstdc++-v3; };
// parallel_list.o and parallel_settings.o depend on omp.h, which is
// generated by the libgomp configure. Unfortunately, due to the use of
// recursive make, we can't be that specific.
@ -526,6 +530,8 @@ dependencies = { module=install-target-libgfortran; on=install-target-libquadmat
dependencies = { module=install-target-libgfortran; on=install-target-libgcc; };
dependencies = { module=install-target-libsanitizer; on=install-target-libstdc++-v3; };
dependencies = { module=install-target-libsanitizer; on=install-target-libgcc; };
dependencies = { module=install-target-libvtv; on=install-target-libstdc++-v3; };
dependencies = { module=install-target-libvtv; on=install-target-libgcc; };
dependencies = { module=install-target-libjava; on=install-target-libgcc; };
dependencies = { module=install-target-libitm; on=install-target-libgcc; };
dependencies = { module=install-target-libobjc; on=install-target-libgcc; };

File diff suppressed because it is too large Load diff

33
configure vendored
View file

@ -2774,6 +2774,7 @@ target_libraries="target-libgcc \
target-libstdc++-v3 \
target-libmudflap \
target-libsanitizer \
target-libvtv \
target-libssp \
target-libquadmath \
target-libgfortran \
@ -3215,6 +3216,25 @@ $as_echo "yes" >&6; }
fi
fi
# Disable libvtv on unsupported systems.
if test -d ${srcdir}/libvtv; then
if test x$enable_libvtv = x; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libvtv support" >&5
$as_echo_n "checking for libvtv support... " >&6; }
if (srcdir=${srcdir}/libvtv; \
. ${srcdir}/configure.tgt; \
test -n "$UNSUPPORTED")
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
noconfigdirs="$noconfigdirs target-libvtv"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
fi
fi
# Disable libquadmath for some systems.
case "${target}" in
avr-*-*)
@ -6551,11 +6571,11 @@ case ,${enable_languages},:${enable_objc_gc} in
;;
esac
# Disable libitm and libsanitizer if we're not building C++
# Disable libitm, libsanitizer, libvtv if we're not building C++
case ,${enable_languages}, in
*,c++,*) ;;
*)
noconfigdirs="$noconfigdirs target-libitm target-libsanitizer"
noconfigdirs="$noconfigdirs target-libitm target-libsanitizer target-libvtv"
;;
esac
@ -7032,6 +7052,11 @@ if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1 ; then
bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer,
fi
# If we are building libvtv, bootstrap it.
if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 ; then
bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
fi
# Determine whether gdb needs tk/tcl or not.
# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
# and in that case we want gdb to be built without tk. Ugh!
@ -13747,7 +13772,7 @@ else
esac
if test $ok = yes; then
# An in-tree tool is available and we can use it
CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs'
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: just compiled" >&5
$as_echo "just compiled" >&6; }
elif expr "x$CXX_FOR_TARGET" : "x/" > /dev/null; then
@ -13792,7 +13817,7 @@ else
esac
if test $ok = yes; then
# An in-tree tool is available and we can use it
RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs'
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: just compiled" >&5
$as_echo "just compiled" >&6; }
elif expr "x$RAW_CXX_FOR_TARGET" : "x/" > /dev/null; then

View file

@ -161,6 +161,7 @@ target_libraries="target-libgcc \
target-libstdc++-v3 \
target-libmudflap \
target-libsanitizer \
target-libvtv \
target-libssp \
target-libquadmath \
target-libgfortran \
@ -554,6 +555,22 @@ if test -d ${srcdir}/libsanitizer; then
fi
fi
# Disable libvtv on unsupported systems.
if test -d ${srcdir}/libvtv; then
if test x$enable_libvtv = x; then
AC_MSG_CHECKING([for libvtv support])
if (srcdir=${srcdir}/libvtv; \
. ${srcdir}/configure.tgt; \
test -n "$UNSUPPORTED")
then
AC_MSG_RESULT([no])
noconfigdirs="$noconfigdirs target-libvtv"
else
AC_MSG_RESULT([yes])
fi
fi
fi
# Disable libquadmath for some systems.
case "${target}" in
avr-*-*)
@ -2037,11 +2054,11 @@ case ,${enable_languages},:${enable_objc_gc} in
;;
esac
# Disable libitm and libsanitizer if we're not building C++
# Disable libitm, libsanitizer, libvtv if we're not building C++
case ,${enable_languages}, in
*,c++,*) ;;
*)
noconfigdirs="$noconfigdirs target-libitm target-libsanitizer"
noconfigdirs="$noconfigdirs target-libitm target-libsanitizer target-libvtv"
;;
esac
@ -2467,6 +2484,11 @@ if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1 ; then
bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer,
fi
# If we are building libvtv, bootstrap it.
if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 ; then
bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
fi
# Determine whether gdb needs tk/tcl or not.
# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
# and in that case we want gdb to be built without tk. Ugh!
@ -3163,10 +3185,10 @@ GCC_TARGET_TOOL(as, AS_FOR_TARGET, AS, [gas/as-new])
GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])
dnl see comments for CXX_FOR_TARGET_FLAG_TO_PASS
GCC_TARGET_TOOL(c++, CXX_FOR_TARGET, CXX,
[gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs],
[gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
c++)
GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX,
[gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs],
[gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs],
c++)
GCC_TARGET_TOOL(dlltool, DLLTOOL_FOR_TARGET, DLLTOOL, [binutils/dlltool])
GCC_TARGET_TOOL(gcc, GCC_FOR_TARGET, , [gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/])

View file

@ -1,3 +1,7 @@
2013-08-03 Caroline Tice4 <cmtice@google.com>
* gcc_update: Add libvtv files.
2013-06-06 Brooks Moses <bmoses@google.com>
* testsuite-management/validate_failures.py: Fix handling of

View file

@ -158,6 +158,9 @@ libsanitizer/configure: libsanitizer/configure.ac libsanitizer/aclocal.m4
libsanitizer/asan/Makefile.in: libsanitizer/asan/Makefile.am libsanitizer/aclocal.m4
libsanitizer/interception/Makefile.in: libsanitizer/interception/Makefile.am libsanitizer/aclocal.m4
libsanitizer/sanitizer_common/Makefile.in: libsanitizer/sanitizer_common/Makefile.am libsanitizer/aclocal.m4
libvtv/aclocal.m4: libvtv/configure.ac libvtv/acinclude.m4
libvtv/Makefile.in: libvtv/Makefile.am libvtv/aclocal.m4
libvtv/configure: libvtv/configure.ac libvtv/aclocal.m4
# Top level
Makefile.in: Makefile.tpl Makefile.def
configure: configure.ac config/acx.m4

View file

@ -1,3 +1,36 @@
2013-08-06 Caroline Tice <cmtice@google.com>
* gcc.c (VTABLE_VERIFICATION_SPEC): New definition.
(LINK_COMMAND_SPEC): Add VTABLE_VERIFICATION_SPEC.
* tree-pass.h: Add pass_vtable_verify.
* varasm.c (assemble_variable): Add code to properly set the comdat
section and name for the .vtable_map_vars section.
(assemble_vtyv_preinit_initializer): New function.
(default_sectin_type_flags): Make sure .vtable_map_vars section has
LINK_ONCE flag.
* output.h: Add function decl for assemble_vtv_preinit_initializer.
* vtable-verify.c: New file.
* vtable-verify.h: New file.
* flag-types.h (enum vtv_priority): Defintions for flag_vtable_verify
initialiation levels.
* timevar.def (TV_VTABLE_VERIFICATION): New definition.
* passes.def: Insert pass_vtable_verify.
* aclocal.m4: Reorder includes.
* doc/invoke.texi: Document the -fvtable-verify=, -fvtv-debug, and
-fvtv-counts options.
* config/gnu-user.h (GNU_USER_TARGET_STARTFILE_SPEC): Add vtv_start*.o,
as appropriate, if -fvtable-verify=... is used.
(GNU_USER_TARGET_ENDFILE_SPEC): Add vtv_end*.o as appropriate, if
-fvtable-verify=... is used.
* Makefile.in (OBJS): Add vtable-verify.o to list.
(vtable-verify.o): Add new build rule.
(GTFILES): Add vtable-verify.c to list.
* common.opt (fvtable-verify=): New flag.
(vtv_priority): Values for fvtable-verify= flag.
(fvtv-counts): New flag.
(fvtv-debug): New flag.
* tree.h (save_vtable_map_decl): New extern function decl.
2013-08-07 David Malcolm <dmalcolm@redhat.com>
* config/rl78/rl78.c (rl78_devirt_pass): Convert from a struct to...

View file

@ -1473,6 +1473,7 @@ OBJS = \
varasm.o \
varpool.o \
vmsdbgout.o \
vtable-verify.o \
web.o \
xcoffout.o \
$(out_object_file) \
@ -2644,6 +2645,12 @@ tree-vectorizer.o: tree-vectorizer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(DUMPFILE_H) $(TM_H) $(GGC_H) $(TREE_H) $(TREE_FLOW_H) \
$(CFGLOOP_H) $(TREE_PASS_H) $(TREE_VECTORIZER_H) \
$(TREE_PRETTY_PRINT_H)
vtable-verify.o: vtable-verify.c vtable-verify.h $(CONFIG_H) \
$(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) cp/cp-tree.h $(TM_P_H) \
$(BASIC_BLOCK_H) output.h $(TREE_FLOW_H) $(TREE_DUMP_H) $(TREE_PASS_H) \
$(TIMEVAR_H) $(CFGLOOP_H) $(FLAGS_H) $(TREE_INLINE_H) $(SCEV_H) \
$(DIAGNOSTIC_CORE_H) $(GIMPLE_PRETTY_PRINT_H) toplev.h langhooks.h \
gt-vtable-verify.h
tree-loop-distribution.o: tree-loop-distribution.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TREE_FLOW_H) $(CFGLOOP_H) $(TREE_DATA_REF_H) $(TREE_PASS_H)
tree-parloops.o: tree-parloops.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
@ -3817,6 +3824,7 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/lto-streamer.h \
$(srcdir)/target-globals.h \
$(srcdir)/ipa-inline.h \
$(srcdir)/vtable-verify.c \
$(srcdir)/asan.c \
$(srcdir)/tsan.c \
@all_gtfiles@

10
gcc/aclocal.m4 vendored
View file

@ -99,11 +99,6 @@ m4_define([AC_PROG_CC],
[m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
])
m4_include([../libtool.m4])
m4_include([../ltoptions.m4])
m4_include([../ltsugar.m4])
m4_include([../ltversion.m4])
m4_include([../lt~obsolete.m4])
m4_include([../config/acx.m4])
m4_include([../config/codeset.m4])
m4_include([../config/dfp.m4])
@ -119,4 +114,9 @@ m4_include([../config/picflag.m4])
m4_include([../config/progtest.m4])
m4_include([../config/stdint.m4])
m4_include([../config/warnings.m4])
m4_include([../libtool.m4])
m4_include([../ltoptions.m4])
m4_include([../ltsugar.m4])
m4_include([../ltversion.m4])
m4_include([../lt~obsolete.m4])
m4_include([acinclude.m4])

View file

@ -2311,6 +2311,30 @@ Enum(symbol_visibility) String(hidden) Value(VISIBILITY_HIDDEN)
EnumValue
Enum(symbol_visibility) String(protected) Value(VISIBILITY_PROTECTED)
fvtable-verify=
Common Joined RejectNegative Enum(vtv_priority) Var(flag_vtable_verify) Init(VTV_NO_PRIORITY)
Validate vtable pointers before using them.
Enum
Name(vtv_priority) Type(enum vtv_priority) UnknownError(unknown vtable verify initialization priority %qs)
EnumValue
Enum(vtv_priority) String(none) Value(VTV_NO_PRIORITY)
EnumValue
Enum(vtv_priority) String(std) Value(VTV_STANDARD_PRIORITY)
EnumValue
Enum(vtv_priority) String(preinit) Value(VTV_PREINIT_PRIORITY)
fvtv-counts
Common Var(flag_vtv_counts)
Output vtable verification counters.
fvtv-debug
Common Var(flag_vtv_debug)
Output vtable verification pointer sets information.
fvpt
Common Report Var(flag_value_profile_transformations) Optimization
Use expression value profiles in optimizations

View file

@ -39,15 +39,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
the GNU userspace magical crtbegin.o file (see crtstuff.c) which
provides part of the support for getting C++ file-scope static
object constructed before entering `main'. */
#if defined HAVE_LD_PIE
#define GNU_USER_TARGET_STARTFILE_SPEC \
"%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
%{fvtable-verify=none:%s; \
fvtable-verify=preinit:vtv_start_preinit.o%s; \
fvtable-verify=std:vtv_start.o%s}"
#else
#define GNU_USER_TARGET_STARTFILE_SPEC \
"%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s} \
%{fvtable-verify=none:%s; \
fvtable-verify=preinit:vtv_start_preinit.o%s; \
fvtable-verify=std:vtv_start.o%s}"
#endif
#undef STARTFILE_SPEC
#define STARTFILE_SPEC GNU_USER_TARGET_STARTFILE_SPEC
@ -59,7 +65,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
GNU userspace "finalizer" file, `crtn.o'. */
#define GNU_USER_TARGET_ENDFILE_SPEC \
"%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
"%{fvtable-verify=none:%s; \
fvtable-verify=preinit:vtv_end_preinit.o%s; \
fvtable-verify=std:vtv_end.o%s} \
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC GNU_USER_TARGET_ENDFILE_SPEC

View file

@ -1,3 +1,35 @@
2013-08-06 Caroline Tice <cmtice@google.com>
* Make-lang.in (*CXX_AND_OBJCXX_OBJS): Add vtable-class-hierarchy.o to
list.
(vtable-class-hierarchy.o): Add build rule.
* cp-tree.h (vtv_start_verification_constructor_init_function): New
extern function decl.
(vtv_finish_verification_constructor_init_function): New extern
function decl.
(build_vtbl_address): New extern function decl.
(get_mangled_vtable_map_var_name): New extern function decl.
(vtv_compute_class_hierarchy_transitive_closure): New extern function
decl.
(vtv_generate_init_routine): New extern function decl.
(vtv_save_class_info): New extern function decl.
(vtv_recover_class_info): New extern function decl.
(vtv_build_vtable_verify_fndecl): New extern function decl.
* class.c (finish_struct_1): Add call to vtv_save_class_info if
flag_vtable_verify is true.
* config-lang.in: Add vtable-class-hierarchy.c to gtfiles list.
* vtable-class-hierarchy.c: New file.
* mangle.c (get_mangled_vtable_map_var_name): New function.
* decl2.c (start_objects): Update function comment.
(cp_write_global_declarations): Call vtv_recover_class_info,
vtv_compute_class_hierarchy_transitive_closure and
vtv_build_vtable_verify_fndecl, before calling
finalize_compilation_unit, and call vtv_generate_init_rount after, IFF
flag_vtable_verify is true.
(vtv_start_verification_constructor_init_function): New function.
(vtv_finish_verification_constructor_init_function): New function.
* init.c (build_vtbl_address): Remove static qualifier from function.
2013-08-06 Jason Merrill <jason@redhat.com>
PR c++/57825

View file

@ -80,7 +80,8 @@ CXX_AND_OBJCXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \
cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o cp/method.o \
cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o cp/optimize.o \
cp/mangle.o cp/cp-objcp-common.o cp/name-lookup.o cp/cxx-pretty-print.o \
cp/cp-gimplify.o cp/cp-array-notation.o cp/lambda.o $(CXX_C_OBJS)
cp/cp-gimplify.o cp/cp-array-notation.o cp/lambda.o \
cp/vtable-class-hierarchy.o $(CXX_C_OBJS)
# Language-specific object files for C++.
CXX_OBJS = cp/cp-lang.o c-family/stub-objc.o $(CXX_AND_OBJCXX_OBJS)
@ -341,7 +342,12 @@ cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_CORE_H) \
c-family/c-objc.h tree-pretty-print.h $(CXX_PARSER_H) $(TIMEVAR_H)
cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) $(C_COMMON_H) \
$(TM_H) coretypes.h pointer-set.h tree-iterator.h $(SPLAY_TREE_H)
cp/vtable-class-hierarchy.o: cp/vtable-class-hierarchy.c \
$(TM_H) $(TIMEVAR_H) $(CXX_TREE_H) intl.h $(CXX_PARSER_H) cp/decl.h \
$(FLAGS_H) $(DIAGNOSTIC_CORE_H) output.h $(CGRAPH_H) c-family/c-common.h \
c-family/c-objc.h $(PLUGIN_H) \
tree-iterator.h vtable-verify.h $(GIMPLE_H) \
gt-cp-vtable-class-hierarchy.h
cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(CXX_TREE_H) $(TIMEVAR_H) gt-cp-name-lookup.h $(PARAMS_H) \
$(DIAGNOSTIC_CORE_H) $(FLAGS_H) debug.h pointer-set.h

View file

@ -6485,6 +6485,9 @@ finish_struct_1 (tree t)
maybe_suppress_debug_info (t);
if (flag_vtable_verify)
vtv_save_class_info (t);
dump_class_hierarchy (t);
/* Finish debugging output for this type. */

View file

@ -29,4 +29,4 @@ compilers="cc1plus\$(exeext)"
target_libs="target-libstdc++-v3"
gtfiles="\$(srcdir)/cp/rtti.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.h \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/c-family/c-lex.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c \$(srcdir)/cp/class.c \$(srcdir)/cp/cp-objcp-common.c \$(srcdir)/cp/cp-lang.c \$(srcdir)/cp/except.c"
gtfiles="\$(srcdir)/cp/rtti.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.h \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-family/c-common.c \$(srcdir)/c-family/c-common.h \$(srcdir)/c-family/c-objc.h \$(srcdir)/c-family/c-lex.c \$(srcdir)/c-family/c-pragma.h \$(srcdir)/c-family/c-pragma.c \$(srcdir)/cp/class.c \$(srcdir)/cp/cp-objcp-common.c \$(srcdir)/cp/cp-lang.c \$(srcdir)/cp/except.c \$(srcdir)/cp/vtable-class-hierarchy.c"

View file

@ -5298,6 +5298,8 @@ extern void note_vague_linkage_fn (tree);
extern tree build_artificial_parm (tree, tree);
extern bool possibly_inlined_p (tree);
extern int parm_index (tree);
extern tree vtv_start_verification_constructor_init_function (void);
extern tree vtv_finish_verification_constructor_init_function (tree);
/* in error.c */
extern void init_error (void);
@ -5388,6 +5390,7 @@ extern tree build_java_class_ref (tree);
extern tree integral_constant_value (tree);
extern tree decl_constant_value_safe (tree);
extern int diagnose_uninitialized_cst_or_ref_member (tree, bool, bool);
extern tree build_vtbl_address (tree);
/* in lex.c */
extern void cxx_dup_lang_specific_decl (tree);
@ -5617,7 +5620,6 @@ extern tree copied_binfo (tree, tree);
extern tree original_binfo (tree, tree);
extern int shared_member_p (tree);
/* The representation of a deferred access check. */
typedef struct GTY(()) deferred_access_check {
@ -6112,6 +6114,7 @@ extern tree mangle_tls_init_fn (tree);
extern tree mangle_tls_wrapper_fn (tree);
extern bool decl_tls_wrapper_p (tree);
extern tree mangle_ref_init_variable (tree);
extern char * get_mangled_vtable_map_var_name (tree);
/* in dump.c */
extern bool cp_dump_tree (void *, tree);
@ -6144,6 +6147,13 @@ extern bool cxx_omp_privatize_by_reference (const_tree);
extern void suggest_alternatives_for (location_t, tree);
extern tree strip_using_decl (tree);
/* in vtable-class-hierarchy.c */
extern void vtv_compute_class_hierarchy_transitive_closure (void);
extern void vtv_generate_init_routine (void);
extern void vtv_save_class_info (tree);
extern void vtv_recover_class_info (void);
extern void vtv_build_vtable_verify_fndecl (void);
/* In cp/cp-array-notations.c */
extern tree expand_array_notation_exprs (tree);
bool cilkplus_an_triplet_types_ok_p (location_t, tree, tree, tree,

View file

@ -3039,7 +3039,8 @@ generate_tls_wrapper (tree fn)
}
/* Start the process of running a particular set of global constructors
or destructors. Subroutine of do_[cd]tors. */
or destructors. Subroutine of do_[cd]tors. Also called from
vtv_start_verification_constructor_init_function. */
static tree
start_objects (int method_type, int initp)
@ -4353,8 +4354,25 @@ cp_write_global_declarations (void)
timevar_stop (TV_PHASE_DEFERRED);
timevar_start (TV_PHASE_OPT_GEN);
if (flag_vtable_verify)
{
vtv_recover_class_info ();
vtv_compute_class_hierarchy_transitive_closure ();
vtv_build_vtable_verify_fndecl ();
}
finalize_compilation_unit ();
if (flag_vtable_verify)
{
/* Generate the special constructor initialization function that
calls __VLTRegisterPairs, and give it a very high
initialization priority. This must be done after
finalize_compilation_unit so that we have accurate
information about which vtable will actually be emitted. */
vtv_generate_init_routine ();
}
timevar_stop (TV_PHASE_OPT_GEN);
timevar_start (TV_PHASE_CHECK_DBGINFO);
@ -4731,4 +4749,23 @@ mark_used (tree decl)
return mark_used (decl, tf_warning_or_error);
}
tree
vtv_start_verification_constructor_init_function (void)
{
return start_objects ('I', MAX_RESERVED_INIT_PRIORITY - 1);
}
tree
vtv_finish_verification_constructor_init_function (tree function_body)
{
tree fn;
finish_compound_stmt (function_body);
fn = finish_function (0);
DECL_STATIC_CONSTRUCTOR (fn) = 1;
decl_init_priority_insert (fn, MAX_RESERVED_INIT_PRIORITY - 1);
return fn;
}
#include "gt-cp-decl2.h"

View file

@ -43,7 +43,6 @@ static tree initializing_context (tree);
static void expand_cleanup_for_base (tree, tree);
static tree dfs_initialize_vtbl_ptrs (tree, void *);
static tree build_field_list (tree, tree, int *);
static tree build_vtbl_address (tree);
static int diagnose_uninitialized_cst_or_ref_member_1 (tree, tree, bool, bool);
/* We are about to generate some complex initialization code.
@ -1098,7 +1097,7 @@ emit_mem_initializers (tree mem_inits)
/* Returns the address of the vtable (i.e., the value that should be
assigned to the vptr) for BINFO. */
static tree
tree
build_vtbl_address (tree binfo)
{
tree binfo_for = binfo;

View file

@ -3888,4 +3888,34 @@ write_java_integer_type_codes (const tree type)
gcc_unreachable ();
}
/* Given a CLASS_TYPE, such as a record for std::bad_exception this
function generates a mangled name for the vtable map variable of
the class type. For example, if the class type is
"std::bad_exception", the mangled name for the class is
"St13bad_exception". This function would generate the name
"_ZN4_VTVISt13bad_exceptionE12__vtable_mapE", which unmangles as:
"_VTV<std::bad_exception>::__vtable_map". */
char *
get_mangled_vtable_map_var_name (tree class_type)
{
char *var_name = NULL;
const char *prefix = "_ZN4_VTVI";
const char *postfix = "E12__vtable_mapE";
gcc_assert (TREE_CODE (class_type) == RECORD_TYPE);
tree class_id = DECL_ASSEMBLER_NAME (TYPE_NAME (class_type));
unsigned int len = strlen (IDENTIFIER_POINTER (class_id)) +
strlen (prefix) +
strlen (postfix) + 1;
var_name = (char *) xmalloc (len);
sprintf (var_name, "%s%s%s", prefix, IDENTIFIER_POINTER (class_id), postfix);
return var_name;
}
#include "gt-cp-mangle.h"

File diff suppressed because it is too large Load diff

View file

@ -191,6 +191,8 @@ in the following sections.
-ftemplate-depth=@var{n} @gol
-fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ @gol
-fno-default-inline -fvisibility-inlines-hidden @gol
-fvtable-verify=@var{std|preinit|none} @gol
-fvtv-counts -fvtv-debug @gol
-fvisibility-ms-compat @gol
-fext-numeric-literals @gol
-Wabi -Wconversion-null -Wctor-dtor-privacy @gol
@ -318,6 +320,7 @@ Objective-C and Objective-C++ Dialects}.
-fdump-tree-sra@r{[}-@var{n}@r{]} @gol
-fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
-fdump-tree-fre@r{[}-@var{n}@r{]} @gol
-fdump-tree-vtable-verify @gol
-fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
-ftree-vectorizer-verbose=@var{n} @gol
-fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
@ -2302,6 +2305,56 @@ and that pointers to function members defined in different shared
objects may not compare equal. When this flag is given, it is a
violation of the ODR to define types with the same name differently.
@item -fvtable-verify=@var{std|preinit|none}
@opindex fvtable-verify
Turn on (or off, if using @option{-fvtable-verify=none}) the security
feature that verifies at runtime, for every virtual call that is made, that
the vtable pointer through which the call is made is valid for the type of
the object, and has not been corrupted or overwritten. If an invalid vtable
pointer is detected (at runtime), an error is reported and execution of the
program is immediately halted.
This option causes runtime data structures to be built, at program start up,
for verifying the vtable pointers. The options @code{std} and @code{preinit}
control the timing of when these data structures are built. In both cases the
data structures are built before execution reaches 'main'. The
@option{-fvtable-verify=std} causes these data structure to be built after the
shared libraries have been loaded and initialized.
@option{-fvtable-verify=preinit} causes them to be built before the shared
libraries have been loaded and initialized.
If this option appears multiple times in the compiler line, with different
values specified, 'none' will take highest priority over both 'std' and
'preinit'; 'preinit' will take priority over 'std'.
@item -fvtv-debug
@opindex (fvtv-debug)
Causes debug versions of the runtime functions for the vtable verification
feature to be called. This assumes the @option{-fvtable-verify=std} or
@option{-fvtable-verify=preinit} has been used. This flag will also cause the
compiler to keep track of which vtable pointers it found for each class, and
record that information in the file ``vtv_set_ptr_data.log'', in the dump
file directory on the user's machine.
Note: This feature APPENDS data to the log file. If you want a fresh log
file, be sure to delete any existing one.
@item -fvtv-counts
@opindex (fvtv-counts)
This is a debugging flag. When used in conjunction with
@option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
causes the compiler to keep track of the total number of virtual calls
it encountered and the number of verifications it inserted. It also
counts the number of calls to certain runtime library functions
that it inserts. This information, for each compilation unit, is written
to a file named ``vtv_count_data.log'', in the dump_file directory on
the user's machine. It also counts the size of the vtable pointer sets
for each class, and writes this information to ``vtv_class_set_sizes.log''
in the same directory.
Note: This feature APPENDS data to the log files. To get a fresh log
files, be sure to delete any existing ones.
@item -fno-weak
@opindex fno-weak
Do not use weak symbol support, even if it is provided by the linker.

View file

@ -191,4 +191,10 @@ enum fp_contract_mode {
FP_CONTRACT_FAST = 2
};
/* flag_vtable_verify initialization levels. */
enum vtv_priority {
VTV_NO_PRIORITY = 0, /* i.E. Do NOT do vtable verification. */
VTV_STANDARD_PRIORITY = 1,
VTV_PREINIT_PRIORITY = 2
};
#endif /* ! GCC_FLAG_TYPES_H */

View file

@ -722,6 +722,16 @@ proper position among the other output files. */
%{!pie:%{!shared:%e-fsanitize=thread linking must be done with -pie or -shared}}}}}"
#endif
/* This is the spec to use, once the code for creating the vtable
verification runtime library, libvtv.so, has been created. Currently
the vtable verification runtime functions are in libstdc++, so we use
the spec just below this one. */
#ifndef VTABLE_VERIFICATION_SPEC
#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}}"
#endif
/* -u* was put back because both BSD and SysV seem to support it. */
/* %{static:} simply prevents an error message if the target machine
doesn't handle -static. */
@ -740,7 +750,7 @@ proper position among the other output files. */
%{flto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*}\
%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
%{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
%{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\

View file

@ -197,6 +197,10 @@ extern void assemble_end_function (tree, const char *);
initial value (that will be done by the caller). */
extern void assemble_variable (tree, int, int, int);
/* Put the vtable verification constructor initialization function
into the preinit array. */
extern void assemble_vtv_preinit_initializer (tree);
/* Compute the alignment of variable specified by DECL.
DONT_OUTPUT_DATA is from assemble_variable. */
extern void align_variable (tree decl, bool dont_output_data);

View file

@ -292,6 +292,7 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_tm_memopt);
NEXT_PASS (pass_tm_edges);
POP_INSERT_PASSES ()
NEXT_PASS (pass_vtable_verify);
NEXT_PASS (pass_lower_vector);
NEXT_PASS (pass_lower_complex_O0);
NEXT_PASS (pass_asan_O0);

View file

@ -255,6 +255,7 @@ DEFTIMEVAR (TV_TREE_UNINIT , "uninit var analysis")
DEFTIMEVAR (TV_PLUGIN_INIT , "plugin initialization")
DEFTIMEVAR (TV_PLUGIN_RUN , "plugin execution")
DEFTIMEVAR (TV_GIMPLE_SLSR , "straight-line strength reduction")
DEFTIMEVAR (TV_VTABLE_VERIFICATION , "vtable verification")
/* Everything else in rest_of_compilation not included above. */
DEFTIMEVAR (TV_EARLY_LOCAL , "early local passes")

View file

@ -439,6 +439,7 @@ extern gimple_opt_pass *make_pass_tm_edges (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_split_functions (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_feedback_split_functions (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_strength_reduction (gcc::context *ctxt);
extern gimple_opt_pass *make_pass_vtable_verify (gcc::context *ctxt);
/* IPA Passes */
extern simple_ipa_opt_pass *make_pass_ipa_lower_emutls (gcc::context *ctxt);

View file

@ -6496,6 +6496,9 @@ is_lang_specific (tree t)
/* In gimple-low.c. */
extern bool block_may_fallthru (const_tree);
/* In vtable-verify.c. */
extern void save_vtable_map_decl (tree);
/* Functional interface to the builtin functions. */
@ -6586,7 +6589,6 @@ builtin_decl_implicit_p (enum built_in_function fncode)
&& builtin_info.implicit_p[uns_fncode]);
}
/* For anonymous aggregate types, we need some sort of name to
hold on to. In practice, this should not appear, but it should
not be harmful if it does. */

View file

@ -2107,7 +2107,31 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
assemble_noswitch_variable (decl, name, sect, align);
else
{
switch_to_section (sect);
/* The following bit of code ensures that vtable_map
variables are not only in the comdat section, but that
each variable has its own unique comdat name. If this
code is removed, the variables end up in the same section
with a single comdat name.
FIXME: resolve_unique_section needs to deal better with
decls with both DECL_SECTION_NAME and DECL_ONE_ONLY. Once
that is fixed, this if-else statement can be replaced with
a single call to "switch_to_section (sect)". */
if (sect->named.name
&& (strcmp (sect->named.name, ".vtable_map_vars") == 0))
{
#if defined (OBJECT_FORMAT_ELF)
targetm.asm_out.named_section (sect->named.name,
sect->named.common.flags
| SECTION_LINKONCE,
DECL_NAME (decl));
in_section = sect;
#else
switch_to_section (sect);
#endif
}
else
switch_to_section (sect);
if (align > BITS_PER_UNIT)
ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (align / BITS_PER_UNIT));
assemble_variable_contents (decl, name, dont_output_data);
@ -2120,6 +2144,23 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
}
}
/* Given a function declaration (FN_DECL), this function assembles the
function into the .preinit_array section. */
void
assemble_vtv_preinit_initializer (tree fn_decl)
{
section *sect;
unsigned flags = SECTION_WRITE;
rtx symbol = XEXP (DECL_RTL (fn_decl), 0);
flags |= SECTION_NOTYPE;
sect = get_section (".preinit_array", flags, fn_decl);
switch_to_section (sect);
assemble_addr_to_section (symbol, sect);
}
/* Return 1 if type TYPE contains any pointers. */
static int
@ -6046,6 +6087,9 @@ default_section_type_flags (tree decl, const char *name, int reloc)
if (decl && DECL_P (decl) && DECL_ONE_ONLY (decl))
flags |= SECTION_LINKONCE;
if (strcmp (name, ".vtable_map_vars") == 0)
flags |= SECTION_LINKONCE;
if (decl && TREE_CODE (decl) == VAR_DECL && DECL_THREAD_LOCAL_P (decl))
flags |= SECTION_TLS | SECTION_WRITE;

793
gcc/vtable-verify.c Normal file
View file

@ -0,0 +1,793 @@
/* Copyright (C) 2013
Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* Virtual Table Pointer Security Pass - Detect corruption of vtable pointers
before using them for virtual method dispatches. */
/* This file is part of the vtable security feature implementation.
The vtable security feature is designed to detect when a virtual
call is about to be made through an invalid vtable pointer
(possibly due to data corruption or malicious attacks). The
compiler finds every virtual call, and inserts a verification call
before the virtual call. The verification call takes the actual
vtable pointer value in the object through which the virtual call
is being made, and compares the vtable pointer against a set of all
valid vtable pointers that the object could contain (this set is
based on the declared type of the object). If the pointer is in
the valid set, execution is allowed to continue; otherwise the
program is halted.
There are several pieces needed in order to make this work: 1. For
every virtual class in the program (i.e. a class that contains
virtual methods), we need to build the set of all possible valid
vtables that an object of that class could point to. This includes
vtables for any class(es) that inherit from the class under
consideration. 2. For every such data set we build up, we need a
way to find and reference the data set. This is complicated by the
fact that the real vtable addresses are not known until runtime,
when the program is loaded into memory, but we need to reference the
sets at compile time when we are inserting verification calls into
the program. 3. We need to find every virtual call in the program,
and insert the verification call (with the appropriate arguments)
before the virtual call. 4. We need some runtime library pieces:
the code to build up the data sets at runtime; the code to actually
perform the verification using the data sets; and some code to set
protections on the data sets, so they themselves do not become
hacker targets.
To find and reference the set of valid vtable pointers for any given
virtual class, we create a special global variable for each virtual
class. We refer to this as the "vtable map variable" for that
class. The vtable map variable has the type "void *", and is
initialized by the compiler to NULL. At runtime when the set of
valid vtable pointers for a virtual class, e.g. class Foo, is built,
the vtable map variable for class Foo is made to point to the set.
During compile time, when the compiler is inserting verification
calls into the program, it passes the vtable map variable for the
appropriate class to the verification call, so that at runtime the
verification call can find the appropriate data set.
The actual set of valid vtable pointers for a virtual class,
e.g. class Foo, cannot be built until runtime, when the vtables get
loaded into memory and their addresses are known. But the knowledge
about which vtables belong in which class' hierarchy is only known
at compile time. Therefore at compile time we collect class
hierarchy and vtable information about every virtual class, and we
generate calls to build up the data sets at runtime. To build the
data sets, we call one of the functions we add to the runtime
library, __VLTRegisterPair. __VLTRegisterPair takes two arguments,
a vtable map variable and the address of a vtable. If the vtable
map variable is currently NULL, it creates a new data set (hash
table), makes the vtable map variable point to the new data set, and
inserts the vtable address into the data set. If the vtable map
variable is not NULL, it just inserts the vtable address into the
data set. In order to make sure that our data sets are built before
any verification calls happen, we create a special constructor
initialization function for each compilation unit, give it a very
high initialization priority, and insert all of our calls to
__VLTRegisterPair into our special constructor initialization
function.
The vtable verification feature is controlled by the flag
'-fvtable-verify='. There are three flavors of this:
'-fvtable-verify=std', '-fvtable-verify=preinit', and
'-fvtable-verify=none'. If the option '-fvtable-verfy=preinit' is
used, then our constructor initialization function gets put into the
preinit array. This is necessary if there are data sets that need
to be built very early in execution. If the constructor
initialization function gets put into the preinit array, the we also
add calls to __VLTChangePermission at the beginning and end of the
function. The call at the beginning sets the permissions on the
data sets and vtable map variables to read/write, and the one at the
end makes them read-only. If the '-fvtable-verify=std' option is
used, the constructor initialization functions are executed at their
normal time, and the __VLTChangePermission calls are handled
differently (see the comments in libstdc++-v3/libsupc++/vtv_rts.cc).
The option '-fvtable-verify=none' turns off vtable verification.
This file contains code for the tree pass that goes through all the
statements in each basic block, looking for virtual calls, and
inserting a call to __VLTVerifyVtablePointer (with appropriate
arguments) before each one. It also contains the hash table
functions for the data structures used for collecting the class
hierarchy data and building/maintaining the vtable map variable data
are defined in gcc/vtable-verify.h. These data structures are
shared with the code in the C++ front end that collects the class
hierarchy & vtable information and generates the vtable map
variables (see cp/vtable-class-hierarchy.c). This tree pass should
run just before the gimple is converted to RTL.
Some implementation details for this pass:
To find all of the virtual calls, we iterate through all the
gimple statements in each basic block, looking for any call
statement with the code "OBJ_TYPE_REF". Once we have found the
virtual call, we need to find the vtable pointer through which the
call is being made, and the type of the object containing the
pointer (to find the appropriate vtable map variable). We then use
these to build a call to __VLTVerifyVtablePointer, passing the
vtable map variable, and the vtable pointer. We insert the
verification call just after the gimple statement that gets the
vtable pointer out of the object, and we update the next
statement to depend on the result returned from
__VLTVerifyVtablePointer (the vtable pointer value), to ensure
subsequent compiler phases don't remove or reorder the call (it's no
good to have the verification occur after the virtual call, for
example). To find the vtable pointer being used (and the type of
the object) we search backwards through the def_stmts chain from the
virtual call (see verify_bb_vtables for more details). */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tree.h"
#include "basic-block.h"
#include "tree-flow.h"
#include "tree-pass.h"
#include "cfgloop.h"
#include "vtable-verify.h"
unsigned num_vtable_map_nodes = 0;
int total_num_virtual_calls = 0;
int total_num_verified_vcalls = 0;
extern GTY(()) tree verify_vtbl_ptr_fndecl;
tree verify_vtbl_ptr_fndecl = NULL_TREE;
/* Keep track of whether or not any virtual call were verified. */
static bool any_verification_calls_generated = false;
unsigned int vtable_verify_main (void);
/* The following few functions are for the vtbl pointer hash table
in the 'registered' field of the struct vtable_map_node. The hash
table keeps track of which vtable pointers have been used in
calls to __VLTRegisterPair with that particular vtable map variable. */
/* This function checks to see if a particular VTABLE_DECL and OFFSET are
already in the 'registered' hash table for NODE. */
bool
vtbl_map_node_registration_find (struct vtbl_map_node *node,
tree vtable_decl,
unsigned offset)
{
struct vtable_registration key;
struct vtable_registration **slot;
gcc_assert (node && node->registered.is_created());
key.vtable_decl = vtable_decl;
slot = (struct vtable_registration **) node->registered.find_slot (&key,
NO_INSERT);
if (slot && (*slot))
{
unsigned i;
for (i = 0; i < ((*slot)->offsets).length(); ++i)
if ((*slot)->offsets[i] == offset)
return true;
}
return false;
}
/* This function inserts VTABLE_DECL and OFFSET into the 'registered'
hash table for NODE. It returns a boolean indicating whether or not
it actually inserted anything. */
bool
vtbl_map_node_registration_insert (struct vtbl_map_node *node,
tree vtable_decl,
unsigned offset)
{
struct vtable_registration key;
struct vtable_registration **slot;
bool inserted_something = false;
if (!node || !node->registered.is_created())
return false;
key.vtable_decl = vtable_decl;
slot = (struct vtable_registration **) node->registered.find_slot (&key,
INSERT);
if (! *slot)
{
struct vtable_registration *node;
node = XNEW (struct vtable_registration);
node->vtable_decl = vtable_decl;
(node->offsets).create (10);
(node->offsets).safe_push (offset);
*slot = node;
inserted_something = true;
}
else
{
/* We found the vtable_decl slot; we need to see if it already
contains the offset. If not, we need to add the offset. */
unsigned i;
bool found = false;
for (i = 0; i < ((*slot)->offsets).length() && !found; ++i)
if ((*slot)->offsets[i] == offset)
found = true;
if (!found)
{
((*slot)->offsets).safe_push (offset);
inserted_something = true;
}
}
return inserted_something;
}
/* Hashtable functions for vtable_registration hashtables. */
inline hashval_t
registration_hasher::hash (const value_type *p)
{
const struct vtable_registration *n = (const struct vtable_registration *) p;
return (hashval_t) (DECL_UID (n->vtable_decl));
}
inline bool
registration_hasher::equal (const value_type *p1, const compare_type *p2)
{
const struct vtable_registration *n1 =
(const struct vtable_registration *) p1;
const struct vtable_registration *n2 =
(const struct vtable_registration *) p2;
return (DECL_UID (n1->vtable_decl) == DECL_UID (n2->vtable_decl));
}
/* End of hashtable functions for "registered" hashtables. */
/* Hashtable definition and functions for vtbl_map_hash. */
struct vtbl_map_hasher : typed_noop_remove <struct vtbl_map_node>
{
typedef struct vtbl_map_node value_type;
typedef struct vtbl_map_node compare_type;
static inline hashval_t hash (const value_type *);
static inline bool equal (const value_type *, const compare_type *);
};
/* Returns a hash code for P. */
inline hashval_t
vtbl_map_hasher::hash (const value_type *p)
{
const struct vtbl_map_node n = *((const struct vtbl_map_node *) p);
return (hashval_t) IDENTIFIER_HASH_VALUE (n.class_name);
}
/* Returns nonzero if P1 and P2 are equal. */
inline bool
vtbl_map_hasher::equal (const value_type *p1, const compare_type *p2)
{
const struct vtbl_map_node n1 = *((const struct vtbl_map_node *) p1);
const struct vtbl_map_node n2 = *((const struct vtbl_map_node *) p2);
return (IDENTIFIER_HASH_VALUE (n1.class_name) ==
IDENTIFIER_HASH_VALUE (n2.class_name));
}
/* Here are the two structures into which we insert vtable map nodes.
We use two data structures because of the vastly different ways we need
to find the nodes for various tasks (see comments in vtable-verify.h
for more details. */
typedef hash_table <vtbl_map_hasher> vtbl_map_table_type;
typedef vtbl_map_table_type::iterator vtbl_map_iterator_type;
/* Vtable map variable nodes stored in a hash table. */
static vtbl_map_table_type vtbl_map_hash;
/* Vtable map variable nodes stored in a vector. */
vec<struct vtbl_map_node *> vtbl_map_nodes_vec;
/* Return vtbl_map node for CLASS_NAME without creating a new one. */
struct vtbl_map_node *
vtbl_map_get_node (tree class_type)
{
struct vtbl_map_node key;
struct vtbl_map_node **slot;
tree class_type_decl;
tree class_name;
unsigned int type_quals;
if (!vtbl_map_hash.is_created())
return NULL;
gcc_assert (TREE_CODE (class_type) == RECORD_TYPE);
/* Find the TYPE_DECL for the class. */
class_type_decl = TYPE_NAME (class_type);
/* Verify that there aren't any qualifiers on the type. */
type_quals = TYPE_QUALS (TREE_TYPE (class_type_decl));
gcc_assert (type_quals == TYPE_UNQUALIFIED);
/* Get the mangled name for the unqualified type. */
gcc_assert (HAS_DECL_ASSEMBLER_NAME_P (class_type_decl));
class_name = DECL_ASSEMBLER_NAME (class_type_decl);
key.class_name = class_name;
slot = (struct vtbl_map_node **) vtbl_map_hash.find_slot (&key,
NO_INSERT);
if (!slot)
return NULL;
return *slot;
}
/* Return vtbl_map node assigned to BASE_CLASS_TYPE. Create new one
when needed. */
struct vtbl_map_node *
find_or_create_vtbl_map_node (tree base_class_type)
{
struct vtbl_map_node key;
struct vtbl_map_node *node;
struct vtbl_map_node **slot;
tree class_type_decl;
unsigned int type_quals;
if (!vtbl_map_hash.is_created())
vtbl_map_hash.create (10);
/* Find the TYPE_DECL for the class. */
class_type_decl = TYPE_NAME (base_class_type);
/* Verify that there aren't any type qualifiers on type. */
type_quals = TYPE_QUALS (TREE_TYPE (class_type_decl));
gcc_assert (type_quals == TYPE_UNQUALIFIED);
gcc_assert (HAS_DECL_ASSEMBLER_NAME_P (class_type_decl));
key.class_name = DECL_ASSEMBLER_NAME (class_type_decl);
slot = (struct vtbl_map_node **) vtbl_map_hash.find_slot (&key,
INSERT);
if (*slot)
return *slot;
node = XNEW (struct vtbl_map_node);
node->vtbl_map_decl = NULL_TREE;
node->class_name = key.class_name;
node->uid = num_vtable_map_nodes++;
node->class_info = XNEW (struct vtv_graph_node);
node->class_info->class_type = base_class_type;
node->class_info->class_uid = node->uid;
node->class_info->num_processed_children = 0;
(node->class_info->parents).create (4);
(node->class_info->children).create (4);
node->registered.create (16);
node->is_used = false;
vtbl_map_nodes_vec.safe_push (node);
gcc_assert (vtbl_map_nodes_vec[node->uid] == node);
*slot = node;
return node;
}
/* End of hashtable functions for vtable_map variables hash table. */
/* Given a gimple STMT, this function checks to see if the statement
is an assignment, the rhs of which is getting the vtable pointer
value out of an object. (i.e. it's the value we need to verify
because its the vtable pointer that will be used for a virtual
call). */
static bool
is_vtable_assignment_stmt (gimple stmt)
{
if (gimple_code (stmt) != GIMPLE_ASSIGN)
return false;
else
{
tree lhs = gimple_assign_lhs (stmt);
tree rhs = gimple_assign_rhs1 (stmt);
if (TREE_CODE (lhs) != SSA_NAME)
return false;
if (TREE_CODE (rhs) != COMPONENT_REF)
return false;
if (! (TREE_OPERAND (rhs, 1))
|| (TREE_CODE (TREE_OPERAND (rhs, 1)) != FIELD_DECL))
return false;
if (! DECL_VIRTUAL_P (TREE_OPERAND (rhs, 1)))
return false;
}
return true;
}
/* This function attempts to recover the declared class of an object
that is used in making a virtual call. We try to get the type from
the type cast in the gimple assignment statement that extracts the
vtable pointer from the object (DEF_STMT). The gimple statement
usually looks something like this:
D.2201_4 = MEM[(struct Event *)this_1(D)]._vptr.Event */
static tree
extract_object_class_type (tree rhs)
{
tree result = NULL_TREE;
/* Try to find and extract the type cast from that stmt. */
if (TREE_CODE (rhs) == COMPONENT_REF)
{
tree op0 = TREE_OPERAND (rhs, 0);
tree op1 = TREE_OPERAND (rhs, 1);
if (TREE_CODE (op1) == FIELD_DECL
&& DECL_VIRTUAL_P (op1))
{
if (TREE_CODE (op0) == COMPONENT_REF
&& TREE_CODE (TREE_OPERAND (op0, 0)) == MEM_REF
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (op0, 0)))== RECORD_TYPE)
result = TREE_TYPE (TREE_OPERAND (op0, 0));
else
result = TREE_TYPE (op0);
}
else if (TREE_CODE (op0) == COMPONENT_REF)
{
result = extract_object_class_type (op0);
if (result == NULL_TREE
&& TREE_CODE (op1) == COMPONENT_REF)
result = extract_object_class_type (op1);
}
}
return result;
}
/* This function traces forward through the def-use chain of an SSA
variable to see if it ever gets used in a virtual function call. It
returns a boolean indicating whether or not it found a virtual call in
the use chain. */
static bool
var_is_used_for_virtual_call_p (tree lhs, int *mem_ref_depth)
{
imm_use_iterator imm_iter;
bool found_vcall = false;
use_operand_p use_p;
if (TREE_CODE (lhs) != SSA_NAME)
return false;
if (*mem_ref_depth > 2)
return false;
/* Iterate through the immediate uses of the current variable. If
it's a virtual function call, we're done. Otherwise, if there's
an LHS for the use stmt, add the ssa var to the work list
(assuming it's not already in the list and is not a variable
we've already examined. */
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, lhs)
{
gimple stmt2 = USE_STMT (use_p);
if (gimple_code (stmt2) == GIMPLE_CALL)
{
tree fncall = gimple_call_fn (stmt2);
if (TREE_CODE (fncall) == OBJ_TYPE_REF)
found_vcall = true;
else
return false;
}
else if (gimple_code (stmt2) == GIMPLE_PHI)
{
found_vcall = var_is_used_for_virtual_call_p
(gimple_phi_result (stmt2),
mem_ref_depth);
}
else if (gimple_code (stmt2) == GIMPLE_ASSIGN)
{
tree rhs = gimple_assign_rhs1 (stmt2);
if (TREE_CODE (rhs) == ADDR_EXPR
|| TREE_CODE (rhs) == MEM_REF)
*mem_ref_depth = *mem_ref_depth + 1;
if (TREE_CODE (rhs) == COMPONENT_REF)
{
while (TREE_CODE (TREE_OPERAND (rhs, 0)) == COMPONENT_REF)
rhs = TREE_OPERAND (rhs, 0);
if (TREE_CODE (TREE_OPERAND (rhs, 0)) == ADDR_EXPR
|| TREE_CODE (TREE_OPERAND (rhs, 0)) == MEM_REF)
*mem_ref_depth = *mem_ref_depth + 1;
}
if (*mem_ref_depth < 3)
found_vcall = var_is_used_for_virtual_call_p
(gimple_assign_lhs (stmt2),
mem_ref_depth);
}
else
break;
if (found_vcall)
return true;
}
return false;
}
/* Search through all the statements in a basic block (BB), searching
for virtual method calls. For each virtual method dispatch, find
the vptr value used, and the statically declared type of the
object; retrieve the vtable map variable for the type of the
object; generate a call to __VLTVerifyVtablePointer; and insert the
generated call into the basic block, after the point where the vptr
value is gotten out of the object and before the virtual method
dispatch. Make the virtual method dispatch depend on the return
value from the verification call, so that subsequent optimizations
cannot reorder the two calls. */
static void
verify_bb_vtables (basic_block bb)
{
gimple_seq stmts;
gimple stmt = NULL;
gimple_stmt_iterator gsi_vtbl_assign;
gimple_stmt_iterator gsi_virtual_call;
stmts = bb_seq (bb);
gsi_virtual_call = gsi_start (stmts);
for (; !gsi_end_p (gsi_virtual_call); gsi_next (&gsi_virtual_call))
{
stmt = gsi_stmt (gsi_virtual_call);
/* Count virtual calls. */
if (gimple_code (stmt) == GIMPLE_CALL)
{
tree fncall = gimple_call_fn (stmt);
if (TREE_CODE (fncall) == OBJ_TYPE_REF)
total_num_virtual_calls++;
}
if (is_vtable_assignment_stmt (stmt))
{
tree lhs = gimple_assign_lhs (stmt);
tree vtbl_var_decl = NULL_TREE;
struct vtbl_map_node *vtable_map_node;
tree vtbl_decl = NULL_TREE;
gimple call_stmt;
const char *vtable_name = "<unknown>";
tree tmp0;
bool found;
int mem_ref_depth = 0;
/* Make sure this vptr field access is for a virtual call. */
if (!var_is_used_for_virtual_call_p (lhs, &mem_ref_depth))
continue;
/* Now we have found the virtual method dispatch and
the preceding access of the _vptr.* field... Next
we need to find the statically declared type of
the object, so we can find and use the right
vtable map variable in the verification call. */
tree class_type = extract_object_class_type
(gimple_assign_rhs1 (stmt));
gsi_vtbl_assign = gsi_for_stmt (stmt);
if (class_type
&& (TREE_CODE (class_type) == RECORD_TYPE)
&& TYPE_BINFO (class_type))
{
/* Get the vtable VAR_DECL for the type. */
vtbl_var_decl = BINFO_VTABLE (TYPE_BINFO (class_type));
if (TREE_CODE (vtbl_var_decl) == POINTER_PLUS_EXPR)
vtbl_var_decl = TREE_OPERAND (TREE_OPERAND (vtbl_var_decl, 0),
0);
gcc_assert (vtbl_var_decl);
vtbl_decl = vtbl_var_decl;
vtable_map_node = vtbl_map_get_node
(TYPE_MAIN_VARIANT (class_type));
gcc_assert (verify_vtbl_ptr_fndecl);
/* Given the vtable pointer for the base class of the
object, build the call to __VLTVerifyVtablePointer to
verify that the object's vtable pointer (contained in
lhs) is in the set of valid vtable pointers for the
base class. */
if (vtable_map_node && vtable_map_node->vtbl_map_decl)
{
use_operand_p use_p;
ssa_op_iter iter;
vtable_map_node->is_used = true;
vtbl_var_decl = vtable_map_node->vtbl_map_decl;
if (TREE_CODE (vtbl_decl) == VAR_DECL)
vtable_name = IDENTIFIER_POINTER (DECL_NAME (vtbl_decl));
/* Call different routines if we are interested in
trace information to debug problems. */
if (flag_vtv_debug)
{
int len1 = IDENTIFIER_LENGTH
(DECL_NAME (vtbl_var_decl));
int len2 = strlen (vtable_name);
call_stmt = gimple_build_call
(verify_vtbl_ptr_fndecl, 4,
build1 (ADDR_EXPR,
TYPE_POINTER_TO
(TREE_TYPE (vtbl_var_decl)),
vtbl_var_decl),
lhs,
build_string_literal
(len1 + 1,
IDENTIFIER_POINTER
(DECL_NAME
(vtbl_var_decl))),
build_string_literal (len2 + 1,
vtable_name));
}
else
call_stmt = gimple_build_call
(verify_vtbl_ptr_fndecl, 2,
build1 (ADDR_EXPR,
TYPE_POINTER_TO
(TREE_TYPE (vtbl_var_decl)),
vtbl_var_decl),
lhs);
/* Create a new SSA_NAME var to hold the call's
return value, and make the call_stmt use the
variable for that purpose. */
tmp0 = make_temp_ssa_name (TREE_TYPE (lhs), NULL, "VTV");
gimple_call_set_lhs (call_stmt, tmp0);
update_stmt (call_stmt);
/* Find the next stmt, after the vptr assignment
statememt, which should use the result of the
vptr assignment statement value. */
gsi_next (&gsi_vtbl_assign);
gimple next_stmt = gsi_stmt (gsi_vtbl_assign);
if (!next_stmt)
return;
/* Find any/all uses of 'lhs' in next_stmt, and
replace them with 'tmp0'. */
found = false;
FOR_EACH_PHI_OR_STMT_USE (use_p, next_stmt, iter,
SSA_OP_ALL_USES)
{
tree op = USE_FROM_PTR (use_p);
if (op == lhs)
{
SET_USE (use_p, tmp0);
found = true;
}
}
update_stmt (next_stmt);
gcc_assert (found);
/* Insert the new verification call just after the
statement that gets the vtable pointer out of the
object. */
gsi_vtbl_assign = gsi_for_stmt (stmt);
gsi_insert_after (&gsi_vtbl_assign, call_stmt,
GSI_NEW_STMT);
any_verification_calls_generated = true;
total_num_verified_vcalls++;
}
}
}
}
}
/* Main function, called from pass->excute(). Loop through all the
basic blocks in the current function, passing them to
verify_bb_vtables, which searches for virtual calls, and inserts
calls to __VLTVerifyVtablePointer. */
unsigned int
vtable_verify_main (void)
{
unsigned int ret = 1;
basic_block bb;
FOR_ALL_BB (bb)
verify_bb_vtables (bb);
return ret;
}
/* Gate function for the pass. */
static bool
gate_tree_vtable_verify (void)
{
return (flag_vtable_verify);
}
/* Definition of this optimization pass. */
namespace {
const pass_data pass_data_vtable_verify =
{
GIMPLE_PASS, /* type */
"vtable-verify", /* name */
OPTGROUP_NONE, /* optinfo_flags */
true, /* has_gate */
true, /* has_execute */
TV_VTABLE_VERIFICATION, /* tv_id */
( PROP_cfg | PROP_ssa ), /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_update_ssa, /* todo_flags_finish */
};
class pass_vtable_verify : public gimple_opt_pass
{
public:
pass_vtable_verify(gcc::context *ctxt)
: gimple_opt_pass(pass_data_vtable_verify, ctxt)
{}
/* opt_pass methods: */
bool gate () { return gate_tree_vtable_verify (); }
unsigned int execute () { return vtable_verify_main (); }
}; // class pass_vtable_verify
} // anon namespace
gimple_opt_pass *
make_pass_vtable_verify (gcc::context *ctxt)
{
return new pass_vtable_verify (ctxt);
}
#include "gt-vtable-verify.h"

141
gcc/vtable-verify.h Normal file
View file

@ -0,0 +1,141 @@
/* Copyright (C) 2013
Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* Virtual Table Pointer Security. */
#ifndef VTABLE_VERIFY_H
#define VTABLE_VERIFY_H
#include "sbitmap.h"
#include "hash-table.h"
/* The function decl used to create calls to __VLTVtableVerify. It must
be global because it needs to be initialized in the C++ front end, but
used in the middle end (in the vtable verification pass). */
extern tree verify_vtbl_ptr_fndecl;
/* Global variable keeping track of how many vtable map variables we
have created. */
extern unsigned num_vtable_map_nodes;
/* Keep track of how many virtual calls we are actually verifying. */
extern int total_num_virtual_calls;
extern int total_num_verified_vcalls;
/* Each vtable map variable corresponds to a virtual class. Each
vtable map variable has a hash table associated with it, that keeps
track of the vtable pointers for which we have generated a call to
__VLTRegisterPair (with the current vtable map variable). This is
the hash table node that is used for each entry in this hash table
of vtable pointers.
Sometimes there are multiple valid vtable pointer entries that use
the same vtable pointer decl with different offsets. Therefore,
for each vtable pointer in the hash table, there is also an array
of offsets used with that vtable. */
struct vtable_registration
{
tree vtable_decl; /* The var decl of the vtable. */
vec<unsigned> offsets; /* The offsets array. */
};
struct registration_hasher : typed_noop_remove <struct vtable_registration>
{
typedef struct vtable_registration value_type;
typedef struct vtable_registration compare_type;
static inline hashval_t hash (const value_type *);
static inline bool equal (const value_type *, const compare_type *);
};
typedef hash_table <registration_hasher> register_table_type;
typedef register_table_type::iterator registration_iterator_type;
/* This struct is used to represent the class hierarchy information
that we need. Each vtable map variable has an associated class
hierarchy node (struct vtv_graph_node). Note: In this struct,
'children' means immediate descendants in the class hierarchy;
'descendant' means any descendant however many levels deep. */
struct vtv_graph_node {
tree class_type; /* The record_type of the class. */
unsigned class_uid; /* A unique, monotonically
ascending id for class node.
Each vtable map node also has
an id. The class uid is the
same as the vtable map node id
for nodes corresponding to the
same class. */
unsigned num_processed_children; /* # of children for whom we have
computed the class hierarchy
transitive closure. */
vec<struct vtv_graph_node *> parents; /* Vector of parents in the graph. */
vec<struct vtv_graph_node *> children; /* Vector of children in the graph.*/
sbitmap descendants; /* Bitmap representing all this node's
descendants in the graph. */
};
/* This is the node used for our hashtable of vtable map variable
information. When we create a vtable map variable (var decl) we
put it into one of these nodes; create a corresponding
vtv_graph_node for our class hierarchy info and store that in this
node; generate a unique (monotonically ascending) id for both the
vtbl_map_node and the vtv_graph_node; and insert the node into two
data structures (to make it easy to find in several different
ways): 1). A hash table ("vtbl_map_hash" in vtable-verify.c).
This gives us an easy way to check to see if we already have a node
for the vtable map variable or not; and 2). An array (vector) of
vtbl_map_nodes, where the array index corresponds to the unique id
of the vtbl_map_node, which gives us an easy way to use bitmaps to
represent and find the vtable map nodes. */
struct vtbl_map_node {
tree vtbl_map_decl; /* The var decl for the vtable map
variable. */
tree class_name; /* The DECL_ASSEMBLER_NAME of the
class. */
struct vtv_graph_node *class_info; /* Our class hierarchy info for the
class. */
unsigned uid; /* The unique id for the vtable map
variable. */
struct vtbl_map_node *next, *prev; /* Pointers for the linked list
structure. */
register_table_type registered; /* Hashtable of vtable pointers for which
we have generated a _VLTRegisterPair
call with this vtable map variable. */
bool is_used; /* Boolean indicating if we used this vtable map
variable in a call to __VLTVerifyVtablePointer. */
};
/* Controls debugging for vtable verification. */
extern bool vtv_debug;
/* The global vector of vtbl_map_nodes. */
extern vec<struct vtbl_map_node *> vtbl_map_nodes_vec;
extern struct vtbl_map_node *vtbl_map_get_node (tree);
extern struct vtbl_map_node *find_or_create_vtbl_map_node (tree);
extern void vtbl_map_node_class_insert (struct vtbl_map_node *, unsigned);
extern bool vtbl_map_node_registration_find (struct vtbl_map_node *,
tree, unsigned);
extern bool vtbl_map_node_registration_insert (struct vtbl_map_node *,
tree, unsigned);
#endif /* VTABLE_VERIFY_H */

View file

@ -1,3 +1,7 @@
2013-08-02 Caroline Tice <cmtice@google.com>
* vtv-change-permission.h: New file.
2013-04-03 Jason Merrill <jason@redhat.com>
Demangle C++11 ref-qualifier.

View file

@ -0,0 +1,55 @@
/* Copyright (C) 2013
Free Software Foundation
This file is part of GCC.
modify it under the terms of the GNU Library General Public License
as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
In addition to the permissions in the GNU Library General Public
License, the Free Software Foundation gives you unlimited
permission to link the compiled version of this file into
combinations with other programs, and to distribute those
combinations without any restriction coming from the use of this
file. (The Library Public License restrictions do apply in other
respects; for example, they cover modification of the file, and
distribution when not linked into a combined executable.)
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
#ifndef __VTV_H__
#define __VTV_H__
/* We could have used an enumeration here but it just makes it more
difficult for the compiler to generate a call to this. These are
used as arguments to the function __VLTChangePermission, declared
below. */
#define __VLTP_READ_ONLY 0
#define __VLTP_READ_WRITE 1
#ifdef __cplusplus
extern "C" void __VLTChangePermission (int);
#else
extern void __VLTChangePermission (int);
#endif
#ifdef BIG_PAGE_SIZE
/* TODO - Replace '4096' below with correct big page size. */
#define VTV_PAGE_SIZE 4096
#else
#define VTV_PAGE_SIZE 4096
#endif
#endif /* __VTV_H__ */

View file

@ -1,3 +1,16 @@
2013-08-06 Caroline Tice <cmtice@google.com>
config.host (extra_parts): Add vtv_start.o, vtv_end.o
vtv_start_preinit.o and vtv_end_preinit.o.
configure.ac: Add code to check/set enable_vtable_verify.
Makefile.in: Add rules to build vtv_*.o, if enable_vtable_verify is
true.
vtv_start_preinit.c: New file.
vtv_end_preinit.c: New file.
vtv_start.c: New file.
vtv_end.c: New file.
configure: Regenerated.
2013-08-01 Maxim Kuvyrkov <maxim@kugelworks.com>
* config/aarch64/sfp-machine.h, config/aarch64/sync-cache.c,

View file

@ -39,6 +39,7 @@ enable_shared = @enable_shared@
double_type_size = @double_type_size@
long_double_type_size = @long_double_type_size@
decimal_float = @decimal_float@
enable_vtable_verify = @enable_vtable_verify@
enable_decimal_float = @enable_decimal_float@
fixed_point = @fixed_point@
@ -971,6 +972,22 @@ crtendS$(objext): $(srcdir)/crtstuff.c
# This is a version of crtbegin for -static links.
crtbeginT$(objext): $(srcdir)/crtstuff.c
$(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN -DCRTSTUFFT_O
ifeq ($(enable_vtable_verify),yes)
# These are used in vtable verification; see comments in source files for
# more details.
vtv_start$(objext): $(srcdir)/vtv_start.c
$(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $(srcdir)/vtv_start.c
vtv_end$(objext): $(srcdir)/vtv_end.c
$(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $(srcdir)/vtv_end.c
vtv_start_preinit$(objext): $(srcdir)/vtv_start_preinit.c
$(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $(srcdir)/vtv_start_preinit.c
vtv_end_preinit$(objext): $(srcdir)/vtv_end_preinit.c
$(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $(srcdir)/vtv_end_preinit.c
endif
endif
ifeq ($(CUSTOM_CRTIN),)

View file

@ -197,7 +197,7 @@ case ${host} in
;;
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o"
;;
*-*-lynxos*)
tmake_file="$tmake_file t-lynx $cpu_type/t-crtstuff t-crtstuff-pic t-libgcc-pic"

16
libgcc/configure vendored
View file

@ -608,6 +608,7 @@ build_os
build_vendor
build_cpu
build
enable_vtable_verify
enable_shared
libgcc_topdir
target_alias
@ -655,6 +656,7 @@ with_target_subdir
with_cross_host
with_ld
enable_shared
enable_vtable_verify
enable_version_specific_runtime_libs
with_slibdir
enable_maintainer_mode
@ -1288,6 +1290,7 @@ Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-shared don't provide a shared libgcc
--enable-vtable-verify Enable vtable verification feature
--enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory
--enable-maintainer-mode
enable make rules and dependencies not useful (and
@ -2140,6 +2143,19 @@ fi
# Check whether --enable-vtable-verify was given.
if test "${enable_vtable_verify+set}" = set; then :
enableval=$enable_vtable_verify; case "$enableval" in
yes) enable_vtable_verify=yes ;;
no) enable_vtable_verify=no ;;
*) enable_vtable_verify=no;;
esac
else
enable_vtable_verify=no
fi
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5

View file

@ -66,6 +66,16 @@ AC_ARG_ENABLE(shared,
], [enable_shared=yes])
AC_SUBST(enable_shared)
AC_ARG_ENABLE(vtable-verify,
[ --enable-vtable-verify Enable vtable verification feature ],
[case "$enableval" in
yes) enable_vtable_verify=yes ;;
no) enable_vtable_verify=no ;;
*) enable_vtable_verify=no;;
esac],
[enable_vtable_verify=no])
AC_SUBST(enable_vtable_verify)
GCC_PICFLAG
AC_SUBST(PICFLAG)

66
libgcc/vtv_end.c Normal file
View file

@ -0,0 +1,66 @@
/* Copyright (C) 2012, 2013
Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
/* This file is part of the vtable verification feature (for a
detailed description of the feature, see comments in
vtable-verify.c). The vtable verification feature creates
certain global symbols that need to be read-write sometimes during
program execution, and read-only at others. It uses 'mprotect' to
change the memory protections of the pages on which these variables
are stored. In order to not affect the protections of other
program variables, these variables are put into a special named
section, ".vtable_map_vars", which is page-aligned at the start,
and which is padded with a page-sized amount of zeros at the end.
To make this section page aligned, we create a special symbol,
"_vtable_map_vars_start" which we make the very first thing that
goes into the section. That is defined in vtv_start.c (which
contains nothing else). vtv_start.c gest compiled into
vtv_start.o, and vtv_start.o gets inserted into the link line
immediately after crtbegin.o, if the program is compiled with
-fvtable.verify.
In order to pad the ".vtable_map_vars" section with a page-sized
amount of zeros at the end, there is a second symbol,
_vtable_map_vars_end. This file defines that symbol (and only this
symbol). This second symbol is a page-sized array of chars,
zero-filled, and is the very last thing to go into the section.
When the GCC driver inserts vtv_start.o into the link line (just
after crtbegin.o) it also inserts vtv_end.o into the link line,
just before crtend.o. This has the desired effect of making our
section page-aligned and page-size paded, ensuring that no other
program data lands on our pages. */
#include "vtv-change-permission.h"
__attribute__ ((constructor(100))) void
__VLTprotect (void)
{
__VLTChangePermission (__VLTP_READ_ONLY);
}
/* Page-sized variable to mark end of .vtable_map_vars section. */
char _vtable_map_vars_end[VTV_PAGE_SIZE]
__attribute__ ((__visibility__ ("protected"), used,
section(".vtable_map_vars")));

71
libgcc/vtv_end_preinit.c Normal file
View file

@ -0,0 +1,71 @@
/* Copyright (C) 2012, 2013
Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
/* This file is part of the vtable verification feature (for a
detailed description of the feature, see comments in
vtable-verify.c). The vtable verification feature creates
certain global symbols that need to be read-write sometimes during
program execution, and read-only at others. It uses 'mprotect' to
change the memory protections of the pages on which these variables
are stored. In order to not affect the protections of other
program variables, these variables are put into a special named
section, ".vtable_map_vars", which is page-aligned at the start,
and which is padded with a page-sized amount of zeros at the end.
To make this section page aligned, we create a special symbol,
"_vtable_map_vars_start" which we make the very first thing that
goes into the section. That is defined in vtv_start.c (which
contains nothing else). vtv_start.c gest compiled into
vtv_start.o, and vtv_start.o gets inserted into the link line
immediately after crtbegin.o, if the program is compiled with
-fvtable.verify.
In order to pad the ".vtable_map_vars" section with a page-sized
amount of zeros at the end, there is a second symbol,
_vtable_map_vars_end. This file defines that symbol (and only this
symbol). This second symbol is a page-sized array of chars,
zero-filled, and is the very last thing to go into the section.
When the GCC driver inserts vtv_start.o into the link line (just
after crtbegin.o) it also inserts vtv_end.o into the link line,
just before crtend.o. This has the desired effect of making our
section page-aligned and page-size paded, ensuring that no other
program data lands on our pages. */
#include "vtv-change-permission.h"
void
__VLTProtectPreinit (void)
{
__VLTChangePermission (__VLTP_READ_ONLY);
}
/* Page-sized variable to mark end of .vtable_map_vars section. */
char _vtable_map_vars_end[VTV_PAGE_SIZE]
__attribute__ ((__visibility__ ("protected"), used,
section(".vtable_map_vars")));
/* Put the function __VLTProtectPreinit into the .preinit_array
section. */
__attribute__ ((section (".preinit_array")))
typeof (__VLTProtectPreinit) *__preinit_end = __VLTProtectPreinit;

65
libgcc/vtv_start.c Normal file
View file

@ -0,0 +1,65 @@
/* Copyright (C) 2012, 2013
Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
/* This file is part of the vtable verification feature (for a
detailed description of the feature, see comments in
vtable-verify.c). The vtable verification feature creates
certain global symbols that need to be read-write sometimes during
program execution, and read-only at others. It uses 'mprotect' to
change the memory protections of the pages on which these variables
are stored. In order to not affect the protections of other
program variables, these variables are put into a special named
section, ".vtable_map_vars", which is page-aligned at the start,
and which is padded with a page-sized amount of zeros at the end.
To make this section page aligned, we create a special symbol,
"_vtable_map_vars_start" which we make the very first thing that
goes into the section. This file defines that symbol (and only
that symbol). GCC compiles this file into vtv_start.o, and
inserts vtv_start.o into the link line immediately after
crtbegin.o, if the program is compiled with -fvtable.verify.
In order to pad the ".vtable_map_vars" section with a page-sized
amount of zeros at the end, there is a second symbol,
_vtable_map_vars_end, which is defined in another file, vtv_end.c.
This second symbol is a page-sized array of chars, zero-filled, and
is the very last thing to go into the section. When the GCC driver
inserts vtv_start.o into the link line (just after crtbegin.o) it
also inserts vtv_end.o into the link line, just before crtend.o.
This has the desired effect of making our section page-aligned and
page-size paded, ensuring that no other program data lands on our
pages. */
#include "vtv-change-permission.h"
__attribute__ ((constructor(98))) void
__VLTunprotect (void)
{
__VLTChangePermission (__VLTP_READ_WRITE);
}
/* Page-aligned symbol to mark beginning of .vtable_map_vars section. */
char _vtable_map_vars_start []
__attribute__ ((__visibility__ ("protected"), used, aligned(VTV_PAGE_SIZE),
section(".vtable_map_vars")))
= { };

View file

@ -0,0 +1,73 @@
/* Copyright (C) 2012, 2013
Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
Under Section 7 of GPL version 3, you are granted additional
permissions described in the GCC Runtime Library Exception, version
3.1, as published by the Free Software Foundation.
You should have received a copy of the GNU General Public License and
a copy of the GCC Runtime Library Exception along with this program;
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
/* This file is part of the vtable verification feature (for a
detailed description of the feature, see comments in
vtable-verify.c). The vtable verification feature creates
certain global symbols that need to be read-write sometimes during
program execution, and read-only at others. It uses 'mprotect' to
change the memory protections of the pages on which these variables
are stored. In order to not affect the protections of other
program variables, these variables are put into a special named
section, ".vtable_map_vars", which is page-aligned at the start,
and which is padded with a page-sized amount of zeros at the end.
To make this section page aligned, we create a special symbol,
"_vtable_map_vars_start" which we make the very first thing that
goes into the section. This file defines that symbol (and only
that symbol). GCC compiles this file into vtv_start.o, and
inserts vtv_start.o into the link line immediately after
crtbegin.o, if the program is compiled with -fvtable.verify.
In order to pad the ".vtable_map_vars" section with a page-sized
amount of zeros at the end, there is a second symbol,
_vtable_map_vars_end, which is defined in another file, vtv_end.c.
This second symbol is a page-sized array of chars, zero-filled, and
is the very last thing to go into the section. When the GCC driver
inserts vtv_start.o into the link line (just after crtbegin.o) it
also inserts vtv_end.o into the link line, just before crtend.o.
This has the desired effect of making our section page-aligned and
page-size paded, ensuring that no other program data lands on our
pages. */
#include "vtv-change-permission.h"
void
__VLTUnprotectPreinit (void)
{
__VLTChangePermission (__VLTP_READ_WRITE);
}
/* Page-aligned symbol to mark beginning of .vtable_map_vars section. */
char _vtable_map_vars_start []
__attribute__ ((__visibility__ ("protected"), used, aligned(VTV_PAGE_SIZE),
section(".vtable_map_vars")))
= { };
/* Put the function __VLTUnprotectPreinit into the .preinit_array
section. */
__attribute__ ((section (".preinit_array")))
typeof (__VLTUnprotectPreinit) *__preinit = __VLTUnprotectPreinit;

View file

@ -1,3 +1,43 @@
2013-08-06 Caroline Tice <cmtice@google.com>
* fragment.am: Add XTEMPLATE_FLAGS.
* configure.ac: Add definitions for --enable-vtable-verify.
* acinclude.m4: Add --enable-vtable-verify and
--disable-vtable-verify; define --enable-vtable-verify; define
VTV_CXXFLAGS, VTV_PCH_CXXFLAGS and VTV_CXXLINKFLAGS.
* config/abi/pre/gnu.ver: Export symbols for vtable verification.
* libsupc++/Makefile.am: Define vtv_sources and add it to
libsupc___la_SOURCES and libsupc__convenience_la_SOURCES.
* libsupc++/vtv_stubs.cc: New file.
* include/Makefile.am: Add VTV_PCH_CXXFLAGS to PCHFLAGS.
* src/Makefile.am: Add VTV_CXXFLAGS to AM_CXXFLAGS; add
VTV_CXXLINKFLAGS to CXXLINK.
* src/c++98/Makefile.am: Comment out XTEMPLATE_FLAGS; add VTV_CXXFLAGS
to AM_CXXFLAGS; add VTV_CXXXLINKFLAGS to CXXLINK.
* src/C++11/Makefile.am: Ditto.
* doc/xml/manual/configure.xml: Add entry for --enable-vtable-verify.
* scripts/testsuite_flags.in: Add cxxvtvflags to Usage; cause
cxxvtvflags to use VTV_CXXFLAGS and VTV_CXXLINKFLAGS.
* testsuite/lib/libstdc++.exp: Add cxxvtvflags; add code to locate
libvtv if --enable-vtable-verify was used; set cxxvtvflags; add
cxxvtvflags to cxx_final.
* testsuite/18_support/bad_exception/23591_thread-1.c: Add
-fvtable-verify=none to compiler flags.
* testsuite/17_intro/freestanding.cc: Add -fvtable-verify=none
to compiler flags.
* configure: Regenerated.
* Makefile.in: Regenerated.
* python/Makefile.in: Regenerated.
* include/Makefile.in: Regenerated.
* libsupc++/Makefile.in: Regenerated.
* config.h.in: Regenerated.
* po/Makefile.in: Regenerated.
* src/Makefile.in: Regenerated.
* src/c++98/Makefile.in: Regenerated.
* src/c++11/Makefile.in: Regenerated.
* doc/Makefile.in: Regenerated.
* testsuite/Makefile.in: Regenerated.
2013-08-06 Paolo Carlini <paolo.carlini@oracle.com>
Revert the last commit.

View file

@ -203,6 +203,9 @@ SYMVER_FILE = @SYMVER_FILE@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VTV_CXXFLAGS = @VTV_CXXFLAGS@
VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
XMLLINT = @XMLLINT@
@ -299,6 +302,8 @@ toolexecdir = $(glibcxx_toolexecdir)
toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_WERROR_FALSE@WERROR_FLAG =
@ENABLE_WERROR_TRUE@WERROR_FLAG = $(WERROR)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.

View file

@ -2284,6 +2284,38 @@ AC_DEFUN([GLIBCXX_ENABLE_EXTERN_TEMPLATE], [
GLIBCXX_CONDITIONAL(ENABLE_EXTERN_TEMPLATE, test $enable_extern_template = yes)
])
dnl
dnl Use vtable verification.
dnl
dnl --enable-vtable-verify defines _GLIBCXX_VTABLE_VERIFY to 1
dnl --disable-vtable-verify defines _GLIBCXX_VTABLE_VERIFY to 0
dnl + Usage: GLIBCXX_ENABLE_VTABLE_VERIFY[(DEFAULT)]
dnl Where DEFAULT is `yes' or `no'.
dnl
AC_DEFUN([GLIBCXX_ENABLE_VTABLE_VERIFY], [
GLIBCXX_ENABLE(vtable-verify,$1,,[enable vtable verify])
AC_MSG_CHECKING([for vtable verify support])
AC_MSG_RESULT([$enable_vtable_verify])
if test $enable_vtable_verify = yes; then
VTV_CXXFLAGS="-fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end"
VTV_PCH_CXXFLAGS="-fvtable-verify=std"
VTV_CXXLINKFLAGS="-L${toplevel_builddir}/libvtv/.libs -Wl,--rpath -Wl,${toplevel_builddir}/libvtv/.libs"
else
VTV_CXXFLAGS=
VTV_PCH_CXXFLAGS=
VTV_CXXLINKFLAGS=
fi
AC_SUBST(VTV_CXXFLAGS)
AC_SUBST(VTV_PCH_CXXFLAGS)
AC_SUBST(VTV_CXXLINKFLAGS)
GLIBCXX_CONDITIONAL(ENABLE_VTABLE_VERIFY, test $enable_vtable_verify = yes)
])
dnl
dnl Check for parallel mode pre-requisites, including OpenMP support.
dnl

View file

@ -810,12 +810,13 @@
namespace std::tr1. */
#undef _GLIBCXX_USE_C99_STDINT_TR1
/* Defined if clock_gettime syscall has monotonic and realtime clock support.
*/
#undef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL
/* Defined if clock_gettime has monotonic clock support. */
#undef _GLIBCXX_USE_CLOCK_MONOTONIC
/* Defined if clock_gettime syscall has monotonic and realtime clock support. */
#undef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL
/* Defined if clock_gettime has realtime clock support. */
#undef _GLIBCXX_USE_CLOCK_REALTIME

View file

@ -1572,6 +1572,16 @@ CXXABI_1.3.8 {
__cxa_throw_bad_array_length;
_Z*St16bad_array_length*;
# Virtual table verification stub functions.
_Z17__VLTRegisterPair*;
_Z22__VLTRegisterPairDebug*;
_Z16__VLTRegisterSet*;
_Z21__VLTRegisterSetDebug*;
_Z24__VLTVerifyVtablePointer*;
_Z29__VLTVerifyVtablePointerDebug*;
__VLTChangePermission;
} CXXABI_1.3.7;
# Symbols in the support library (libsupc++) supporting transactional memory.

View file

@ -664,6 +664,11 @@ LIBICONV
OPT_LDFLAGS
SECTION_LDFLAGS
GLIBCXX_LIBS
ENABLE_VTABLE_VERIFY_FALSE
ENABLE_VTABLE_VERIFY_TRUE
VTV_CXXLINKFLAGS
VTV_PCH_CXXFLAGS
VTV_CXXFLAGS
ENABLE_WERROR_FALSE
ENABLE_WERROR_TRUE
ENABLE_PYTHONDIR_FALSE
@ -866,6 +871,7 @@ enable_fully_dynamic_string
enable_extern_template
with_python_dir
enable_werror
enable_vtable_verify
enable_libstdcxx_time
enable_tls
enable_rpath
@ -1558,6 +1564,7 @@ Optional Features:
--enable-extern-template
enable extern template [default=yes]
--enable-werror turns on -Werror [default=yes]
--enable-vtable-verify enable vtable verify [default=no]
--enable-libstdcxx-time[=KIND]
use KIND for check type [default=auto]
--enable-tls Use thread-local storage [default=yes]
@ -11513,7 +11520,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11516 "configure"
#line 11523 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11619,7 +11626,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 11622 "configure"
#line 11629 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -14906,6 +14913,12 @@ esac
if test "$enable_vtable_verify" = yes; then
predep_objects_CXX="${predep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_start.o"
postdep_objects_CXX="${postdep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_end.o"
fi
# libtool variables for C++ shared and position-independent compiles.
#
# Use glibcxx_lt_pic_flag to designate the automake variable
@ -15033,7 +15046,7 @@ fi
#
# Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
cat > conftest.$ac_ext << EOF
#line 15036 "configure"
#line 15049 "configure"
struct S { ~S(); };
void bar();
void foo()
@ -15383,7 +15396,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
# Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF
#line 15386 "configure"
#line 15399 "configure"
int main()
{
typedef bool atomic_type;
@ -15418,7 +15431,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
#line 15421 "configure"
#line 15434 "configure"
int main()
{
typedef short atomic_type;
@ -15453,7 +15466,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
#line 15456 "configure"
#line 15469 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
@ -15489,7 +15502,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
#line 15492 "configure"
#line 15505 "configure"
int main()
{
typedef long long atomic_type;
@ -15568,7 +15581,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
#line 15571 "configure"
#line 15584 "configure"
int main()
{
_Decimal32 d1;
@ -15610,7 +15623,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
#line 15613 "configure"
#line 15626 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@ -15644,7 +15657,7 @@ $as_echo "$enable_int128" >&6; }
rm -f conftest*
cat > conftest.$ac_ext << EOF
#line 15647 "configure"
#line 15660 "configure"
template<typename T1, typename T2>
struct same
{ typedef T2 type; };
@ -17379,6 +17392,42 @@ $as_echo "$enable_werror" >&6; }
# Check whether --enable-vtable-verify was given.
if test "${enable_vtable_verify+set}" = set; then :
enableval=$enable_vtable_verify;
case "$enableval" in
yes|no) ;;
*) as_fn_error "Argument to enable/disable vtable-verify must be yes or no" "$LINENO" 5 ;;
esac
else
enable_vtable_verify=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for vtable verify support" >&5
$as_echo_n "checking for vtable verify support... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_vtable_verify" >&5
$as_echo "$enable_vtable_verify" >&6; }
if test $enable_vtable_verify = yes; then
VTV_CXXFLAGS="-fvtable-verify=std -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end"
VTV_PCH_CXXFLAGS="-fvtable-verify=std"
VTV_CXXLINKFLAGS="-L${toplevel_builddir}/libvtv/.libs -Wl,--rpath -Wl,${toplevel_builddir}/libvtv/.libs"
else
VTV_CXXFLAGS=
VTV_PCH_CXXFLAGS=
VTV_CXXLINKFLAGS=
fi
# Checks for operating systems support that doesn't require linking.
@ -72960,6 +73009,15 @@ else
fi
if test $enable_vtable_verify = yes; then
ENABLE_VTABLE_VERIFY_TRUE=
ENABLE_VTABLE_VERIFY_FALSE='#'
else
ENABLE_VTABLE_VERIFY_TRUE='#'
ENABLE_VTABLE_VERIFY_FALSE=
fi
if test $enable_symvers != no; then
ENABLE_SYMVERS_TRUE=
ENABLE_SYMVERS_FALSE='#'
@ -73403,6 +73461,10 @@ if test -z "${ENABLE_WERROR_TRUE}" && test -z "${ENABLE_WERROR_FALSE}"; then
as_fn_error "conditional \"ENABLE_WERROR\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_VTABLE_VERIFY_TRUE}" && test -z "${ENABLE_VTABLE_VERIFY_FALSE}"; then
as_fn_error "conditional \"ENABLE_VTABLE_VERIFY\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
if test -z "${ENABLE_SYMVERS_TRUE}" && test -z "${ENABLE_SYMVERS_FALSE}"; then
as_fn_error "conditional \"ENABLE_SYMVERS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5

View file

@ -97,6 +97,12 @@ ACX_LT_HOST_FLAGS
AC_SUBST(enable_shared)
AC_SUBST(enable_static)
if test "$enable_vtable_verify" = yes; then
predep_objects_CXX="${predep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_start.o"
postdep_objects_CXX="${postdep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_end.o"
fi
# libtool variables for C++ shared and position-independent compiles.
#
# Use glibcxx_lt_pic_flag to designate the automake variable
@ -168,6 +174,7 @@ GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING([no])
GLIBCXX_ENABLE_EXTERN_TEMPLATE([yes])
GLIBCXX_ENABLE_PYTHON
GLIBCXX_ENABLE_WERROR([yes])
GLIBCXX_ENABLE_VTABLE_VERIFY([no])
# Checks for operating systems support that doesn't require linking.
GLIBCXX_CHECK_STDIO_PROTO

View file

@ -175,6 +175,9 @@ SYMVER_FILE = @SYMVER_FILE@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VTV_CXXFLAGS = @VTV_CXXFLAGS@
VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
@ -281,6 +284,8 @@ toolexecdir = $(glibcxx_toolexecdir)
toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_WERROR_FALSE@WERROR_FLAG =
@ENABLE_WERROR_TRUE@WERROR_FLAG = $(WERROR)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.

View file

@ -382,6 +382,18 @@
</para>
</listitem></varlistentry>
<varlistentry><term><code>--enable-vtable-verify</code>[default]</term>
<listitem>
<para>Use <code>-fvtable-verify=std</code> to compile the C++
runtime with instrumentation for vtable verification. All virtual
functions in the standard library will be verified at runtime.
Types impacted include <classname>locale</classname> and
<classname>iostream</classname>, and others. Disabling means that
the C++ runtime is compiled without support for vtable
verification. By default, this option is off.
</para>
</listitem></varlistentry>
</variablelist>
</section>

View file

@ -19,6 +19,12 @@ else
WERROR_FLAG=
endif
if ENABLE_EXTERN_TEMPLATE
XTEMPLATE_FLAGS = -fno-implicit-templates
else
XTEMPLATE_FLAGS =
endif
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
CONFIG_CXXFLAGS = \

View file

@ -893,7 +893,7 @@ pch_output_dirs = \
${pch1_output_builddir} ${pch2_output_builddir} ${pch3_output_builddir}
pch_output_anchors = \
${pch1_output_anchor} ${pch2_output_anchor} ${pch3_output_anchor}
PCHFLAGS=-x c++-header -nostdinc++ $(CXXFLAGS)
PCHFLAGS=-x c++-header -nostdinc++ $(CXXFLAGS) $(VTV_PCH_CXXFLAGS)
if GLIBCXX_BUILD_PCH
pch_build = ${pch_output}
else

View file

@ -175,6 +175,9 @@ SYMVER_FILE = @SYMVER_FILE@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VTV_CXXFLAGS = @VTV_CXXFLAGS@
VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
XMLLINT = @XMLLINT@
@ -271,6 +274,8 @@ toolexecdir = $(glibcxx_toolexecdir)
toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_WERROR_FALSE@WERROR_FLAG =
@ENABLE_WERROR_TRUE@WERROR_FLAG = $(WERROR)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
@ -1147,7 +1152,7 @@ pch_output_dirs = \
pch_output_anchors = \
${pch1_output_anchor} ${pch2_output_anchor} ${pch3_output_anchor}
PCHFLAGS = -x c++-header -nostdinc++ $(CXXFLAGS)
PCHFLAGS = -x c++-header -nostdinc++ $(CXXFLAGS) $(VTV_PCH_CXXFLAGS)
@GLIBCXX_BUILD_PCH_FALSE@pch_build =
@GLIBCXX_BUILD_PCH_TRUE@pch_build = ${pch_output}

View file

@ -26,6 +26,7 @@ include $(top_srcdir)/fragment.am
# separately too.
# 1) separate libsupc++.la
toolexeclib_LTLIBRARIES = libsupc++.la
# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
noinst_LTLIBRARIES = libsupc++convenience.la
@ -96,8 +97,13 @@ sources = \
vmi_class_type_info.cc \
vterminate.cc
libsupc___la_SOURCES = $(sources) $(c_sources)
libsupc__convenience_la_SOURCES = $(sources) $(c_sources)
if ENABLE_VTABLE_VERIFY
vtv_sources = \
vtv_stubs.cc
endif
libsupc___la_SOURCES = $(sources) $(c_sources) $(vtv_sources)
libsupc__convenience_la_SOURCES = $(sources) $(c_sources) $(vtv_sources)
cp-demangle.c:
rm -f $@
@ -282,3 +288,8 @@ uninstall-bitsHEADERS:
q=`echo $$p | sed -e 's,.*/,,'`; \
rm -f $(DESTDIR)$(bitsdir)/$$q; \
done
# By adding these files here, automake will remove them for 'make clean'
CLEANFILES = stamp-*

View file

@ -105,10 +105,13 @@ am__objects_1 = array_type_info.lo atexit_arm.lo atexit_thread.lo \
pointer_type_info.lo pure.lo si_class_type_info.lo tinfo.lo \
tinfo2.lo vec.lo vmi_class_type_info.lo vterminate.lo
@GLIBCXX_HOSTED_TRUE@am__objects_2 = cp-demangle.lo
am_libsupc___la_OBJECTS = $(am__objects_1) $(am__objects_2)
@ENABLE_VTABLE_VERIFY_TRUE@am__objects_3 = vtv_stubs.lo
am_libsupc___la_OBJECTS = $(am__objects_1) $(am__objects_2) \
$(am__objects_3)
libsupc___la_OBJECTS = $(am_libsupc___la_OBJECTS)
libsupc__convenience_la_LIBADD =
am_libsupc__convenience_la_OBJECTS = $(am__objects_1) $(am__objects_2)
am_libsupc__convenience_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
$(am__objects_3)
libsupc__convenience_la_OBJECTS = \
$(am_libsupc__convenience_la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
@ -235,6 +238,9 @@ SYMVER_FILE = @SYMVER_FILE@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VTV_CXXFLAGS = @VTV_CXXFLAGS@
VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
XMLLINT = @XMLLINT@
@ -331,6 +337,8 @@ toolexecdir = $(glibcxx_toolexecdir)
toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_WERROR_FALSE@WERROR_FLAG =
@ENABLE_WERROR_TRUE@WERROR_FLAG = $(WERROR)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
@ -348,6 +356,7 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES)
# separately too.
# 1) separate libsupc++.la
toolexeclib_LTLIBRARIES = libsupc++.la
# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
noinst_LTLIBRARIES = libsupc++convenience.la
std_HEADERS = \
@ -414,8 +423,11 @@ sources = \
vmi_class_type_info.cc \
vterminate.cc
libsupc___la_SOURCES = $(sources) $(c_sources)
libsupc__convenience_la_SOURCES = $(sources) $(c_sources)
@ENABLE_VTABLE_VERIFY_TRUE@vtv_sources = \
@ENABLE_VTABLE_VERIFY_TRUE@ vtv_stubs.cc
libsupc___la_SOURCES = $(sources) $(c_sources) $(vtv_sources)
libsupc__convenience_la_SOURCES = $(sources) $(c_sources) $(vtv_sources)
# AM_CXXFLAGS needs to be in each subdirectory so that it can be
# modified in a per-library or per-sub-library way. Need to manually
@ -499,6 +511,9 @@ CXXLINK = \
# prepending each of $(*_HEADERS) with VPATH below.
stddir = $(gxx_include_dir)
bitsdir = $(gxx_include_dir)/bits
# By adding these files here, automake will remove them for 'make clean'
CLEANFILES = stamp-*
all: all-am
.SUFFIXES:
@ -683,6 +698,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)

View file

@ -0,0 +1,100 @@
// Copyright (C) 2012-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/* This is part of the vtable verification runtime library. For more
information about this feature, see the comments in libvtv/vtv_rts.cc. */
/* The functions in this file are used to create the libvtv_stubs
library, as part of the vtable verification feature. When building
a binary without vtable verification, and linking it with a
(possibly pre-built third-party) library that was built with
verification, it is possible that vtable verification will fail due
to incomplete data (rather than due to corrupt vtable pointers). In
this case we need to give programmers a way of turning off the
vtable verification in their libraries. They can do so by linking
with the libvtv_stubs library, which (as you can see) will replace
the real verification functions with a set of functions that do
nothing (so no more verification failures/aborts). */
#include <cstddef>
// Declare as weak for libsupc++, strong definitions are in libvtv.
#if __GXX_WEAK__
extern "C"
void
__VLTChangePermission(int) __attribute__((weak));
void
__VLTRegisterSet(void**, const void*, std::size_t, std::size_t,
void**) __attribute__((weak));
void
__VLTRegisterPair(void**, const void*, std::size_t,
const void*) __attribute__((weak));
const void*
__VLTVerifyVtablePointer(void**, const void*) __attribute__((weak));
void
__VLTRegisterSetDebug(void**, const void*, std::size_t, std::size_t,
void**) __attribute__((weak));
void
__VLTRegisterPairDebug(void**, const void*, std::size_t, const void*,
const char*, const char*) __attribute__((weak));
const void*
__VLTVerifyVtablePointerDebug(void**, const void*, const char*,
const char*) __attribute__((weak));
#endif
// Stub definitions.
extern "C"
void
__VLTChangePermission(int)
{ }
void
__VLTRegisterSet(void**, const void*, std::size_t, std::size_t, void**)
{ }
void
__VLTRegisterPair(void**, const void*, std::size_t, const void*)
{ }
const void*
__VLTVerifyVtablePointer(void**, const void* vtable_ptr)
{ return vtable_ptr; }
void
__VLTRegisterSetDebug(void**, const void*, std::size_t, std::size_t, void**)
{ }
void
__VLTRegisterPairDebug(void**, const void*, std::size_t, const void*,
const char*, const char*)
{ }
const void*
__VLTVerifyVtablePointerDebug(void**, const void* vtable_ptr, const char*,
const char*)
{ return vtable_ptr; }

View file

@ -175,6 +175,9 @@ SYMVER_FILE = @SYMVER_FILE@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VTV_CXXFLAGS = @VTV_CXXFLAGS@
VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
XMLLINT = @XMLLINT@
@ -271,6 +274,8 @@ toolexecdir = $(glibcxx_toolexecdir)
toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_WERROR_FALSE@WERROR_FLAG =
@ENABLE_WERROR_TRUE@WERROR_FLAG = $(WERROR)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.

View file

@ -199,6 +199,9 @@ SYMVER_FILE = @SYMVER_FILE@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VTV_CXXFLAGS = @VTV_CXXFLAGS@
VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
XMLLINT = @XMLLINT@
@ -295,6 +298,8 @@ toolexecdir = $(glibcxx_toolexecdir)
toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_WERROR_FALSE@WERROR_FLAG =
@ENABLE_WERROR_TRUE@WERROR_FLAG = $(WERROR)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.

View file

@ -18,8 +18,10 @@ Usage:
--build-cc
--install-cxx
--cxxflags
--cxxpchflags
--cxxldflags
--cxxpchflags
--cxxvtvflags
EOF
}
@ -56,7 +58,12 @@ case ${query} in
--cxxflags)
CXXFLAGS_default="-D_GLIBCXX_ASSERT -fmessage-length=0"
CXXFLAGS_config="@SECTION_FLAGS@ @CXXFLAGS@ @EXTRA_CXX_FLAGS@"
echo ${CXXFLAGS_default} ${CXXFLAGS_config}
echo ${CXXFLAGS_default} ${CXXFLAGS_config}
;;
--cxxvtvflags)
CXXFLAGS_vtv="@VTV_CXXFLAGS@"
LDFLAGS_vtv="@VTV_CXXLINKFLAGS@"
echo ${CXXFLAGS_vtv} ${LDFLAGS_vtv}
;;
--cxxparallelflags)
CXXFLAGS_parallel="-D_GLIBCXX_PARALLEL -fopenmp

View file

@ -73,7 +73,6 @@ libstdc___la_LDFLAGS = \
libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS)
# Use special rules for compatibility-ldbl.cc compilation, as we need to
# pass -mlong-double-64.
if GLIBCXX_LDBL_COMPAT
@ -138,7 +137,7 @@ compatibility-condvar.o: compatibility-condvar.cc
# as the occasion calls for it.
AM_CXXFLAGS = \
$(glibcxx_compiler_pic_flag) \
$(XTEMPLATE_FLAGS) \
$(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
$(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
# Libtool notes
@ -185,9 +184,9 @@ CXXLINK = \
$(LIBTOOL) --tag CXX \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXX) \
$(VTV_CXXLINKFLAGS) \
$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
# Symbol versioning for shared libraries.
if ENABLE_SYMVERS
libstdc++-symbols.ver: ${glibcxx_srcdir}/$(SYMVER_FILE) \

View file

@ -226,6 +226,9 @@ SYMVER_FILE = @SYMVER_FILE@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VTV_CXXFLAGS = @VTV_CXXFLAGS@
VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
XMLLINT = @XMLLINT@
@ -322,6 +325,8 @@ toolexecdir = $(glibcxx_toolexecdir)
toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_WERROR_FALSE@WERROR_FLAG =
@ENABLE_WERROR_TRUE@WERROR_FLAG = $(WERROR)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
@ -403,7 +408,7 @@ libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS)
# as the occasion calls for it.
AM_CXXFLAGS = \
$(glibcxx_compiler_pic_flag) \
$(XTEMPLATE_FLAGS) \
$(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
$(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
@ -451,6 +456,7 @@ CXXLINK = \
$(LIBTOOL) --tag CXX \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXX) \
$(VTV_CXXLINKFLAGS) \
$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
@ENABLE_SYMVERS_TRUE@CLEANFILES = libstdc++-symbols.ver $(version_dep)

View file

@ -46,13 +46,13 @@ sources = \
thread.cc
if ENABLE_EXTERN_TEMPLATE
XTEMPLATE_FLAGS = -fno-implicit-templates
# XTEMPLATE_FLAGS = -fno-implicit-templates
inst_sources = \
fstream-inst.cc \
string-inst.cc \
wstring-inst.cc
else
XTEMPLATE_FLAGS =
# XTEMPLATE_FLAGS =
inst_sources =
endif
@ -75,7 +75,7 @@ hashtable_c++0x.o: hashtable_c++0x.cc
AM_CXXFLAGS = \
-std=gnu++11 \
$(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
$(XTEMPLATE_FLAGS) \
$(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
$(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
AM_MAKEFLAGS = \
@ -125,4 +125,5 @@ CXXLINK = \
$(LIBTOOL) --tag CXX --tag disable-shared \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXX) \
$(VTV_CXXLINKFLAGS) \
$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@

View file

@ -192,6 +192,9 @@ SYMVER_FILE = @SYMVER_FILE@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VTV_CXXFLAGS = @VTV_CXXFLAGS@
VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
XMLLINT = @XMLLINT@
@ -288,6 +291,8 @@ toolexecdir = $(glibcxx_toolexecdir)
toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_WERROR_FALSE@WERROR_FLAG =
@ENABLE_WERROR_TRUE@WERROR_FLAG = $(WERROR)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
@ -322,9 +327,10 @@ sources = \
system_error.cc \
thread.cc
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
# XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_FALSE@inst_sources =
# XTEMPLATE_FLAGS = -fno-implicit-templates
@ENABLE_EXTERN_TEMPLATE_TRUE@inst_sources = \
@ENABLE_EXTERN_TEMPLATE_TRUE@ fstream-inst.cc \
@ENABLE_EXTERN_TEMPLATE_TRUE@ string-inst.cc \
@ -340,7 +346,7 @@ libc__11convenience_la_SOURCES = $(sources) $(inst_sources)
AM_CXXFLAGS = \
-std=gnu++11 \
$(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
$(XTEMPLATE_FLAGS) \
$(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
$(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
AM_MAKEFLAGS = \
@ -391,6 +397,7 @@ CXXLINK = \
$(LIBTOOL) --tag CXX --tag disable-shared \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXX) \
$(VTV_CXXLINKFLAGS) \
$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
all: all-am

View file

@ -82,7 +82,7 @@ basic_file.cc: ${glibcxx_srcdir}/$(BASIC_FILE_CC)
if ENABLE_EXTERN_TEMPLATE
XTEMPLATE_FLAGS = -fno-implicit-templates
# XTEMPLATE_FLAGS = -fno-implicit-templates
inst_sources = \
allocator-inst.cc \
concept-inst.cc \
@ -97,7 +97,7 @@ inst_sources = \
streambuf-inst.cc \
wlocale-inst.cc
else
XTEMPLATE_FLAGS =
# XTEMPLATE_FLAGS =
inst_sources =
endif
@ -172,7 +172,7 @@ parallel_settings.o: parallel_settings.cc
# as the occasion calls for it.
AM_CXXFLAGS = \
$(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
$(XTEMPLATE_FLAGS) \
$(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
$(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
AM_MAKEFLAGS = \
@ -222,4 +222,5 @@ CXXLINK = \
$(LIBTOOL) --tag CXX --tag disable-shared \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXX) \
$(VTV_CXXLINKFLAGS) \
$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@

View file

@ -208,6 +208,9 @@ SYMVER_FILE = @SYMVER_FILE@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VTV_CXXFLAGS = @VTV_CXXFLAGS@
VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
XMLLINT = @XMLLINT@
@ -304,6 +307,8 @@ toolexecdir = $(glibcxx_toolexecdir)
toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_WERROR_FALSE@WERROR_FLAG =
@ENABLE_WERROR_TRUE@WERROR_FLAG = $(WERROR)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.
@ -342,9 +347,10 @@ host_sources_extra = \
basic_file.cc c++locale.cc \
${inst_sources} ${parallel_sources}
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
# XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_FALSE@inst_sources =
# XTEMPLATE_FLAGS = -fno-implicit-templates
@ENABLE_EXTERN_TEMPLATE_TRUE@inst_sources = \
@ENABLE_EXTERN_TEMPLATE_TRUE@ allocator-inst.cc \
@ENABLE_EXTERN_TEMPLATE_TRUE@ concept-inst.cc \
@ -412,7 +418,7 @@ PARALLEL_FLAGS = -D_GLIBCXX_PARALLEL
# as the occasion calls for it.
AM_CXXFLAGS = \
$(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
$(XTEMPLATE_FLAGS) \
$(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \
$(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
AM_MAKEFLAGS = \
@ -463,6 +469,7 @@ CXXLINK = \
$(LIBTOOL) --tag CXX --tag disable-shared \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXX) \
$(VTV_CXXLINKFLAGS) \
$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
all: all-am

View file

@ -1,4 +1,4 @@
// { dg-options "-x c -std=gnu++0x -lsupc++" }
// { dg-options "-x c -std=gnu++0x -lsupc++ -fvtable-verify=none" }
// Copyright (C) 2010-2013 Free Software Foundation, Inc.
//

View file

@ -1,5 +1,5 @@
// { dg-require-sharedlib "" }
// { dg-options "-g -O2 -pthread -ldl -x c" { target *-*-linux* *-*-gnu* } }
// { dg-options "-g -O2 -pthread -ldl -x c -fvtable-verify=none" { target *-*-linux* *-*-gnu* } }
// Copyright (C) 2005-2013 Free Software Foundation, Inc.
//

View file

@ -175,6 +175,9 @@ SYMVER_FILE = @SYMVER_FILE@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
VTV_CXXFLAGS = @VTV_CXXFLAGS@
VTV_CXXLINKFLAGS = @VTV_CXXLINKFLAGS@
VTV_PCH_CXXFLAGS = @VTV_PCH_CXXFLAGS@
WARN_FLAGS = @WARN_FLAGS@
WERROR = @WERROR@
XMLLINT = @XMLLINT@
@ -274,6 +277,8 @@ toolexecdir = $(glibcxx_toolexecdir)
toolexeclibdir = $(glibcxx_toolexeclibdir)
@ENABLE_WERROR_FALSE@WERROR_FLAG =
@ENABLE_WERROR_TRUE@WERROR_FLAG = $(WERROR)
@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.ac to see how they are set. See GLIBCXX_EXPORT_FLAGS.

View file

@ -84,7 +84,7 @@ proc libstdc++_init { testfile } {
global env
global v3-sharedlib v3-libgomp
global srcdir blddir objdir tool_root_dir
global cc cxx cxxflags cxxpchflags cxxldflags
global cc cxx cxxflags cxxpchflags cxxldflags cxxvtvflags
global includes
global gluefile wrap_flags
global ld_library_path
@ -157,6 +157,17 @@ proc libstdc++_init { testfile } {
}
v3track libgompdir 3
# Locate libvtv. This is only required for --enable-vtable-verify.
set v3-libvtv 0
set libvtvdir [lookfor_file $blddir/../libvtv .libs/libvtv.$shlib_ext]
if {$libvtvdir != ""} {
set v3-libvtv 1
set libvtvdir [file dirname $libvtvdir]
append ld_library_path_tmp ":${libvtvdir}"
verbose -log "libvtv support detected"
}
v3track libvtvdir 3
# Locate libstdc++ shared library. (ie libstdc++.so.)
set v3-sharedlib 0
set sharedlibdir [lookfor_file $blddir src/.libs/libstdc++.$shlib_ext]
@ -214,6 +225,7 @@ proc libstdc++_init { testfile } {
set cxx [transform "g++"]
set cxxflags "-D_GLIBCXX_ASSERT -fmessage-length=0"
set cxxpchflags ""
set cxxvtvflags ""
set cxxldflags ""
set cc [transform "gcc"]
# Locate testsuite_hooks.h and other testsuite headers.
@ -261,6 +273,7 @@ proc libstdc++_init { testfile } {
set cxx [exec sh $flags_file --build-cxx]
set cxxflags [exec sh $flags_file --cxxflags]
set cxxpchflags [exec sh $flags_file --cxxpchflags]
set cxxvtvflags [exec sh $flags_file --cxxvtvflags]
set cxxldflags [exec sh $flags_file --cxxldflags]
set cc [exec sh $flags_file --build-cc]
set includes [exec sh $flags_file --build-includes]
@ -424,6 +437,7 @@ proc v3_target_compile { source dest type options } {
global wrap_flags
global cxx
global cxxflags
global cxxvtvflags
global cxxldflags
global includes
global STATIC_LIBCXXFLAGS
@ -438,6 +452,7 @@ proc v3_target_compile { source dest type options } {
set cxx_final [concat $cxx_final $cxxlibglossflags]
set cxx_final [concat $cxx_final $STATIC_LIBCXXFLAGS]
set cxx_final [concat $cxx_final $cxxflags]
set cxx_final [concat $cxx_final $cxxvtvflags]
set cxx_final [concat $cxx_final $includes]
# Flag setting based on type argument.

66
libvtv/ChangeLog Normal file
View file

@ -0,0 +1,66 @@
2013-08-02 Caroline Tice <cmtice@google.com>
Initial check-in of new vtable verification feature.
* configure.ac : New file.
* acinclude.m4 : New file.
* Makefile.am : New file.
* aclocal.m4 : New file.
* configure.tgt : New file.
* configure: New file (generated).
* Makefile.in: New file (generated).
* vtv_set.h : New file.
* vtv_utils.cc : New file.
* vtv_utils.h : New file.
* vtv_malloc.cc : New file.
* vtv_rts.cc : New file.
* vtv_malloc.h : New file.
* vtv_rts.h : New file.
* vtv_fail.cc : New file.
* vtv_fail.h : New file.
* vtv_map.h : New file.
* scripts/run-testsuite.sh : New file.
* scripts/sum-vtv-counts.c : New file.
* testsuite/parts-test-main.h : New file.
* testusite/dataentry.cc : New file.
* testsuite/temp_deriv.cc : New file.
* testsuite/register_pair.cc : New file.
* testsuite/virtual_inheritance.cc : New file.
* testsuite/field-test.cc : New file.
* testsuite/nested_vcall_test.cc : New file.
* testsuite/template-list-iostream.cc : New file.
* testsuite/register_pair_inserts.cc : New file.
* testsuite/register_pair_inserts_mt.cc : New file.
* testsuite/event.list : New file.
* testsuite/parts-test-extra-parts-views.cc : New file.
* testsuite/parts-test-extra-parts-views.h : New file.
* testsuite/environment-fail-32.s : New file.
* testsuite/parts-test-extra-parts.h : New file.
* testsuite/temp_deriv2.cc : New file.
* testsuite/dlopen_mt.cc : New file.
* testsuite/event.h : New file.
* testsuite/template-list.cc : New file.
* testsuite/replace-fail.cc : New file.
* testsuite/Makefile.am : New file.
* testsuite/Makefile.in: New file (generated).
* testsuite/mempool_negative.c : New file.
* testsuite/parts-test-main.cc : New file.
* testsuite/event-private.cc : New file.
* testsuite/thunk.cc : New file.
* testsuite/event-defintiions.cc : New file.
* testsuite/event-private.h : New file.
* testsuite/parts-test.list : New file.
* testusite/register_pair_mt.cc : New file.
* testsuite/povray-derived.cc : New file.
* testsuite/event-main.cc : New file.
* testsuite/environment.cc : New file.
* testsuite/template-list2.cc : New file.
* testsuite/thunk_vtable_map_attack.cc : New file.
* testsuite/parts-test-extra-parts.cc : New file.
* testsuite/environment-fail-64.s : New file.
* testsuite/dlopen.cc : New file.
* testsuite/so.cc : New file.
* testsuite/temp_deriv3.cc : New file.
* testsuite/const_vtable.cc : New file.
* testsuite/mempool_positive.c : New file.
* testsuite/dup_name.cc : New file.

83
libvtv/Makefile.am Normal file
View file

@ -0,0 +1,83 @@
## Makefile for the VTV library.
##
## Copyright (C) 2013 Free Software Foundation, Inc.
##
## Process this file with automake to produce Makefile.in.
##
## This file is part of the Vtable Verification (VTV) Library. This
## library is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3, or (at your option)
## any later version.
## This library is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this library; see the file COPYING3. If not see
## <http://www.gnu.org/licenses/>.
SUBDIRS = testsuite
ACLOCAL_AMFLAGS = -I .. -I ../config
# May be used by toolexeclibdir.
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
DEFS =
AM_CPPFLAGS = -I$(top_srcdir)/../include
AM_CFLAGS = $(XCFLAGS)
AM_CCASFLAGS = $(XCFLAGS)
AM_CXXFLAGS = $(XCFLAGS)
AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS)
AM_CXXFLAGS += -Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
toolexeclib_LTLIBRARIES = libvtv.la
vtv_headers = \
vtv_map.h \
vtv_malloc.h \
vtv_fail.h \
vtv_set.h \
vtv_utils.h \
vtv_rts.h
vtv_sources = \
vtv_start.c \
vtv_malloc.cc \
vtv_rts.cc \
vtv_utils.cc \
vtv_end.c
libvtv_includedir = $(includedir)
# Link in vtv_start and vtv_end.
BUILT_SOURCES = vtv_start.c vtv_end.c
vtv_start.c:
rm -f $@
$(LN_S) $(toplevel_srcdir)/libgcc/vtv_start.c $@
vtv_end.c:
rm -f $@
$(LN_S) $(toplevel_srcdir)/libgcc/vtv_end.c $@
if ENABLE_VTABLE_VERIFY
libvtv_la_SOURCES = $(vtv_sources)
libvtv_include_HEADERS = $(vtv_headers)
else
libvtv_la_SOURCES =
libvtv_include_HEADERS =
endif
# Least ordering for dependencies mean linking w/o libstdc++ for as
# long as the development of libvtv does not absolutely require it.
CXXVTV=$(CC_FOR_TARGET)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CXXVTV) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXXVTV) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@

766
libvtv/Makefile.in Normal file
View file

@ -0,0 +1,766 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/../mkinstalldirs $(srcdir)/../depcomp \
$(am__libvtv_include_HEADERS_DIST)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/libstdc++-raw-cxx.m4 \
$(top_srcdir)/../config/multi.m4 \
$(top_srcdir)/../config/override.m4 \
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \
"$(DESTDIR)$(libvtv_includedir)"
LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
libvtv_la_LIBADD =
am__objects_1 = vtv_start.lo vtv_malloc.lo vtv_rts.lo vtv_utils.lo \
vtv_end.lo
@ENABLE_VTABLE_VERIFY_TRUE@am_libvtv_la_OBJECTS = $(am__objects_1)
libvtv_la_OBJECTS = $(am_libvtv_la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/../depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
SOURCES = $(libvtv_la_SOURCES)
MULTISRCTOP =
MULTIBUILDTOP =
MULTIDIRS =
MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
am__libvtv_include_HEADERS_DIST = vtv_map.h vtv_malloc.h vtv_fail.h \
vtv_set.h vtv_utils.h vtv_rts.h
HEADERS = $(libvtv_include_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS =
DEPDIR = @DEPDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSTDCXX_RAW_CXX_CXXFLAGS = @LIBSTDCXX_RAW_CXX_CXXFLAGS@
LIBSTDCXX_RAW_CXX_LDFLAGS = @LIBSTDCXX_RAW_CXX_LDFLAGS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XCFLAGS = @XCFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
enable_shared = @enable_shared@
enable_static = @enable_static@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
libtool_VERSION = @libtool_VERSION@
libvtv_builddir = @libvtv_builddir@
libvtv_srcdir = @libvtv_srcdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
multi_basedir = @multi_basedir@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_noncanonical = @target_noncanonical@
target_os = @target_os@
target_vendor = @target_vendor@
toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
toplevel_builddir = @toplevel_builddir@
toplevel_srcdir = @toplevel_srcdir@
SUBDIRS = testsuite
ACLOCAL_AMFLAGS = -I .. -I ../config
# May be used by toolexeclibdir.
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
AM_CPPFLAGS = -I$(top_srcdir)/../include
AM_CFLAGS = $(XCFLAGS)
AM_CCASFLAGS = $(XCFLAGS)
AM_CXXFLAGS = $(XCFLAGS) $(LIBSTDCXX_RAW_CXX_CXXFLAGS) \
-Wl,-u_vtable_map_vars_start,-u_vtable_map_vars_end
toolexeclib_LTLIBRARIES = libvtv.la
vtv_headers = \
vtv_map.h \
vtv_malloc.h \
vtv_fail.h \
vtv_set.h \
vtv_utils.h \
vtv_rts.h
vtv_sources = \
vtv_start.c \
vtv_malloc.cc \
vtv_rts.cc \
vtv_utils.cc \
vtv_end.c
libvtv_includedir = $(includedir)
# Link in vtv_start and vtv_end.
BUILT_SOURCES = vtv_start.c vtv_end.c
@ENABLE_VTABLE_VERIFY_FALSE@libvtv_la_SOURCES =
@ENABLE_VTABLE_VERIFY_TRUE@libvtv_la_SOURCES = $(vtv_sources)
@ENABLE_VTABLE_VERIFY_FALSE@libvtv_include_HEADERS =
@ENABLE_VTABLE_VERIFY_TRUE@libvtv_include_HEADERS = $(vtv_headers)
# Least ordering for dependencies mean linking w/o libstdc++ for as
# long as the development of libvtv does not absolutely require it.
CXXVTV = $(CC_FOR_TARGET)
LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CXXVTV) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CXXVTV) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
.SUFFIXES: .c .cc .lo .o .obj
am--refresh:
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ./Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign ./Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
@$(NORMAL_INSTALL)
test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)"
@list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(toolexeclibdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(toolexeclibdir)"; \
}
uninstall-toolexeclibLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(toolexeclibdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(toolexeclibdir)/$$f"; \
done
clean-toolexeclibLTLIBRARIES:
-test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
@list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
test "$$dir" != "$$p" || dir=.; \
echo "rm -f \"$${dir}/so_locations\""; \
rm -f "$${dir}/so_locations"; \
done
libvtv.la: $(libvtv_la_OBJECTS) $(libvtv_la_DEPENDENCIES)
$(CXXLINK) -rpath $(toolexeclibdir) $(libvtv_la_OBJECTS) $(libvtv_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vtv_end.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vtv_malloc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vtv_rts.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vtv_start.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vtv_utils.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
.cc.o:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
.cc.obj:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cc.lo:
@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
# GNU Make needs to see an explicit $(MAKE) variable in the command it
# runs to enable its job server during parallel builds. Hence the
# comments below.
all-multi:
$(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
install-multi:
$(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
mostlyclean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
distclean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
maintainer-clean-multi:
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
install-libvtv_includeHEADERS: $(libvtv_include_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(libvtv_includedir)" || $(MKDIR_P) "$(DESTDIR)$(libvtv_includedir)"
@list='$(libvtv_include_HEADERS)'; test -n "$(libvtv_includedir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libvtv_includedir)'"; \
$(INSTALL_HEADER) $$files "$(DESTDIR)$(libvtv_includedir)" || exit $$?; \
done
uninstall-libvtv_includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(libvtv_include_HEADERS)'; test -n "$(libvtv_includedir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(libvtv_includedir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(libvtv_includedir)" && rm -f $$files
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@fail= failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-recursive
all-am: Makefile $(LTLIBRARIES) all-multi $(HEADERS)
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(libvtv_includedir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-multi clean-recursive
clean-am: clean-generic clean-libtool clean-toolexeclibLTLIBRARIES \
mostlyclean-am
distclean: distclean-multi distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am: install-libvtv_includeHEADERS
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am: install-multi install-toolexeclibLTLIBRARIES
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-multi maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-multi mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-libvtv_includeHEADERS \
uninstall-toolexeclibLTLIBRARIES
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all all-multi \
check clean-multi ctags-recursive distclean-multi install \
install-am install-multi install-strip maintainer-clean-multi \
mostlyclean-multi tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am all-multi am--refresh check check-am clean \
clean-generic clean-libtool clean-multi \
clean-toolexeclibLTLIBRARIES ctags ctags-recursive distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-multi distclean-tags dvi dvi-am html html-am info \
info-am install install-am install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-libvtv_includeHEADERS install-man install-multi \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip install-toolexeclibLTLIBRARIES installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic maintainer-clean-multi mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
mostlyclean-multi pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am uninstall-libvtv_includeHEADERS \
uninstall-toolexeclibLTLIBRARIES
vtv_start.c:
rm -f $@
$(LN_S) $(toplevel_srcdir)/libgcc/vtv_start.c $@
vtv_end.c:
rm -f $@
$(LN_S) $(toplevel_srcdir)/libgcc/vtv_end.c $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

58
libvtv/acinclude.m4 Normal file
View file

@ -0,0 +1,58 @@
dnl ----------------------------------------------------------------------
dnl This whole bit snagged from libgfortran.
sinclude(../libtool.m4)
dnl The lines below arrange for aclocal not to bring an installed
dnl libtool.m4 into aclocal.m4, while still arranging for automake to
dnl add a definition of LIBTOOL to Makefile.in.
ifelse(,,,[AC_SUBST(LIBTOOL)
AC_DEFUN([AM_PROG_LIBTOOL])
])
dnl
dnl Initialize the rest of the library configury. At this point we have
dnl variables like $host.
dnl
dnl Substs:
dnl libvtv_builddir (absolute path)
dnl libvtv_srcdir (absolute path)
dnl toplevel_builddir (absolute path)
dnl toplevel_srcdir (absolute path)
dnl with_cross_host
dnl with_newlib
dnl with_target_subdir
dnl plus
dnl - the variables in LIBVTV_CHECK_HOST / configure.host
dnl - default settings for all AM_CONDITIONAL test variables
dnl - lots of tools, like CC and CXX
dnl
AC_DEFUN([LIBVTV_CONFIGURE], [
# Use same top-level configure hooks in libgcc/libstdc++/libvtv.
AC_ARG_ENABLE(vtable-verify,
[ --enable-vtable-verify Enable vtable verification feature ],
[case "$enableval" in
yes) enable_vtable_verify=yes ;;
no) enable_vtable_verify=no ;;
*) enable_vtable_verify=no;;
esac],
[enable_vtable_verify=no])
AM_CONDITIONAL(ENABLE_VTABLE_VERIFY, test $enable_vtable_verify = yes)
# These need to be absolute paths, yet at the same time need to
# canonicalize only relative paths, because then amd will not unmount
# drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd.
libvtv_builddir=`${PWDCMD-pwd}`
case $srcdir in
[\\/$]* | ?:[\\/]*) libvtv_srcdir=${srcdir} ;;
*) libvtv_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
esac
toplevel_builddir=${libvtv_builddir}/..
toplevel_srcdir=${libvtv_srcdir}/..
AC_SUBST(libvtv_builddir)
AC_SUBST(libvtv_srcdir)
AC_SUBST(toplevel_builddir)
AC_SUBST(toplevel_srcdir)
])

1016
libvtv/aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load diff

17164
libvtv/autom4te.cache/output.0 Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,68 @@
# This file was generated.
# It contains the lists of macros which have been traced.
# It can be safely removed.
@request = (
bless( [
'0',
1,
[
'/usr/local/share/autoconf'
],
[
'/usr/local/share/autoconf/autoconf/autoconf.m4f',
'aclocal.m4',
'configure.ac'
],
{
'AM_PROG_F77_C_O' => 1,
'_LT_AC_TAGCONFIG' => 1,
'm4_pattern_forbid' => 1,
'AC_INIT' => 1,
'AC_CANONICAL_TARGET' => 1,
'_AM_COND_IF' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AC_SUBST' => 1,
'AC_CANONICAL_HOST' => 1,
'AC_FC_SRCEXT' => 1,
'AC_PROG_LIBTOOL' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'm4_sinclude' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'_m4_warn' => 1,
'AM_PROG_CXX_C_O' => 1,
'_AM_COND_ENDIF' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_SILENT_RULES' => 1,
'AC_CONFIG_FILES' => 1,
'include' => 1,
'LT_INIT' => 1,
'AM_GNU_GETTEXT' => 1,
'AC_LIBSOURCE' => 1,
'AC_CANONICAL_BUILD' => 1,
'AM_PROG_FC_C_O' => 1,
'AC_FC_FREEFORM' => 1,
'AH_OUTPUT' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AM_PROG_CC_C_O' => 1,
'm4_pattern_allow' => 1,
'sinclude' => 1,
'AM_CONDITIONAL' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'm4_include' => 1,
'_AM_COND_ELSE' => 1,
'AC_SUBST_TRACE' => 1
}
], 'Autom4te::Request' )
);

View file

@ -0,0 +1,680 @@
m4trace:aclocal.m4:1006: -1- m4_include([../config/acx.m4])
m4trace:aclocal.m4:1007: -1- m4_include([../config/depstand.m4])
m4trace:aclocal.m4:1008: -1- m4_include([../config/lead-dot.m4])
m4trace:aclocal.m4:1009: -1- m4_include([../config/libstdc++-raw-cxx.m4])
m4trace:aclocal.m4:1010: -1- m4_include([../config/multi.m4])
m4trace:aclocal.m4:1011: -1- m4_include([../config/override.m4])
m4trace:aclocal.m4:1012: -1- m4_include([../ltoptions.m4])
m4trace:aclocal.m4:1013: -1- m4_include([../ltsugar.m4])
m4trace:aclocal.m4:1014: -1- m4_include([../ltversion.m4])
m4trace:aclocal.m4:1015: -1- m4_include([../lt~obsolete.m4])
m4trace:aclocal.m4:1016: -1- m4_include([acinclude.m4])
m4trace:acinclude.m4:4: -1- sinclude([../libtool.m4])
m4trace:configure.ac:5: -1- AC_INIT([GNU Vtable Verification Runtime Library], [1.0], [], [libvtv])
m4trace:configure.ac:5: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:5: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:5: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
m4trace:configure.ac:5: -1- m4_pattern_allow([^AS_FLAGS$])
m4trace:configure.ac:5: -1- m4_pattern_forbid([^_?m4_])
m4trace:configure.ac:5: -1- m4_pattern_forbid([^dnl$])
m4trace:configure.ac:5: -1- m4_pattern_forbid([^_?AS_])
m4trace:configure.ac:5: -1- AC_SUBST([SHELL])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SHELL])
m4trace:configure.ac:5: -1- m4_pattern_allow([^SHELL$])
m4trace:configure.ac:5: -1- AC_SUBST([PATH_SEPARATOR])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PATH_SEPARATOR$])
m4trace:configure.ac:5: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PACKAGE_NAME])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:5: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:5: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:5: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PACKAGE_STRING])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:5: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:5: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PACKAGE_URL])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:5: -1- AC_SUBST([exec_prefix], [NONE])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([exec_prefix])
m4trace:configure.ac:5: -1- m4_pattern_allow([^exec_prefix$])
m4trace:configure.ac:5: -1- AC_SUBST([prefix], [NONE])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([prefix])
m4trace:configure.ac:5: -1- m4_pattern_allow([^prefix$])
m4trace:configure.ac:5: -1- AC_SUBST([program_transform_name], [s,x,x,])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([program_transform_name])
m4trace:configure.ac:5: -1- m4_pattern_allow([^program_transform_name$])
m4trace:configure.ac:5: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([bindir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^bindir$])
m4trace:configure.ac:5: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([sbindir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^sbindir$])
m4trace:configure.ac:5: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([libexecdir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^libexecdir$])
m4trace:configure.ac:5: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([datarootdir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^datarootdir$])
m4trace:configure.ac:5: -1- AC_SUBST([datadir], ['${datarootdir}'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([datadir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^datadir$])
m4trace:configure.ac:5: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([sysconfdir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^sysconfdir$])
m4trace:configure.ac:5: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([sharedstatedir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^sharedstatedir$])
m4trace:configure.ac:5: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([localstatedir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^localstatedir$])
m4trace:configure.ac:5: -1- AC_SUBST([includedir], ['${prefix}/include'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([includedir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^includedir$])
m4trace:configure.ac:5: -1- AC_SUBST([oldincludedir], ['/usr/include'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([oldincludedir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^oldincludedir$])
m4trace:configure.ac:5: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
['${datarootdir}/doc/${PACKAGE_TARNAME}'],
['${datarootdir}/doc/${PACKAGE}'])])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([docdir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^docdir$])
m4trace:configure.ac:5: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([infodir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^infodir$])
m4trace:configure.ac:5: -1- AC_SUBST([htmldir], ['${docdir}'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([htmldir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^htmldir$])
m4trace:configure.ac:5: -1- AC_SUBST([dvidir], ['${docdir}'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([dvidir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^dvidir$])
m4trace:configure.ac:5: -1- AC_SUBST([pdfdir], ['${docdir}'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([pdfdir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^pdfdir$])
m4trace:configure.ac:5: -1- AC_SUBST([psdir], ['${docdir}'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([psdir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^psdir$])
m4trace:configure.ac:5: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([libdir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^libdir$])
m4trace:configure.ac:5: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([localedir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^localedir$])
m4trace:configure.ac:5: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([mandir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^mandir$])
m4trace:configure.ac:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:5: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
@%:@undef PACKAGE_NAME])
m4trace:configure.ac:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:5: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
@%:@undef PACKAGE_TARNAME])
m4trace:configure.ac:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:5: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
@%:@undef PACKAGE_VERSION])
m4trace:configure.ac:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:5: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
@%:@undef PACKAGE_STRING])
m4trace:configure.ac:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:5: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
@%:@undef PACKAGE_BUGREPORT])
m4trace:configure.ac:5: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:5: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */
@%:@undef PACKAGE_URL])
m4trace:configure.ac:5: -1- AC_SUBST([DEFS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([DEFS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^DEFS$])
m4trace:configure.ac:5: -1- AC_SUBST([ECHO_C])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([ECHO_C])
m4trace:configure.ac:5: -1- m4_pattern_allow([^ECHO_C$])
m4trace:configure.ac:5: -1- AC_SUBST([ECHO_N])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([ECHO_N])
m4trace:configure.ac:5: -1- m4_pattern_allow([^ECHO_N$])
m4trace:configure.ac:5: -1- AC_SUBST([ECHO_T])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([ECHO_T])
m4trace:configure.ac:5: -1- m4_pattern_allow([^ECHO_T$])
m4trace:configure.ac:5: -1- AC_SUBST([LIBS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:5: -1- AC_SUBST([build_alias])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([build_alias])
m4trace:configure.ac:5: -1- m4_pattern_allow([^build_alias$])
m4trace:configure.ac:5: -1- AC_SUBST([host_alias])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([host_alias])
m4trace:configure.ac:5: -1- m4_pattern_allow([^host_alias$])
m4trace:configure.ac:5: -1- AC_SUBST([target_alias])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([target_alias])
m4trace:configure.ac:5: -1- m4_pattern_allow([^target_alias$])
m4trace:configure.ac:25: -1- AC_CANONICAL_SYSTEM
m4trace:configure.ac:25: -1- _m4_warn([obsolete], [The macro `AC_CANONICAL_SYSTEM' is obsolete.
You should run autoupdate.], [../../lib/autoconf/general.m4:1863: AC_CANONICAL_SYSTEM is expanded from...
configure.ac:25: the top level])
m4trace:configure.ac:25: -1- AC_CANONICAL_TARGET
m4trace:configure.ac:25: -1- AC_CANONICAL_HOST
m4trace:configure.ac:25: -1- AC_CANONICAL_BUILD
m4trace:configure.ac:25: -1- AC_REQUIRE_AUX_FILE([config.sub])
m4trace:configure.ac:25: -1- AC_REQUIRE_AUX_FILE([config.guess])
m4trace:configure.ac:25: -1- AC_SUBST([build], [$ac_cv_build])
m4trace:configure.ac:25: -1- AC_SUBST_TRACE([build])
m4trace:configure.ac:25: -1- m4_pattern_allow([^build$])
m4trace:configure.ac:25: -1- AC_SUBST([build_cpu], [$[1]])
m4trace:configure.ac:25: -1- AC_SUBST_TRACE([build_cpu])
m4trace:configure.ac:25: -1- m4_pattern_allow([^build_cpu$])
m4trace:configure.ac:25: -1- AC_SUBST([build_vendor], [$[2]])
m4trace:configure.ac:25: -1- AC_SUBST_TRACE([build_vendor])
m4trace:configure.ac:25: -1- m4_pattern_allow([^build_vendor$])
m4trace:configure.ac:25: -1- AC_SUBST([build_os])
m4trace:configure.ac:25: -1- AC_SUBST_TRACE([build_os])
m4trace:configure.ac:25: -1- m4_pattern_allow([^build_os$])
m4trace:configure.ac:25: -1- AC_SUBST([host], [$ac_cv_host])
m4trace:configure.ac:25: -1- AC_SUBST_TRACE([host])
m4trace:configure.ac:25: -1- m4_pattern_allow([^host$])
m4trace:configure.ac:25: -1- AC_SUBST([host_cpu], [$[1]])
m4trace:configure.ac:25: -1- AC_SUBST_TRACE([host_cpu])
m4trace:configure.ac:25: -1- m4_pattern_allow([^host_cpu$])
m4trace:configure.ac:25: -1- AC_SUBST([host_vendor], [$[2]])
m4trace:configure.ac:25: -1- AC_SUBST_TRACE([host_vendor])
m4trace:configure.ac:25: -1- m4_pattern_allow([^host_vendor$])
m4trace:configure.ac:25: -1- AC_SUBST([host_os])
m4trace:configure.ac:25: -1- AC_SUBST_TRACE([host_os])
m4trace:configure.ac:25: -1- m4_pattern_allow([^host_os$])
m4trace:configure.ac:25: -1- AC_SUBST([target], [$ac_cv_target])
m4trace:configure.ac:25: -1- AC_SUBST_TRACE([target])
m4trace:configure.ac:25: -1- m4_pattern_allow([^target$])
m4trace:configure.ac:25: -1- AC_SUBST([target_cpu], [$[1]])
m4trace:configure.ac:25: -1- AC_SUBST_TRACE([target_cpu])
m4trace:configure.ac:25: -1- m4_pattern_allow([^target_cpu$])
m4trace:configure.ac:25: -1- AC_SUBST([target_vendor], [$[2]])
m4trace:configure.ac:25: -1- AC_SUBST_TRACE([target_vendor])
m4trace:configure.ac:25: -1- m4_pattern_allow([^target_vendor$])
m4trace:configure.ac:25: -1- AC_SUBST([target_os])
m4trace:configure.ac:25: -1- AC_SUBST_TRACE([target_os])
m4trace:configure.ac:25: -1- m4_pattern_allow([^target_os$])
m4trace:configure.ac:27: -1- AC_SUBST([target_alias])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([target_alias])
m4trace:configure.ac:27: -1- m4_pattern_allow([^target_alias$])
m4trace:configure.ac:28: -1- AC_SUBST([target_noncanonical])
m4trace:configure.ac:28: -1- AC_SUBST_TRACE([target_noncanonical])
m4trace:configure.ac:28: -1- m4_pattern_allow([^target_noncanonical$])
m4trace:configure.ac:28: -1- AC_SUBST([LIBSTDCXX_RAW_CXX_CXXFLAGS])
m4trace:configure.ac:28: -1- AC_SUBST_TRACE([LIBSTDCXX_RAW_CXX_CXXFLAGS])
m4trace:configure.ac:28: -1- m4_pattern_allow([^LIBSTDCXX_RAW_CXX_CXXFLAGS$])
m4trace:configure.ac:28: -1- AC_SUBST([LIBSTDCXX_RAW_CXX_LDFLAGS])
m4trace:configure.ac:28: -1- AC_SUBST_TRACE([LIBSTDCXX_RAW_CXX_LDFLAGS])
m4trace:configure.ac:28: -1- m4_pattern_allow([^LIBSTDCXX_RAW_CXX_LDFLAGS$])
m4trace:configure.ac:30: -1- AM_INIT_AUTOMAKE([foreign no-dist])
m4trace:configure.ac:30: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
m4trace:configure.ac:30: -1- AM_AUTOMAKE_VERSION([1.11.1])
m4trace:configure.ac:30: -1- AC_REQUIRE_AUX_FILE([install-sh])
m4trace:configure.ac:30: -1- AC_SUBST([INSTALL_PROGRAM])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
m4trace:configure.ac:30: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
m4trace:configure.ac:30: -1- AC_SUBST([INSTALL_SCRIPT])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
m4trace:configure.ac:30: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
m4trace:configure.ac:30: -1- AC_SUBST([INSTALL_DATA])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([INSTALL_DATA])
m4trace:configure.ac:30: -1- m4_pattern_allow([^INSTALL_DATA$])
m4trace:configure.ac:30: -1- AC_SUBST([am__isrc], [' -I$(srcdir)'])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([am__isrc])
m4trace:configure.ac:30: -1- m4_pattern_allow([^am__isrc$])
m4trace:configure.ac:30: -1- _AM_SUBST_NOTMAKE([am__isrc])
m4trace:configure.ac:30: -1- AC_SUBST([CYGPATH_W])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([CYGPATH_W])
m4trace:configure.ac:30: -1- m4_pattern_allow([^CYGPATH_W$])
m4trace:configure.ac:30: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([PACKAGE])
m4trace:configure.ac:30: -1- m4_pattern_allow([^PACKAGE$])
m4trace:configure.ac:30: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([VERSION])
m4trace:configure.ac:30: -1- m4_pattern_allow([^VERSION$])
m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
m4trace:configure.ac:30: -1- m4_pattern_allow([^PACKAGE$])
m4trace:configure.ac:30: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
@%:@undef PACKAGE])
m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
m4trace:configure.ac:30: -1- m4_pattern_allow([^VERSION$])
m4trace:configure.ac:30: -1- AH_OUTPUT([VERSION], [/* Version number of package */
@%:@undef VERSION])
m4trace:configure.ac:30: -1- AC_REQUIRE_AUX_FILE([missing])
m4trace:configure.ac:30: -1- AC_SUBST([ACLOCAL])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([ACLOCAL])
m4trace:configure.ac:30: -1- m4_pattern_allow([^ACLOCAL$])
m4trace:configure.ac:30: -1- AC_SUBST([AUTOCONF])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([AUTOCONF])
m4trace:configure.ac:30: -1- m4_pattern_allow([^AUTOCONF$])
m4trace:configure.ac:30: -1- AC_SUBST([AUTOMAKE])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([AUTOMAKE])
m4trace:configure.ac:30: -1- m4_pattern_allow([^AUTOMAKE$])
m4trace:configure.ac:30: -1- AC_SUBST([AUTOHEADER])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([AUTOHEADER])
m4trace:configure.ac:30: -1- m4_pattern_allow([^AUTOHEADER$])
m4trace:configure.ac:30: -1- AC_SUBST([MAKEINFO])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([MAKEINFO])
m4trace:configure.ac:30: -1- m4_pattern_allow([^MAKEINFO$])
m4trace:configure.ac:30: -1- AC_SUBST([install_sh])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([install_sh])
m4trace:configure.ac:30: -1- m4_pattern_allow([^install_sh$])
m4trace:configure.ac:30: -1- AC_SUBST([STRIP])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([STRIP])
m4trace:configure.ac:30: -1- m4_pattern_allow([^STRIP$])
m4trace:configure.ac:30: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM])
m4trace:configure.ac:30: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
m4trace:configure.ac:30: -1- AC_REQUIRE_AUX_FILE([install-sh])
m4trace:configure.ac:30: -1- AC_SUBST([MKDIR_P])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([MKDIR_P])
m4trace:configure.ac:30: -1- m4_pattern_allow([^MKDIR_P$])
m4trace:configure.ac:30: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([mkdir_p])
m4trace:configure.ac:30: -1- m4_pattern_allow([^mkdir_p$])
m4trace:configure.ac:30: -1- AC_SUBST([AWK])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([AWK])
m4trace:configure.ac:30: -1- m4_pattern_allow([^AWK$])
m4trace:configure.ac:30: -1- AC_SUBST([SET_MAKE])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([SET_MAKE])
m4trace:configure.ac:30: -1- m4_pattern_allow([^SET_MAKE$])
m4trace:configure.ac:30: -1- AC_SUBST([am__leading_dot])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([am__leading_dot])
m4trace:configure.ac:30: -1- m4_pattern_allow([^am__leading_dot$])
m4trace:configure.ac:30: -1- AC_SUBST([AMTAR])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([AMTAR])
m4trace:configure.ac:30: -1- m4_pattern_allow([^AMTAR$])
m4trace:configure.ac:30: -1- AC_SUBST([am__tar])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([am__tar])
m4trace:configure.ac:30: -1- m4_pattern_allow([^am__tar$])
m4trace:configure.ac:30: -1- AC_SUBST([am__untar])
m4trace:configure.ac:30: -1- AC_SUBST_TRACE([am__untar])
m4trace:configure.ac:30: -1- m4_pattern_allow([^am__untar$])
m4trace:configure.ac:31: -1- AM_ENABLE_MULTILIB([], [..])
m4trace:configure.ac:31: -1- AC_SUBST([multi_basedir])
m4trace:configure.ac:31: -1- AC_SUBST_TRACE([multi_basedir])
m4trace:configure.ac:31: -1- m4_pattern_allow([^multi_basedir$])
m4trace:configure.ac:31: -1- _m4_warn([obsolete], [The macro `AC_OUTPUT_COMMANDS' is obsolete.
You should run autoupdate.], [../../lib/autoconf/status.m4:1040: AC_OUTPUT_COMMANDS is expanded from...
../config/multi.m4:14: AM_ENABLE_MULTILIB is expanded from...
configure.ac:31: the top level])
m4trace:configure.ac:32: -1- AM_MAINTAINER_MODE
m4trace:configure.ac:32: -1- AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
m4trace:configure.ac:32: -1- AC_SUBST([MAINTAINER_MODE_TRUE])
m4trace:configure.ac:32: -1- AC_SUBST_TRACE([MAINTAINER_MODE_TRUE])
m4trace:configure.ac:32: -1- m4_pattern_allow([^MAINTAINER_MODE_TRUE$])
m4trace:configure.ac:32: -1- AC_SUBST([MAINTAINER_MODE_FALSE])
m4trace:configure.ac:32: -1- AC_SUBST_TRACE([MAINTAINER_MODE_FALSE])
m4trace:configure.ac:32: -1- m4_pattern_allow([^MAINTAINER_MODE_FALSE$])
m4trace:configure.ac:32: -1- _AM_SUBST_NOTMAKE([MAINTAINER_MODE_TRUE])
m4trace:configure.ac:32: -1- _AM_SUBST_NOTMAKE([MAINTAINER_MODE_FALSE])
m4trace:configure.ac:32: -1- AC_SUBST([MAINT])
m4trace:configure.ac:32: -1- AC_SUBST_TRACE([MAINT])
m4trace:configure.ac:32: -1- m4_pattern_allow([^MAINT$])
m4trace:configure.ac:61: -1- AC_SUBST([toolexecdir])
m4trace:configure.ac:61: -1- AC_SUBST_TRACE([toolexecdir])
m4trace:configure.ac:61: -1- m4_pattern_allow([^toolexecdir$])
m4trace:configure.ac:62: -1- AC_SUBST([toolexeclibdir])
m4trace:configure.ac:62: -1- AC_SUBST_TRACE([toolexeclibdir])
m4trace:configure.ac:62: -1- m4_pattern_allow([^toolexeclibdir$])
m4trace:configure.ac:67: -1- AC_SUBST([CC])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:67: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:67: -1- AC_SUBST([CFLAGS])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([CFLAGS])
m4trace:configure.ac:67: -1- m4_pattern_allow([^CFLAGS$])
m4trace:configure.ac:67: -1- AC_SUBST([LDFLAGS])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([LDFLAGS])
m4trace:configure.ac:67: -1- m4_pattern_allow([^LDFLAGS$])
m4trace:configure.ac:67: -1- AC_SUBST([LIBS])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:67: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:67: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:67: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:67: -1- AC_SUBST([CC])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:67: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:67: -1- AC_SUBST([CC])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:67: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:67: -1- AC_SUBST([CC])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:67: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:67: -1- AC_SUBST([CC])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:67: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:67: -1- AC_SUBST([ac_ct_CC])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([ac_ct_CC])
m4trace:configure.ac:67: -1- m4_pattern_allow([^ac_ct_CC$])
m4trace:configure.ac:67: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([EXEEXT])
m4trace:configure.ac:67: -1- m4_pattern_allow([^EXEEXT$])
m4trace:configure.ac:67: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([OBJEXT])
m4trace:configure.ac:67: -1- m4_pattern_allow([^OBJEXT$])
m4trace:configure.ac:67: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([DEPDIR])
m4trace:configure.ac:67: -1- m4_pattern_allow([^DEPDIR$])
m4trace:configure.ac:67: -1- AC_SUBST([am__include])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([am__include])
m4trace:configure.ac:67: -1- m4_pattern_allow([^am__include$])
m4trace:configure.ac:67: -1- AC_SUBST([am__quote])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([am__quote])
m4trace:configure.ac:67: -1- m4_pattern_allow([^am__quote$])
m4trace:configure.ac:67: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
m4trace:configure.ac:67: -1- AC_SUBST([AMDEP_TRUE])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([AMDEP_TRUE])
m4trace:configure.ac:67: -1- m4_pattern_allow([^AMDEP_TRUE$])
m4trace:configure.ac:67: -1- AC_SUBST([AMDEP_FALSE])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([AMDEP_FALSE])
m4trace:configure.ac:67: -1- m4_pattern_allow([^AMDEP_FALSE$])
m4trace:configure.ac:67: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE])
m4trace:configure.ac:67: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE])
m4trace:configure.ac:67: -1- AC_SUBST([AMDEPBACKSLASH])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([AMDEPBACKSLASH])
m4trace:configure.ac:67: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
m4trace:configure.ac:67: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])
m4trace:configure.ac:67: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([CCDEPMODE])
m4trace:configure.ac:67: -1- m4_pattern_allow([^CCDEPMODE$])
m4trace:configure.ac:67: -1- AM_CONDITIONAL([am__fastdepCC], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3])
m4trace:configure.ac:67: -1- AC_SUBST([am__fastdepCC_TRUE])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE])
m4trace:configure.ac:67: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
m4trace:configure.ac:67: -1- AC_SUBST([am__fastdepCC_FALSE])
m4trace:configure.ac:67: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE])
m4trace:configure.ac:67: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
m4trace:configure.ac:67: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
m4trace:configure.ac:67: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
m4trace:configure.ac:68: -1- AC_SUBST([CXX])
m4trace:configure.ac:68: -1- AC_SUBST_TRACE([CXX])
m4trace:configure.ac:68: -1- m4_pattern_allow([^CXX$])
m4trace:configure.ac:68: -1- AC_SUBST([CXXFLAGS])
m4trace:configure.ac:68: -1- AC_SUBST_TRACE([CXXFLAGS])
m4trace:configure.ac:68: -1- m4_pattern_allow([^CXXFLAGS$])
m4trace:configure.ac:68: -1- AC_SUBST([LDFLAGS])
m4trace:configure.ac:68: -1- AC_SUBST_TRACE([LDFLAGS])
m4trace:configure.ac:68: -1- m4_pattern_allow([^LDFLAGS$])
m4trace:configure.ac:68: -1- AC_SUBST([LIBS])
m4trace:configure.ac:68: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:68: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:68: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:68: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:68: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:68: -1- AC_SUBST([CXX])
m4trace:configure.ac:68: -1- AC_SUBST_TRACE([CXX])
m4trace:configure.ac:68: -1- m4_pattern_allow([^CXX$])
m4trace:configure.ac:68: -1- AC_SUBST([ac_ct_CXX])
m4trace:configure.ac:68: -1- AC_SUBST_TRACE([ac_ct_CXX])
m4trace:configure.ac:68: -1- m4_pattern_allow([^ac_ct_CXX$])
m4trace:configure.ac:68: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type])
m4trace:configure.ac:68: -1- AC_SUBST_TRACE([CXXDEPMODE])
m4trace:configure.ac:68: -1- m4_pattern_allow([^CXXDEPMODE$])
m4trace:configure.ac:68: -1- AM_CONDITIONAL([am__fastdepCXX], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_CXX_dependencies_compiler_type" = gcc3])
m4trace:configure.ac:68: -1- AC_SUBST([am__fastdepCXX_TRUE])
m4trace:configure.ac:68: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE])
m4trace:configure.ac:68: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$])
m4trace:configure.ac:68: -1- AC_SUBST([am__fastdepCXX_FALSE])
m4trace:configure.ac:68: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE])
m4trace:configure.ac:68: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$])
m4trace:configure.ac:68: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE])
m4trace:configure.ac:68: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE])
m4trace:configure.ac:71: -1- AM_PROG_CC_C_O
m4trace:configure.ac:71: -1- AC_DEFINE_TRACE_LITERAL([NO_MINUS_C_MINUS_O])
m4trace:configure.ac:71: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$])
m4trace:configure.ac:71: -1- AH_OUTPUT([NO_MINUS_C_MINUS_O], [/* Define to 1 if your C compiler doesn\'t accept -c and -o together. */
@%:@undef NO_MINUS_C_MINUS_O])
m4trace:configure.ac:71: -1- AC_REQUIRE_AUX_FILE([compile])
m4trace:configure.ac:73: -1- AC_SUBST([CFLAGS])
m4trace:configure.ac:73: -1- AC_SUBST_TRACE([CFLAGS])
m4trace:configure.ac:73: -1- m4_pattern_allow([^CFLAGS$])
m4trace:configure.ac:74: -1- AC_SUBST([CXXFLAGS])
m4trace:configure.ac:74: -1- AC_SUBST_TRACE([CXXFLAGS])
m4trace:configure.ac:74: -1- m4_pattern_allow([^CXXFLAGS$])
m4trace:configure.ac:79: -1- AC_SUBST([CCAS])
m4trace:configure.ac:79: -1- AC_SUBST_TRACE([CCAS])
m4trace:configure.ac:79: -1- m4_pattern_allow([^CCAS$])
m4trace:configure.ac:80: -1- AC_SUBST([CCASFLAGS])
m4trace:configure.ac:80: -1- AC_SUBST_TRACE([CCASFLAGS])
m4trace:configure.ac:80: -1- m4_pattern_allow([^CCASFLAGS$])
m4trace:configure.ac:82: -1- AC_SUBST([AS])
m4trace:configure.ac:82: -1- AC_SUBST_TRACE([AS])
m4trace:configure.ac:82: -1- m4_pattern_allow([^AS$])
m4trace:configure.ac:83: -1- AC_SUBST([AR])
m4trace:configure.ac:83: -1- AC_SUBST_TRACE([AR])
m4trace:configure.ac:83: -1- m4_pattern_allow([^AR$])
m4trace:configure.ac:84: -1- AC_SUBST([RANLIB])
m4trace:configure.ac:84: -1- AC_SUBST_TRACE([RANLIB])
m4trace:configure.ac:84: -1- m4_pattern_allow([^RANLIB$])
m4trace:configure.ac:87: -1- _m4_warn([obsolete], [The macro `AC_LIBTOOL_DLOPEN' is obsolete.
You should run autoupdate.], [../ltoptions.m4:111: AC_LIBTOOL_DLOPEN is expanded from...
configure.ac:87: the top level])
m4trace:configure.ac:87: -1- _m4_warn([obsolete], [AC_LIBTOOL_DLOPEN: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.], [../ltoptions.m4:111: AC_LIBTOOL_DLOPEN is expanded from...
configure.ac:87: the top level])
m4trace:configure.ac:88: -1- _m4_warn([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete.
You should run autoupdate.], [../libtool.m4:106: AM_PROG_LIBTOOL is expanded from...
configure.ac:88: the top level])
m4trace:configure.ac:88: -1- LT_INIT
m4trace:configure.ac:88: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$])
m4trace:configure.ac:88: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])
m4trace:configure.ac:88: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
m4trace:configure.ac:88: -1- AC_SUBST([LIBTOOL])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([LIBTOOL])
m4trace:configure.ac:88: -1- m4_pattern_allow([^LIBTOOL$])
m4trace:configure.ac:88: -1- AC_SUBST([SED])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([SED])
m4trace:configure.ac:88: -1- m4_pattern_allow([^SED$])
m4trace:configure.ac:88: -1- AC_SUBST([GREP])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([GREP])
m4trace:configure.ac:88: -1- m4_pattern_allow([^GREP$])
m4trace:configure.ac:88: -1- AC_SUBST([EGREP])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([EGREP])
m4trace:configure.ac:88: -1- m4_pattern_allow([^EGREP$])
m4trace:configure.ac:88: -1- AC_SUBST([FGREP])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([FGREP])
m4trace:configure.ac:88: -1- m4_pattern_allow([^FGREP$])
m4trace:configure.ac:88: -1- AC_SUBST([GREP])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([GREP])
m4trace:configure.ac:88: -1- m4_pattern_allow([^GREP$])
m4trace:configure.ac:88: -1- AC_SUBST([LD])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([LD])
m4trace:configure.ac:88: -1- m4_pattern_allow([^LD$])
m4trace:configure.ac:88: -1- AC_SUBST([DUMPBIN])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([DUMPBIN])
m4trace:configure.ac:88: -1- m4_pattern_allow([^DUMPBIN$])
m4trace:configure.ac:88: -1- AC_SUBST([ac_ct_DUMPBIN])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([ac_ct_DUMPBIN])
m4trace:configure.ac:88: -1- m4_pattern_allow([^ac_ct_DUMPBIN$])
m4trace:configure.ac:88: -1- AC_SUBST([DUMPBIN])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([DUMPBIN])
m4trace:configure.ac:88: -1- m4_pattern_allow([^DUMPBIN$])
m4trace:configure.ac:88: -1- AC_SUBST([NM])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([NM])
m4trace:configure.ac:88: -1- m4_pattern_allow([^NM$])
m4trace:configure.ac:88: -1- AC_SUBST([LN_S], [$as_ln_s])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([LN_S])
m4trace:configure.ac:88: -1- m4_pattern_allow([^LN_S$])
m4trace:configure.ac:88: -1- AC_SUBST([OBJDUMP])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([OBJDUMP])
m4trace:configure.ac:88: -1- m4_pattern_allow([^OBJDUMP$])
m4trace:configure.ac:88: -1- AC_SUBST([OBJDUMP])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([OBJDUMP])
m4trace:configure.ac:88: -1- m4_pattern_allow([^OBJDUMP$])
m4trace:configure.ac:88: -1- AC_SUBST([AR])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([AR])
m4trace:configure.ac:88: -1- m4_pattern_allow([^AR$])
m4trace:configure.ac:88: -1- AC_SUBST([STRIP])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([STRIP])
m4trace:configure.ac:88: -1- m4_pattern_allow([^STRIP$])
m4trace:configure.ac:88: -1- AC_SUBST([RANLIB])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([RANLIB])
m4trace:configure.ac:88: -1- m4_pattern_allow([^RANLIB$])
m4trace:configure.ac:88: -1- m4_pattern_allow([LT_OBJDIR])
m4trace:configure.ac:88: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR])
m4trace:configure.ac:88: -1- m4_pattern_allow([^LT_OBJDIR$])
m4trace:configure.ac:88: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
@%:@undef LT_OBJDIR])
m4trace:configure.ac:88: -1- LT_SUPPORTED_TAG([CC])
m4trace:configure.ac:88: -1- AC_SUBST([DSYMUTIL])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([DSYMUTIL])
m4trace:configure.ac:88: -1- m4_pattern_allow([^DSYMUTIL$])
m4trace:configure.ac:88: -1- AC_SUBST([NMEDIT])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([NMEDIT])
m4trace:configure.ac:88: -1- m4_pattern_allow([^NMEDIT$])
m4trace:configure.ac:88: -1- AC_SUBST([LIPO])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([LIPO])
m4trace:configure.ac:88: -1- m4_pattern_allow([^LIPO$])
m4trace:configure.ac:88: -1- AC_SUBST([OTOOL])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([OTOOL])
m4trace:configure.ac:88: -1- m4_pattern_allow([^OTOOL$])
m4trace:configure.ac:88: -1- AC_SUBST([OTOOL64])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([OTOOL64])
m4trace:configure.ac:88: -1- m4_pattern_allow([^OTOOL64$])
m4trace:configure.ac:88: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
@%:@undef HAVE_DLFCN_H])
m4trace:configure.ac:88: -1- AC_SUBST([CPP])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([CPP])
m4trace:configure.ac:88: -1- m4_pattern_allow([^CPP$])
m4trace:configure.ac:88: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:88: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:88: -1- AC_SUBST([CPP])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([CPP])
m4trace:configure.ac:88: -1- m4_pattern_allow([^CPP$])
m4trace:configure.ac:88: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
m4trace:configure.ac:88: -1- m4_pattern_allow([^STDC_HEADERS$])
m4trace:configure.ac:88: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
@%:@undef STDC_HEADERS])
m4trace:configure.ac:88: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
@%:@undef HAVE_SYS_TYPES_H])
m4trace:configure.ac:88: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
@%:@undef HAVE_SYS_STAT_H])
m4trace:configure.ac:88: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
@%:@undef HAVE_STDLIB_H])
m4trace:configure.ac:88: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
@%:@undef HAVE_STRING_H])
m4trace:configure.ac:88: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
@%:@undef HAVE_MEMORY_H])
m4trace:configure.ac:88: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
@%:@undef HAVE_STRINGS_H])
m4trace:configure.ac:88: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
@%:@undef HAVE_INTTYPES_H])
m4trace:configure.ac:88: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
@%:@undef HAVE_STDINT_H])
m4trace:configure.ac:88: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
@%:@undef HAVE_UNISTD_H])
m4trace:configure.ac:88: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H])
m4trace:configure.ac:88: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
m4trace:configure.ac:88: -1- LT_SUPPORTED_TAG([CXX])
m4trace:configure.ac:88: -1- AC_SUBST([CXXCPP])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([CXXCPP])
m4trace:configure.ac:88: -1- m4_pattern_allow([^CXXCPP$])
m4trace:configure.ac:88: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:88: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:88: -1- AC_SUBST([CXXCPP])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([CXXCPP])
m4trace:configure.ac:88: -1- m4_pattern_allow([^CXXCPP$])
m4trace:configure.ac:88: -1- AC_SUBST([LD])
m4trace:configure.ac:88: -1- AC_SUBST_TRACE([LD])
m4trace:configure.ac:88: -1- m4_pattern_allow([^LD$])
m4trace:configure.ac:89: -1- AC_SUBST([enable_shared])
m4trace:configure.ac:89: -1- AC_SUBST_TRACE([enable_shared])
m4trace:configure.ac:89: -1- m4_pattern_allow([^enable_shared$])
m4trace:configure.ac:90: -1- AC_SUBST([enable_static])
m4trace:configure.ac:90: -1- AC_SUBST_TRACE([enable_static])
m4trace:configure.ac:90: -1- m4_pattern_allow([^enable_static$])
m4trace:configure.ac:94: -1- AC_SUBST([libtool_VERSION])
m4trace:configure.ac:94: -1- AC_SUBST_TRACE([libtool_VERSION])
m4trace:configure.ac:94: -1- m4_pattern_allow([^libtool_VERSION$])
m4trace:configure.ac:97: -1- AC_SUBST([XCFLAGS])
m4trace:configure.ac:97: -1- AC_SUBST_TRACE([XCFLAGS])
m4trace:configure.ac:97: -1- m4_pattern_allow([^XCFLAGS$])
m4trace:configure.ac:105: -1- AM_CONDITIONAL([ENABLE_VTABLE_VERIFY], [test $enable_vtable_verify = yes])
m4trace:configure.ac:105: -1- AC_SUBST([ENABLE_VTABLE_VERIFY_TRUE])
m4trace:configure.ac:105: -1- AC_SUBST_TRACE([ENABLE_VTABLE_VERIFY_TRUE])
m4trace:configure.ac:105: -1- m4_pattern_allow([^ENABLE_VTABLE_VERIFY_TRUE$])
m4trace:configure.ac:105: -1- AC_SUBST([ENABLE_VTABLE_VERIFY_FALSE])
m4trace:configure.ac:105: -1- AC_SUBST_TRACE([ENABLE_VTABLE_VERIFY_FALSE])
m4trace:configure.ac:105: -1- m4_pattern_allow([^ENABLE_VTABLE_VERIFY_FALSE$])
m4trace:configure.ac:105: -1- _AM_SUBST_NOTMAKE([ENABLE_VTABLE_VERIFY_TRUE])
m4trace:configure.ac:105: -1- _AM_SUBST_NOTMAKE([ENABLE_VTABLE_VERIFY_FALSE])
m4trace:configure.ac:105: -1- AC_SUBST([libvtv_builddir])
m4trace:configure.ac:105: -1- AC_SUBST_TRACE([libvtv_builddir])
m4trace:configure.ac:105: -1- m4_pattern_allow([^libvtv_builddir$])
m4trace:configure.ac:105: -1- AC_SUBST([libvtv_srcdir])
m4trace:configure.ac:105: -1- AC_SUBST_TRACE([libvtv_srcdir])
m4trace:configure.ac:105: -1- m4_pattern_allow([^libvtv_srcdir$])
m4trace:configure.ac:105: -1- AC_SUBST([toplevel_builddir])
m4trace:configure.ac:105: -1- AC_SUBST_TRACE([toplevel_builddir])
m4trace:configure.ac:105: -1- m4_pattern_allow([^toplevel_builddir$])
m4trace:configure.ac:105: -1- AC_SUBST([toplevel_srcdir])
m4trace:configure.ac:105: -1- AC_SUBST_TRACE([toplevel_srcdir])
m4trace:configure.ac:105: -1- m4_pattern_allow([^toplevel_srcdir$])
m4trace:configure.ac:110: -1- AM_CONDITIONAL([VTV_SUPPORTED], [test "x$VTV_SUPPORTED" = "xyes"])
m4trace:configure.ac:110: -1- AC_SUBST([VTV_SUPPORTED_TRUE])
m4trace:configure.ac:110: -1- AC_SUBST_TRACE([VTV_SUPPORTED_TRUE])
m4trace:configure.ac:110: -1- m4_pattern_allow([^VTV_SUPPORTED_TRUE$])
m4trace:configure.ac:110: -1- AC_SUBST([VTV_SUPPORTED_FALSE])
m4trace:configure.ac:110: -1- AC_SUBST_TRACE([VTV_SUPPORTED_FALSE])
m4trace:configure.ac:110: -1- m4_pattern_allow([^VTV_SUPPORTED_FALSE$])
m4trace:configure.ac:110: -1- _AM_SUBST_NOTMAKE([VTV_SUPPORTED_TRUE])
m4trace:configure.ac:110: -1- _AM_SUBST_NOTMAKE([VTV_SUPPORTED_FALSE])
m4trace:configure.ac:112: -1- AC_CONFIG_FILES([Makefile])
m4trace:configure.ac:115: -2- _m4_warn([obsolete], [The macro `AC_FOREACH' is obsolete.
You should run autoupdate.], [../../lib/autoconf/general.m4:217: AC_FOREACH is expanded from...
configure.ac:115: the top level])
m4trace:configure.ac:115: -1- AC_CONFIG_FILES([./Makefile testsuite/Makefile ], [cat > vpsed$$ << \_EOF
s!`test -f '$<' || echo '$(srcdir)/'`!!
_EOF
sed -f vpsed$$ $ac_file > tmp$$
mv tmp$$ $ac_file
rm vpsed$$
echo 'MULTISUBDIR =' >> $ac_file
ml_norecursion=yes
. ${multi_basedir}/config-ml.in
AS_UNSET([ml_norecursion])
])
m4trace:configure.ac:129: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
m4trace:configure.ac:129: -1- m4_pattern_allow([^LIB@&t@OBJS$])
m4trace:configure.ac:129: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([LTLIBOBJS])
m4trace:configure.ac:129: -1- m4_pattern_allow([^LTLIBOBJS$])
m4trace:configure.ac:129: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
m4trace:configure.ac:129: -1- AC_SUBST([am__EXEEXT_TRUE])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE])
m4trace:configure.ac:129: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
m4trace:configure.ac:129: -1- AC_SUBST([am__EXEEXT_FALSE])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE])
m4trace:configure.ac:129: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
m4trace:configure.ac:129: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
m4trace:configure.ac:129: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([top_builddir])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([top_build_prefix])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([srcdir])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([abs_srcdir])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([top_srcdir])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([abs_top_srcdir])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([builddir])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([abs_builddir])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([abs_top_builddir])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([INSTALL])
m4trace:configure.ac:129: -1- AC_SUBST_TRACE([MKDIR_P])
m4trace:configure.ac:129: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])

17164
libvtv/configure vendored Executable file

File diff suppressed because it is too large Load diff

129
libvtv/configure.ac Normal file
View file

@ -0,0 +1,129 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.64])
AC_INIT([GNU Vtable Verification Runtime Library], 1.0,,[libvtv])
#AC_INIT(package-unused, version-unused, libvtv)
AC_CONFIG_SRCDIR([vtv_rts.h])
# -------
# Options
# -------
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
AC_ARG_ENABLE(version-specific-runtime-libs,
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
[case "$enableval" in
yes) version_specific_libs=yes ;;
no) version_specific_libs=no ;;
*) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
esac],
[version_specific_libs=no])
AC_MSG_RESULT($version_specific_libs)
# Do not delete or change the following two lines. For why, see
# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
AC_CANONICAL_SYSTEM
target_alias=${target_alias-$host_alias}
AC_SUBST(target_alias)
GCC_LIBSTDCXX_RAW_CXX_FLAGS
AM_INIT_AUTOMAKE(foreign no-dist)
AM_ENABLE_MULTILIB(, ..)
AM_MAINTAINER_MODE
# Calculate toolexeclibdir
# Also toolexecdir, though it's only used in toolexeclibdir
case ${version_specific_libs} in
yes)
# Need the gcc compiler version to know where to install libraries
# and header files if --enable-version-specific-runtime-libs option
# is selected.
toolexecdir='$(libdir)/gcc/$(target_alias)'
toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
;;
no)
if test -n "$with_cross_host" &&
test x"$with_cross_host" != x"no"; then
# Install a library built with a cross compiler in tooldir, not libdir.
toolexecdir='$(exec_prefix)/$(target_alias)'
toolexeclibdir='$(toolexecdir)/lib'
else
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
toolexeclibdir='$(libdir)'
fi
multi_os_directory=`$CC -print-multi-os-directory`
case $multi_os_directory in
.) ;; # Avoid trailing /.
*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
esac
;;
esac
AC_SUBST(toolexecdir)
AC_SUBST(toolexeclibdir)
# Check for programs.
m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
m4_define([_AC_ARG_VAR_PRECIOUS],[])
AC_PROG_CC
AC_PROG_CXX
m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
AM_PROG_CC_C_O
AC_SUBST(CFLAGS)
AC_SUBST(CXXFLAGS)
# Newer automakes demand CCAS and CCASFLAGS.
: ${CCAS='$(CC)'}
: ${CCASFLAGS='$(CFLAGS)'}
AC_SUBST(CCAS)
AC_SUBST(CCASFLAGS)
AC_CHECK_TOOL(AS, as)
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
# Configure libtool
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
AC_SUBST(enable_shared)
AC_SUBST(enable_static)
# For libtool versioning info, format is CURRENT:REVISION:AGE
libtool_VERSION=1:0:0
AC_SUBST(libtool_VERSION)
XCFLAGS="-D_GNU_SOURCE -Wall -Wextra -fno-exceptions"
AC_SUBST(XCFLAGS)
if test "${multilib}" = "yes"; then
multilib_arg="--enable-multilib"
else
multilib_arg=
fi
LIBVTV_CONFIGURE
# Get target configury.
unset VTV_SUPPORTED
. ${srcdir}/configure.tgt
AM_CONDITIONAL(VTV_SUPPORTED, [test "x$VTV_SUPPORTED" = "xyes"])
AC_CONFIG_FILES([Makefile])
if test "x$VTV_SUPPORTED" = "xyes"; then
AC_CONFIG_FILES(AC_FOREACH([DIR], [. testsuite], [DIR/Makefile ]),
[cat > vpsed$$ << \_EOF
s!`test -f '$<' || echo '$(srcdir)/'`!!
_EOF
sed -f vpsed$$ $ac_file > tmp$$
mv tmp$$ $ac_file
rm vpsed$$
echo 'MULTISUBDIR =' >> $ac_file
ml_norecursion=yes
. ${multi_basedir}/config-ml.in
AS_UNSET([ml_norecursion])
])
fi
AC_OUTPUT

38
libvtv/configure.tgt Normal file
View file

@ -0,0 +1,38 @@
# -*- shell-script -*-
# Copyright (C) 2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not see <http://www.gnu.org/licenses/>.
# This is the target specific configuration file. This is invoked by the
# autoconf generated configure script. Putting it in a separate shell file
# lets us skip running autoconf when modifying target specific information.
# Filter out unsupported systems.
case "${target}" in
x86_64-*-linux* | i?86-*-linux*)
VTV_SUPPORTED=yes
;;
powerpc*-*-linux*)
;;
sparc*-*-linux*)
;;
arm*-*-linux*)
;;
x86_64-*-darwin[1]* | i?86-*-darwin[1]*)
VTV_SUPPORTED=no
;;
*)
UNSUPPORTED=1
;;
esac

View file

@ -0,0 +1,226 @@
#!/usr/bin/env bash
# Script to do testing.
# Invocation
# run-testsuite SRC_DIR BUILD_DIR
# Pass in build/src directory as parameters.
SRC_DIR=$1
BUILD_DIR=$2
# Now that we've successfully translated the numerical option into
# a symbolic one, we can safely ignore it.
shift
# Use build compiler/library flags from libstdc++
flags_script=$BUILD_DIR/../libstdc++-v3/scripts/testsuite_flags
INCLUDES=`$flags_script --build-includes`
COMPILER=`$flags_script --build-cxx`
CXX="$COMPILER $INCLUDES -L$BUILD_DIR/.libs -Wl,--rpath -Wl,$BUILD_DIR/.libs"
echo "compiler config is:"
echo $CXX
echo ""
# Other constants.
LOPT_LEVELS=${OPT_LEVELS:-"-O0 -O2"}
#LDATA_MODELS=${DATA_MODELS:-"32 64"}
LDATA_MODELS=${DATA_MODELS:-"64"}
# Check if value of LGCC_LIB_PATH/$1 exists. If it does, save this path.
# If it doesn't, use LGCC_LIB_PATH as the library path.
# This allows us to check for paths that are of the form <x>/lib32 or <x>/lib64.
get_lib_path()
{
if [[ -e $LGCC_LIB_PATH$1 ]]; then
LLGCC_LIB_PATH=$LGCC_LIB_PATH$1
else
LLGCC_LIB_PATH=$LGCC_LIB_PATH
fi
return
}
LGCC_SRC=$SRC_DIR/testsuite
TESTS="const_vtable.cc dataentry.cc dup_name.cc environment.cc template-list.cc template-list2.cc template-list-iostream.cc povray-derived.cc thunk.cc thunk_vtable_map_attack.cc virtual_inheritance.cc "
for M in $LDATA_MODELS; do
get_lib_path lib${M}
for T in $TESTS; do
TSRC=${LGCC_SRC}/${T}
for OL in $LOPT_LEVELS; do
CMD="${CXX} -m${M} -fvtable-verify=std -fpic -rdynamic -Wl,-z,relro ${TSRC} ${OL}"
echo $CMD
($CMD && ( ./a.out > $T.$OL.out 2>&1 ) && echo "PASS $T $OL") || echo "FAIL $T $OL"
done
done
done
TESTS_COMPOUND_parts="${LGCC_SRC}/parts-test-main.cc ${LGCC_SRC}/parts-test-extra-parts.cc ${LGCC_SRC}/parts-test-extra-parts-views.cc"
TESTS_COMPOUND_events="${LGCC_SRC}/event-main.cc ${LGCC_SRC}/event-definitions.cc ${LGCC_SRC}/event-private.cc"
for M in $LDATA_MODELS; do
get_lib_path lib${M}
for OL in $LOPT_LEVELS; do
CMD="${CXX} -m${M} -fvtable-verify=std -fpic -rdynamic -Wl,-z,relro ${TESTS_COMPOUND_parts} ${OL}"
echo $CMD
($CMD && ( ./a.out > $T.$OL.out 2>&1 ) && echo "PASS $T $OL") || echo "FAIL $T $OL"
done
done
for M in $LDATA_MODELS; do
for (( TN = 0 ; TN < 100 ; TN++ )); do
SO_NAME=so$TN.so
if [ -f ./lib${M}/$SO_NAME ]; then
/bin/rm ./lib${M}/$SO_NAME
fi
CMD="${CXX} -m${M} -fvtable-verify=std -O0 -g -shared -fpic -rdynamic -Wl,-z,relro -DTPID=$TN -I${SRC_DIR} ${LGCC_SRC}/so.cc -o ./lib${M}/$SO_NAME"
echo ${CMD}
${CMD} || exit 8
done
done
DLOPEN_TESTS="dlopen.cc dlopen_mt.cc"
for M in $LDATA_MODELS; do
get_lib_path lib${M}
for T in $DLOPEN_TESTS; do
TSRC=${LGCC_SRC}/${T}
for OL in $LOPT_LEVELS; do
CMD="${CXX} -m${M} -fvtable-verify=std -fpic -rdynamic -Wl,-z,relro -Wl,-R,./lib${M} -I${SRC_DIR} ${TSRC} ${OL} -ldl -lpthread"
echo $CMD
($CMD && ( ./a.out > $T.$OL.out 2>&1 ) && echo "PASS $T $OL") || echo "FAIL $T $OL"
done
done
done
for M in $LDATA_MODELS; do
get_lib_path lib${M}
for T in $TESTS; do
TSRC=${LGCC_SRC}/${T}
for OL in $LOPT_LEVELS; do
CMD="${CXX} -m${M} -fvtable-verify=preinit -fpic -rdynamic -Wl,-z,relro ${TSRC} ${OL}"
echo $CMD
($CMD && ( ./a.out > $T.$OL.out 2>&1 ) && echo "PASS $T $OL") || echo "FAIL $T $OL"
done
done
done
for M in $LDATA_MODELS; do
if [ -f ./lib${M}/vtv_malloc.o ]; then
/bin/rm ./lib${M}/vtv_malloc.o;
fi
CMD="${CXX} -m${M} -O2 -g -c -fpic ${SRC_DIR}/vtv_malloc.cc -o ./lib${M}/vtv_malloc.o"
echo ${CMD}
${CMD} || exit 3
if [ -f ./lib${M}/vtv_utils.o ]; then
/bin/rm ./lib${M}/vtv_utils.o;
fi
CMD="${CXX} -m${M} -O2 -g -c -fpic ${SRC_DIR}/vtv_utils.cc -o ./lib${M}/vtv_utils.o"
echo ${CMD}
${CMD} || exit 4
done
MEMPOOL_TESTS="mempool_positive.c mempool_negative.c"
for M in $LDATA_MODELS; do
get_lib_path lib${M}
for T in $MEMPOOL_TESTS; do
TSRC=${LGCC_SRC}/${T}
for OL in $LOPT_LEVELS; do
CMD="${CXX} -m${M} -fpic -rdynamic -I${SRC_DIR} ${TSRC} ${OL} ./lib${M}/vtv_malloc.o ./lib${M}/vtv_utils.o"
echo $CMD
($CMD && ( ./a.out > $T.$OL.out 2>&1 ) && echo "PASS $T $OL") || echo "FAIL $T $OL"
done
done
done
# bkoz not working ATM signature mismatch
#MT_TESTS="register_pair_mt.cc register_pair_inserts_mt.cc"
MT_TESTS=
for M in $LDATA_MODELS; do
get_lib_path lib${M}
for T in $MT_TESTS; do
TSRC=${LGCC_SRC}/${T}
for OL in $LOPT_LEVELS; do
CMD="${CXX} -m${M} -fpic -rdynamic -I${SRC_DIR} ${TSRC} ${OL} -lpthread"
echo $CMD
($CMD && ( ./a.out > $T.$OL.out 2>&1 ) && echo "PASS $T $OL") || echo "FAIL $T $OL"
done
done
done
# These test cases were written for performance measurements, not for
# correctness but lets run them here so that we dont loose track of
# them
# bkoz not working ATM signature mismatch
#PERF_TESTS="register_pair.cc register_pair_inserts.cc"
PERF_TESTS=
for M in $LDATA_MODELS; do
get_lib_path lib${M}
for T in $PERF_TESTS; do
TSRC=${LGCC_SRC}/${T}
for OL in $LOPT_LEVELS; do
CMD="${CXX} -m${M} -fpic -rdynamic -I${SRC_DIR} ${TSRC} ${OL} "
echo $CMD
($CMD && ( ./a.out > $T.$OL.out 2>&1 ) && echo "PASS $T $OL") || echo "FAIL $T $OL"
done
done
done
PASS_FAIL_TESTS="field-test.cc temp_deriv.cc temp_deriv2.cc temp_deriv3.cc"
for M in $LDATA_MODELS; do
get_lib_path lib${M}
for T in $PASS_FAIL_TESTS; do
TSRC=${LGCC_SRC}/${T}
for OL in $LOPT_LEVELS; do
CMD="${CXX} -m${M} -fvtable-verify=std -fpic -rdynamic ${TSRC} ${OL} -Wl,-z,relro -DTPID"
echo $CMD
($CMD && ( ./a.out > $T.$OL.out 2>&1 )) || (( grep "Pass first attack" $T.$OL.out ) && echo "PASS $T $OL - correctly passed then failed.") || echo "FAIL $T $OL"
done
done
done
for M in $LDATA_MODELS; do
get_lib_path lib${M}
for T in $PERF_TESTS; do
TSRC=${LGCC_SRC}/${T}
for OL in $LOPT_LEVELS; do
CMD="${CXX} -m${M} -fpic -rdynamic -I${SRC_DIR} ${TSRC} ${OL} "
echo $CMD
($CMD && ( ./a.out > $T.$OL.out 2>&1 ) && echo "PASS $T $OL") || echo "FAIL $T $OL"
done
done
done
for M in $LDATA_MODELS; do
get_lib_path lib${M}
for OL in $LOPT_LEVELS; do
CMD="as --${M} -o environment-fail-${M}.o ${LGCC_SRC}/environment-fail-${M}.s"
echo $CMD
${CMD} || exit 5
CMD="${CXX} -m${M} environment-fail-${M}.o -O0 -Wl,-z,relro -o environment-fail-${M}"
echo ${CMD}
# ${CMD} || exit 6
# (./environment-fail-${M}) || echo "PASS environment-fail-${M} (correctly failed), ${OL}"
CMD="${CXX} -fvtable-verify=std -m${M} environment-fail-${M}.o -O0 -Wl,-z,relro -o environment-fail-${M}"
echo ${CMD}
($CMD && ( ./environment-fail-${M} > environment-fail-${M}-stubs.out 2>&1 ) && echo "PASS environment-fail-${M} with libvtv_stubs ${OL}" ) || echo "FAIL environment-fail-${M} with libvtv_stubs ${OL}"
CMD="${CXX} -m${M} ${LGCC_SRC}/replace-fail.cc -O0 -c -o replace-fail-${M}.o"
echo ${CMD}
${CMD} || exit 7
CMD="${CXX} -fvtable-verify=std -m${M} environment-fail-${M}.o replace-fail-${M}.o -O0 -Wl,-z,relro -o environment-fail-${M}"
echo ${CMD}
($CMD && ( ./environment-fail-${M} > environment-fail-${M}-stubs.out 2>&1 ) && echo "PASS environment-fail-${M} with replace-fail ${OL}" ) || echo "FAIL environment-fail-${M} with replace-fail ${OL}"
done
done

View file

@ -0,0 +1,150 @@
/*
This script sums up the counters for seeing how many virtual calls are
actually being verified. The flag for generating the count data is
"-fvtv-counts". This flag will generate two files in /tmp,
"vtv_count_data.log" and "vtv_class_set_sizes.log". The first file is
the one that contains the info I mentioned; the second one is one I
generated because I was curious about how big the average set size was
for the vtable verification work.
After compiling the attached program, run it on the vtv_count_data.log
file:
$ sum-counters /tmp/vtv_count_data.log
One can optionally pass a "--verbose" flag. This file generates an
output file whose name is the same as the input file, with ".summary"
appended to it, e.g. /tmp/vtv_count_data.log.summary . Without the
verbose flag, it will just contain something like this:
Total # virtual calls: 349123
Total # verified calls: 348236
Percent verified: 99 %
Total calls to __VLTRegisterSet: 42236
Total calls to __VLTRegisterPair: 84371
Total # unused vtable map vars: 1536333
With the --verbose flag it will also output one line for each
compilation unit for which it verified less than 90% of the virtual
calls (and there were more than 20 virtual calls in the file),
something like this:
Verified 1 out of 25 (4.00%) : foo.cc
Verified 27 out of 43 (62.00%) : bar.cc
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void
usage (const char *error_text)
{
fprintf (stderr, "%s", error_text);
fprintf (stderr, "Usage: \n");
fprintf (stderr, "sum-counters <input-file> [--verbose]\n");
}
int
main (int argc, char **argv)
{
FILE *fp_in = NULL;
FILE *fp_out = NULL;
int sum_vcalls = 0;
int sum_verified = 0;
int sum_regset = 0;
int sum_regpair = 0;
int sum_unused = 0;
char fname_in[1024];
char fname_out[1024];
int total;
int verified;
int regset;
int regpair;
int unused;
float pct;
char buffer[1024];
int verbose = 0;
if (argc < 2)
{
usage ("Error: Need an input file.\n");
return 1;
}
fp_in = fopen (argv[1], "r");
if (!fp_in)
{
snprintf (buffer, 1024, "Error: Unable to open input file '%s'.\n",
argv[1]);
usage (buffer);
return 1;
}
if (argc == 3)
{
if (strcmp (argv[2], "--verbose") == 0)
verbose = 1;
else
{
snprintf (buffer, 1024, "Error: Unrecognized option '%s'.\n",
argv[2]);
usage (buffer);
return 1;
}
}
snprintf (fname_out, 1024, "%s.summary", argv[1]);
fp_out = fopen (fname_out, "w");
if (!fp_out)
{
fprintf (stderr, "Error: Unable to open output file '%s'\n",
fname_out);
return 1;
}
while (fscanf (fp_in, "%s %d %d %d %d %d\n", fname_in, &total,
&verified, &regset, &regpair, &unused) != EOF)
{
sum_vcalls += total;
sum_verified += verified;
sum_regset += regset;
sum_regpair += regpair;
sum_unused += unused;
float tmp_pct = 0.0;
if (total > 0)
tmp_pct = (verified * 100) / total;
if (verbose && tmp_pct < 90 && total >= 20)
{
fprintf (fp_out, "Verified %d out of %d (%.2f%%) : %s\n",
verified, total, tmp_pct, fname_in);
}
}
fclose (fp_in);
fprintf (fp_out, "\n\n");
fprintf (fp_out, "Total # virtual calls: %d\n", sum_vcalls);
fprintf (fp_out, "Total # verified calls: %d\n", sum_verified);
if (sum_vcalls > 0)
fprintf (fp_out, "Percent verified: %d %%\n",
sum_verified * 100 / sum_vcalls);
else
fprintf (fp_out, "Percent verified: NA %%\n");
fprintf (fp_out, "\nTotal calls to __VLTRegisterSet: %d\n",
sum_regset);
fprintf (fp_out, "Total calls to __VLTRegisterPair: %d\n",
sum_regpair);
fprintf (fp_out, "Total # unused vtable map vars: %d\n", sum_unused);
fclose (fp_out);
return 0;
}

View file

@ -0,0 +1,56 @@
## Makefile for the testsuite subdirectory of the VTV library.
##
## Copyright (C) 2013 Free Software Foundation, Inc.
##
## Process this file with automake to produce Makefile.in.
##
## This file is part of the Vtable Verification (VTV) Library. This
## library is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3, or (at your option)
## any later version.
## This library is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this library; see the file COPYING3. If not see
## <http://www.gnu.org/licenses/>.
AUTOMAKE_OPTIONS = nostdinc
# Runs the testsuite via a script.
# Create subdirectories.
stamp-subdir:
if test ! -d lib64; then \
mkdir -p lib64; \
fi; \
if test ! -d lib32; then \
mkdir -p lib32; \
fi; \
echo `date` > stamp-subdir;
testing_script=${libvtv_srcdir}/scripts/run-testsuite.sh
check-script: ${testing_script} stamp-subdir
-@(chmod +x ${testing_script}; \
${testing_script} ${libvtv_srcdir} ${libvtv_builddir})
if ENABLE_VTABLE_VERIFY
check-am:
$(MAKE) $(AM_MAKEFLAGS) check-script
else
check-am:
endif
.PHONY: check-script
# By adding these files here, automake will remove them for 'make clean'
CLEANFILES = *.out environment-fail-* stamp-* replace-fail-*
# To remove directories.
clean-local:
rm -rf lib*

View file

@ -0,0 +1,380 @@
# Makefile.in generated by automake 1.11.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = testsuite
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
$(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/libstdc++-raw-cxx.m4 \
$(top_srcdir)/../config/multi.m4 \
$(top_srcdir)/../config/override.m4 \
$(top_srcdir)/../ltoptions.m4 $(top_srcdir)/../ltsugar.m4 \
$(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/../libtool.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCAS = @CCAS@
CCASFLAGS = @CCASFLAGS@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSTDCXX_RAW_CXX_CXXFLAGS = @LIBSTDCXX_RAW_CXX_CXXFLAGS@
LIBSTDCXX_RAW_CXX_LDFLAGS = @LIBSTDCXX_RAW_CXX_LDFLAGS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
XCFLAGS = @XCFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
enable_shared = @enable_shared@
enable_static = @enable_static@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
libtool_VERSION = @libtool_VERSION@
libvtv_builddir = @libvtv_builddir@
libvtv_srcdir = @libvtv_srcdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
multi_basedir = @multi_basedir@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_noncanonical = @target_noncanonical@
target_os = @target_os@
target_vendor = @target_vendor@
toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
toplevel_builddir = @toplevel_builddir@
toplevel_srcdir = @toplevel_srcdir@
AUTOMAKE_OPTIONS = nostdinc
testing_script = ${libvtv_srcdir}/scripts/run-testsuite.sh
# By adding these files here, automake will remove them for 'make clean'
CLEANFILES = *.out environment-fail-* stamp-* replace-fail-*
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign testsuite/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign testsuite/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-local mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
clean-local distclean distclean-generic distclean-libtool dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
# Runs the testsuite via a script.
# Create subdirectories.
stamp-subdir:
if test ! -d lib64; then \
mkdir -p lib64; \
fi; \
if test ! -d lib32; then \
mkdir -p lib32; \
fi; \
echo `date` > stamp-subdir;
check-script: ${testing_script} stamp-subdir
-@(chmod +x ${testing_script}; \
${testing_script} ${libvtv_srcdir} ${libvtv_builddir})
@ENABLE_VTABLE_VERIFY_TRUE@check-am:
@ENABLE_VTABLE_VERIFY_TRUE@ $(MAKE) $(AM_MAKEFLAGS) check-script
@ENABLE_VTABLE_VERIFY_FALSE@check-am:
.PHONY: check-script
# To remove directories.
clean-local:
rm -rf lib*
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -0,0 +1,82 @@
extern "C" int printf(const char *,...);
struct V1 {
int v;
virtual int foo();
V1();
~V1();
};
struct V2 : virtual V1 {
int v2;
virtual int foo();
V2();
~V2();
};
struct C : virtual V1, virtual V2 {
int c;
virtual int foo();
C();
~C();
};
struct B {
int b; };
struct D : B, C {
int d;
virtual int bar();
D();
~D();
};
extern "C" int printf(const char *,...);
main()
{
try {
D *d = new D;
delete d;
} catch (int) {
printf("Int caught\n");
}
}
int V1::foo() {
printf("V1::foo called\n"); return 1; }
V1::V1() : v(5) {
printf("V1 called\n"); }
V1::~V1() {
printf("~V1 called\n"); }
int V2::foo() {
printf("V2::foo called\n"); return 1; }
V2::V2() : v2(6) {
printf("V2 called\n"); }
V2::~V2() {
printf("~V2 called\n"); }
int C::foo() {
printf("C::foo called %d\n", c); return 1; }
C::C() : c(7) {
printf("C called\n");
V1 *vv = this; vv->foo();
C *cp = dynamic_cast<C *>(vv);
if (this == cp) {
printf("PASSED this == cp\n");
} else {
printf("FAILED this != cp\n");
}
}
C::~C() {
printf("~C called\n");
V1 *vv = this; vv->foo();
C *cp = dynamic_cast<C *>(vv);
if (this == cp) {
printf("PASSED this == cp\n");
} else {
printf("FAILED this != cp\n");
}
}
int D::bar() {
printf("D::bar called\n"); return 1; }
D::D() : d(8) {
printf("D called\n"); throw 5; }
D::~D() {
printf("~D called\n"); }

View file

@ -0,0 +1,37 @@
template<int patch_dim, int patch_space_dim>
class DataOutInterface
{
public:
virtual ~DataOutInterface() {}
};
template <int dof_handler_dim, int patch_dim, int patch_space_dim=patch_dim>
class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
{
public:
virtual ~DataOut_DoFData() {}
class DataEntryBase {
public:
virtual ~DataEntryBase () {}
};
template <typename T>
class DataEntry : public DataEntryBase
{
public:
virtual ~DataEntry() {}
};
};
template <typename T> void Destroy(T * p) __attribute__((noinline));
template <typename T> void Destroy(T * p)
{
delete p;
}
int main()
{
DataOut_DoFData<3,3>::DataEntryBase * p = new DataOut_DoFData<3,3>::DataEntry<int>();
Destroy(p);
}

View file

@ -0,0 +1,38 @@
#include <stdlib.h>
#include <dlfcn.h>
#include <stdio.h>
typedef void (*voidfn)(void);
int failures = 0;
void
__vtv_verify_fail (void **data_set_ptr, const void *vtbl_pointer)
{
failures++;
return;
}
int main()
{
char so_name[] = "so0.so";
void * dlhandle = dlopen(so_name, RTLD_NOW);
if (!dlhandle)
{
fprintf(stderr, "dlopen %s error: %s\n", so_name, dlerror());
exit(1);
}
voidfn so_entry = (voidfn)dlsym(dlhandle, "so_entry_0");
if (!so_entry)
{
fprintf(stderr, "dlopen %s dlsym error: %s\n", so_name, dlerror());
exit(2);
}
so_entry();
dlclose(dlhandle);
}

View file

@ -0,0 +1,112 @@
#include <stdlib.h>
#include <dlfcn.h>
#include <stdio.h>
#include "vtv_utils.h"
#include "vtv_rts.h"
#include "pthread.h"
#define NUM_REPEATS 10
#define NUM_THREADS 10
#define NUM_SOS 100
#define NUM_SOS_PER_THREAD (NUM_SOS/NUM_THREADS)
typedef void (*voidfn)(void);
int failures = 0;
void
__vtv_verify_fail (void **data_set_ptr, const void *vtbl_pointer)
{
failures++;
return;
}
void do_dlopen(int so_num)
{
char so_name [sizeof("soxxx.so")];
sprintf(so_name, "so%d.so", so_num);
// printf("dl-opening %s\n", so_name);
void * dlhandle = dlopen(so_name, RTLD_NOW);
if (!dlhandle)
{
fprintf(stderr, "dlopen so:%s error: %s\n", so_name, dlerror());
exit(1);
}
char so_entry [sizeof("so_entry_xxx")];
sprintf(so_entry, "so_entry_%d", so_num);
voidfn so_entry_fn = (voidfn)dlsym(dlhandle, so_entry);
if (!so_entry_fn)
{
fprintf(stderr, "so:%s dlsym error: %s\n", so_name, dlerror());
exit(2);
}
so_entry_fn();
dlclose(dlhandle);
}
volatile int threads_completed_it = 0;
volatile int current_wave = -1;
void * do_dlopens(void * ptid)
{
for (int k = 0; k < NUM_REPEATS; k++)
{
for (int i = 0; i < NUM_SOS_PER_THREAD; i++)
{
while (current_wave < (k*NUM_SOS_PER_THREAD + i)) /* from 0 to 99 */
;
do_dlopen((NUM_SOS_PER_THREAD * *(int *)ptid) + i);
int old_value;
do {
old_value = threads_completed_it;
} while (!__sync_bool_compare_and_swap(&threads_completed_it, old_value, old_value + 1));
if (old_value == (NUM_THREADS - 1)) // Only one thread will do this.
{
threads_completed_it = 0;
printf("%c%d", 13, current_wave + 1);
fflush(stdout);
current_wave++;
}
}
}
return NULL;
}
int main()
{
pthread_t thread_ids[NUM_THREADS];
int thread_nids[NUM_THREADS];
for (int t = 0; t < NUM_THREADS; t++ )
{
thread_nids[t] = t;
if (pthread_create(&thread_ids[t], NULL, do_dlopens, &thread_nids[t]) != 0)
{
printf("failed pthread_create\n");
exit(1);
}
}
current_wave = 0; // start the work on the other threads
for (int t = 0; t < NUM_THREADS; t++)
if (pthread_join(thread_ids[t], NULL) != 0)
{
printf("failed pthread_join\n");
exit(2);
}
printf("\n");
return 0;
}

View file

@ -0,0 +1,60 @@
#include <assert.h>
extern "C" int printf(const char *, ...);
class Subscriptor
{
public:
Subscriptor()
{ counter = 1;}
virtual ~Subscriptor()
{
counter--;
assert(counter == 0);
}
private:
static int counter;
};
int Subscriptor::counter;
template <typename number>
class Polynomial : public Subscriptor
{
};
class LagrangeEquidistant: public Polynomial<double>
{
};
template <int value>
class A
{
public:
class Nested: public LagrangeEquidistant
{
};
A() { n = new Nested; }
~A() { delete n; }
Subscriptor * n;
};
template<typename _Tp>
inline void
_MyDestroy(_Tp* __pointer)
{ __pointer->~_Tp(); }
int main()
{
Subscriptor * s1 = new LagrangeEquidistant;
_MyDestroy(s1);
A<1> * a1 = new A<1>;
_MyDestroy(a1);
A<2> * a2 = new A<2>;
_MyDestroy(a2);
return 0;
}

View file

@ -0,0 +1,514 @@
.file "environment.cc"
.section .text._ZN15EnvironmentImpl6GetVarEPKcPc,"axG",@progbits,_ZN15EnvironmentImpl6GetVarEPKcPc,comdat
.align 2
.weak _ZN15EnvironmentImpl6GetVarEPKcPc
.type _ZN15EnvironmentImpl6GetVarEPKcPc, @function
_ZN15EnvironmentImpl6GetVarEPKcPc:
.LFB0:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
movl $1, %eax
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size _ZN15EnvironmentImpl6GetVarEPKcPc, .-_ZN15EnvironmentImpl6GetVarEPKcPc
.text
.align 2
.globl _ZN11EnvironmentD2Ev
.type _ZN11EnvironmentD2Ev, @function
_ZN11EnvironmentD2Ev:
.LFB2:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
pushl %ebx
subl $20, %esp
.cfi_offset 3, -12
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
movl 8(%ebp), %eax
movl _ZTV11Environment@GOT(%ebx), %edx
leal 8(%edx), %edx
movl %edx, (%eax)
movl $0, %eax
testl %eax, %eax
je .L3
movl 8(%ebp), %eax
movl %eax, (%esp)
call _ZdlPv@PLT
.L3:
addl $20, %esp
popl %ebx
.cfi_restore 3
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE2:
.size _ZN11EnvironmentD2Ev, .-_ZN11EnvironmentD2Ev
.globl _ZN11EnvironmentD1Ev
.set _ZN11EnvironmentD1Ev,_ZN11EnvironmentD2Ev
.align 2
.globl _ZN11EnvironmentD0Ev
.type _ZN11EnvironmentD0Ev, @function
_ZN11EnvironmentD0Ev:
.LFB4:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
pushl %ebx
subl $20, %esp
.cfi_offset 3, -12
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
movl 8(%ebp), %eax
movl %eax, (%esp)
call _ZN11EnvironmentD1Ev@PLT
movl 8(%ebp), %eax
movl %eax, (%esp)
call _ZdlPv@PLT
addl $20, %esp
popl %ebx
.cfi_restore 3
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE4:
.size _ZN11EnvironmentD0Ev, .-_ZN11EnvironmentD0Ev
.section .text._ZN11EnvironmentC2Ev,"axG",@progbits,_ZN11EnvironmentC5Ev,comdat
.align 2
.weak _ZN11EnvironmentC2Ev
.type _ZN11EnvironmentC2Ev, @function
_ZN11EnvironmentC2Ev:
.LFB8:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
call __x86.get_pc_thunk.cx
addl $_GLOBAL_OFFSET_TABLE_, %ecx
movl 8(%ebp), %eax
movl _ZTV11Environment@GOT(%ecx), %edx
leal 8(%edx), %edx
movl %edx, (%eax)
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE8:
.size _ZN11EnvironmentC2Ev, .-_ZN11EnvironmentC2Ev
.weak _ZN11EnvironmentC1Ev
.set _ZN11EnvironmentC1Ev,_ZN11EnvironmentC2Ev
.section .text._ZN15EnvironmentImplC2Ev,"axG",@progbits,_ZN15EnvironmentImplC5Ev,comdat
.align 2
.weak _ZN15EnvironmentImplC2Ev
.type _ZN15EnvironmentImplC2Ev, @function
_ZN15EnvironmentImplC2Ev:
.LFB10:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
pushl %ebx
subl $20, %esp
.cfi_offset 3, -12
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
movl 8(%ebp), %eax
movl %eax, (%esp)
call _ZN11EnvironmentC2Ev@PLT
movl 8(%ebp), %eax
movl _ZTV15EnvironmentImpl@GOT(%ebx), %edx
leal 8(%edx), %edx
movl %edx, (%eax)
addl $20, %esp
popl %ebx
.cfi_restore 3
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE10:
.size _ZN15EnvironmentImplC2Ev, .-_ZN15EnvironmentImplC2Ev
.weak _ZN15EnvironmentImplC1Ev
.set _ZN15EnvironmentImplC1Ev,_ZN15EnvironmentImplC2Ev
.text
.align 2
.globl _ZN11Environment6CreateEv
.type _ZN11Environment6CreateEv, @function
_ZN11Environment6CreateEv:
.LFB5:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
pushl %esi
pushl %ebx
subl $16, %esp
.cfi_offset 6, -12
.cfi_offset 3, -16
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
movl $4, (%esp)
call _Znwj@PLT
movl %eax, %esi
movl $0, (%esi)
movl %esi, (%esp)
call _ZN15EnvironmentImplC1Ev@PLT
movl %esi, %eax
addl $16, %esp
popl %ebx
.cfi_restore 3
popl %esi
.cfi_restore 6
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE5:
.size _ZN11Environment6CreateEv, .-_ZN11Environment6CreateEv
.section .rodata
.LC0:
.string "%p\n"
.text
.globl main
.type main, @function
main:
.LFB12:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
pushl %ebx
andl $-16, %esp
subl $32, %esp
.cfi_offset 3, -12
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
movl $0, 28(%esp)
call _ZN11Environment6CreateEv@PLT
movl %eax, 24(%esp)
movl 24(%esp), %eax
movl (%eax), %eax
movl %eax, 4(%esp)
leal _ZN4_VTVI11EnvironmentE12__vtable_mapE@GOTOFF(%ebx), %eax
movl %eax, (%esp)
call _Z24__VLTVerifyVtablePointerPPvPKv@PLT
addl $8, %eax
movl (%eax), %eax
movl 28(%esp), %edx
movl %edx, 8(%esp)
movl $0, 4(%esp)
movl 24(%esp), %edx
movl %edx, (%esp)
call *%eax
movl 24(%esp), %eax
movl %eax, 4(%esp)
leal .LC0@GOTOFF(%ebx), %eax
movl %eax, (%esp)
call printf@PLT
movl $0, %eax
movl -4(%ebp), %ebx
leave
.cfi_restore 5
.cfi_restore 3
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE12:
.size main, .-main
.weak _ZTV11Environment
.section .data.rel.ro._ZTV11Environment,"awG",@progbits,_ZTV11Environment,comdat
.align 8
.type _ZTV11Environment, @object
.size _ZTV11Environment, 20
_ZTV11Environment:
.long 0
.long _ZTI11Environment
.long _ZN11EnvironmentD1Ev
.long _ZN11EnvironmentD0Ev
.long __cxa_pure_virtual
.weak _ZTV15EnvironmentImpl
.section .data.rel.ro._ZTV15EnvironmentImpl,"awG",@progbits,_ZTV15EnvironmentImpl,comdat
.align 8
.type _ZTV15EnvironmentImpl, @object
.size _ZTV15EnvironmentImpl, 20
_ZTV15EnvironmentImpl:
.long 0
.long _ZTI15EnvironmentImpl
.long _ZN15EnvironmentImplD1Ev
.long _ZN15EnvironmentImplD0Ev
.long _ZN15EnvironmentImpl6GetVarEPKcPc
.section .text._ZN15EnvironmentImplD2Ev,"axG",@progbits,_ZN15EnvironmentImplD5Ev,comdat
.align 2
.weak _ZN15EnvironmentImplD2Ev
.type _ZN15EnvironmentImplD2Ev, @function
_ZN15EnvironmentImplD2Ev:
.LFB14:
.cfi_startproc
.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
.cfi_lsda 0x1b,.LLSDA14
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
pushl %ebx
subl $20, %esp
.cfi_offset 3, -12
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
movl 8(%ebp), %eax
movl _ZTV15EnvironmentImpl@GOT(%ebx), %edx
leal 8(%edx), %edx
movl %edx, (%eax)
movl 8(%ebp), %eax
movl %eax, (%esp)
.LEHB0:
call _ZN11EnvironmentD2Ev@PLT
.LEHE0:
movl $0, %eax
testl %eax, %eax
je .L19
movl 8(%ebp), %eax
movl %eax, (%esp)
call _ZdlPv@PLT
jmp .L19
.L18:
movl %eax, (%esp)
.LEHB1:
call _Unwind_Resume@PLT
.LEHE1:
.L19:
addl $20, %esp
popl %ebx
.cfi_restore 3
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE14:
.globl __gxx_personality_v0
.section .gcc_except_table._ZN15EnvironmentImplD2Ev,"aG",@progbits,_ZN15EnvironmentImplD5Ev,comdat
.LLSDA14:
.byte 0xff
.byte 0xff
.byte 0x1
.uleb128 .LLSDACSE14-.LLSDACSB14
.LLSDACSB14:
.uleb128 .LEHB0-.LFB14
.uleb128 .LEHE0-.LEHB0
.uleb128 .L18-.LFB14
.uleb128 0
.uleb128 .LEHB1-.LFB14
.uleb128 .LEHE1-.LEHB1
.uleb128 0
.uleb128 0
.LLSDACSE14:
.section .text._ZN15EnvironmentImplD2Ev,"axG",@progbits,_ZN15EnvironmentImplD5Ev,comdat
.size _ZN15EnvironmentImplD2Ev, .-_ZN15EnvironmentImplD2Ev
.weak _ZN15EnvironmentImplD1Ev
.set _ZN15EnvironmentImplD1Ev,_ZN15EnvironmentImplD2Ev
.section .text._ZN15EnvironmentImplD0Ev,"axG",@progbits,_ZN15EnvironmentImplD0Ev,comdat
.align 2
.weak _ZN15EnvironmentImplD0Ev
.type _ZN15EnvironmentImplD0Ev, @function
_ZN15EnvironmentImplD0Ev:
.LFB16:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
pushl %ebx
subl $20, %esp
.cfi_offset 3, -12
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
movl 8(%ebp), %eax
movl %eax, (%esp)
call _ZN15EnvironmentImplD1Ev@PLT
movl 8(%ebp), %eax
movl %eax, (%esp)
call _ZdlPv@PLT
addl $20, %esp
popl %ebx
.cfi_restore 3
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE16:
.size _ZN15EnvironmentImplD0Ev, .-_ZN15EnvironmentImplD0Ev
.weak _ZTS15EnvironmentImpl
.section .rodata._ZTS15EnvironmentImpl,"aG",@progbits,_ZTS15EnvironmentImpl,comdat
.type _ZTS15EnvironmentImpl, @object
.size _ZTS15EnvironmentImpl, 18
_ZTS15EnvironmentImpl:
.string "15EnvironmentImpl"
.weak _ZTI15EnvironmentImpl
.section .data.rel.ro._ZTI15EnvironmentImpl,"awG",@progbits,_ZTI15EnvironmentImpl,comdat
.align 4
.type _ZTI15EnvironmentImpl, @object
.size _ZTI15EnvironmentImpl, 12
_ZTI15EnvironmentImpl:
.long _ZTVN10__cxxabiv120__si_class_type_infoE+8
.long _ZTS15EnvironmentImpl
.long _ZTI11Environment
.weak _ZTI11Environment
.section .data.rel.ro._ZTI11Environment,"awG",@progbits,_ZTI11Environment,comdat
.align 4
.type _ZTI11Environment, @object
.size _ZTI11Environment, 8
_ZTI11Environment:
.long _ZTVN10__cxxabiv117__class_type_infoE+8
.long _ZTS11Environment
.weak _ZTS11Environment
.section .rodata._ZTS11Environment,"aG",@progbits,_ZTS11Environment,comdat
.type _ZTS11Environment, @object
.size _ZTS11Environment, 14
_ZTS11Environment:
.string "11Environment"
.hidden _ZN4_VTVI11EnvironmentE12__vtable_mapE
.weak _ZN4_VTVI11EnvironmentE12__vtable_mapE
.section .vtable_map_vars,"awG",@progbits,_ZN4_VTVI11EnvironmentE12__vtable_mapE,comdat
.align 4
.type _ZN4_VTVI11EnvironmentE12__vtable_mapE, @gnu_unique_object
.size _ZN4_VTVI11EnvironmentE12__vtable_mapE, 4
_ZN4_VTVI11EnvironmentE12__vtable_mapE:
.zero 4
.hidden _ZN4_VTVI15EnvironmentImplE12__vtable_mapE
.weak _ZN4_VTVI15EnvironmentImplE12__vtable_mapE
.section .vtable_map_vars,"awG",@progbits,_ZN4_VTVI15EnvironmentImplE12__vtable_mapE,comdat
.align 4
.type _ZN4_VTVI15EnvironmentImplE12__vtable_mapE, @gnu_unique_object
.size _ZN4_VTVI15EnvironmentImplE12__vtable_mapE, 4
_ZN4_VTVI15EnvironmentImplE12__vtable_mapE:
.zero 4
.section .data.rel.ro,"aw",@progbits
.align 4
.type __vptr_array_11Environment, @object
.size __vptr_array_11Environment, 8
__vptr_array_11Environment:
.long _ZTV11Environment+8
.long _ZTV15EnvironmentImpl+8
.section .rodata
.align 4
.LC1:
.string "&"
.string ""
.string ""
.ascii "\224\tl\022_ZN4_VTVI11EnvironmentE12__vtable_mapE"
.align 4
.LC2:
.string "*"
.string ""
.string ""
.ascii "N\225\r\334_ZN4_VTVI15EnvironmentImplE12__vtable_mapE"
.text
.type _GLOBAL__sub_I.00099_environment.cc, @function
_GLOBAL__sub_I.00099_environment.cc:
.LFB17:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
pushl %ebx
subl $36, %esp
.cfi_offset 3, -12
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
leal __vptr_array_11Environment@GOTOFF(%ebx), %eax
movl %eax, 16(%esp)
movl $2, 12(%esp)
movl $2, 8(%esp)
leal .LC1@GOTOFF(%ebx), %eax
movl %eax, 4(%esp)
leal _ZN4_VTVI11EnvironmentE12__vtable_mapE@GOTOFF(%ebx), %eax
movl %eax, (%esp)
movl _ZTV15EnvironmentImpl@GOT(%ebx), %eax
leal 8(%eax), %eax
movl %eax, 12(%esp)
movl $1, 8(%esp)
leal .LC2@GOTOFF(%ebx), %eax
movl %eax, 4(%esp)
leal _ZN4_VTVI15EnvironmentImplE12__vtable_mapE@GOTOFF(%ebx), %eax
movl %eax, (%esp)
call _Z17__VLTRegisterPairPPvPKvjS2_@PLT
addl $36, %esp
popl %ebx
.cfi_restore 3
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE17:
.size _GLOBAL__sub_I.00099_environment.cc, .-_GLOBAL__sub_I.00099_environment.cc
.section .init_array.00099,"aw"
.align 4
.long _GLOBAL__sub_I.00099_environment.cc
.section .text.__x86.get_pc_thunk.cx,"axG",@progbits,__x86.get_pc_thunk.cx,comdat
.globl __x86.get_pc_thunk.cx
.hidden __x86.get_pc_thunk.cx
.type __x86.get_pc_thunk.cx, @function
__x86.get_pc_thunk.cx:
.LFB18:
.cfi_startproc
movl (%esp), %ecx
ret
.cfi_endproc
.LFE18:
.section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
.globl __x86.get_pc_thunk.bx
.hidden __x86.get_pc_thunk.bx
.type __x86.get_pc_thunk.bx, @function
__x86.get_pc_thunk.bx:
.LFB19:
.cfi_startproc
movl (%esp), %ebx
ret
.cfi_endproc
.LFE19:
.hidden DW.ref.__gxx_personality_v0
.weak DW.ref.__gxx_personality_v0
.section .data.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
.align 4
.type DW.ref.__gxx_personality_v0, @object
.size DW.ref.__gxx_personality_v0, 4
DW.ref.__gxx_personality_v0:
.long __gxx_personality_v0
.ident "GCC: (GNU) 4.9.0 20130616 (experimental)"
.section .note.GNU-stack,"",@progbits

View file

@ -0,0 +1,425 @@
.file "environment.cc"
.section .text._ZN15EnvironmentImpl6GetVarEPKcPc,"axG",@progbits,_ZN15EnvironmentImpl6GetVarEPKcPc,comdat
.align 2
.weak _ZN15EnvironmentImpl6GetVarEPKcPc
.type _ZN15EnvironmentImpl6GetVarEPKcPc, @function
_ZN15EnvironmentImpl6GetVarEPKcPc:
.LFB0:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movq %rdi, -8(%rbp)
movq %rsi, -16(%rbp)
movq %rdx, -24(%rbp)
movl $1, %eax
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size _ZN15EnvironmentImpl6GetVarEPKcPc, .-_ZN15EnvironmentImpl6GetVarEPKcPc
.text
.align 2
.globl _ZN11EnvironmentD2Ev
.type _ZN11EnvironmentD2Ev, @function
_ZN11EnvironmentD2Ev:
.LFB2:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movq %rdi, -8(%rbp)
movq -8(%rbp), %rax
movq _ZTV11Environment@GOTPCREL(%rip), %rdx
leaq 16(%rdx), %rdx
movq %rdx, (%rax)
movl $0, %eax
testl %eax, %eax
je .L3
movq -8(%rbp), %rax
movq %rax, %rdi
call _ZdlPv@PLT
.L3:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE2:
.size _ZN11EnvironmentD2Ev, .-_ZN11EnvironmentD2Ev
.globl _ZN11EnvironmentD1Ev
.set _ZN11EnvironmentD1Ev,_ZN11EnvironmentD2Ev
.align 2
.globl _ZN11EnvironmentD0Ev
.type _ZN11EnvironmentD0Ev, @function
_ZN11EnvironmentD0Ev:
.LFB4:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movq %rdi, -8(%rbp)
movq -8(%rbp), %rax
movq %rax, %rdi
call _ZN11EnvironmentD1Ev@PLT
movq -8(%rbp), %rax
movq %rax, %rdi
call _ZdlPv@PLT
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE4:
.size _ZN11EnvironmentD0Ev, .-_ZN11EnvironmentD0Ev
.section .text._ZN11EnvironmentC2Ev,"axG",@progbits,_ZN11EnvironmentC5Ev,comdat
.align 2
.weak _ZN11EnvironmentC2Ev
.type _ZN11EnvironmentC2Ev, @function
_ZN11EnvironmentC2Ev:
.LFB8:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
movq %rdi, -8(%rbp)
movq -8(%rbp), %rax
movq _ZTV11Environment@GOTPCREL(%rip), %rdx
leaq 16(%rdx), %rdx
movq %rdx, (%rax)
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE8:
.size _ZN11EnvironmentC2Ev, .-_ZN11EnvironmentC2Ev
.weak _ZN11EnvironmentC1Ev
.set _ZN11EnvironmentC1Ev,_ZN11EnvironmentC2Ev
.section .text._ZN15EnvironmentImplC2Ev,"axG",@progbits,_ZN15EnvironmentImplC5Ev,comdat
.align 2
.weak _ZN15EnvironmentImplC2Ev
.type _ZN15EnvironmentImplC2Ev, @function
_ZN15EnvironmentImplC2Ev:
.LFB10:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movq %rdi, -8(%rbp)
movq -8(%rbp), %rax
movq %rax, %rdi
call _ZN11EnvironmentC2Ev@PLT
movq -8(%rbp), %rax
movq _ZTV15EnvironmentImpl@GOTPCREL(%rip), %rdx
leaq 16(%rdx), %rdx
movq %rdx, (%rax)
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE10:
.size _ZN15EnvironmentImplC2Ev, .-_ZN15EnvironmentImplC2Ev
.weak _ZN15EnvironmentImplC1Ev
.set _ZN15EnvironmentImplC1Ev,_ZN15EnvironmentImplC2Ev
.text
.align 2
.globl _ZN11Environment6CreateEv
.type _ZN11Environment6CreateEv, @function
_ZN11Environment6CreateEv:
.LFB5:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
pushq %rbx
subq $8, %rsp
.cfi_offset 3, -24
movl $8, %edi
call _Znwm@PLT
movq %rax, %rbx
movq $0, (%rbx)
movq %rbx, %rdi
call _ZN15EnvironmentImplC1Ev@PLT
movq %rbx, %rax
addq $8, %rsp
popq %rbx
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE5:
.size _ZN11Environment6CreateEv, .-_ZN11Environment6CreateEv
.section .rodata
.LC0:
.string "%p\n"
.text
.globl main
.type main, @function
main:
.LFB12:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movq $0, -8(%rbp)
call _ZN11Environment6CreateEv@PLT
movq %rax, -16(%rbp)
movq -16(%rbp), %rax
movq (%rax), %rax
movq %rax, %rsi
leaq _ZN4_VTVI11EnvironmentE12__vtable_mapE(%rip), %rdi
call _Z24__VLTVerifyVtablePointerPPvPKv@PLT
addq $16, %rax
movq (%rax), %rax
movq -8(%rbp), %rdx
movq -16(%rbp), %rcx
movl $0, %esi
movq %rcx, %rdi
call *%rax
movq -16(%rbp), %rax
movq %rax, %rsi
leaq .LC0(%rip), %rdi
movl $0, %eax
call printf@PLT
movl $0, %eax
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE12:
.size main, .-main
.weak _ZTV11Environment
.section .data.rel.ro._ZTV11Environment,"awG",@progbits,_ZTV11Environment,comdat
.align 32
.type _ZTV11Environment, @object
.size _ZTV11Environment, 40
_ZTV11Environment:
.quad 0
.quad _ZTI11Environment
.quad _ZN11EnvironmentD1Ev
.quad _ZN11EnvironmentD0Ev
.quad __cxa_pure_virtual
.weak _ZTV15EnvironmentImpl
.section .data.rel.ro._ZTV15EnvironmentImpl,"awG",@progbits,_ZTV15EnvironmentImpl,comdat
.align 32
.type _ZTV15EnvironmentImpl, @object
.size _ZTV15EnvironmentImpl, 40
_ZTV15EnvironmentImpl:
.quad 0
.quad _ZTI15EnvironmentImpl
.quad _ZN15EnvironmentImplD1Ev
.quad _ZN15EnvironmentImplD0Ev
.quad _ZN15EnvironmentImpl6GetVarEPKcPc
.section .text._ZN15EnvironmentImplD2Ev,"axG",@progbits,_ZN15EnvironmentImplD5Ev,comdat
.align 2
.weak _ZN15EnvironmentImplD2Ev
.type _ZN15EnvironmentImplD2Ev, @function
_ZN15EnvironmentImplD2Ev:
.LFB14:
.cfi_startproc
.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
.cfi_lsda 0x1b,.LLSDA14
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movq %rdi, -8(%rbp)
movq -8(%rbp), %rax
movq _ZTV15EnvironmentImpl@GOTPCREL(%rip), %rdx
leaq 16(%rdx), %rdx
movq %rdx, (%rax)
movq -8(%rbp), %rax
movq %rax, %rdi
.LEHB0:
call _ZN11EnvironmentD2Ev@PLT
.LEHE0:
movl $0, %eax
testl %eax, %eax
je .L19
movq -8(%rbp), %rax
movq %rax, %rdi
call _ZdlPv@PLT
jmp .L19
.L18:
movq %rax, %rdi
.LEHB1:
call _Unwind_Resume@PLT
.LEHE1:
.L19:
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE14:
.globl __gxx_personality_v0
.section .gcc_except_table._ZN15EnvironmentImplD2Ev,"aG",@progbits,_ZN15EnvironmentImplD5Ev,comdat
.LLSDA14:
.byte 0xff
.byte 0xff
.byte 0x1
.uleb128 .LLSDACSE14-.LLSDACSB14
.LLSDACSB14:
.uleb128 .LEHB0-.LFB14
.uleb128 .LEHE0-.LEHB0
.uleb128 .L18-.LFB14
.uleb128 0
.uleb128 .LEHB1-.LFB14
.uleb128 .LEHE1-.LEHB1
.uleb128 0
.uleb128 0
.LLSDACSE14:
.section .text._ZN15EnvironmentImplD2Ev,"axG",@progbits,_ZN15EnvironmentImplD5Ev,comdat
.size _ZN15EnvironmentImplD2Ev, .-_ZN15EnvironmentImplD2Ev
.weak _ZN15EnvironmentImplD1Ev
.set _ZN15EnvironmentImplD1Ev,_ZN15EnvironmentImplD2Ev
.section .text._ZN15EnvironmentImplD0Ev,"axG",@progbits,_ZN15EnvironmentImplD0Ev,comdat
.align 2
.weak _ZN15EnvironmentImplD0Ev
.type _ZN15EnvironmentImplD0Ev, @function
_ZN15EnvironmentImplD0Ev:
.LFB16:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
subq $16, %rsp
movq %rdi, -8(%rbp)
movq -8(%rbp), %rax
movq %rax, %rdi
call _ZN15EnvironmentImplD1Ev@PLT
movq -8(%rbp), %rax
movq %rax, %rdi
call _ZdlPv@PLT
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE16:
.size _ZN15EnvironmentImplD0Ev, .-_ZN15EnvironmentImplD0Ev
.weak _ZTS15EnvironmentImpl
.section .rodata._ZTS15EnvironmentImpl,"aG",@progbits,_ZTS15EnvironmentImpl,comdat
.align 16
.type _ZTS15EnvironmentImpl, @object
.size _ZTS15EnvironmentImpl, 18
_ZTS15EnvironmentImpl:
.string "15EnvironmentImpl"
.weak _ZTI15EnvironmentImpl
.section .data.rel.ro._ZTI15EnvironmentImpl,"awG",@progbits,_ZTI15EnvironmentImpl,comdat
.align 16
.type _ZTI15EnvironmentImpl, @object
.size _ZTI15EnvironmentImpl, 24
_ZTI15EnvironmentImpl:
.quad _ZTVN10__cxxabiv120__si_class_type_infoE+16
.quad _ZTS15EnvironmentImpl
.quad _ZTI11Environment
.weak _ZTI11Environment
.section .data.rel.ro._ZTI11Environment,"awG",@progbits,_ZTI11Environment,comdat
.align 16
.type _ZTI11Environment, @object
.size _ZTI11Environment, 16
_ZTI11Environment:
.quad _ZTVN10__cxxabiv117__class_type_infoE+16
.quad _ZTS11Environment
.weak _ZTS11Environment
.section .rodata._ZTS11Environment,"aG",@progbits,_ZTS11Environment,comdat
.type _ZTS11Environment, @object
.size _ZTS11Environment, 14
_ZTS11Environment:
.string "11Environment"
.hidden _ZN4_VTVI11EnvironmentE12__vtable_mapE
.weak _ZN4_VTVI11EnvironmentE12__vtable_mapE
.section .vtable_map_vars,"awG",@progbits,_ZN4_VTVI11EnvironmentE12__vtable_mapE,comdat
.align 8
.type _ZN4_VTVI11EnvironmentE12__vtable_mapE, @gnu_unique_object
.size _ZN4_VTVI11EnvironmentE12__vtable_mapE, 8
_ZN4_VTVI11EnvironmentE12__vtable_mapE:
.zero 8
.hidden _ZN4_VTVI15EnvironmentImplE12__vtable_mapE
.weak _ZN4_VTVI15EnvironmentImplE12__vtable_mapE
.section .vtable_map_vars,"awG",@progbits,_ZN4_VTVI15EnvironmentImplE12__vtable_mapE,comdat
.align 8
.type _ZN4_VTVI15EnvironmentImplE12__vtable_mapE, @gnu_unique_object
.size _ZN4_VTVI15EnvironmentImplE12__vtable_mapE, 8
_ZN4_VTVI15EnvironmentImplE12__vtable_mapE:
.zero 8
.section .data.rel.ro,"aw",@progbits
.align 16
.type __vptr_array_11Environment, @object
.size __vptr_array_11Environment, 16
__vptr_array_11Environment:
.quad _ZTV11Environment+16
.quad _ZTV15EnvironmentImpl+16
.section .rodata
.align 8
.LC1:
.string "&"
.string ""
.string ""
.ascii "\224\tl\022_ZN4_VTVI11EnvironmentE12__vtable_mapE"
.align 8
.LC2:
.string "*"
.string ""
.string ""
.ascii "N\225\r\334_ZN4_VTVI15EnvironmentImplE12__vtable_mapE"
.text
.type _GLOBAL__sub_I.00099_environment.cc, @function
_GLOBAL__sub_I.00099_environment.cc:
.LFB17:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq %rsp, %rbp
.cfi_def_cfa_register 6
leaq __vptr_array_11Environment(%rip), %r8
movl $2, %ecx
movl $2, %edx
leaq .LC1(%rip), %rsi
leaq _ZN4_VTVI11EnvironmentE12__vtable_mapE(%rip), %rdi
movq _ZTV15EnvironmentImpl@GOTPCREL(%rip), %rax
leaq 16(%rax), %rcx
movl $1, %edx
leaq .LC2(%rip), %rsi
leaq _ZN4_VTVI15EnvironmentImplE12__vtable_mapE(%rip), %rdi
call _Z17__VLTRegisterPairPPvPKvmS2_@PLT
popq %rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE17:
.size _GLOBAL__sub_I.00099_environment.cc, .-_GLOBAL__sub_I.00099_environment.cc
.section .init_array.00099,"aw"
.align 8
.quad _GLOBAL__sub_I.00099_environment.cc
.hidden DW.ref.__gxx_personality_v0
.weak DW.ref.__gxx_personality_v0
.section .data.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
.align 8
.type DW.ref.__gxx_personality_v0, @object
.size DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
.quad __gxx_personality_v0
.ident "GCC: (GNU) 4.9.0 20130616 (experimental)"
.section .note.GNU-stack,"",@progbits

View file

@ -0,0 +1,37 @@
extern "C" int printf(const char *, ...);
class Environment {
public:
virtual ~Environment();
// Static factory method that returns the implementation that provide the
// appropriate platform-specific instance.
static Environment* Create();
// Gets an environment variable's value and stores it in |result|.
// Returns false if the key is unset.
virtual bool GetVar(const char* variable_name, char* result) = 0;
};
class EnvironmentImpl : public Environment {
public:
virtual bool GetVar(const char* variable_name, char* result) {
return true;
}
};
Environment::~Environment() {}
// static
Environment* Environment::Create() {
return new EnvironmentImpl();
}
int main()
{
char * null = 0;
Environment * env = Environment::Create();
env->GetVar(0, null);
printf("%p\n", env);
}

View file

@ -0,0 +1,10 @@
#include "event.h"
Event::Event()
{
}
Event::~Event()
{
}

View file

@ -0,0 +1,13 @@
#include "event-private.h"
template<typename T> void derefIfNotNull(T* ptr)
{
if (ptr != 0)
ptr->deref();
}
int main()
{
Event * ev = new Event;
derefIfNotNull(ev);
}

View file

@ -0,0 +1,10 @@
#include "event-private.h"
PrivateEvent::PrivateEvent()
{
}
PrivateEvent::~PrivateEvent()
{
}

View file

@ -0,0 +1,7 @@
#include "event.h"
class PrivateEvent: public Event {
public:
PrivateEvent();
~PrivateEvent ();
};

29
libvtv/testsuite/event.h Normal file
View file

@ -0,0 +1,29 @@
class RefCountedBase {
protected:
bool derefBase()
{
return true;
}
};
template<typename T> class RefCounted : public RefCountedBase {
public:
void deref()
{
if (derefBase())
delete static_cast<T*>(this);
}
protected:
// RefCounted() { }
~RefCounted()
{
}
};
class Event : public RefCounted<Event> {
public:
Event();
virtual ~Event();
};

View file

@ -0,0 +1 @@
event-main.cc event-definitions.cc event-private.cc

Some files were not shown because too many files have changed in this diff Show more