Commit fc74d67fab3c88cbd51efb0bca76004b70c7e8bc

Authored by Jay Berkenbilt
1 parent ae854950

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.
README-maintainer.md
@@ -4,7 +4,6 @@ @@ -4,7 +4,6 @@
4 ``` 4 ```
5 ./configure CFLAGS="-g" CXXFLAGS="-g" --enable-werror --disable-shared 5 ./configure CFLAGS="-g" CXXFLAGS="-g" --enable-werror --disable-shared
6 ``` 6 ```
7 -* 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`.  
8 * 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`. 7 * 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`.
9 * Run tests with sanitize address enabled: 8 * Run tests with sanitize address enabled:
10 ``` 9 ```
@@ -20,6 +19,7 @@ @@ -20,6 +19,7 @@
20 * Avoid atoi. Use QUtil::string_to_int instead. It does overflow/underflow checking. 19 * Avoid atoi. Use QUtil::string_to_int instead. It does overflow/underflow checking.
21 * Remember to avoid using `operator[]` with `std::string` or `std::vector`. Instead, use `at()`. See README-hardening.md for details. 20 * Remember to avoid using `operator[]` with `std::string` or `std::vector`. Instead, use `at()`. See README-hardening.md for details.
22 * Increment shared library version information as needed (`LT_*` in `configure.ac`) 21 * Increment shared library version information as needed (`LT_*` in `configure.ac`)
  22 +* 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`.
23 * Update release notes in manual. Look at diffs and ChangeLog. 23 * Update release notes in manual. Look at diffs and ChangeLog.
24 * Add a release entry to ChangeLog. 24 * Add a release entry to ChangeLog.
25 * Make sure version numbers are consistent in the following locations: 25 * Make sure version numbers are consistent in the following locations:
configure.ac
@@ -35,6 +35,20 @@ LT_REVISION=0 @@ -35,6 +35,20 @@ LT_REVISION=0
35 AC_SUBST(LT_CURRENT) 35 AC_SUBST(LT_CURRENT)
36 AC_SUBST(LT_REVISION) 36 AC_SUBST(LT_REVISION)
37 AC_SUBST(LT_AGE) 37 AC_SUBST(LT_AGE)
  38 +LT_SONAME=$(expr $LT_CURRENT - $LT_AGE)
  39 +# BEGIN LT_SONAME WORKAROUND
  40 +# For elf versioned symbols, get the soname version. Unfortunately,
  41 +# there was a mistake at one point where we had 19 when we should have
  42 +# had 18, so make this a special case until the next ABI change. At
  43 +# that point, just remove the code deliminated by the LT_SONAME
  44 +# WORKAROUND comments.
  45 +if test $LT_SONAME = 18; then
  46 + LT_SONAME=19
  47 +elif test $LT_SONAME -gt 18; then
  48 + AC_MSG_ERROR(Remove LT_SONAME workaround in configure.ac)
  49 +fi
  50 +# END LT_SONAME WORKAROUND
  51 +AC_SUBST(LT_SONAME)
38 52
39 AC_ARG_ENABLE(insecure-random, 53 AC_ARG_ENABLE(insecure-random,
40 AS_HELP_STRING([--enable-insecure-random], 54 AS_HELP_STRING([--enable-insecure-random],
libqpdf.map.in
1 -LIBQPDF_@LT_CURRENT@ { 1 +LIBQPDF_@LT_SONAME@ {
2 global: 2 global:
3 *; 3 *;
4 }; 4 };