[webkit-dev] exporting symbols for building .so/.dll's

Ami Fischman fischman at chromium.org
Thu Mar 8 19:52:39 PST 2012


Hi webkittens,

The over-all question: how should webkit libraries declare which symbols
they export?
The trigger for the question: as described in bug
80062<https://bugs.webkit.org/show_bug.cgi?id=80062>,
the chromium shared-library-based build links test code into the (non-test)
libwebkit.so target, which is terrible.

The details:
I took a crack at fixing the above bug (see patch in the bug) by pulling
the test files out of the non-test build target, and sprinkling various
{WTF,WEBKIT}_EXPORT{,DATA} macros around declarations that need them (as
discovered by build-time and run-time failures).  This style of export
declaration is what the webkit codebase does in various places
(WTF<http://code.google.com/codesearch#OAMlx_jo-ck/src/third_party/WebKit/Source/JavaScriptCore/wtf/ExportMacros.h&exact_package=chromium&q=WTF_EXPORT&type=cs&l=39>
, Platform<http://code.google.com/codesearch#OAMlx_jo-ck/src/third_party/WebKit/Source/Platform/chromium/public/WebCommon.h&exact_package=chromium&q=WEBKIT_EXPORT&l=68>
, WebCore<http://code.google.com/codesearch#OAMlx_jo-ck/src/third_party/WebKit/Source/WebCore/platform/PlatformExportMacros.h&exact_package=chromium&q=define%5C%20WEBKIT_EXPORT&ct=rc&cd=2&sq=&l=39>,
and WebKit<http://code.google.com/codesearch#OAMlx_jo-ck/src/third_party/WebKit/Source/WebKit/chromium/public/platform/WebCommon.h&exact_package=chromium&q=file:(%5E%7C/)platform/WebCommon%5C.h$>,
AFAICT), and incidentally also what the chromium project uses for its
sub-components.
But I'm told other ports use different mechanisms such as .exp.in
files<http://code.google.com/p/chromium/source/search?q=file%3ASource%2FWebCore%2FWebCore.exp.in&origq=file%3ASource%2FWebCore%2FWebCore.exp.in&btnG=Search+Trunk>
for
apple/mac (and maybe others for other ports? IDK).

Is there consensus on the list for what the Right Thing To Do(tm) is?
ISTM my options are:
1) Add EXPORT declarations as in the patch on the bug.
2) Drop the patch from the bug and replace it with chromium-specific
.exp.in-style files, one per layer from which I need to export (WebCore,
WTF, WebKit).  And build the build-time machinery to use them.  I don't
really know what's involved here and would appreciate any pointers/hints
people had if this is the way to go.
3) Something else (preferably unifying other ports' approaches).

Help me webkit-dev, you're my only hope (for consensus).

Cheers,
-a
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120308/a8d3b01d/attachment.html>


More information about the webkit-dev mailing list