Fixed bug 4367 - compatibility version decreased between 2.0.8 and 2.0.9
authorSam Lantinga <slouken@libsdl.org>
Mon, 12 Nov 2018 16:34:58 -0800
changeset 12406d274fa9731b1
parent 12405 5a95fbfd3617
child 12407 2a761b9ff83f
Fixed bug 4367 - compatibility version decreased between 2.0.8 and 2.0.9

Joshua Root

The change resulting from Bug 4208 changed the compatibility_version of libSDL2 from 9.0.0 to 1.0.0. This is simply wrong.

This means that programs linked against 2.0.9 are considered by the dynamic linker to be compatible with all previous versions of libSDL2. This is not the case since new public symbols have been added.

The way compatibility_version and current_version are meant to work is:
* current_version increases every time the library changes in any way.
* compatibility_version is increased to match current_version whenever new public symbols are added.

Thus both versions should only ever increase. The solution to the Xcode project and autotools not having matching versions should have been to increase the version(s) in the Xcode project.

Reference: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/VersionInformation.html
build-scripts/ltmain.sh
     1.1 --- a/build-scripts/ltmain.sh	Sat Nov 10 20:56:23 2018 -0400
     1.2 +++ b/build-scripts/ltmain.sh	Mon Nov 12 16:34:58 2018 -0800
     1.3 @@ -7404,11 +7404,8 @@
     1.4  	  # Darwin ld doesn't like 0 for these options...
     1.5  	  func_arith $current + 1
     1.6  	  minor_current=$func_arith_result
     1.7 -	  #xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
     1.8 -	  #verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
     1.9 -	  # make the compatibility version match the Xcode project files, i.e. 1.0
    1.10 -	  xlcverstring="${wl}-compatibility_version 1.0 ${wl}-current_version ${wl}$minor_current.$revision"
    1.11 -	  verstring="-compatibility_version 1.0 -current_version $minor_current.$revision"
    1.12 +	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
    1.13 +	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
    1.14  	  ;;
    1.15  
    1.16  	freebsd-aout)