diff options
author | Jay Berkenbilt <ejb@ql.org> | 2018-01-14 02:56:28 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2018-01-15 02:09:20 +0100 |
commit | fc74d67fab3c88cbd51efb0bca76004b70c7e8bc (patch) | |
tree | ba3fdadded225116e2a432fb2c70dd30130a8e9f | |
parent | ae854950b939a9208998e823b41a31ea1ff10fd7 (diff) | |
download | qpdf-fc74d67fab3c88cbd51efb0bca76004b70c7e8bc.tar.zst |
Correct handling of elf symbol versioning
We were putting the value of LT_CURRENT in the versioned symbol map
instead of the soname major version, which was creating binary
incompatibility where none was present. Unfortunately, this bug is
already out there for qpdf 7.0.0, so we'll have to work around it for
now.
-rw-r--r-- | README-maintainer.md | 2 | ||||
-rw-r--r-- | configure.ac | 14 | ||||
-rw-r--r-- | libqpdf.map.in | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/README-maintainer.md b/README-maintainer.md index 2f2e40ea..7b2bf99b 100644 --- a/README-maintainer.md +++ b/README-maintainer.md @@ -4,7 +4,6 @@ ``` ./configure CFLAGS="-g" CXXFLAGS="-g" --enable-werror --disable-shared ``` -* Test for binary compatibility. The easiest way to do this is to check out the last release, run the test suite, check out the new release, run `make build_libqpdf`, check out the old release, and run `make check NO_REBUILD=1`. * When making a release, always remember to run large file tests and image comparison tests (`--enable-test-compare-images` `--with-large-file-test-path=/path`). For Windows, use a Windows style path, not an MSYS path for large files. For a major release, consider running a spelling checker over the source code to catch errors in variable names, strings, and comments. Use `ispell -p ispell-words`. * Run tests with sanitize address enabled: ``` @@ -20,6 +19,7 @@ * Avoid atoi. Use QUtil::string_to_int instead. It does overflow/underflow checking. * Remember to avoid using `operator[]` with `std::string` or `std::vector`. Instead, use `at()`. See README-hardening.md for details. * Increment shared library version information as needed (`LT_*` in `configure.ac`) +* Test for binary compatibility. The easiest way to do this is to check out the last release, run the test suite, check out the new release, run `./autogen.mk; ./configure --enable-werror; make build_libqpdf`, check out the old release, and run `make check NO_REBUILD=1`. * Update release notes in manual. Look at diffs and ChangeLog. * Add a release entry to ChangeLog. * Make sure version numbers are consistent in the following locations: diff --git a/configure.ac b/configure.ac index cd395d91..c28fedc6 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,20 @@ LT_REVISION=0 AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) +LT_SONAME=$(expr $LT_CURRENT - $LT_AGE) +# BEGIN LT_SONAME WORKAROUND +# For elf versioned symbols, get the soname version. Unfortunately, +# there was a mistake at one point where we had 19 when we should have +# had 18, so make this a special case until the next ABI change. At +# that point, just remove the code deliminated by the LT_SONAME +# WORKAROUND comments. +if test $LT_SONAME = 18; then + LT_SONAME=19 +elif test $LT_SONAME -gt 18; then + AC_MSG_ERROR(Remove LT_SONAME workaround in configure.ac) +fi +# END LT_SONAME WORKAROUND +AC_SUBST(LT_SONAME) AC_ARG_ENABLE(insecure-random, AS_HELP_STRING([--enable-insecure-random], diff --git a/libqpdf.map.in b/libqpdf.map.in index 68ab12cb..9d4e8b9e 100644 --- a/libqpdf.map.in +++ b/libqpdf.map.in @@ -1,4 +1,4 @@ -LIBQPDF_@LT_CURRENT@ { +LIBQPDF_@LT_SONAME@ { global: *; }; |