GNOME Bugzilla – Bug 560073
Poor linking against convenience libs
Last modified: 2008-12-05 12:39:30 UTC
Kinda risky to link against local convenience libs via -l and -L paths. If the lib doesn't get built first, linker crashes without providing useful info to user. And you're also at risk of not getting the -L order perfect, allowing "some other libFOO" to be found instead of the one from the immediately adjacent -L path. Better (and documentedly correct) to link directly to the lib by pathname instead.
Created attachment 122286 [details] [review] link to local libs by explicit name Why is jpegutils/libeog-jpegutils.a built explicitly as a simple static lib instead of a libtool convenience library (the way libtoolbareditor is, for example)?
As a bonus, I *think* specifying explicit pathnames sets the DEPENDENCIES automatically instead of requiring separate and explicit Makefile.am variables.
(In reply to comment #1) > Why is jpegutils/libeog-jpegutils.a built explicitly as a simple static lib > instead of a libtool convenience library (the way libtoolbareditor is, for > example)? > This is a left-over from pre-eog-2.20 times which was not updated. Will check converting this over as well.
(In reply to comment #2) > As a bonus, I *think* specifying explicit pathnames sets the DEPENDENCIES > automatically instead of requiring separate and explicit Makefile.am variables. > Yup, you're right. After removing the DEPENDENCIES var from Makefile.am automake automatically used the _LIB vars. I've updated your patch (Thanks!) to take that into account for the trunk-based commit. The commit to stable is unchanged. 2008-12-05 Felix Riemann <> * jpegutils/Makefile.am: Produce .la-file as well. * doc/reference/Makefile.am: * src/Makefile.am: Link to local convenience libs directly instead of using a library search path to avoid linking to wrong libs. Let automake calculate the dependencies list. Remove now unneeded vars. Fixes bug #560073 (Daniel Macks, Felix Riemann). ------------------------------------------------------------------------------- This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.