Skip to content

Commit

Permalink
Correct handling of elf symbol versioning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jberkenbilt committed Jan 15, 2018
1 parent ae85495 commit fc74d67
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README-maintainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
```
Expand All @@ -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:
Expand Down
14 changes: 14 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion libqpdf.map.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LIBQPDF_@LT_CURRENT@ {
LIBQPDF_@LT_SONAME@ {
global:
*;
};

0 comments on commit fc74d67

Please sign in to comment.