openldap-2.4.39-symbol_versions-1.patch 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. Submitted By: Armin K. <krejzi at email dot com>
  2. Date: 2012-04-06
  3. Initial Package Version: 2.4.30
  4. Upstream Status: Unknown
  5. Origin: Debian
  6. Description: This patch enables symbol versioning in ldap libraries. Without this
  7. patch some applications might generate a warning about missing symbol
  8. versions.
  9. --- openldap.orig/build/openldap.m4 2012-02-29 18:37:09.000000000 +0100
  10. +++ openldap/build/openldap.m4 2012-04-01 17:29:50.973881411 +0200
  11. @@ -1136,3 +1136,54 @@
  12. #endif
  13. ], [ol_cv_ssl_crl_compat=yes], [ol_cv_ssl_crl_compat=no])])
  14. ])
  15. +
  16. +dnl ====================================================================
  17. +dnl check for symbol versioning support
  18. +AC_DEFUN([OL_SYMBOL_VERSIONING],
  19. +[AC_CACHE_CHECK([for .symver assembler directive],
  20. + [ol_cv_asm_symver_directive],[
  21. +cat > conftest.s <<EOF
  22. +${libc_cv_dot_text}
  23. +_sym:
  24. +.symver _sym,sym@VERS
  25. +EOF
  26. +if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
  27. + ol_cv_asm_symver_directive=yes
  28. +else
  29. + ol_cv_asm_symver_directive=no
  30. +fi
  31. +rm -f conftest*])
  32. +AC_CACHE_CHECK([for ld --version-script],
  33. + [ol_cv_ld_version_script_option],[
  34. +if test $ol_cv_asm_symver_directive = yes; then
  35. + cat > conftest.s <<EOF
  36. +${libc_cv_dot_text}
  37. +_sym:
  38. +.symver _sym,sym@VERS
  39. +EOF
  40. + cat > conftest.map <<EOF
  41. +VERS_1 {
  42. + global: sym;
  43. +};
  44. +
  45. +VERS_2 {
  46. + global: sym;
  47. +} VERS_1;
  48. +EOF
  49. + if ${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then
  50. + if AC_TRY_COMMAND([${CC-cc} $CFLAGS $LDFLAGS -shared
  51. + -o conftest.so conftest.o
  52. + -Wl,--version-script,conftest.map
  53. + 1>&AS_MESSAGE_LOG_FD]);
  54. + then
  55. + ol_cv_ld_version_script_option=yes
  56. + else
  57. + ol_cv_ld_version_script_option=no
  58. + fi
  59. + else
  60. + ol_cv_ld_version_script_option=no
  61. + fi
  62. +else
  63. + ol_cv_ld_version_script_option=no
  64. +fi
  65. +rm -f conftest*])])
  66. --- openldap.orig/build/top.mk 2012-02-29 18:37:09.000000000 +0100
  67. +++ openldap/build/top.mk 2012-04-01 17:29:50.972881390 +0200
  68. @@ -104,6 +104,9 @@
  69. # LINK_LIBS referenced in library and module link commands.
  70. LINK_LIBS = $(MOD_LIBS) $(@PLAT@_LINK_LIBS)
  71. +# option to pass to $(CC) to support library symbol versioning, if any
  72. +VERSION_OPTION = @VERSION_OPTION@
  73. +
  74. LTSTATIC = @LTSTATIC@
  75. LTLINK = $(LIBTOOL) --mode=link \
  76. @@ -113,7 +116,7 @@
  77. $(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(LIB_DEFS) -c
  78. LTLINK_LIB = $(LIBTOOL) $(LTONLY_LIB) --mode=link \
  79. - $(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_LIB)
  80. + $(CC) $(LT_CFLAGS) $(LDFLAGS) $(LTFLAGS_LIB) $(VERSION_FLAGS)
  81. LTCOMPILE_MOD = $(LIBTOOL) $(LTONLY_MOD) --mode=compile \
  82. $(CC) $(LT_CFLAGS) $(LT_CPPFLAGS) $(MOD_DEFS) -c
  83. --- openldap.orig/configure.in 2012-02-29 18:37:09.000000000 +0100
  84. +++ openldap/configure.in 2012-04-01 17:29:50.981881580 +0200
  85. @@ -1907,6 +1907,13 @@
  86. fi
  87. AC_SUBST(LTSTATIC)dnl
  88. +VERSION_OPTION=""
  89. +OL_SYMBOL_VERSIONING
  90. +if test $ol_cv_ld_version_script_option = yes ; then
  91. + VERSION_OPTION="-Wl,--version-script="
  92. +fi
  93. +AC_SUBST(VERSION_OPTION)
  94. +
  95. dnl ----------------------------------------------------------------
  96. if test $ol_enable_wrappers != no ; then
  97. AC_CHECK_HEADERS(tcpd.h,[
  98. --- openldap.orig/libraries/liblber/liblber.map 1970-01-01 01:00:00.000000000 +0100
  99. +++ openldap/libraries/liblber/liblber.map 2012-04-01 17:29:50.983881622 +0200
  100. @@ -0,0 +1,8 @@
  101. +OPENLDAP_2.4_2 {
  102. + global:
  103. + ber_*;
  104. + der_alloc;
  105. + lutil_*;
  106. + local:
  107. + *;
  108. +};
  109. --- openldap.orig/libraries/liblber/Makefile.in 2012-04-01 17:27:12.042526978 +0200
  110. +++ openldap/libraries/liblber/Makefile.in 2012-04-01 17:29:50.982881601 +0200
  111. @@ -38,6 +38,9 @@
  112. XXLIBS =
  113. NT_LINK_LIBS = $(AC_LIBS)
  114. UNIX_LINK_LIBS = $(AC_LIBS)
  115. +ifneq (,$(VERSION_OPTION))
  116. + VERSION_FLAGS = "$(VERSION_OPTION)$(srcdir)/liblber.map"
  117. +endif
  118. dtest: $(XLIBS) dtest.o
  119. $(LTLINK) -o $@ dtest.o $(LIBS)
  120. --- openldap.orig/libraries/libldap/libldap.map 1970-01-01 01:00:00.000000000 +0100
  121. +++ openldap/libraries/libldap/libldap.map 2012-04-01 17:29:50.981881580 +0200
  122. @@ -0,0 +1,7 @@
  123. +OPENLDAP_2.4_2 {
  124. + global:
  125. + ldap_*;
  126. + ldif_*;
  127. + local:
  128. + *;
  129. +};
  130. --- openldap.orig/libraries/libldap/Makefile.in 2012-04-01 17:27:12.043527000 +0200
  131. +++ openldap/libraries/libldap/Makefile.in 2012-04-01 17:29:50.982881601 +0200
  132. @@ -52,6 +52,9 @@
  133. XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS)
  134. NT_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
  135. UNIX_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
  136. +ifneq (,$(VERSION_OPTION))
  137. + VERSION_FLAGS = $(VERSION_OPTION)$(srcdir)/libldap.map
  138. +endif
  139. apitest: $(XLIBS) apitest.o
  140. $(LTLINK) -o $@ apitest.o $(LIBS)
  141. --- openldap.orig/libraries/libldap_r/Makefile.in 2012-04-01 17:27:12.043527000 +0200
  142. +++ openldap/libraries/libldap_r/Makefile.in 2012-04-01 17:29:50.971881369 +0200
  143. @@ -61,6 +61,9 @@
  144. XXXLIBS = $(LTHREAD_LIBS)
  145. NT_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS)
  146. UNIX_LINK_LIBS = $(LDAP_LIBLBER_LA) $(AC_LIBS) $(SECURITY_LIBS) $(LTHREAD_LIBS)
  147. +ifneq (,$(VERSION_OPTION))
  148. + VERSION_FLAGS = "$(VERSION_OPTION)$(XXDIR)/libldap.map"
  149. +endif
  150. .links : Makefile
  151. @for i in $(XXSRCS); do \