https://gcc.gnu.org/g:7db94370a74481ad1db1f0a4dc4aa45fa464a02a

commit r15-7501-g7db94370a74481ad1db1f0a4dc4aa45fa464a02a
Author: Rainer Orth <r...@cebitec.uni-bielefeld.de>
Date:   Thu Feb 13 10:17:50 2025 +0100

    build: Remove HAVE_LD_EH_FRAME_CIEV3
    
    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  <r...@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.

Diff:
---
 gcc/config.in            |  6 ------
 gcc/config/sol2-protos.h |  1 -
 gcc/config/sol2.cc       |  9 ---------
 gcc/config/sol2.h        |  5 -----
 gcc/configure            | 40 ----------------------------------------
 gcc/configure.ac         | 36 ------------------------------------
 6 files changed, 97 deletions(-)

diff --git a/gcc/config.in b/gcc/config.in
index 3b06533c4829..45ae9fb222eb 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -1773,12 +1773,6 @@
 #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
 
diff --git a/gcc/config/sol2-protos.h b/gcc/config/sol2-protos.h
index 2462b475c7fc..70dd9583e6ce 100644
--- a/gcc/config/sol2-protos.h
+++ b/gcc/config/sol2-protos.h
@@ -24,7 +24,6 @@ extern void solaris_elf_asm_comdat_section (const char *, 
unsigned int, tree);
 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);
diff --git a/gcc/config/sol2.cc b/gcc/config/sol2.cc
index 9bd9722dff72..f46bcfaf0023 100644
--- a/gcc/config/sol2.cc
+++ b/gcc/config/sol2.cc
@@ -291,12 +291,3 @@ solaris_file_end (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;
-}
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
index 9618b43c6178..2405c101aee3 100644
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -119,11 +119,6 @@ along with GCC; see the file COPYING3.  If not see
     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
diff --git a/gcc/configure b/gcc/configure
index e36d1d91612a..69a9cf7af5f5 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -32335,46 +32335,6 @@ fi
 { $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
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 8fab93c93654..845827a340f7 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -6101,42 +6101,6 @@ if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then
 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

Reply via email to