aboutsummaryrefslogtreecommitdiff
path: root/libtool.m4
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-01-11 16:26:39 -0800
committerArsen Arsenović <arsen@gcc.gnu.org>2023-08-07 22:59:37 +0200
commit9c7797a8c2d707ba4516d3d96d8dff6201476fb6 (patch)
tree3bb182275598b0c39d4d5f9520d538875b282e72 /libtool.m4
parent126f707efbb5184178701cbdc753a10fd831374e (diff)
downloadgcc-9c7797a8c2d707ba4516d3d96d8dff6201476fb6.zip
gcc-9c7797a8c2d707ba4516d3d96d8dff6201476fb6.tar.gz
gcc-9c7797a8c2d707ba4516d3d96d8dff6201476fb6.tar.bz2
GCC: Check if AR works with --plugin and rc
AR from older binutils doesn't work with --plugin and rc: [hjl@gnu-cfl-2 bin]$ touch foo.c [hjl@gnu-cfl-2 bin]$ ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c [hjl@gnu-cfl-2 bin]$ ./ar --plugin /usr/libexec/gcc/x86_64-redhat-linux/10/liblto_plugin.so rc libfoo.a foo.c ./ar: no operation specified [hjl@gnu-cfl-2 bin]$ ./ar --version GNU ar (Linux/GNU Binutils) 2.29.51.0.1.20180112 Copyright (C) 2018 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) any later version. This program has absolutely no warranty. [hjl@gnu-cfl-2 bin]$ Check if AR works with --plugin and rc before passing --plugin to AR and RANLIB. ChangeLog: * configure: Regenerated. * libtool.m4 (_LT_CMD_OLD_ARCHIVE): Check if AR works with --plugin and rc before enabling --plugin. config/ChangeLog: * gcc-plugin.m4 (GCC_PLUGIN_OPTION): Check if AR works with --plugin and rc before enabling --plugin. gcc/ChangeLog: * configure: Regenerate. libatomic/ChangeLog: * configure: Regenerate. libbacktrace/ChangeLog: * configure: Regenerate. libcc1/ChangeLog: * configure: Regenerate. libffi/ChangeLog: * configure: Regenerate. libgfortran/ChangeLog: * configure: Regenerate. libgm2/ChangeLog: * configure: Regenerate. libgomp/ChangeLog: * configure: Regenerate. libiberty/ChangeLog: * configure: Regenerate. libitm/ChangeLog: * configure: Regenerate. libobjc/ChangeLog: * configure: Regenerate. libphobos/ChangeLog: * configure: Regenerate. libquadmath/ChangeLog: * configure: Regenerate. libsanitizer/ChangeLog: * configure: Regenerate. libssp/ChangeLog: * configure: Regenerate. libstdc++-v3/ChangeLog: * configure: Regenerate. libvtv/ChangeLog: * configure: Regenerate. lto-plugin/ChangeLog: * configure: Regenerate. zlib/ChangeLog: * configure: Regenerate.
Diffstat (limited to 'libtool.m4')
-rw-r--r--libtool.m49
1 files changed, 8 insertions, 1 deletions
diff --git a/libtool.m4 b/libtool.m4
index adf75bd..7af5489 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -1342,7 +1342,14 @@ AC_CHECK_TOOL(AR, ar, false)
test -z "$AR" && AR=ar
if test -n "$plugin_option"; then
if $AR --help 2>&1 | grep -q "\--plugin"; then
- AR="$AR $plugin_option"
+ touch conftest.c
+ $AR $plugin_option rc conftest.a conftest.c
+ if test "$?" != 0; then
+ AC_MSG_WARN([Failed: $AR $plugin_option rc])
+ else
+ AR="$AR $plugin_option"
+ fi
+ rm -f conftest.*
fi
fi
test -z "$AR_FLAGS" && AR_FLAGS=cru