diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2015-11-25 10:30:25 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2015-11-25 10:30:25 +0000 |
commit | e5ef217c3e12ddab9e50843ce322702e8b9d1686 (patch) | |
tree | 9216240eb09617c83cf72cd69f1d6971f33b581d /gcc | |
parent | 70927cae316077708327bfe545a1464c7affe331 (diff) | |
download | gcc-e5ef217c3e12ddab9e50843ce322702e8b9d1686.zip gcc-e5ef217c3e12ddab9e50843ce322702e8b9d1686.tar.gz gcc-e5ef217c3e12ddab9e50843ce322702e8b9d1686.tar.bz2 |
Port libvtv to Solaris
libstdc++-v3:
* acinclude.m4 (GLIBCXX_ENABLE_VTABLE_VERIFY) <solaris2*>: Use
-Wl,-R in VTV_CXXLINKFLAGS.
* configure: Regenerate.
* testsuite/18_support/bad_exception/23591_thread-1.c: Use
-fvtable-verify=none on Solaris 12+.
libgcc:
* Makefile.in (VTV_CFLAGS): New variable.
(vtv_start$(objext), vtv_end$(objext), vtv_end$(objext))
(vtv_start_preinit$(objext), vtv_end_preinit$(objext)): Use it.
* config.host (*-*-solaris2*): Add t-crtstuff-pic to tmake_file.
Add vtv_start.o, vtv_end.o, vtv_start_preinit.o, vtv_end_preinit.o
to extra_parts if $enable_vtable_verify = yes.
libvtv:
* configure.tgt (*-*-solaris2.[1-9]*): Declare supported.
* configure.ac: Call AC_USE_SYSTEM_EXTENSIONS.
<*-*-solaris2*>: Check for init priority support.
Check for getexecname, __fortify_fail, _obstack_begin.
(VTV_NO_OBSTACK): New conditional.
* configure: Regenerate.
* Makefile.am [VTV_NO_OBSTACK] (obstack.c): Use new condition.
Create empty config.h
* Makefile.in: Regenerate.
* vtv_rts.cc [HAVE_GETEXECNAME] (program_invocation_name): New
variable.
(read_section_offset_and_length) [HAVE_GETEXECNAME]: Set it.
(dl_iterate_phdr_callback) [HAVE_GETEXECNAME]: Set it.
(__fortify_fail): Wrap in HAVE___FORTIFY_FAIL
[!HAVE___FORTIFY_FAIL]: Provide non-Cygwin implementation.
(read_section_offset_and_length): Assert sh_size >= VTV_PAGE_SIZE.
(iterate_modules): Fix typo.
Use VTV_PAGE_SIZE.
(dl_iterate_phdr_callback): Fix typo.
Use VTV_PAGE_SIZE.
(__VLTChangePermission): Fix typos.
include:
* vtv-change-permission.h (VTV_PAGE_SIZE) [__sun__ && __svr4__ &&
__sparc__]: Define.
gcc:
* config/sol2.h (SUPPORTS_INIT_PRIORITY): Move up.
(STARTFILE_VTV_SPEC, ENDFILE_VTV_SPEC): Define.
(STARTFILE_SPEC): Use %(startfile_vtv).
(ENDFILE_SPEC): Use %(endfile_vtv).
(SUBTARGET_EXTRA_SPECS): Handle STARTFILE_VTV_SPEC,
ENDFILE_VTV_SPEC.
* gcc.c (LINK_COMMAND_SPEC): Move VTABLE_VERIFICATION_SPEC after %{L*}.
From-SVN: r230865
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/config/sol2.h | 36 | ||||
-rw-r--r-- | gcc/gcc.c | 6 |
3 files changed, 42 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1e788e8..b2efa82 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2015-11-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * config/sol2.h (SUPPORTS_INIT_PRIORITY): Move up. + (STARTFILE_VTV_SPEC, ENDFILE_VTV_SPEC): Define. + (STARTFILE_SPEC): Use %(startfile_vtv). + (ENDFILE_SPEC): Use %(endfile_vtv). + (SUBTARGET_EXTRA_SPECS): Handle STARTFILE_VTV_SPEC, + ENDFILE_VTV_SPEC. + + * gcc.c (LINK_COMMAND_SPEC): Move VTABLE_VERIFICATION_SPEC after %{L*}. + 2015-11-25 Bernd Schmidt <bschmidt@redhat.com> * ifcvt.c (noce_mem_write_may_trap_or_fault_p, diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h index 6bf0599..1758b91 100644 --- a/gcc/config/sol2.h +++ b/gcc/config/sol2.h @@ -150,6 +150,10 @@ along with GCC; see the file COPYING3. If not see #define MD_EXEC_PREFIX "/usr/ccs/bin/" #endif +/* Enable constructor priorities if the configured linker supports it. */ +#undef SUPPORTS_INIT_PRIORITY +#define SUPPORTS_INIT_PRIORITY HAVE_INITFINI_ARRAY_SUPPORT + #undef STARTFILE_ARCH_SPEC #define STARTFILE_ARCH_SPEC "%{ansi:values-Xc.o%s} \ %{!ansi:values-Xa.o%s}" @@ -162,6 +166,22 @@ along with GCC; see the file COPYING3. If not see #define STARTFILE_CRTBEGIN_SPEC "crtbegin.o%s" #endif +#if SUPPORTS_INIT_PRIORITY +#define STARTFILE_VTV_SPEC \ + "%{fvtable-verify=none:%s; \ + fvtable-verify=preinit:vtv_start_preinit.o%s; \ + fvtable-verify=std:vtv_start.o%s}" + +#define ENDFILE_VTV_SPEC \ + "%{fvtable-verify=none:%s; \ + fvtable-verify=preinit:vtv_end_preinit.o%s; \ + fvtable-verify=std:vtv_end.o%s}" +#else +#define STARTFILE_VTV_SPEC \ + "%{fvtable-verify:%e-fvtable-verify is not supported in this configuration}" +#define ENDFILE_VTV_SPEC "" +#endif + /* We don't use the standard svr4 STARTFILE_SPEC because it's wrong for us. */ #undef STARTFILE_SPEC #ifdef HAVE_SOLARIS_CRTS @@ -172,13 +192,15 @@ along with GCC; see the file COPYING3. If not see %{p:%e-p is not supported; \ pg:crtpg.o%s gmon.o%s; \ :crtp.o%s}}} \ - crti.o%s %(startfile_arch) %(startfile_crtbegin)" + crti.o%s %(startfile_arch) %(startfile_crtbegin) \ + %(startfile_vtv)" #else #define STARTFILE_SPEC "%{!shared:%{!symbolic: \ %{p:mcrt1.o%s; \ pg:gcrt1.o%s gmon.o%s; \ :crt1.o%s}}} \ - crti.o%s %(startfile_arch) %(startfile_crtbegin)" + crti.o%s %(startfile_arch) %(startfile_crtbegin) \ + %(startfile_vtv)" #endif #if defined(HAVE_LD_PIE) && defined(HAVE_SOLARIS_CRTS) @@ -192,7 +214,7 @@ along with GCC; see the file COPYING3. If not see #undef ENDFILE_SPEC #define ENDFILE_SPEC \ "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ - %(endfile_arch) %(endfile_crtend) crtn.o%s" + %(endfile_arch) %(endfile_vtv) %(endfile_crtend) crtn.o%s" #undef LINK_ARCH32_SPEC_BASE #define LINK_ARCH32_SPEC_BASE \ @@ -267,12 +289,14 @@ along with GCC; see the file COPYING3. If not see #define SUBTARGET_EXTRA_SPECS \ { "startfile_arch", STARTFILE_ARCH_SPEC }, \ { "startfile_crtbegin", STARTFILE_CRTBEGIN_SPEC }, \ + { "startfile_vtv", STARTFILE_VTV_SPEC }, \ { "link_arch32", LINK_ARCH32_SPEC }, \ { "link_arch64", LINK_ARCH64_SPEC }, \ { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \ { "link_arch", LINK_ARCH_SPEC }, \ { "endfile_arch", ENDFILE_ARCH_SPEC }, \ - { "endfile_crtend", ENDFILE_CRTEND_SPEC }, \ + { "endfile_crtend", ENDFILE_CRTEND_SPEC }, \ + { "endfile_vtv", ENDFILE_VTV_SPEC }, \ SUBTARGET_CPU_EXTRA_SPECS /* C++11 programs need -lrt for nanosleep. */ @@ -398,10 +422,6 @@ along with GCC; see the file COPYING3. If not see #define NO_DBX_BNSYM_ENSYM 1 #endif -/* Enable constructor priorities if the configured linker supports it. */ -#undef SUPPORTS_INIT_PRIORITY -#define SUPPORTS_INIT_PRIORITY HAVE_INITFINI_ARRAY_SUPPORT - /* Solaris has an implementation of __enable_execute_stack. */ #define HAVE_ENABLE_EXECUTE_STACK @@ -1016,9 +1016,9 @@ proper position among the other output files. */ %{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \ "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \ "%X %{o*} %{e*} %{N} %{n} %{r}\ - %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \ - %{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\ - " CHKP_SPEC " \ + %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} \ + %{static:} %{L*} %(mfwrap) %(link_libgcc) " \ + VTABLE_VERIFICATION_SPEC " " SANITIZER_EARLY_SPEC " %o " CHKP_SPEC " \ %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*} 1):\ %:include(libgomp.spec)%(link_gomp)}\ %{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\ |