summaryrefslogtreecommitdiffstats
path: root/recipes-support/openldap/openldap-2.4.39/libldap-symbol-versions.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-support/openldap/openldap-2.4.39/libldap-symbol-versions.patch')
-rw-r--r--recipes-support/openldap/openldap-2.4.39/libldap-symbol-versions.patch161
1 files changed, 161 insertions, 0 deletions
diff --git a/recipes-support/openldap/openldap-2.4.39/libldap-symbol-versions.patch b/recipes-support/openldap/openldap-2.4.39/libldap-symbol-versions.patch
new file mode 100644
index 0000000..fb28f49
--- /dev/null
+++ b/recipes-support/openldap/openldap-2.4.39/libldap-symbol-versions.patch
@@ -0,0 +1,161 @@
1Add symbol versioning to the public LDAP libraries. This is required for
2library transitions, such as the current transition from 2.1 to 2.4,
3since programs will sometimes have both libraries loaded by different
4dependency chains during the transition.
5
6Not yet contributed upstream.
7
8Upstream ITS #5365 filed requesting symbol versioning for libldap and
9libber.
10
11--- a/libraries/libldap_r/Makefile.in
12+++ b/libraries/libldap_r/Makefile.in
13@@ -61,6 +61,9 @@ XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
14 XXXLIBS = $(LTHREAD_LIBS)
15 NT_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
16 UNIX_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS) $(LTHREAD_LIBS)
17+ifneq (,$(VERSION_OPTION))
18+ VERSION_FLAGS = "$(VERSION_OPTION)$(XXDIR)/libldap.map"
19+endif
20
21 .links : Makefile
22 @for i in $(XXSRCS); do \
23--- a/build/top.mk
24+++ b/build/top.mk
25@@ -104,6 +104,9 @@ LTFLAGS_MOD = $(@PLAT@_LTFLAGS_MOD)
26 # LINK_LIBS referenced in library and module link commands.
27 LINK_LIBS = $(MOD_LIBS) $(@PLAT@_LINK_LIBS)
28
29+# option to pass to $(CC) to support library symbol versioning, if any
30+VERSION_OPTION = @VERSION_OPTION@
31+
32 LTSTATIC = @LTSTATIC@
33
34 LTLINK = $(LIBTOOL) --mode=link \
35@@ -113,7 +116,7 @@ LTCOMPILE_LIB = $(LIBTOOL) $(LTONLY_LIB)
36 $(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(LIB_DEFS) -c
37
38 LTLINK_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=link \
39- $(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_LIB)
40+ $(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_LIB) $(VERSION_FLAGS)
41
42 LTCOMPILE_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=compile \
43 $(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(MOD_DEFS) -c
44--- a/build/openldap.m4
45+++ b/build/openldap.m4
46@@ -1136,3 +1136,54 @@ AC_DEFUN([OL_SSL_COMPAT],
47 #endif
48 ], [ol_cv_ssl_crl_compat=yes], [ol_cv_ssl_crl_compat=no])])
49 ])
50+
51+dnl ====================================================================
52+dnl check for symbol versioning support
53+AC_DEFUN([OL_SYMBOL_VERSIONING],
54+[AC_CACHE_CHECK([for .symver assembler directive],
55+ [ol_cv_asm_symver_directive],[
56+cat > conftest.s <<EOF
57+${libc_cv_dot_text}
58+_sym:
59+.symver _sym,sym@VERS
60+EOF
61+if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
62+ ol_cv_asm_symver_directive=yes
63+else
64+ ol_cv_asm_symver_directive=no
65+fi
66+rm -f conftest*])
67+AC_CACHE_CHECK([for ld --version-script],
68+ [ol_cv_ld_version_script_option],[
69+if test $ol_cv_asm_symver_directive = yes; then
70+ cat > conftest.s <<EOF
71+${libc_cv_dot_text}
72+_sym:
73+.symver _sym,sym@VERS
74+EOF
75+ cat > conftest.map <<EOF
76+VERS_1 {
77+ global: sym;
78+};
79+
80+VERS_2 {
81+ global: sym;
82+} VERS_1;
83+EOF
84+ if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
85+ if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
86+ -o conftest.so conftest.o
87+ -Wl,--version-script,conftest.map
88+ 1>&AS_MESSAGE_LOG_FD]);
89+ then
90+ ol_cv_ld_version_script_option=yes
91+ else
92+ ol_cv_ld_version_script_option=no
93+ fi
94+ else
95+ ol_cv_ld_version_script_option=no
96+ fi
97+else
98+ ol_cv_ld_version_script_option=no
99+fi
100+rm -f conftest*])])
101--- a/configure.in
102+++ b/configure.in
103@@ -1909,6 +1909,13 @@ else
104 fi
105 AC_SUBST(LTSTATIC)dnl
106
107+VERSION_OPTION=""
108+OL_SYMBOL_VERSIONING
109+if test $ol_cv_ld_version_script_option = yes ; then
110+ VERSION_OPTION="-Wl,--version-script="
111+fi
112+AC_SUBST(VERSION_OPTION)
113+
114 dnl ----------------------------------------------------------------
115 if test $ol_enable_wrappers != no ; then
116 AC_CHECK_HEADERS(tcpd.h,[
117--- /dev/null
118+++ b/libraries/libldap/libldap.map
119@@ -0,0 +1,7 @@
120+OPENLDAP_2.4_2 {
121+ global:
122+ ldap_*;
123+ ldif_*;
124+ local:
125+ *;
126+};
127--- a/libraries/libldap/Makefile.in
128+++ b/libraries/libldap/Makefile.in
129@@ -52,6 +52,9 @@ XLIBS = $(LIBRARY) $(LDAP_LIBLBER_LA) $(
130 XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
131 NT_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
132 UNIX_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
133+ifneq (,$(VERSION_OPTION))
134+ VERSION_FLAGS = $(VERSION_OPTION)$(srcdir)/libldap.map
135+endif
136
137 apitest: $(XLIBS) apitest.o
138 $(LTLINK) -o $@ apitest.o $(LIBS)
139--- a/libraries/liblber/Makefile.in
140+++ b/libraries/liblber/Makefile.in
141@@ -38,6 +38,9 @@ XLIBS = $(LIBRARY) $(LDAP_LIBLUTIL_A)
142 XXLIBS =
143 NT_LINK_LIBS = $(AC_LIBS)
144 UNIX_LINK_LIBS = $(AC_LIBS)
145+ifneq (,$(VERSION_OPTION))
146+ VERSION_FLAGS = "$(VERSION_OPTION)$(srcdir)/liblber.map"
147+endif
148
149 dtest: $(XLIBS) dtest.o
150 $(LTLINK) -o $@ dtest.o $(LIBS)
151--- /dev/null
152+++ b/libraries/liblber/liblber.map
153@@ -0,0 +1,8 @@
154+OPENLDAP_2.4_2 {
155+ global:
156+ ber_*;
157+ der_alloc;
158+ lutil_*;
159+ local:
160+ *;
161+};