[Pkg-openldap-devel] r906 - in openldap/trunk/debian: . patches
Steve Langasek
vorlon at alioth.debian.org
Sun Dec 16 09:20:17 UTC 2007
Author: vorlon
Date: 2007-12-16 09:20:17 +0000 (Sun, 16 Dec 2007)
New Revision: 906
Added:
openldap/trunk/debian/patches/libldap-symbol-versions
Modified:
openldap/trunk/debian/changelog
openldap/trunk/debian/patches/series
Log:
* add new patch, libldap-symbol-versions, to build libldap and liblber
with symbol versions; needed to avoid segfaults when applications
manage to pull both libldap2 and the new libldap-2.4-2 into the same
process (as during a partial upgrade or the initial soname
transition), and also when the library soname changes again in the
future (as it's likely to do).
Modified: openldap/trunk/debian/changelog
===================================================================
--- openldap/trunk/debian/changelog 2007-12-16 09:06:57 UTC (rev 905)
+++ openldap/trunk/debian/changelog 2007-12-16 09:20:17 UTC (rev 906)
@@ -18,8 +18,14 @@
slapd.conf. Closes: #452749.
* drop libldap.so as was done for libldap2, making it a link to
libldap_r.so to avoid unfortunate symbol collisions.
+ * add new patch, libldap-symbol-versions, to build libldap and liblber
+ with symbol versions; needed to avoid segfaults when applications
+ manage to pull both libldap2 and the new libldap-2.4-2 into the same
+ process (as during a partial upgrade or the initial soname
+ transition), and also when the library soname changes again in the
+ future (as it's likely to do).
- -- Steve Langasek <vorlon at debian.org> Sun, 16 Dec 2007 00:14:31 -0800
+ -- Steve Langasek <vorlon at debian.org> Sun, 16 Dec 2007 01:07:16 -0800
openldap2.3 (2.3.39-1) unstable; urgency=medium
Added: openldap/trunk/debian/patches/libldap-symbol-versions
===================================================================
--- openldap/trunk/debian/patches/libldap-symbol-versions (rev 0)
+++ openldap/trunk/debian/patches/libldap-symbol-versions 2007-12-16 09:20:17 UTC (rev 906)
@@ -0,0 +1,168 @@
+Index: trunk/libraries/libldap_r/Makefile.in
+===================================================================
+--- trunk.orig/libraries/libldap_r/Makefile.in
++++ trunk/libraries/libldap_r/Makefile.in
+@@ -57,6 +57,9 @@
+ XXXLIBS = $(LTHREAD_LIBS)
+ NT_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
+ UNIX_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS) $(LTHREAD_LIBS)
++ifneq (,$(VERSION_OPTION))
++ VERSION_FLAGS = "$(VERSION_OPTION)$(XXDIR)/libldap.map"
++endif
+
+ .links : Makefile
+ @for i in $(XXSRCS); do \
+Index: trunk/build/top.mk
+===================================================================
+--- trunk.orig/build/top.mk
++++ trunk/build/top.mk
+@@ -103,6 +103,9 @@
+ # LINK_LIBS referenced in library and module link commands.
+ LINK_LIBS = $(MOD_LIBS) $(@PLAT at _LINK_LIBS)
+
++# option to pass to $(CC) to support library symbol versioning, if any
++VERSION_OPTION = @VERSION_OPTION@
++
+ LTSTATIC = @LTSTATIC@
+
+ LTLINK = $(LIBTOOL) --mode=link \
+@@ -112,7 +115,7 @@
+ $(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) $(VERSION_FLAGS)
+
+ LTCOMPILE_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=compile \
+ $(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(MOD_DEFS) -c
+Index: trunk/build/openldap.m4
+===================================================================
+--- trunk.orig/build/openldap.m4
++++ trunk/build/openldap.m4
+@@ -1312,3 +1312,54 @@
+ #endif
+ ], [ol_cv_ssl_crl_compat=yes], [ol_cv_ssl_crl_compat=no])])
+ ])
++
++dnl ====================================================================
++dnl check for symbol versioning support
++AC_DEFUN([OL_SYMBOL_VERSIONING],
++[AC_CACHE_CHECK([for .symver assembler directive],
++ [ol_cv_asm_symver_directive],[
++cat > conftest.s <<EOF
++${libc_cv_dot_text}
++_sym:
++.symver _sym,sym at VERS
++EOF
++if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
++ ol_cv_asm_symver_directive=yes
++else
++ ol_cv_asm_symver_directive=no
++fi
++rm -f conftest*])
++AC_CACHE_CHECK([for ld --version-script],
++ [ol_cv_ld_version_script_option],[
++if test $ol_cv_asm_symver_directive = yes; then
++ cat > conftest.s <<EOF
++${libc_cv_dot_text}
++_sym:
++.symver _sym,sym at VERS
++EOF
++ cat > conftest.map <<EOF
++VERS_1 {
++ global: sym;
++};
++
++VERS_2 {
++ global: sym;
++} VERS_1;
++EOF
++ if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
++ if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
++ -o conftest.so conftest.o
++ -Wl,--version-script,conftest.map
++ 1>&AS_MESSAGE_LOG_FD]);
++ then
++ ol_cv_ld_version_script_option=yes
++ else
++ ol_cv_ld_version_script_option=no
++ fi
++ else
++ ol_cv_ld_version_script_option=no
++ fi
++else
++ ol_cv_ld_version_script_option=no
++fi
++rm -f conftest*])])
+Index: trunk/configure.in
+===================================================================
+--- trunk.orig/configure.in
++++ trunk/configure.in
+@@ -1858,6 +1858,13 @@
+ fi
+ AC_SUBST(LTSTATIC)dnl
+
++VERSION_OPTION=""
++OL_SYMBOL_VERSIONING
++if test $ol_cv_ld_version_script_option = yes ; then
++ VERSION_OPTION="-Wl,--version-script="
++fi
++AC_SUBST(VERSION_OPTION)
++
+ dnl ----------------------------------------------------------------
+ if test $ol_enable_wrappers != no ; then
+ AC_CHECK_HEADERS(tcpd.h,[
+Index: trunk/libraries/libldap/libldap.map
+===================================================================
+--- /dev/null
++++ trunk/libraries/libldap/libldap.map
+@@ -0,0 +1,6 @@
++OPENLDAP_2.4_2 {
++ global:
++ ldap_*;
++ local:
++ *;
++};
+Index: trunk/libraries/libldap/Makefile.in
+===================================================================
+--- trunk.orig/libraries/libldap/Makefile.in
++++ trunk/libraries/libldap/Makefile.in
+@@ -48,7 +48,10 @@
+ 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)
+-
++ifneq (,$(VERSION_OPTION))
++ VERSION_FLAGS = "$(VERSION_OPTION)$(srcdir)/libldap.map"
++endif
++
+ apitest: $(XLIBS) apitest.o
+ $(LTLINK) -o $@ apitest.o $(LIBS)
+ dntest: $(XLIBS) dntest.o
+Index: trunk/libraries/liblber/Makefile.in
+===================================================================
+--- trunk.orig/libraries/liblber/Makefile.in
++++ trunk/libraries/liblber/Makefile.in
+@@ -38,6 +38,9 @@
+ XXLIBS =
+ NT_LINK_LIBS = $(AC_LIBS)
+ UNIX_LINK_LIBS = $(AC_LIBS)
++ifneq (,$(VERSION_OPTION))
++ VERSION_FLAGS = "$(VERSION_OPTION)$(srcdir)/liblber.map"
++endif
+
+ dtest: $(XLIBS) dtest.o
+ $(LTLINK) -o $@ dtest.o $(LIBS)
+Index: trunk/libraries/liblber/liblber.map
+===================================================================
+--- /dev/null
++++ trunk/libraries/liblber/liblber.map
+@@ -0,0 +1,8 @@
++OPENLDAP_2.4_2 {
++ global:
++ ber_*;
++ der_alloc;
++ lutil_*;
++ local:
++ *;
++};
Modified: openldap/trunk/debian/patches/series
===================================================================
--- openldap/trunk/debian/patches/series 2007-12-16 09:06:57 UTC (rev 905)
+++ openldap/trunk/debian/patches/series 2007-12-16 09:20:17 UTC (rev 906)
@@ -8,3 +8,4 @@
wrong-database-location -p0
index-files-created-as-root -p0
sasl-default-path -p0
+libldap-symbol-versions
More information about the Pkg-openldap-devel
mailing list