summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2016-03-03 13:51:44 -0800
committerRichard Henderson <rth@twiddle.net>2016-05-04 06:49:50 -1000
commitc02c3414440e816aa13a2fe8446484173d3edb0e (patch)
treeb97f4e5761b6424581284741c32d2bf0ce0d0683 /Makefile.am
parent14be9a1d0713deb97edb91fe9800afe971a001d5 (diff)
downloadlibffi-c02c3414440e816aa13a2fe8446484173d3edb0e.tar.gz
Use ELF symbol versioning
At the same time, we must bump the (major) ABI version. This needed to be done anyway due to ABI breakage in the AArch64 port (see 12cf89ee and the corresponding GCC PR70024).
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am28
1 files changed, 26 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 20fa382..4ddd12d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -155,7 +155,6 @@ EXTRA_libffi_la_SOURCES = \
TARGET_OBJ = @TARGET_OBJ@
libffi_la_LIBADD = $(TARGET_OBJ)
-libffi_la_DEPENDENCIES = $(TARGET_OBJ)
libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
EXTRA_libffi_convenience_la_SOURCES = $(EXTRA_libffi_la_SOURCES)
@@ -172,7 +171,32 @@ if FFI_DEBUG
AM_CFLAGS += -DFFI_DEBUG
endif
-libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
+if LIBFFI_BUILD_VERSIONED_SHLIB
+if LIBFFI_BUILD_VERSIONED_SHLIB_GNU
+libffi_version_script = -Wl,--version-script,libffi.map
+libffi_version_dep = libffi.map
+endif
+if LIBFFI_BUILD_VERSIONED_SHLIB_SUN
+libffi_version_script = -Wl,-M,libffi.map-sun
+libffi_version_dep = libffi.map-sun
+libffi.map-sun : libffi.map $(top_srcdir)/../contrib/make_sunver.pl \
+ $(libffi_la_OBJECTS) $(libffi_la_LIBADD)
+ perl $(top_srcdir)/../contrib/make_sunver.pl libffi.map \
+ `echo $(libffi_la_OBJECTS) $(libffi_la_LIBADD) | \
+ sed 's,\([^/ ]*\)\.l\([ao]\),.libs/\1.\2,g'` \
+ > $@ || (rm -f $@ ; exit 1)
+endif
+else
+libffi_version_script =
+libffi_version_dep =
+endif
+libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+
+libffi.map: $(top_srcdir)/libffi.map.in
+ $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $<
+
+libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS)
+libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep)
AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
AM_CCASFLAGS = $(AM_CPPFLAGS)