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 572075 - Make the scanner work with static and convenience libraries
Make the scanner work with static and convenience libraries
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2009-02-16 22:00 UTC by Owen Taylor
Modified: 2015-02-07 17:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make the scanner work with static and convenience libraries (5.88 KB, patch)
2009-02-16 22:00 UTC, Owen Taylor
accepted-commit_now Details | Review

Description Owen Taylor 2009-02-16 22:00:11 UTC
We need to reference the get_type() functions we are going to dlsym
or otherwise the linker may not include them in the introspection
binary.

giscanner/dumper.py: Accept a list of _get_type() functions
  and write an array referencing them into the introspection
  binary.
giscanner/glibtransformer.py: Break parsing into too stages -
 the stage where we compute the _get_type() functions and the
 stage where we invoke the introspection binary.
tools/g-ir-scanner: Pass _get_type() functions from the
 scanner when creating the introspection binary.
Comment 1 Owen Taylor 2009-02-16 22:00:20 UTC
Created attachment 128870 [details] [review]
Make the scanner work with static and convenience libraries
Comment 2 Owen Taylor 2009-02-16 22:10:52 UTC
I wrote this patch so I could generate a separate .gir for a part of Clutter  (ClutterJson) that is compiled as a convenience library in a subdir and then  linked into the main library.

There's a definite caveat here - the gir generated by g-ir-scanner will have:

 shared-library="clutter-json"

And g-ir-compiler will die. While the right thing is to have something like:

 shared-library="libclutter-glx-0.9.so.0"

But that library hasn't even been built yet (and will be built one level up) And I'm not really sure how to work around that short of some really gross hacks. (I'm going to try and see if I can get those hacks to work.)

So, while I think this patch is clean and the right thing to do, most practical
uses will have similar problems.
Comment 3 Owen Taylor 2009-02-16 22:43:48 UTC
Got the hacks to work successfully:

 http://bugzilla.openedhand.com/show_bug.cgi?id=1450

See how clutter/Makefile.am creates ClutterJson.gir by munging the ClutterJson.gir in the subdir with the shared-library="" from Clutter.gir.

Comment 4 Colin Walters 2009-02-17 21:30:43 UTC
Looks good to me.
Comment 5 Owen Taylor 2009-02-19 17:07:41 UTC
Pushed
Comment 6 André Klapper 2015-02-07 17:02:29 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]