Bug 126232

Summary: [GTK] [CMake] Convenience libraries that export API should be compiled with --whole-archive on Unix
Product: WebKit Reporter: Martin Robinson <mrobinson>
Component: WebKitGTKAssignee: Martin Robinson <mrobinson>
Severity: Normal CC: cdumez, commit-queue, gustavo, gyuyoung.kim, rakuco
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 115966    
Description Flags
Patch none

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.