#endif
+/* Define if your linker supports -z ctf. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_LD_CTF
+#endif
+
+
/* Define if your linker supports --demangle option. */
#ifndef USED_FOR_TARGET
#undef HAVE_LD_DEMANGLE
#define CPP_SPEC "%(cpp_subtarget)"
#undef CC1_SPEC
-#define CC1_SPEC "%(cc1_cpu) " ASAN_CC1_SPEC \
+#define CC1_SPEC "%(cc1_cpu) " ASAN_CC1_SPEC SCTF_CC1_SPEC \
" %{mx32:%e-mx32 is not supported on Solaris}"
/* GNU as understands --32 and --64, but the native Solaris
#define LINK_CLEARCAP_SPEC ""
#endif
+/* Convenience alias for Solaris CTF generation. */
+#ifdef HAVE_LD_CTF
+#define SCTF_CC1_SPEC " %{gsctf:-gctf} %<gsctf"
+#else
+#define SCTF_CC1_SPEC " %{gsctf:%e-gsctf is not supported in this configuration}"
+#endif
+
+/* How to generate Solaris CTF. */
+#ifdef HAVE_LD_CTF
+/* Direct linker support. */
+#define LINK_SCTF_SPEC " %{gsctf:-z ctf}"
+#else
+#define LINK_SCTF_SPEC \
+ " %{gsctf:%e-gsctf is not supported in this configuration}"
+#endif
+
#undef LINK_SPEC
#define LINK_SPEC \
"%{h*} %{v:-V} \
%{!shared:%{!static:%{rdynamic: " RDYNAMIC_SPEC "}}} \
%{static:-dn -Bstatic} \
%{shared:-G -dy %{!mimpure-text:-z text}} " \
- LINK_LIBGCC_MAPFILE_SPEC LINK_CLEARCAP_SPEC " \
+ LINK_LIBGCC_MAPFILE_SPEC LINK_CLEARCAP_SPEC LINK_SCTF_SPEC " \
%{symbolic:-Bsymbolic -G -dy -z text} \
%(link_arch) \
%{Qy:} %{!Qn:-Qy}"
Ym,
Driver Joined
+gsctf
+Driver RejectNegative
+Generate Solaris CTF.
+
mclear-hwcap
Target
Clear hardware capabilities when linking.
G
UrlSuffix(gcc/System-V-Options.html#index-G-5)
+gsctf
+UrlSuffix(gcc/Solaris-2-Options.html#index-gsctf)
+
mclear-hwcap
UrlSuffix(gcc/Solaris-2-Options.html#index-mclear-hwcap)
%{m64:%{m32:%emay not use both -m32 and -m64}} \
%{m64:-mptr64 -mstack-bias -mno-v8plus \
%{!mcpu*:-%{!mv8plus:mcpu=v9}}} \
-" ASAN_CC1_SPEC
+" ASAN_CC1_SPEC SCTF_CC1_SPEC
#else
#define CC1_SPEC "\
%{m32:%{m64:%emay not use both -m32 and -m64}} \
%{!mcpu*:%{!mv8plus:-mcpu=v9}}} \
%{mv8plus:-m32 -mptr32 -mno-stack-bias \
%{!mcpu*:-mcpu=v9}} \
-" ASAN_CC1_SPEC
+" ASAN_CC1_SPEC SCTF_CC1_SPEC
#endif
/* Support for a compile-time default CPU, et cetera. The rules are:
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_compress_debug" >&5
$as_echo "$gcc_cv_ld_compress_debug" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker support for -z ctf" >&5
+$as_echo_n "checking linker support for -z ctf... " >&6; }
+gcc_cv_ld_ctf=no
+# Check for Solaris ld 1.3315 introduced in Solaris 11.4 SRU 84. ld -z ctf
+# already went in in SRU 81, but lacked GNU CTF to Solaris CTF conversion.
+if $gcc_cv_ld --help 2>&1 | grep -- '-z ctf' > /dev/null \
+ && test x$gnu_ld = xno && test "$ld_vers_minor" -ge 3315; then
+ gcc_cv_ld_ctf=yes
+
+$as_echo "#define HAVE_LD_CTF 1" >>confdefs.h
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_ctf" >&5
+$as_echo "$gcc_cv_ld_ctf" >&6; }
+
if test x"$ld64_flag" = x"yes"; then
# Set defaults for possibly untestable items.
[Define to the linker option to enable compressed debug sections.])
AC_MSG_RESULT($gcc_cv_ld_compress_debug)
+AC_MSG_CHECKING(linker support for -z ctf)
+gcc_cv_ld_ctf=no
+# Check for Solaris ld 1.3315 introduced in Solaris 11.4 SRU 84. ld -z ctf
+# already went in in SRU 81, but lacked GNU CTF to Solaris CTF conversion.
+if $gcc_cv_ld --help 2>&1 | grep -- '-z ctf' > /dev/null \
+ && test x$gnu_ld = xno && test "$ld_vers_minor" -ge 3315; then
+ gcc_cv_ld_ctf=yes
+ AC_DEFINE(HAVE_LD_CTF, 1, [Define if your linker supports -z ctf.])
+fi
+AC_MSG_RESULT($gcc_cv_ld_ctf)
+
if test x"$ld64_flag" = x"yes"; then
# Set defaults for possibly untestable items.
@emph{Solaris 2 Options} (@ref{Solaris 2 Options})
@gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text -mno-impure-text
--pthreads}
+-gsctf -pthreads}
@emph{SPARC Options} (@ref{SPARC Options})
@gccoptlist{-mcpu=@var{cpu-type}
These switches are supported in addition to the above on Solaris 2:
@table @gcctabopt
+@opindex gsctf
+@item -gsctf
+Generate Solaris CTF. Needs to be used both for compilation and
+linking. See @command{ctf(7)} for more information. This is only
+supported since Solaris 11.4 SRU 84 where the necessary toolchain
+support was added.
@opindex pthreads
@item -pthreads
This is a synonym for @option{-pthread}.