]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
binuitils: Check if AR is usable for LTO build
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 12 Jan 2021 00:37:03 +0000 (16:37 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 12 Jan 2021 00:37:13 +0000 (16:37 -0800)
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.

ChangeLog
configure
configure.ac

index 81593bc8f8505358fabef5e22b79227f469eb96f..b9255d643cb968e96db178eab9556ed086b29c0d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-11  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR binutils/26766
+       * configure.ac:
+       * configure: Regenerated.
+
 2021-01-11  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/27173
index 5437ef12c72f08a5811ab2ad8444c31b59669ba0..25d2fc48c66b89c0cf977948edf7083ac4456653 100755 (executable)
--- a/configure
+++ b/configure
@@ -10241,6 +10241,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
 
 
index 9dd51c36e5ac4d6d8cdce07859aa9bbe56220f6b..d39019d70934ce3e93557c12f55baa69409f196d 100644 (file)
@@ -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)