On 11/13/21 9:33 AM, H.J. Lu via Gcc-patches wrote:
Sync with binutils for building binutils with LTO:
From 50ad1254d5030d0804cbf89c758359ae202e8d55 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.to...@gmail.com>
Date: Sat, 9 Jan 2021 06:43:11 -0800
Subject: [PATCH] GCC: Pass --plugin to AR and RANLIB
Detect GCC LTO plugin. Pass --plugin to AR and RANLIB to support LTO
build.
* Makefile.tpl (AR): Add @AR_PLUGIN_OPTION@
(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
* configure.ac: Include config/gcc-plugin.m4.
AC_SUBST AR_PLUGIN_OPTION and RANLIB_PLUGIN_OPTION.
* libtool.m4 (_LT_CMD_OLD_ARCHIVE): Pass --plugin to AR and
RANLIB if possible.
* Makefile.in: Regenerated.
* configure: Likewise.
config/
* gcc-plugin.m4 (GCC_PLUGIN_OPTION): New.
libiberty/
* Makefile.in (AR): Add @AR_PLUGIN_OPTION@
(RANLIB): Add @RANLIB_PLUGIN_OPTION@.
(configure_deps): Depend on ../config/gcc-plugin.m4.
* configure.ac: AC_SUBST AR_PLUGIN_OPTION and
RANLIB_PLUGIN_OPTION.
* aclocal.m4: Regenerated.
* configure: Likewise.
zlib/
* configure: Regenerated.
This patch appears to have broken my nios2-linux-gnu target,
x86_64-linux-gnu host cross build:
x86_64-linux-gnu-ar --plugin
/usr/local/tools/gcc-2021/bin/../libexec/gcc/x86_64-linux-gnu/9.3.1/liblto_plugin.so
--plugin
/usr/local/tools/gcc-2021/bin/../libexec/gcc/x86_64-linux-gnu/9.3.1/liblto_plugin.so
rc ./libiberty.a \
./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o ./sha1.o ./alloca.o
./argv.o ./bsearch_r.o ./choose-temp.o ./concat.o ./cp-demint.o
./crc32.o ./d-demangle.o ./dwarfnames.o ./dyn-string.o ./fdmatch.o
./fibheap.o ./filedescriptor.o ./filename_cmp.o ./floatformat.o
./fnmatch.o ./fopen_unlocked.o ./getopt.o ./getopt1.o ./getpwd.o
./getruntime.o ./hashtab.o ./hex.o ./lbasename.o ./lrealpath.o
./make-relative-prefix.o ./make-temp-file.o ./objalloc.o ./obstack.o
./partition.o ./pexecute.o ./physmem.o ./pex-common.o ./pex-one.o
./pex-unix.o ./vprintf-support.o ./rust-demangle.o ./safe-ctype.o
./simple-object.o ./simple-object-coff.o ./simple-object-elf.o
./simple-object-mach-o.o ./simple-object-xcoff.o ./sort.o ./spaces.o
./splay-tree.o ./stack-limit.o ./strerror.o ./strsignal.o
./timeval-utils.o ./unlink-if-ordinary.o ./xasprintf.o ./xatexit.o
./xexit.o ./xmalloc.o ./xmemdup.o ./xstrdup.o ./xstrerror.o ./xstrndup.o
./xvasprintf.o ./setproctitle.o
x86_64-linux-gnu-ar: no operation specified
This is ar version 2.32.51. I also tried with an older set of host
tools using ar 2.25.51 and saw the same failure.
-Sandra