https://gcc.gnu.org/g:866697bac2cd3e05875d6a0dc3f64590143fd894

commit r16-3426-g866697bac2cd3e05875d6a0dc3f64590143fd894
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Thu Aug 28 10:10:28 2025 +0200

    configure: Add readelf fallback for HAVE_AS_ULEB128 test [PR119367]
    
    The following patch adds a readelf fallback if objdump nor otool don't
    exist.  All of GNU binutils readelf, eu-readelf and llvm-readelf can
    handle it with those options.
    
    2025-08-28  Jakub Jelinek  <ja...@redhat.com>
    
            PR debug/119367
            * configure.ac (gcc_cv_as_leb128): Add fallback using readelf.
            Grammar fix in comment.
            * configure: Regenerate.

Diff:
---
 gcc/configure    | 9 +++++++--
 gcc/configure.ac | 9 +++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/gcc/configure b/gcc/configure
index 4a751d969bab..013865a2bb63 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -26500,8 +26500,8 @@ fi
 esac
 
 # Check if we have .[us]leb128, and support symbol arithmetic with it.
-# Older versions of GAS and some non-GNU assemblers, have a bugs handling
-# these directives, even when they appear to accept them.
+# Older versions of GAS and some non-GNU assemblers have bugs in handling
+# of these directives, even when they appear to accept them.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .sleb128 and 
.uleb128" >&5
 $as_echo_n "checking assembler for .sleb128 and .uleb128... " >&6; }
 if ${gcc_cv_as_leb128+:} false; then :
@@ -26535,6 +26535,11 @@ elif test "x$gcc_cv_otool" != x; then
      | grep '04 80 0a 8e 78 80 80 80 80 80 80 80 80 80 01' >/dev/null; then
     gcc_cv_as_leb128=yes
   fi
+elif test "x$gcc_cv_readelf" != x; then
+  if $gcc_cv_readelf -x .data conftest.o 2>/dev/null \
+     | grep '04800a8e 78808080 80808080 808001' >/dev/null; then
+    gcc_cv_as_leb128=yes
+  fi
 else
   # play safe, assume the assembler is broken.
   :
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 4532c5c22fe5..2532523b0025 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3307,8 +3307,8 @@ case $target in
 esac
 
 # Check if we have .[us]leb128, and support symbol arithmetic with it.
-# Older versions of GAS and some non-GNU assemblers, have a bugs handling
-# these directives, even when they appear to accept them.
+# Older versions of GAS and some non-GNU assemblers have bugs in handling
+# of these directives, even when they appear to accept them.
 gcc_GAS_CHECK_FEATURE([.sleb128 and .uleb128], gcc_cv_as_leb128,
 [$check_leb128_asflags],
 [      .data
@@ -3330,6 +3330,11 @@ elif test "x$gcc_cv_otool" != x; then
      | grep '04 80 0a 8e 78 80 80 80 80 80 80 80 80 80 01' >/dev/null; then
     gcc_cv_as_leb128=yes
   fi
+elif test "x$gcc_cv_readelf" != x; then
+  if $gcc_cv_readelf -x .data conftest.o 2>/dev/null \
+     | grep '04800a8e 78808080 80808080 808001' >/dev/null; then
+    gcc_cv_as_leb128=yes
+  fi
 else
   # play safe, assume the assembler is broken.
   :

Reply via email to