diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2015-11-25 10:30:25 +0000 |
---|---|---|
committer | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2015-11-25 10:30:25 +0000 |
commit | 7cf7e9c49e1cb3fb88074f3418ce093439b773fe (patch) | |
tree | 9216240eb09617c83cf72cd69f1d6971f33b581d /gcc/config/sol2.h | |
parent | c918f711e5fced735657803f5efa6ca5da96d4ea (diff) |
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*}.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@230865 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sol2.h')
-rw-r--r-- | gcc/config/sol2.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h index 6bf0599feaa..1758b9158db 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 |