diff options
author | ctice <ctice@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-29 08:03:56 +0000 |
---|---|---|
committer | ctice <ctice@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-29 08:03:56 +0000 |
commit | 5be42fa921560bbdaa277e40df5346e650bf72a2 (patch) | |
tree | d1a4e15369f535e9126c671e3f4bfc0bfe410bf2 /libgcc | |
parent | 3a9f48e70f4233a413dde353a5b1dffbc6f7321b (diff) | |
download | linaro-gcc-5be42fa921560bbdaa277e40df5346e650bf72a2.tar.gz linaro-gcc-5be42fa921560bbdaa277e40df5346e650bf72a2.tar.bz2 linaro-gcc-5be42fa921560bbdaa277e40df5346e650bf72a2.zip |
Committing VTV Cygwin patch for Patrick Wollgast
* gcc/config/i386/cygwin.h (STARTFILE_SPEC): Add vtv_start.o,
if -fvtable-verify=preinit/std is used.
* gcc/config/i386/mingw-w64.h (STARTFILE_SPEC): Likewise.
* gcc/config/i386/mingw32.h (STARTFILE_SPEC): Likewise.
* gcc/config/i386/cygwin.h (ENDFILE_SPEC): Add vtv_end.o,
if -fvtable-verify=preinit/std is used.
* gcc/config/i386/mingw32.h (ENDFILE_SPEC): Likewise.
* gcc/config/i386/cygwin.h (LIB_SPEC): Pass -lvtv and -lpsapi,
if -fvtable-verify=preinit/std is used.
* gcc/config/i386/mingw-w64.h (LIB_SPEC): Likewise.
* gcc/config/i386/mingw32.h (LIB_SPEC): Likewise.
* gcc/cp/vtable-class-hierarchy.c (vtv_generate_init_routine): Add
check for not TARGET_PECOFF at the VTV_PREINIT_PRIORITY checks.
* gcc/varasm.c (assemble_variable): Add code to properly set the comdat
section and name for the .vtable_map_vars section in case the
target is PE or COFF.
* libgcc/Makefile.in: Move rules to build vtv_*.o out of the check
for CUSTOM_CRTSTUFF.
* libgcc/config.host (i[34567]86-*-cygwin*, x86_64-*-cygwin*, i[34567]86-*-mingw*)
(x86_64-*-mingw*): Only add vtv_*.o to extra_parts if enable_vtable_verify.
* libstdc++-v3/acinclude.m4: Define VTV_CYGMIN.
* libstdc++-v3/configure: Regenerate.
* libstdc++-v3/libsupc++/Makefile.am: Add vtv_sources only to
libsupc___la_SOURCES and libsupc__convenience_la_SOURCES if VTV_CYGMIN is
not set.
* libstdc++-v3/libsupc++/Makefile.in: Regenerated.
* libstdc++-v3/libsupc++/vtv_stubs.cc: Add none weak declaration of every
function for Cygwin and MinGW.
* libstdc++-v3/src/Makefile.am: Add libvtv.la to toolexeclib_LTLIBRARIES,
if VTV_CYGMIN is set. Define libvtv_la_SOURCES, libvtv_la_LDFLAGS,
libvtv_la_AM_CXXFLAGS and libvtv_la_LINK if VTV_CYGMIN is set.
* libstdc++-v3/src/Makefile.in: Regenerate.
* libvtv/Makefile.am : Add libvtv.la to toolexeclib_LTLIBRARIES, if VTV_CYGMIN
is set. Define libvtv_la_LIBADD, libvtv_la_LDFLAGS, libvtv_stubs_la_LDFLAGS
and libvtv_stubs_la_SOURCES if VTV_CYGMIN is set. Add obstac.c to
libvtv_la_SOURCES if VTV_CYGMIN is set.
* libvtv/Makefile.in : Regenerate.
* libvtv/aclocal.m4 : Regenerate.
* libvtv/configure : Regenerate.
* libvtv/configure.ac : Add ACX_LT_HOST_FLAGS. Define VTV_CYGMIN.
* libvtv/configure.tgt : (x86_64-*-cygwin*, i?86-*-cygwin*, x86_64-*-mingw*)
(i?86-*-mingw*): Add to supported targets.
* libvtv/vtv_fail.cc : Skip inclusion of execinfo.h on Cygwin and MinGW.
(log_error_message): Skip calls to backtrace and backtrace_symbols_fd on Cygwin
and MinGW.
* libvtv/vtv_malloc.cc : Include windows.h and skip sys/mman.h inclusion on
Cygwin and MinGW. Add sysconf port on Cygwin and MinGW.
(obstack_chunk_alloc): Exchange call to mmap with call to VirtualAlloc on Cygwin
and MinGW.
(__vtv_malloc_init): Exchange call to sysconf with call to port of sysconf on
Cygwin and MinGW.
* libvtv/vtv_malloc.h : Declare mprotect and define PROT_READ and PROT_WRITE on
Cygwin and MinGW.
* libvtv/map.h : Include stdint.h on MinGW.
* libvtv/rts.cc : Include windows.h, winternl.h and psapi.h, skip include of
execinfo.h, sys/mman.h and link.h on Cygwin and MinGW.
Add port of __fortify_fail on Cygwin and MinGW.
Change ElfW (Addr) to uintptr_t on Cygwin and MinGW.
(read_section_offset_and_length): Add port for Cygwin and MinGW
(iterate_modules): New function.
(vtv_unprotect_vtable_vars): Use iterate_modules instead of dl_iterate_phdr on
Cygwin and MinGW.
(vtv_protect_vtable_vars): Likewise.
(count_all_pages): Likewise.
(dl_iterate_phdr_count_pages): Don't build on Cygwin and MinGW.
* libvtv/utils.cc : Include windows.h and skip execinfo.h inclusion on
Cygwin and MinGW.
(__vtv_open_log): Exchange call to getuid and getpid with GetCurrentProcessId and
adjust call to snprintf accordingly on Cygwin and MinGW.
Adjust calls to mkdir on MinGW.
Adjust call to open on Cygwin and MinGW.
(__vtv_add_to_log): Adjust call to snprintf on Cygwin and MinGW.
(__vtv_log_verification_failure): Don't generate a backtrace on Cygwin and MinGW.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220232 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/ChangeLog | 10 | ||||
-rw-r--r-- | libgcc/Makefile.in | 2 | ||||
-rw-r--r-- | libgcc/config.host | 12 |
3 files changed, 23 insertions, 1 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index dbe2b82905a..5600d56bb86 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,13 @@ +2015-01-27 Caroline Tice <cmtice@google.com> + + Committing VTV Cywin/Ming patch for Patrick Wollgast + * Makefile.in: Move rules to build vtv_*.o out of the check + for CUSTOM_CRTSTUFF. + * config.host (i[34567]86-*-cygwin*, x86_64-*-cygwin*, + i[34567]86-*-mingw*) + (x86_64-*-mingw*): Only add vtv_*.o to extra_parts if + enable_vtable_verify. + 2015-01-27 Nick Clifton <nickc@redhat.com> * config/rl78/cmpsi2.S: Use function start and end macros. diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in index f693883d718..88ddfea18eb 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -1003,6 +1003,7 @@ crtoffloadbegin$(objext): $(srcdir)/offloadstuff.c crtoffloadend$(objext): $(srcdir)/offloadstuff.c $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_END +endif ifeq ($(enable_vtable_verify),yes) # These are used in vtable verification; see comments in source files for @@ -1019,7 +1020,6 @@ vtv_start_preinit$(objext): $(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),) # -x assembler-with-cpp is only needed on case-insensitive filesystem. diff --git a/libgcc/config.host b/libgcc/config.host index 3c19b1fcfc2..5baeae54e6c 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -626,6 +626,9 @@ i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae) ;; i[34567]86-*-cygwin*) extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o" + if test x$enable_vtable_verify = xyes; then + extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o" + fi # This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h if test x$enable_sjlj_exceptions = xyes; then tmake_eh_file="i386/t-sjlj-eh" @@ -642,6 +645,9 @@ i[34567]86-*-cygwin*) ;; x86_64-*-cygwin*) extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o" + if test x$enable_vtable_verify = xyes; then + extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o" + fi # This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h if test x$enable_sjlj_exceptions = xyes; then tmake_eh_file="i386/t-sjlj-eh" @@ -659,6 +665,9 @@ x86_64-*-cygwin*) ;; i[34567]86-*-mingw*) extra_parts="crtbegin.o crtend.o crtfastmath.o" + if test x$enable_vtable_verify = xyes; then + extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o" + fi case ${target_thread_file} in win32) tmake_file="$tmake_file i386/t-gthr-win32" @@ -705,6 +714,9 @@ x86_64-*-mingw*) fi tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-mingw32 t-dfprules i386/t-crtfm i386/t-chkstk" extra_parts="$extra_parts crtbegin.o crtend.o crtfastmath.o" + if test x$enable_vtable_verify = xyes; then + extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o" + fi ;; i[34567]86-*-interix[3-9]*) tmake_file="$tmake_file i386/t-interix i386/t-chkstk" |