Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 791007 - Stage2 Prefix fails to build binutils-2.34-r1 on Solaris 11.4SRU32
Summary: Stage2 Prefix fails to build binutils-2.34-r1 on Solaris 11.4SRU32
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: Sparc64 Solaris
: Normal major (vote)
Assignee: Gentoo Prefix
URL: https://sourceware.org/PR27967
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-19 00:05 UTC by Michael Kosarev
Modified: 2023-08-23 01:29 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Stage2 build log (stage2.zip,313.35 KB, application/x-zip-compressed)
2021-05-19 00:09 UTC, Michael Kosarev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Kosarev 2021-05-19 00:05:59 UTC
Gentoo prefix stage2 bootstrap fails to build binutils-2.34-41

Reproducible: Always
Comment 1 Michael Kosarev 2021-05-19 00:09:43 UTC
Created attachment 709731 [details]
Stage2 build log
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2021-05-19 07:04:26 UTC
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?
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2021-06-08 07:52:26 UTC
Filed upstream bug report as https://sourceware.org/PR27967
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2021-06-25 21:37:43 UTC
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?
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2023-08-23 01:29:38 UTC
(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?