V2 [PATCH 1/2] GCC: Check if AR works with --plugin and rc
H.J. Lu
hjl.tools@gmail.com
Tue Jan 12 00:07:22 GMT 2021
On Mon, Jan 11, 2021 at 3:27 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Mon, Jan 11, 2021 at 08:57:05AM -0800, H.J. Lu via Binutils wrote:
> > diff --git a/config/gcc-plugin.m4 b/config/gcc-plugin.m4
> > index c5b72e9a13d..798a2054edd 100644
> > --- a/config/gcc-plugin.m4
> > +++ b/config/gcc-plugin.m4
> > @@ -145,6 +145,18 @@ for plugin in $plugin_names; do
> > break
> > fi
> > done
> > +dnl Check if ${AR} $plugin_option rc works.
> > +AC_CHECK_TOOL(AR, ar)
> > +if test "${AR}" = "" ; then
> > + AC_MSG_ERROR([Required archive tool 'ar' not found on PATH.])
> > +fi
> > +touch conftest.c
> > +${AR} $plugin_option rc conftest.a conftest.c
> > +if test "$?" != 0; then
> > + echo "Failed: ${AR} $plugin_option rc"
>
> Use AC_MSG_ERROR rather than echo.
>
> > + plugin_option=
> > +fi
> > +rm -f conftest.*
> > if test -n "$plugin_option"; then
> > $1="$plugin_option"
> > AC_MSG_RESULT($plugin_option)
>
> > diff --git a/libtool.m4 b/libtool.m4
> > index 3672e9516e2..150971974c1 100644
> > --- a/libtool.m4
> > +++ b/libtool.m4
> > @@ -1340,7 +1340,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
> > + echo "Failed: $AR $plugin_option rc"
>
> AC_MSG_ERROR again.
These are not fatal errors. Here is the updated patch to use
AC_MSG_WARN instead. OK for master?
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-GCC-Check-if-AR-works-with-plugin-and-rc.patch
Type: text/x-patch
Size: 10721 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20210111/06872e47/attachment-0001.bin>
More information about the Gdb-patches
mailing list