Gentoo prefix stage2 bootstrap fails to build binutils-2.34-41 Reproducible: Always
Created attachment 709731 [details] Stage2 build log
Posting error snippet for posterity here: """ /export/home/ruse39/gentoo/tmp/bin/bash ./libtool --tag=CC --mode=link gcc -m64 -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -pedantic -Wno-long-long -O2 -pipe -version-info 0:0:0 -Wl,--version-script='/export/home/ruse39/gentoo/tmp/var/tmp/portage/sys-devel/binutils-2.34-r1/work/binutils-2.34/libctf/libctf.ver' -L/export/home/ruse39/gentoo/tmp/usr/lib -R/export/home/ruse39/gentoo/tmp/usr/lib -R/export/home/ruse39/gentoo/tmp/tmp -o libctf.la -rpath /export/home/ruse39/gentoo/tmp/usr/lib/binutils/sparcv9-sun-solaris2.11/2.34 ctf-archive.lo ctf-dump.lo ctf-create.lo ctf-decl.lo ctf-error.lo ctf-hash.lo ctf-labels.lo ctf-link.lo ctf-lookup.lo ctf-open.lo ctf-string.lo ctf-subr.lo ctf-types.lo ctf-util.lo ctf-open-bfd.lo -Wl,/export/home/ruse39/gentoo/tmp/var/tmp/portage/sys-devel/binutils-2.34-r1/work/build/libctf/../bfd/.libs/libbfd.so -L/export/home/ruse39/gentoo/tmp/var/tmp/portage/sys-devel/binutils-2.34-r1/work/build/libctf/../libiberty/pic -liberty -lz libtool: link: gcc -m64 -shared -Wl,-z -Wl,text -Wl,-h -Wl,libctf.so.0 -o .libs/libctf.so.0.0.0 .libs/ctf-archive.o .libs/ctf-dump.o .libs/ctf-create.o .libs/ctf-decl.o .libs/ctf-error.o .libs/ctf-hash.o .libs/ctf-labels.o .libs/ctf-link.o .libs/ctf-lookup.o .libs/ctf-open.o .libs/ctf-string.o .libs/ctf-subr.o .libs/ctf-types.o .libs/ctf-util.o .libs/ctf-open-bfd.o -R/export/home/ruse39/gentoo/tmp/usr/lib -R/export/home/ruse39/gentoo/tmp/tmp -L/export/home/ruse39/gentoo/tmp/usr/lib -L/export/home/ruse39/gentoo/tmp/var/tmp/portage/sys-devel/binutils-2.34-r1/work/build/libctf/../libiberty/pic -liberty -lz -m64 -Wl,--version-script=/export/home/ruse39/gentoo/tmp/var/tmp/portage/sys-devel/binutils-2.34-r1/work/binutils-2.34/libctf/libctf.ver -Wl,/export/home/ruse39/gentoo/tmp/var/tmp/portage/sys-devel/binutils-2.34-r1/work/build/libctf/../bfd/.libs/libbfd.so ld: fatal: option --version-script requires option -z gnu-version-script-compat to be specified """ https://docs.oracle.com/cd/E88353_01/html/E37839/ld-1.html says we need an extra option """ –z gnu-version-script=mapfile –z gnu-version-script-compat –version-script mapfile Provides partial support for the GNU version script style of mapfile. Version scripts are based on the original Solaris version 1 symbol definition syntax, with some extensions. ld supports the most common such extension, the use of wildcard characters in the specified symbol names. Other GNU-specific extensions may not be supported. ld will issue an appropriate error if an unsupported extension is encountered. For convenience in building software developed with GNU version scripts, the native GNU –version-script option is accepted as an alias for –z gnu-version-script. Due to the partial nature of the support for GNU version scripts, the use of –version-script must be explicitly enabled by specifying –z gnu-version-script-compat. """ libctf/configure.ac has too simplistic detection of --version-script and will need to be extended: """ # Use a version script, if possible, or an -export-symbols-regex otherwise. VERSION_FLAGS='-export-symbols-regex ctf_.*' if $LD --help 2>&1 | grep -- --version-script >/dev/null; then VERSION_FLAGS="-Wl,--version-script='$srcdir/libctf.ver'" fi AC_SUBST(VERSION_FLAGS) """ If you add LDFLAGS=-Wl,-z,gnu-version-script-compat for bootstrap does it help?
Filed upstream bug report as https://sourceware.org/PR27967
Nick asked to test https://sourceware.org/PR27967#c4 proposed patch against binutils-head in his binutils branch. Do you have a chance to test if it gets binutils working for you?
(In reply to Sergei Trofimovich (RETIRED) from comment #4) > Nick asked to test https://sourceware.org/PR27967#c4 proposed patch against > binutils-head in his binutils branch. Do you have a chance to test if it > gets binutils working for you?