Issue 576 in webp: dylib compatibility_version mismatch between autotools & CMake

16 views
Skip to first unread message

jz… via monorail

unread,
Jul 22, 2022, 1:14:04 PM7/22/22
to webp-d...@webmproject.org
Status: Accepted
Owner: jz...@google.com
Labels: Type-Defect Priority-Medium v1.3.0

New issue 576 by jz...@google.com: dylib compatibility_version mismatch between autotools & CMake
https://bugs.chromium.org/p/webp/issues/detail?id=576

v1.2.3-4-g7366f7f3

$ ./configure ...
$ make install
$ cmake -DBUILD_SHARED_LIBS=1 ...
$ make install

$ otool -L /tmp/autotools-install/lib/libwebp.7.dylib /tmp/cmake-install/lib/libwebp.7.dylib
/tmp/autotools-install/lib/libwebp.7.dylib:
/tmp/autotools-install/lib/libwebp.7.dylib (compatibility version 9.0.0, current version 9.4.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
/tmp/cmake-install/lib/libwebp.7.dylib:
@rpath/libwebp.7.dylib (compatibility version 7.0.0, current version 7.1.4)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)

This looks similar to an issue reported for libexpat [1]. For compatibility, CMake should be made to match autotools.

[1] https://github.com/libexpat/libexpat/issues/55

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

jz… via monorail

unread,
Jul 22, 2022, 1:45:28 PM7/22/22
to webp-d...@webmproject.org

Comment #1 on issue 576 by jz...@google.com: dylib compatibility_version mismatch between autotools & CMake
https://bugs.chromium.org/p/webp/issues/detail?id=576#c1

As mentioned in the expat bug, from the configure generated by autotools 2.71 on macOS:

darwin)
# Like Linux, but with the current version available in
# verstring for coding it into the library header
func_arith $current - $age
major=.$func_arith_result
versuffix=$major.$age.$revision
# Darwin ld doesn't like 0 for these options...
func_arith $current + 1
minor_current=$func_arith_result
xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
# On Darwin other compilers
case $CC in
nagfor*)
verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
;;
*)
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
;;
esac
;;


For libwebp currently we see:
libtool --tag=CC --mode=link cc ... -version-info 8:4:1 -o libwebp.la
libtool: link: cc -dynamiclib -o .libs/libwebp.7.dylib ... -install_name /lib/libwebp.7.dylib -compatibility_version 9 -current_version 9.4

Git Watcher via monorail

unread,
Jul 25, 2022, 7:30:10 PM7/25/22
to webp-d...@webmproject.org
Updates:
Status: Fixed

Comment #2 on issue 576 by Git Watcher: dylib compatibility_version mismatch between autotools & CMake
https://bugs.chromium.org/p/webp/issues/detail?id=576#c2

The following revision refers to this bug:
https://chromium.googlesource.com/webm/libwebp/+/231bdfb762016ed4448b764d6a677afa15f0c02c

commit 231bdfb762016ed4448b764d6a677afa15f0c02c
Author: James Zern <jz...@google.com>
Date: Fri Jul 22 17:50:31 2022

CMake: fix dylib versioning

match the behavior of autoconf in generating the -compatibility_version
and -current_version options. these use current + 1 and revision:

# Darwin ld doesn't like 0 for these options...
func_arith $current + 1
minor_current=$func_arith_result
...

verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"

this requires CMake >= 3.17 to set the MACHO_COMPATIBILITY_VERSION and
MACHO_CURRENT_VERSION properties:
https://cmake.org/cmake/help/latest/prop_tgt/MACHO_COMPATIBILITY_VERSION.html

based on the fix in libexpat:
https://github.com/libexpat/libexpat/issues/55

Bug: webp:576
Fixed: webp:576
Change-Id: Ibc3ab99449aa213fc8c2ca3ae06def648c61acbd

[modify] https://crrev.com/231bdfb762016ed4448b764d6a677afa15f0c02c/CMakeLists.txt
Reply all
Reply to author
Forward
0 new messages