Bug 126232 - [GTK] [CMake] Convenience libraries that export API should be compiled with --whole-archive on Unix
Summary: [GTK] [CMake] Convenience libraries that export API should be compiled with -...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Martin Robinson
Depends on:
Blocks: 115966
  Show dependency treegraph
Reported: 2013-12-25 10:59 PST by Martin Robinson
Modified: 2013-12-29 10:46 PST (History)
5 users (show)

See Also:

Patch (2.89 KB, patch)
2013-12-26 16:12 PST, Martin Robinson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Robinson 2013-12-25 10:59:15 PST
CMake doesn't automatically add --whole-archive when linking convenience libraries, so we need to add it to the linker command line manually. Without the flag, the linker will trim unused symbols from the final shared object.
Comment 1 Martin Robinson 2013-12-26 16:11:56 PST
An example of this issue for me is that after linking, 

$ objdump -T lib/libwebkitgtk-3.0.so | grep webkit_dom_css_value_get_type 

does not show any output. With this change, I see:

0000000001fdefc0 g    DF .text	0000000000000090  Base        webkit_dom_css_value_get_type

This change may seem a bit mysterious, but I've confirmed that libtool (which isn't used in the CMake build) does this as well.
Comment 2 Martin Robinson 2013-12-26 16:12:39 PST
Created attachment 220037 [details]
Comment 3 Martin Robinson 2013-12-29 10:46:26 PST
Comment on attachment 220037 [details]

Clearing flags on attachment: 220037

Committed r161121: <http://trac.webkit.org/changeset/161121>
Comment 4 Martin Robinson 2013-12-29 10:46:29 PST
All reviewed patches have been landed.  Closing bug.