After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 723877 - configure: Don't link to both Qt and gdk-pixbuf if both are autodetected
configure: Don't link to both Qt and gdk-pixbuf if both are autodetected
Status: RESOLVED FIXED
Product: libmediaart
Classification: Other
Component: Cache
0.2.x
Other Linux
: Normal normal
: ---
Assigned To: libmediaart maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-02-08 00:22 UTC by Yanko Kaneti
Modified: 2014-02-10 11:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (2.19 KB, patch)
2014-02-08 00:23 UTC, Yanko Kaneti
committed Details | Review
Additional linkage fix (1.57 KB, patch)
2014-02-08 09:58 UTC, Yanko Kaneti
none Details | Review
Additional linkage fix - remove one more excplicit -lm (1.79 KB, patch)
2014-02-08 10:33 UTC, Yanko Kaneti
reviewed Details | Review
build: Remove leftover explicit -lm -lz linkage (1.18 KB, patch)
2014-02-10 09:48 UTC, Yanko Kaneti
committed Details | Review
build: Force automake C linkage when building C only (1.48 KB, patch)
2014-02-10 09:51 UTC, Yanko Kaneti
committed Details | Review

Description Yanko Kaneti 2014-02-08 00:22:05 UTC
If both qt and gdk-pixbuf are found at configure time the backend is set to gdk-pixbuf but the library is linked with both.
Comment 1 Yanko Kaneti 2014-02-08 00:23:08 UTC
Created attachment 268466 [details] [review]
proposed fix
Comment 2 Yanko Kaneti 2014-02-08 09:58:31 UTC
Created attachment 268478 [details] [review]
Additional linkage fix

Left to its devices automake+libtool use CXXLINK for the final library link despite not building any .cpp files. This leads to extra unnecessary linkage to libstdc++.
Comment 3 Yanko Kaneti 2014-02-08 10:33:55 UTC
Created attachment 268479 [details] [review]
Additional linkage fix - remove one more excplicit -lm

remove one more excplicit -lm
Comment 4 Martyn Russell 2014-02-10 08:29:59 UTC
Comment on attachment 268466 [details] [review]
proposed fix

Superb patch, thanks for noticing. Please commit. If you need me to commit, I can of course :)
Comment 5 Martyn Russell 2014-02-10 08:36:18 UTC
Comment on attachment 268479 [details] [review]
Additional linkage fix - remove one more excplicit -lm

>diff --git a/configure.ac b/configure.ac
>index ddba936..792cfd3 100644
>--- a/configure.ac
>+++ b/configure.ac
>@@ -151,8 +151,6 @@ PKG_CHECK_MODULES(LIBMEDIAART, [$LIBMEDIAART_REQUIRED])
> GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal`
> AC_SUBST(GLIB_GENMARSHAL)
> 
>-LIBMEDIAART_LIBS="$LIBMEDIAART_LIBS -lz -lm"

Nice. I think the linking with libm is really just left over linking foo from Tracker. I didn't actually know if it was needed or not so I kept it for now, but thanks for checking.

>diff --git a/libmediaart/Makefile.am b/libmediaart/Makefile.am
>index 6d370f2..2057fe3 100644
>--- a/libmediaart/Makefile.am
>+++ b/libmediaart/Makefile.am
>@@ -34,11 +34,14 @@ libmediaart_@LIBMEDIAART_API_VERSION@_la_SOURCES = \
> 
> if HAVE_GDKPIXBUF
> libmediaart_@LIBMEDIAART_API_VERSION@_la_SOURCES += extractpixbuf.c
>+libmediaart_@LIBMEDIAART_API_VERSION@_la_LINK = $(LINK) $(libmediaart_1.0_la_LDFLAGS)
> else
> if HAVE_QT
> libmediaart_@LIBMEDIAART_API_VERSION@_la_SOURCES += extractqt.cpp
>+libmediaart_@LIBMEDIAART_API_VERSION@_la_LINK = $(CXXLINK) $(libmediaart_1.0_la_LDFLAGS)
> else
> libmediaart_@LIBMEDIAART_API_VERSION@_la_SOURCES += extractdummy.c
>+libmediaart_@LIBMEDIAART_API_VERSION@_la_LINK = $(LINK) $(libmediaart_1.0_la_LDFLAGS)
> endif
> endif


Hmm, is the extra _LINK line necessary if we already have the libmediaart_@LIBMEDIAART_API_VERSION@_la_LIBADD line in the Makefile.am?
I also wonder what $(LINK) is set to.
Perhaps you did this for completeness? It worked before so ...

>@@ -46,7 +49,6 @@ libmediaart_@LIBMEDIAART_API_VERSION@_la_LDFLAGS = \
> 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
> 
> libmediaart_@LIBMEDIAART_API_VERSION@_la_LIBADD = \
>-	-lm \
> 	$(BUILD_LIBS) \
> 	$(LIBMEDIAART_LIBS)


The rest looks good. Thanks :)
Comment 6 Yanko Kaneti 2014-02-10 08:38:10 UTC
Comment on attachment 268466 [details] [review]
proposed fix

53381ad
Comment 7 Yanko Kaneti 2014-02-10 08:57:06 UTC
I probably shouldn't have mixed the explict -lm/-lz removal with the CXXLINK/LINK stuff. Both are indenpendent issues. 

Automake chooses the linker to use by examining the _SOURCES.
http://www.gnu.org/software/automake/manual/html_node/How-the-Linker-is-Chosen.html#How-the-Linker-is-Chosen
Unfortunately this includes all potential sources, even the ones excluded by CONDITIONALS, so it picks CXXLINK because of extractqt.cpp.

Linking the library with CXXLINK brings with it a soname linkage with libstdc++.
overriding <TARGET>_LINK on target by target basis is the way to force automake to use the specific linker, C(LINK) or C++(CXXLINK)
Comment 8 Yanko Kaneti 2014-02-10 09:48:05 UTC
Created attachment 268648 [details] [review]
build: Remove leftover explicit -lm -lz linkage

The -lm -lz part separately
Comment 9 Yanko Kaneti 2014-02-10 09:51:18 UTC
Created attachment 268649 [details] [review]
build: Force automake C linkage when building C only

The LINK/CXXLINK part with additional comments in the patch
Comment 10 Martyn Russell 2014-02-10 11:14:45 UTC
Comment on attachment 268648 [details] [review]
build: Remove leftover explicit -lm -lz linkage

Thanks for separating the patch :)
Comment 11 Martyn Russell 2014-02-10 11:15:29 UTC
Comment on attachment 268649 [details] [review]
build: Force automake C linkage when building C only

Thanks for clarifying why we're using _LINK here...

Please be sure to include the bug report in the commit of this patch so people can find out why we made this change! :) Thanks
Comment 12 Yanko Kaneti 2014-02-10 11:21:52 UTC
Comment on attachment 268648 [details] [review]
build: Remove leftover explicit -lm -lz linkage

pushed to master as 4f07de7
Comment 13 Yanko Kaneti 2014-02-10 11:22:34 UTC
Comment on attachment 268649 [details] [review]
build: Force automake C linkage when building C only

pushed to master as 4ae83f6
Comment 14 Yanko Kaneti 2014-02-10 11:23:02 UTC
Thanks.
Added bug reference in the commits. Closing