Bug 691543 - "make so" produces binary linked to highest installed major version rather than current
Summary: "make so" produces binary linked to highest installed major version rather th...
Status: RESOLVED WORKSFORME
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Build Process (show other bugs)
Version: master
Hardware: PC Linux
: P4 normal
Assignee: Chris Liddell (chrisl)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-09 22:07 UTC by Jason Giglio
Modified: 2010-08-23 13:07 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Giglio 2010-08-09 22:07:37 UTC
On my linux 64-bit system with 8.72 libraries installed in /usr/lib64, when I do a "make so" it causes the build system to produce "libgs.so.9.00" alongside binaries that are linked to "libgs.so.8". 

If libgs.so.9.00 is installed and ldconfig is run prior to re-running make so, the correct binaries linked to libgs.so.9 will be produced.

This will cause trouble for anyone upgrading from 8.xx to 9.xx, as they will get binaries that will continue to use the old library when they attempt to build a 9.00-shared lib version.
Comment 1 Hin-Tak Leung 2010-08-11 11:26:07 UTC
Have you looked *after* "make soinstall"? It should link libgs.so to libgs.so.9 . I don't think there is a bug here - after 'make so' and 'before make soinstall',
ldd would show the new binaries as linked to libgs.so.8 (in the system directory) without any LD_LIBRARY_* trickery, but that's temporary and all should be fine when you get to 'make soinstall'.
Comment 2 Jason Giglio 2010-08-11 16:16:46 UTC
Yes, make soinstall does not change the fact that the gsc and gsx produced are linked explicitly to libgs.so.8

You can see libgs.so.8 as a string literal in the binary file.  make soinstall does not change that.

The only way to get correct gsc/gsx binaries would be to do the following:

make so
make soinstall
make soclean
make so
make soinstall
Comment 3 Jason Giglio 2010-08-11 16:24:05 UTC
To be clear, when I said linked above, I mean dynamically linked in the programming sense.

They get linked to (the installed) libgs.so.X rather than libgs.so, so it doesn't matter that soinstall is going to fix up the libgs.so symbolic link, they don't use it anyway.
Comment 4 Hin-Tak Leung 2010-08-11 16:45:27 UTC
(In reply to comment #2)
> Yes, make soinstall does not change the fact that the gsc and gsx produced are
> linked explicitly to libgs.so.8
> 
> You can see libgs.so.8 as a string literal in the binary file.  make soinstall
> does not change that.

That's not the case here - I actually just tried 'make so' (r11620) myself this morning and right after, ldd on sobin/gsc and sobin/gsx shows they are linked to libgs.so.9 and => not found . (which is expected, before soinstall). So I am inclined to think there is something wrong or strange with your system.
Comment 5 Jason Giglio 2010-08-11 17:13:53 UTC
Could I ask what the contents of your /usr/lib or /usr/lib64 directory were in terms of libgs prior to make so?
Comment 6 Hin-Tak Leung 2010-08-11 18:56:06 UTC
(In reply to comment #5)
> Could I ask what the contents of your /usr/lib or /usr/lib64 directory were in
> terms of libgs prior to make so?

I have a fairly standard fedora 13 x86_64 (nothing installed outside of rpm/yum).

$ ls -l /usr/lib*/libgs.*
lrwxrwxrwx. 1 root root      13 Aug 11 19:54 /usr/lib64/libgs.so -> libgs.so.8.71
lrwxrwxrwx. 1 root root      13 Aug 11 15:33 /usr/lib64/libgs.so.8 -> libgs.so.8.71
-rwxr-xr-x. 1 root root 8074728 Mar 16 15:19 /usr/lib64/libgs.so.8.71
lrwxrwxrwx. 1 root root      13 Aug 11 19:53 /usr/lib/libgs.so -> libgs.so.8.71
lrwxrwxrwx. 1 root root      13 Aug 11 15:34 /usr/lib/libgs.so.8 -> libgs.so.8.71
-rwxr-xr-x. 1 root root 7096156 Mar 16 15:20 /usr/lib/libgs.so.8.71
Comment 7 Chris Liddell (chrisl) 2010-08-23 13:07:22 UTC
I get the same results as Hin-Tak: with the current trunk head revision I get executables linked against libgs.so.9 despite having libgs.so.8.70 installed in /usr/lib (this is on my 32 bit system).

I believe the current behaviour is correct.