bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/27967] New: Build failure on solaris-11 ld: fatal: option


From: slyfox at inbox dot ru
Subject: [Bug binutils/27967] New: Build failure on solaris-11 ld: fatal: option --version-script requires option -z gnu-version-script-compat to be specified
Date: Tue, 08 Jun 2021 07:51:47 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=27967

            Bug ID: 27967
           Summary: Build failure on solaris-11 ld: fatal: option
                    --version-script requires option -z
                    gnu-version-script-compat to be specified
           Product: binutils
           Version: 2.34
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: slyfox at inbox dot ru
  Target Milestone: ---
              Host: sparcv9-sun-solaris2.11

Created attachment 13486
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13486&action=edit
build.log

It's a forward of https://bugs.gentoo.org/791007 bug found by Michael Kosarev
where on solaris-11 binutils building fails as:

"""
/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
"""

Looks like solaris' ld needs extra `–z gnu-version-script-compat` option set to
make `–version-script` work:

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
probably 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)
"""

Attached full build.log. binutils was configured as:

$ ./configure --enable-plugins --disable-nls --with-system-zlib
--build=sparcv9-sun-solaris2.11 --prefix=/export/home/ruse39/gentoo/tmp/usr
--host=sparcv9-sun-solaris2.11 --target=sparcv9-sun-solaris2.11
--datadir=/export/home/ruse39/gentoo/tmp/usr/share/binutils-data/sparcv9-sun-solaris2.11/2.34
--datarootdir=/export/home/ruse39/gentoo/tmp/usr/share/binutils-data/sparcv9-sun-solaris2.11/2.34
--infodir=/export/home/ruse39/gentoo/tmp/usr/share/binutils-data/sparcv9-sun-solaris2.11/2.34/info
--mandir=/export/home/ruse39/gentoo/tmp/usr/share/binutils-data/sparcv9-sun-solaris2.11/2.34/man
--bindir=/export/home/ruse39/gentoo/tmp/usr/sparcv9-sun-solaris2.11/binutils-bin/2.34
--libdir=/export/home/ruse39/gentoo/tmp/usr/lib/binutils/sparcv9-sun-solaris2.11/2.34
--libexecdir=/export/home/ruse39/gentoo/tmp/usr/lib/binutils/sparcv9-sun-solaris2.11/2.34
--includedir=/export/home/ruse39/gentoo/tmp/usr/lib/binutils/sparcv9-sun-solaris2.11/2.34/include
--enable-obsolete --enable-shared --enable-threads --enable-relro
--enable-install-libiberty --disable-werror
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion=Gentoo 2.34 p4
--disable-static --disable-gdb --disable-libdecnumber --disable-readline
--disable-sim --without-stage1-ldflags
--with-extra-soversion-suffix=gentoo-sys-devel-binutils-st

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]