From 6436f99f34e607a25018cb2a8d915bf8a3b268cc Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Mon, 24 Nov 2014 14:02:25 +0100 Subject: [PATCH] Added symbol versioning for nettle and hogweed Signed-off-by: Nikos Mavrogiannopoulos --- .gitignore | 3 +++ Makefile.in | 4 ++-- aclocal.m4 | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 7 ++++++- libhogweed.map.in | 18 +++++++++++++++++ libnettle.map.in | 17 ++++++++++++++++ 6 files changed, 105 insertions(+), 3 deletions(-) create mode 100644 libhogweed.map.in create mode 100644 libnettle.map.in diff --git a/.gitignore b/.gitignore index 2b16f4c..7c4e04c 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,6 @@ core /nettle.tps /nettle.vr /nettle.vrs +*.po +/libhogweed.map +/libnettle.map diff --git a/Makefile.in b/Makefile.in index 10a58b0..ebd2bb1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -244,7 +244,7 @@ libhogweed.a: $(hogweed_OBJS) # Rules building shared libraries. $(LIBNETTLE_FORLINK): $(nettle_OBJS) - $(LIBNETTLE_LINK) $(nettle_OBJS) -o $@ $(LIBNETTLE_LIBS) + $(LIBNETTLE_LINK) $(nettle_OBJS) @EXTRA_LINKER_FLAGS@ -o $@ $(LIBNETTLE_LIBS) -mkdir .lib 2>/dev/null (cd .lib \ && rm -f $(LIBNETTLE_FORLINK) \ @@ -255,7 +255,7 @@ $(LIBNETTLE_FORLINK): $(nettle_OBJS) echo nettle > libnettle.stamp $(LIBHOGWEED_FORLINK): $(hogweed_OBJS) $(LIBNETTLE_FORLINK) - $(LIBHOGWEED_LINK) $(hogweed_OBJS) -o $@ $(LIBHOGWEED_LIBS) + $(LIBHOGWEED_LINK) $(hogweed_OBJS) @EXTRA_HOGWEED_LINKER_FLAGS@ -o $@ $(LIBHOGWEED_LIBS) -mkdir .lib 2>/dev/null (cd .lib \ && rm -f $(LIBHOGWEED_FORLINK) \ diff --git a/aclocal.m4 b/aclocal.m4 index 36daec6..4c0bd41 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1211,3 +1211,62 @@ ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" ac_cv_type_intmax_t="$ac_cv_type_intmax_t" ]) ]) + +# ld-version-script.m4 serial 3 +dnl Copyright (C) 2008-2014 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Simon Josefsson + +# FIXME: The test below returns a false positive for mingw +# cross-compiles, 'local:' statements does not reduce number of +# exported symbols in a DLL. Use --disable-ld-version-script to work +# around the problem. + +# gl_LD_VERSION_SCRIPT +# -------------------- +# Check if LD supports linker scripts, and define automake conditional +# HAVE_LD_VERSION_SCRIPT if so. +AC_DEFUN([LD_VERSION_SCRIPT], +[ + AC_ARG_ENABLE([ld-version-script], + AS_HELP_STRING([--enable-ld-version-script], + [enable linker version script (default is enabled when possible)]), + [have_ld_version_script=$enableval], []) + if test -z "$have_ld_version_script"; then + AC_MSG_CHECKING([if LD -Wl,--version-script works]) + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" + cat > conftest.map < conftest.map <