Commit 38d1ac04 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#5365 - Add support for symbol versioning libldap and lilber

parent bc0d62db
......@@ -104,6 +104,9 @@ LTFLAGS_MOD = $(@PLAT@_LTFLAGS_MOD)
# LINK_LIBS referenced in library and module link commands.
LINK_LIBS = $(MOD_LIBS) $(@PLAT@_LINK_LIBS)
# compiler options for versioned library symbol support
OL_VERSIONED_SYMBOLS = @OL_VERSIONED_SYMBOLS@
LTSTATIC = @LTSTATIC@
LTLINK = $(LIBTOOL) --mode=link \
......@@ -113,7 +116,7 @@ LTCOMPILE_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=compile \
$(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(LIB_DEFS) -c
LTLINK_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=link \
$(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_LIB)
$(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_LIB) $(SYMBOL_VERSION_FLAGS)
LTCOMPILE_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=compile \
$(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(MOD_DEFS) -c
......
......@@ -22,11 +22,11 @@ if test $ol_patch != X ; then
ol_type=Release
elif test $ol_minor != X ; then
ol_version=${ol_major}.${ol_minor}.${ol_patch}
ol_api_lib_release=${ol_major}.${ol_minor}-releng
ol_api_lib_release=${ol_major}.${ol_minor}.releng
ol_type=Engineering
else
ol_version=${ol_major}.${ol_minor}
ol_api_lib_release=${ol_major}-devel
ol_api_lib_release=${ol_major}.devel
ol_type=Devel
fi
......
......@@ -440,7 +440,8 @@ AC_ARG_ENABLE(xxliboptions,[
Library Generation & Linking Options])
AC_ENABLE_STATIC
AC_ENABLE_SHARED
OL_ARG_ENABLE(versioning, [AS_HELP_STRING([--enable-versioning], [Enable versioned symbols in shared library])],
auto, [no yes auto])
dnl ----------------------------------------------------------------
dnl Validate options
dnl ----------------------------------------------------------------
......@@ -3072,6 +3073,18 @@ if test "$ol_enable_slapi" != no ; then
SLAPD_SLAPI_DEPEND=libslapi.a
fi
OL_VERSIONED_SYMBOLS=""
if test $ol_enable_versioning != no; then
LDVS=`$LD --help < /dev/null 2>/dev/null | grep version-script`
if test -z "$LDVS"; then
if test $ol_enable_versioning = "yes" ; then
AC_MSG_ERROR([Library symbol versioning requested but not supported])
fi
else
OL_VERSIONED_SYMBOLS="-Wl,--version-script="
fi
fi
dnl ----------------------------------------------------------------
dnl
......@@ -3094,6 +3107,7 @@ AC_SUBST(WITH_MODULES_ENABLED)
AC_SUBST(WITH_ACI_ENABLED)
AC_SUBST(BUILD_THREAD)
AC_SUBST(BUILD_LIBS_DYNAMIC)
AC_SUBST(OL_VERSIONED_SYMBOLS)
AC_SUBST(BUILD_SLAPD)
dnl slapi
......@@ -3212,8 +3226,10 @@ AC_CONFIG_FILES([Makefile:build/top.mk:Makefile.in:build/dir.mk]
[libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk]
[libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk]
[libraries/liblber/lber.pc]
[libraries/liblber/liblber.vers]
[libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk]
[libraries/libldap/ldap.pc]
[libraries/libldap/libldap.vers]
[libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk]
[libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk]
[libraries/librewrite/Makefile:build/top.mk:libraries/librewrite/Makefile.in:build/lib.mk:build/lib-static.mk]
......
......@@ -38,6 +38,9 @@ XLIBS = $(LIBRARY) $(LDAP_LIBLUTIL_A)
XXLIBS =
NT_LINK_LIBS = $(AC_LIBS)
UNIX_LINK_LIBS = $(AC_LIBS)
ifneq (,$(OL_VERSIONED_SYMBOLS))
SYMBOL_VERSION_FLAGS=$(OL_VERSIONED_SYMBOLS)$(LDAP_LIBDIR)/liblber/liblber.vers
endif
dtest: $(XLIBS) dtest.o
$(LTLINK) -o $@ dtest.o $(LIBS)
......
HIDDEN
{
local:
__*;
_rest*;
_save*;
};
OPENLDAP_@OPENLDAP_LIBRELEASE@
{
global:
ber_*;
der_alloc*;
lutil_*;
local: *;
};
......@@ -58,6 +58,9 @@ XLIBS = $(LIBRARY) $(LDAP_LIBLBER_LA) $(LDAP_LIBLUTIL_A)
XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
NT_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
UNIX_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS) $(LTHREAD_LIBS)
ifneq (,$(OL_VERSIONED_SYMBOLS))
SYMBOL_VERSION_FLAGS=$(OL_VERSIONED_SYMBOLS)$(LDAP_LIBDIR)/libldap/libldap.vers
endif
apitest: $(XLIBS) apitest.o
$(LTLINK) -o $@ apitest.o $(LIBS)
......
HIDDEN
{
local:
__*;
_rest*;
_save*;
};
OPENLDAP_@OPENLDAP_LIBRELEASE@
{
global:
ldap_*;
ldif_*;
local: *;
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment