Re: Using weak linking and other techniques with non-Apple libs
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Thunderbird 2.0.0.9 (X11/20071115) David Elliott wrote:
Actually they could reduce it to compat 5.0.0, current 7.0.0 and no existing apps would break.
David, I have to correct your impression that the number passed as an argument to the ld flag -current_version has some effect on the dynamic linker. Here's a quick test of that: $ cat foo.c int foo() { return 1;} $ cat main.c extern int foo(void); int main() { return foo(); } $ mkdir lib $ gcc -dynamiclib -o lib/libfoo.dylib foo.c -install_name `pwd`/lib/libfoo.dylib -compatibility_version 7.0.0 -current_version 7.0.0 $ gcc -o main main.c -Llib -lfoo $ ./main $ echo $? 1 Now to relink the shared library with a lower compatibility version (but keep current version the same). $ gcc -dynamiclib -o lib/libfoo.dylib foo.c -install_name `pwd`/lib/libfoo.dylib -compatibility_version 5.0.0 -current_version 7.0.0 $ ./main dyld: Library not loaded: /Users/peter/tmp/ldcheck/lib/libfoo.dylib Referenced from: /Volumes/Users/peter/tmp/ldcheck/./main Reason: Incompatible library version: main requires version 7.0.0 or later, but libfoo.dylib provides version 5.0.0 Trace/BPT trap So, you see, that the -current_version flag has no effect on the dynamic linker, the compatibility version is the only one checked by dyld. Peter -- Peter O'Gorman http://pogma.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Peter O'Gorman