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 773100 - Merge libgdk.so into libgtk.so
Merge libgdk.so into libgtk.so
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-10-17 13:06 UTC by Alexander Larsson
Modified: 2016-10-26 14:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make gdk.la a noninst helper library (9.79 KB, patch)
2016-10-17 13:09 UTC, Alexander Larsson
none Details | Review
Make gdk.la a noninst helper library (16.32 KB, patch)
2016-10-17 14:25 UTC, Alexander Larsson
none Details | Review

Description Alexander Larsson 2016-10-17 13:06:41 UTC
Now that we branched for gtk4 we are free to break ABI, and there really is no particular reason for libgdk.so to be a separate shared library. All that does is cause problems:

 * No good way to have private APIs in gdk for gtk-only use
 * No inter-library optimizations, and all gdk calls are slower than internal
 * More .so:s in the link table, causing slower symbol lookups

I'm attaching some initial patches for this. The resulting stripped shared library is 84kb smaller on disk than the original gtk+gdk together.

They have some issues though:

 * The gdk dir files don't refer to any shared library.
   I guess we should make it refer to the gtk one? Is it even possible to have 
   two girs/typelibs for a single shared library, or do we need to put all the 
   gdk stuff in the gtk gir/typelib?

 * The win32 build isn't updated

 * I didn't look at gtk-doc yet
Comment 1 Alexander Larsson 2016-10-17 13:09:41 UTC
Created attachment 337849 [details] [review]
Make gdk.la a noninst helper library

This merged gtk and gdk into one library, making it possible to have
internal private APIs between gtk and gdk, as well as producing
more efficient code.
Comment 2 Emmanuele Bassi (:ebassi) 2016-10-17 13:13:39 UTC
As said on IRC: Gdk-4.0.gir/typelib should just reference libgtk-4.so. The shared library is the file language bindings have to dlopen in order to call the symbols from within their own trampolines.

This means moving Gdk-4.0.gir and .typelib rules into gtk/.
Comment 3 Alexander Larsson 2016-10-17 14:25:02 UTC
Created attachment 337859 [details] [review]
Make gdk.la a noninst helper library

This merged gtk and gdk into one library, making it possible to have
internal private APIs between gtk and gdk, as well as producing
more efficient code.
Comment 4 Alexander Larsson 2016-10-17 14:27:53 UTC
New version builds gdk/Gdk-4.0-noinstall.gir in gdk/ and has a sed hack to inject the shared library into gtk/Gdk-4.0.gir and we delay building the typelibs until in gtk/ when we have the shared library there.
Comment 5 Alexander Larsson 2016-10-26 14:34:32 UTC
Merged a version of this