Commit e3c9512b252ebb19f3a7d1d66e55ff8e6ca4086a

Authored by Jay Berkenbilt
1 parent 8e9fe213

notes on symbol versioning

Showing 1 changed file with 46 additions and 0 deletions
@@ -5,6 +5,52 @@ Next @@ -5,6 +5,52 @@ Next
5 to build and test cleanly in 2.3.1. Hopefully the next release 5 to build and test cleanly in 2.3.1. Hopefully the next release
6 will include 64-bit binary distributions and external libraries. 6 will include 64-bit binary distributions and external libraries.
7 7
  8 + * Add versioned symbols. Fix below to not use AM_CONDITIONAL. Just
  9 + set some variable that can be part of LDFLAGS, like
  10 + LD_VERSION_SCRIPT, instead.
  11 +
  12 +# Check if LD supports linker scripts, and define conditional
  13 +# HAVE_LD_VERSION_SCRIPT if so. This functionality is currently
  14 +# constrained to compilers using GNU ld on ELF systems or systems
  15 +# which provide an adequate emulation thereof.
  16 +AC_ARG_ENABLE([ld-version-script],
  17 + AS_HELP_STRING([--enable-ld-version-script],
  18 + [enable linker version script (default is disabled)]),
  19 + [have_ld_version_script=$enableval], [have_ld_version_script=no])
  20 +if test "$have_ld_version_script" != no; then
  21 + AC_MSG_CHECKING([if LD -Wl,--version-script works])
  22 + save_LDFLAGS="$LDFLAGS"
  23 + LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
  24 + cat > conftest.map <<EOF
  25 +VERS_1 {
  26 + global: sym;
  27 +};
  28 +
  29 +VERS_2 {
  30 + global: sym;
  31 +} VERS_1;
  32 +EOF
  33 + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
  34 + [have_ld_version_script=yes], [have_ld_version_script=no])
  35 + rm -f conftest.map
  36 + LDFLAGS="$save_LDFLAGS"
  37 + AC_MSG_RESULT($have_ld_version_script)
  38 +fi
  39 +AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
  40 +
  41 +----
  42 +
  43 +if HAVE_LD_VERSION_SCRIPT
  44 +libtiff_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtiff.map
  45 +endif
  46 +
  47 +----
  48 +
  49 +LIBQPDF_3 {
  50 + global:
  51 + *;
  52 +};
  53 +
8 54
9 Better 64-bit support on Windows 55 Better 64-bit support on Windows
10 ================================ 56 ================================