diff mbox series

libbacktrace patch committed: Use objcopy --help to check for option

Message ID CAOyqgcXQRZQteFG7Cvh63Lz=cVTOYVOSur7ZWqHGKrOLZL-O3Q@mail.gmail.com
State New
Headers show
Series libbacktrace patch committed: Use objcopy --help to check for option | expand

Commit Message

Ian Lance Taylor Feb. 12, 2021, 2:10 a.m. UTC
This patch changes the libbacktrace configure script to check for
whether objcopy supports --add-gnu-debuglink (a test that only affects
the libbacktrace testsuite) to look at the objcopy --help option
rather than trying to apply --add-gnu-debuglink to /bin/ls.  The
latter can trigger a warning if /bin/ls already has a separate debug
file.  Bootstrapped and ran libbacktrace testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian

* configure.ac: Check for objcopy --add-gnu-debuglink by using
objcopy --help.
* configure: Regenerate
diff mbox series

Patch

diff --git a/libbacktrace/configure.ac b/libbacktrace/configure.ac
index 83d4733509a..43a33a66b82 100644
--- a/libbacktrace/configure.ac
+++ b/libbacktrace/configure.ac
@@ -500,8 +500,7 @@  AC_CACHE_CHECK([whether objcopy supports debuglink],
   libbacktrace_cv_objcopy_debuglink=no
 elif ! test -n "${OBJCOPY}"; then
   libbacktrace_cv_objcopy_debuglink=no
-elif ${OBJCOPY} --add-gnu-debuglink=x /bin/ls /tmp/ls$$; then
-  rm -f /tmp/ls$$
+elif ${OBJCOPY} --help | fgrep add-gnu-debuglink >/dev/null 2>&1; then
   libbacktrace_cv_objcopy_debuglink=yes
 else
   libbacktrace_cv_objcopy_debuglink=no