public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] binuitils: Check if AR is usable for LTO build
@ 2021-01-11 19:53 H.J. Lu
  2021-01-11 21:20 ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2021-01-11 19:53 UTC (permalink / raw)
  To: binutils; +Cc: gcc-patches, gdb-patches

Check if AR is usable for LTO build with --enable-pgo-build=lto:

checking for -plugin option... ar: no operation specified
Failed: ar --plugin /usr/gcc-11.0.0-x32/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/liblto_plugin.so rc
no
configure: error: AR with --plugin and rc is required for LTO build

instead of build failure later.

	PR binutils/26766
	* configure.ac:
	* configure: Regenerated.
---
 configure    | 4 ++++
 configure.ac | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/configure b/configure
index c44184f72ff..84285addafe 100755
--- a/configure
+++ b/configure
@@ -10240,6 +10240,10 @@ if test -n "$PLUGIN_OPTION"; then
   if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
     RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
   fi
+else
+  if test "$enable_pgo_build" != "no"; then
+    as_fn_error $? "AR with --plugin and rc is required for LTO build" "$LINENO" 5
+  fi
 fi
 
 
diff --git a/configure.ac b/configure.ac
index 9dd51c36e5a..d39019d7093 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3452,6 +3452,10 @@ if test -n "$PLUGIN_OPTION"; then
   if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
     RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
   fi
+else
+  if test "$enable_pgo_build" != "no"; then
+    AC_MSG_ERROR([AR with --plugin and rc is required for LTO build])
+  fi
 fi
 AC_SUBST(AR_PLUGIN_OPTION)
 AC_SUBST(RANLIB_PLUGIN_OPTION)
-- 
2.29.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] binuitils: Check if AR is usable for LTO build
  2021-01-11 19:53 [PATCH] binuitils: Check if AR is usable for LTO build H.J. Lu
@ 2021-01-11 21:20 ` Alan Modra
  2021-01-11 22:52   ` H.J. Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2021-01-11 21:20 UTC (permalink / raw)
  To: H.J. Lu; +Cc: binutils, gcc-patches, gdb-patches

On Mon, Jan 11, 2021 at 11:53:15AM -0800, H.J. Lu via Binutils wrote:
> Check if AR is usable for LTO build with --enable-pgo-build=lto:
> 
> checking for -plugin option... ar: no operation specified
> Failed: ar --plugin /usr/gcc-11.0.0-x32/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/liblto_plugin.so rc
> no
> configure: error: AR with --plugin and rc is required for LTO build
> 
> instead of build failure later.
> 
> 	PR binutils/26766
> 	* configure.ac:
> 	* configure: Regenerated.

See pr27173 too.  The problem isn't a matter of finding an "ar" that
supports --plugin, we have versions of GNU ar (2.30 to 2.32?) that
accept --plugin but then don't parse the "rc" or other command
options.  I don't think this patch will help.

> ---
>  configure    | 4 ++++
>  configure.ac | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/configure b/configure
> index c44184f72ff..84285addafe 100755
> --- a/configure
> +++ b/configure
> @@ -10240,6 +10240,10 @@ if test -n "$PLUGIN_OPTION"; then
>    if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
>      RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
>    fi
> +else
> +  if test "$enable_pgo_build" != "no"; then
> +    as_fn_error $? "AR with --plugin and rc is required for LTO build" "$LINENO" 5
> +  fi
>  fi
>  
>  
> diff --git a/configure.ac b/configure.ac
> index 9dd51c36e5a..d39019d7093 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -3452,6 +3452,10 @@ if test -n "$PLUGIN_OPTION"; then
>    if $RANLIB --help 2>&1 | grep -q "\--plugin"; then
>      RANLIB_PLUGIN_OPTION="$PLUGIN_OPTION"
>    fi
> +else
> +  if test "$enable_pgo_build" != "no"; then
> +    AC_MSG_ERROR([AR with --plugin and rc is required for LTO build])
> +  fi
>  fi
>  AC_SUBST(AR_PLUGIN_OPTION)
>  AC_SUBST(RANLIB_PLUGIN_OPTION)
> -- 
> 2.29.2

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] binuitils: Check if AR is usable for LTO build
  2021-01-11 21:20 ` Alan Modra
@ 2021-01-11 22:52   ` H.J. Lu
  2021-01-12  0:26     ` Alan Modra
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2021-01-11 22:52 UTC (permalink / raw)
  To: Alan Modra; +Cc: Binutils, GCC Patches, GDB

On Mon, Jan 11, 2021 at 1:20 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Mon, Jan 11, 2021 at 11:53:15AM -0800, H.J. Lu via Binutils wrote:
> > Check if AR is usable for LTO build with --enable-pgo-build=lto:
> >
> > checking for -plugin option... ar: no operation specified
> > Failed: ar --plugin /usr/gcc-11.0.0-x32/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/liblto_plugin.so rc
> > no
> > configure: error: AR with --plugin and rc is required for LTO build
> >
> > instead of build failure later.
> >
> >       PR binutils/26766
> >       * configure.ac:
> >       * configure: Regenerated.
>
> See pr27173 too.  The problem isn't a matter of finding an "ar" that
> supports --plugin, we have versions of GNU ar (2.30 to 2.32?) that
> accept --plugin but then don't parse the "rc" or other command
> options.  I don't think this patch will help.

PR 27173 patches are at

https://sourceware.org/pipermail/binutils/2021-January/114879.html

-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] binuitils: Check if AR is usable for LTO build
  2021-01-11 22:52   ` H.J. Lu
@ 2021-01-12  0:26     ` Alan Modra
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Modra @ 2021-01-12  0:26 UTC (permalink / raw)
  To: H.J. Lu; +Cc: Binutils, GCC Patches, GDB

On Mon, Jan 11, 2021 at 02:52:43PM -0800, H.J. Lu wrote:
> On Mon, Jan 11, 2021 at 1:20 PM Alan Modra <amodra@gmail.com> wrote:
> >
> > On Mon, Jan 11, 2021 at 11:53:15AM -0800, H.J. Lu via Binutils wrote:
> > > Check if AR is usable for LTO build with --enable-pgo-build=lto:
> > >
> > > checking for -plugin option... ar: no operation specified
> > > Failed: ar --plugin /usr/gcc-11.0.0-x32/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/liblto_plugin.so rc
> > > no
> > > configure: error: AR with --plugin and rc is required for LTO build
> > >
> > > instead of build failure later.
> > >
> > >       PR binutils/26766
> > >       * configure.ac:
> > >       * configure: Regenerated.
> >
> > See pr27173 too.  The problem isn't a matter of finding an "ar" that
> > supports --plugin, we have versions of GNU ar (2.30 to 2.32?) that
> > accept --plugin but then don't parse the "rc" or other command
> > options.  I don't think this patch will help.
> 
> PR 27173 patches are at
> 
> https://sourceware.org/pipermail/binutils/2021-January/114879.html

After that one is committed, this patch is OK too (with any needed
modifications).

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-12  0:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 19:53 [PATCH] binuitils: Check if AR is usable for LTO build H.J. Lu
2021-01-11 21:20 ` Alan Modra
2021-01-11 22:52   ` H.J. Lu
2021-01-12  0:26     ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).