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 674065 - Clean up unnecessary linking
Clean up unnecessary linking
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-04-13 17:48 UTC by Kalev Lember
Modified: 2015-02-07 16:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't link with gthread-2.0 (2.72 KB, patch)
2012-04-13 17:51 UTC, Kalev Lember
committed Details | Review
Move libffi and gmodule to Requires.private in .pc files (2.40 KB, patch)
2012-04-13 17:51 UTC, Kalev Lember
committed Details | Review

Description Kalev Lember 2012-04-13 17:48:09 UTC
Currently everything that uses gobject-introspection-1.0.pc to link to libgirepository is also getting linked to libffi. This is caused by Requires: libffi in g-i .pc files.

As I understand it, libffi is actually an internal dependency and it's not necessary to link with it in order to use libgirepository public API.

There's a libffi soname bump coming to Fedora soon and as it turns out, a large number of modules that use g-i will be broken by the soname change. Most of them, however, are just linking to libffi because it's listed in g-i .pc files and don't actually use any symbols from libffi. It would be nice to avoid such unnecessary linking.
Comment 1 Kalev Lember 2012-04-13 17:51:00 UTC
Created attachment 212011 [details] [review]
Don't link with gthread-2.0

Commit df189c38 removed the use of g_thread_init() and we don't use any
other symbols from gthread-2.0.
Comment 2 Kalev Lember 2012-04-13 17:51:12 UTC
Created attachment 212012 [details] [review]
Move libffi and gmodule to Requires.private in .pc files

The intention of the change is to clean up unnecessary linking with
libffi and gmodule in g-i consumers as they typically don't use any
libffi/gmodule symbols.

Listing libffi and gmodule in pkg-config Requires meant that every
consumer that wanted to link with -lgirepository also got -lffi and
-lgmodule-2.0, which caused ld to emit unnecessary DT_NEEDED entries.

Moving the deps to Requires.private removes the internal dependencies
from 'pkg-config --libs', but keeps them in --libs --static output. The
change won't affect --cflags and the include directories necessary for
<ffi.h> will still be listed.
Comment 3 Colin Walters 2012-04-13 17:59:31 UTC
Review of attachment 212011 [details] [review]:

We intended to remove gthread in commit 2fff9866fd7f9de0fb8a7ac08d6c27a14c1f3f42 actually, but yes, this all looks good.
Comment 4 Colin Walters 2012-04-13 18:01:21 UTC
Review of attachment 212012 [details] [review]:

"The change won't affect --cflags and the include directories necessary for
<ffi.h> will still be listed."

I think that's a pkg-config bug...an old one that we can't easily change now.  Anyways, looks good.
Comment 5 Kalev Lember 2012-04-13 18:25:55 UTC
Review of attachment 212011 [details] [review]:

Thanks, updated the commit message and pushed to master as 48f1332.
Comment 6 Kalev Lember 2012-04-13 18:26:41 UTC
Review of attachment 212012 [details] [review]:

Pushed to master as a847eb8.
Comment 7 André Klapper 2015-02-07 16:49:51 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]