aboutsummaryrefslogtreecommitdiff
path: root/libctf/Makefile.am
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2021-09-27 20:31:21 +0100
committerNick Alcock <nick.alcock@oracle.com>2021-09-27 20:31:24 +0100
commitea9c2009115d7e00732f5ad316c10a171fc66a53 (patch)
tree964e06b495b0f2eea0b157a8765093ed265dac6e /libctf/Makefile.am
parentbef9ef8ca0f941d743c77cc55b5fe7985990b2a7 (diff)
downloadgdb-ea9c2009115d7e00732f5ad316c10a171fc66a53.zip
gdb-ea9c2009115d7e00732f5ad316c10a171fc66a53.tar.gz
gdb-ea9c2009115d7e00732f5ad316c10a171fc66a53.tar.bz2
libctf: try several possibilities for linker versioning flags
Checking for linker versioning by just grepping ld --help output for mentions of --version-script is inadequate now that Solaris 11.4 implements a --version-script with different semantics. Try linking a test program with a small wildcard-using version script with each supported set of flags in turn, to make sure that linker versioning is not only advertised but actually works. The Solaris "GNU-compatible" linker versioning is not quite GNU-compatible enough, but we can work around the differences by generating a new version script that removes the comments from the original (Solaris ld requires #-style comments), and making another version script for libctf-nonbfd in particular which doesn't mention any of the symbols that appear in libctf.la, to avoid Solaris ld introducing corresponding new NOTYPE symbols to match the version script. libctf/ChangeLog 2021-09-27 Nick Alcock <nick.alcock@oracle.com> PR libctf/27967 * configure.ac (VERSION_FLAGS): Replace with... (ac_cv_libctf_version_script): ... this multiple test. (VERSION_FLAGS_NOBFD): Substitute this too. * Makefile.am (libctf_nobfd_la_LDFLAGS): Use it. Split out... (libctf_ldflags_nover): ... non-versioning flags here. (libctf_la_LDFLAGS): Use it. * libctf.ver: Give every symbol not in libctf-nobfd a comment on the same line noting as much.
Diffstat (limited to 'libctf/Makefile.am')
-rw-r--r--libctf/Makefile.am5
1 files changed, 3 insertions, 2 deletions
diff --git a/libctf/Makefile.am b/libctf/Makefile.am
index 970b66d..31fcb5d 100644
--- a/libctf/Makefile.am
+++ b/libctf/Makefile.am
@@ -42,7 +42,8 @@ noinst_LTLIBRARIES = libctf.la libctf-nobfd.la
endif
libctf_nobfd_la_LIBADD = @CTF_LIBADD@ $(ZLIB)
-libctf_nobfd_la_LDFLAGS = -version-info 0:0:0 @SHARED_LDFLAGS@ @VERSION_FLAGS@
+libctf_ldflags_nover = -version-info 0:0:0 @SHARED_LDFLAGS@
+libctf_nobfd_la_LDFLAGS = $(libctf_ldflags_nover) @VERSION_FLAGS_NOBFD@
libctf_nobfd_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=1
libctf_nobfd_la_SOURCES = ctf-archive.c ctf-dump.c ctf-create.c ctf-decl.c ctf-error.c \
ctf-hash.c ctf-labels.c ctf-dedup.c ctf-link.c ctf-lookup.c \
@@ -58,7 +59,7 @@ endif
# references in there get picked up.
libctf_la_LIBADD = @CTF_LIBADD@ ../bfd/libbfd.la $(libctf_nobfd_la_LIBADD)
libctf_la_CPPFLAGS = $(AM_CPPFLAGS) -DNOBFD=0
-libctf_la_LDFLAGS = $(libctf_nobfd_la_LDFLAGS)
+libctf_la_LDFLAGS = $(libctf_ldflags_nover) @VERSION_FLAGS@
libctf_la_SOURCES = $(libctf_nobfd_la_SOURCES) ctf-open-bfd.c
# Setup the testing framework, if you have one