]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
configure: Add readelf fallback for HAVE_AS_ULEB128 test [PR119367]
authorJakub Jelinek <jakub@redhat.com>
Thu, 28 Aug 2025 08:10:28 +0000 (10:10 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 28 Aug 2025 08:10:28 +0000 (10:10 +0200)
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  <jakub@redhat.com>

PR debug/119367
* configure.ac (gcc_cv_as_leb128): Add fallback using readelf.
Grammar fix in comment.
* configure: Regenerate.

gcc/configure
gcc/configure.ac

index 4a751d969bab25eb2eb741b45e14e35f0dcbc828..013865a2bb6311a11310a0a957f5b1ef7b13b8cb 100755 (executable)
@@ -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.
   :
index 4532c5c22fe5ce0bce990bb7c69f7cea570edcaf..2532523b002508d2147919e9b51938905d0d374b 100644 (file)
@@ -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.
   :