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.
This commit is contained in:
Jay Berkenbilt 2018-01-13 20:56:28 -05:00
parent ae854950b9
commit fc74d67fab
3 changed files with 16 additions and 2 deletions

View File

@ -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:

View File

@ -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],

View File

@ -1,4 +1,4 @@
LIBQPDF_@LT_CURRENT@ {
LIBQPDF_@LT_SONAME@ {
global:
*;
};