Old versions of Solaris ld and GNU ld didn't support CIEv3 in .eh_frame.
To avoid this breaking the build
[build] Default to DWARF 4 on Solaris if linker supports CIEv3
http://gcc.gnu.org/ml/gcc-patches/2013-03/msg00669.html
checked for the necessary linker support, defaulting to DWARF-2 if
necessary. Solaris ld was fixed in Solaris 11.1, GNU ld in binutils
2.16, so this is long obsolete and only used in Solaris code anyway.
This patch thus removes both the configure check and
solaris_override_options.
Bootstrapped without regressions on i386-pc-solaris2.11 and
sparc-sun-solaris2.11.
2025-02-12 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc:
* configure.ac (gcc_cv_ld_eh_frame_ciev3): Remove.
* configure, config.in: Regenerate.
* config/sol2.cc (solaris_override_options): Remove.
* config/sol2.h (SUBTARGET_OVERRIDE_OPTIONS): Remove.
* config/sol2-protos.h (solaris_override_options): Remove.
#endif
-/* Define 0/1 if your linker supports CIE v3 in .eh_frame. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_LD_EH_FRAME_CIEV3
-#endif
-
-
/* Define if your linker supports .eh_frame_hdr. */
#undef HAVE_LD_EH_FRAME_HDR
extern void solaris_file_end (void);
extern void solaris_insert_attributes (tree, tree *);
extern void solaris_output_init_fini (FILE *, tree);
-extern void solaris_override_options (void);
/* In sol2-c.cc. */
extern void solaris_register_pragmas (void);
solaris_comdat_htab->traverse <void *, solaris_define_comdat_signature>
(NULL);
}
-
-void
-solaris_override_options (void)
-{
- /* Older versions of Solaris ld cannot handle CIE version 3 in .eh_frame.
- Don't emit DWARF3/4 unless specifically selected if so. */
- if (!HAVE_LD_EH_FRAME_CIEV3 && !OPTION_SET_P (dwarf_version))
- dwarf_version = 2;
-}
TARGET_SUB_OS_CPP_BUILTINS(); \
} while (0)
-#define SUBTARGET_OVERRIDE_OPTIONS \
- do { \
- solaris_override_options (); \
- } while (0)
-
#if DEFAULT_ARCH32_P
#define MULTILIB_DEFAULTS { "m32" }
#else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_eh_frame_hdr" >&5
$as_echo "$gcc_cv_ld_eh_frame_hdr" >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker CIEv3 in .eh_frame support" >&5
-$as_echo_n "checking linker CIEv3 in .eh_frame support... " >&6; }
-gcc_cv_ld_eh_frame_ciev3=no
-if test $in_tree_ld = yes ; then
- if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
- && test $in_tree_ld_is_elf = yes; then
- gcc_cv_ld_eh_frame_ciev3=yes
- fi
-elif test x$gcc_cv_ld != x; then
- if echo "$ld_ver" | grep GNU > /dev/null; then
- gcc_cv_ld_eh_frame_ciev3=yes
- if test 0"$ld_date" -lt 20040513; then
- if test -n "$ld_date"; then
- # If there was date string, but was earlier than 2004-05-13, fail
- gcc_cv_ld_eh_frame_ciev3=no
- elif test "$ld_vers_major" -lt 2; then
- gcc_cv_ld_eh_frame_ciev3=no
- elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 16; then
- gcc_cv_ld_eh_frame_ciev3=no
- fi
- fi
- else
- case "$target" in
- *-*-solaris2*)
- # Sun ld added support for CIE v3 in .eh_frame in Solaris 11.1.
- if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 2324; then
- gcc_cv_ld_eh_frame_ciev3=yes
- fi
- ;;
- esac
- fi
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_LD_EH_FRAME_CIEV3 `if test x"$gcc_cv_ld_eh_frame_ciev3" = xyes; then echo 1; else echo 0; fi`
-_ACEOF
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_ld_eh_frame_ciev3" >&5
-$as_echo "$gcc_cv_ld_eh_frame_ciev3" >&6; }
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker position independent executable support" >&5
$as_echo_n "checking linker position independent executable support... " >&6; }
gcc_cv_ld_pie=no
fi
AC_MSG_RESULT($gcc_cv_ld_eh_frame_hdr)
-AC_MSG_CHECKING(linker CIEv3 in .eh_frame support)
-gcc_cv_ld_eh_frame_ciev3=no
-if test $in_tree_ld = yes ; then
- if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
- && test $in_tree_ld_is_elf = yes; then
- gcc_cv_ld_eh_frame_ciev3=yes
- fi
-elif test x$gcc_cv_ld != x; then
- if echo "$ld_ver" | grep GNU > /dev/null; then
- gcc_cv_ld_eh_frame_ciev3=yes
- if test 0"$ld_date" -lt 20040513; then
- if test -n "$ld_date"; then
- # If there was date string, but was earlier than 2004-05-13, fail
- gcc_cv_ld_eh_frame_ciev3=no
- elif test "$ld_vers_major" -lt 2; then
- gcc_cv_ld_eh_frame_ciev3=no
- elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 16; then
- gcc_cv_ld_eh_frame_ciev3=no
- fi
- fi
- else
- case "$target" in
- *-*-solaris2*)
- # Sun ld added support for CIE v3 in .eh_frame in Solaris 11.1.
- if test "$ld_vers_major" -gt 1 || test "$ld_vers_minor" -ge 2324; then
- gcc_cv_ld_eh_frame_ciev3=yes
- fi
- ;;
- esac
- fi
-fi
-AC_DEFINE_UNQUOTED(HAVE_LD_EH_FRAME_CIEV3,
- [`if test x"$gcc_cv_ld_eh_frame_ciev3" = xyes; then echo 1; else echo 0; fi`],
- [Define 0/1 if your linker supports CIE v3 in .eh_frame.])
-AC_MSG_RESULT($gcc_cv_ld_eh_frame_ciev3)
-
AC_MSG_CHECKING(linker position independent executable support)
gcc_cv_ld_pie=no
if test $in_tree_ld = yes ; then