[Webkit-unassigned] [Bug 200033] [WPE] Unable to use jsc_weak_xxxx APIs in WPE web-extensions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 8 02:29:03 PST 2020


https://bugs.webkit.org/show_bug.cgi?id=200033

--- Comment #6 from Adrian Perez <aperez at igalia.com> ---
(In reply to Michael Catanzaro from comment #3)
> I agree we should support --no-undefined.
> 
> I recall talking to Don a few weeks ago about CMake object libraries, which
> I don't fully understand. But I guess the proper solution is to turn JSC
> into an object library rather than a static library. That only needs to be
> done for WPE port because only WPE port exports public API from JSC built as
> a static library:
> 
> https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#object-
> libraries
> 
> But I don't know how to actually make all the CMake changes required to do
> that. There is an ADD_WHOLE_ARCHIVE_TO_LIBRARIES macro in OptionsGTK.cmake
> that we could use here as a really big hammer for a quick fix. We could copy
> that into Source/WebKit/PlatformWPE.cmake and then use for the WebKit
> target. (That actually adds --whole-archive to all libraries, but we only
> need it for JavaScriptCore, so it could be refined a bit.) Either way, this
> wouldn't be great as it will bloat the installed library with useless code,
> but I think it should work.

The ADD_WHOLE_ARCHIVE_TO_LIBRARIES() macro is flawed because it won't
resolve target names to their file names, for example printing a before
and after using it on “TestWebCore_LIBRARIES” (the only use at the moment)
results in:

 -- BEFORE: WebKit::WebCore;gtest;GTK::GTK
 -- AFTER: -Wl,--whole-archive;WebKit::WebCore;-Wl,--no-whole-archive;-Wl,--whole-archive;gtest;-Wl,--no-whole-archive;-Wl,--whole-archive;GTK::GTK;-Wl,--no-whole-archive

…which somewhat wrong because the list contains CMake target names
(like WebKit::WebCore), while the linker expects either “-lWebCore” or
“path/to/libWebCore.a” as arguments in between the “-Wl,--whole-archive”
and the “-Wl,--no-whole-archive” flags.

I *think_ that it somewhat works because CMake realizes that “-Wl,…” is not
a valid target name nor an actual file and it passes the flags as-is to the
linker command line. This looks very finicky to me.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20201208/e973a9ac/attachment.htm>


More information about the webkit-unassigned mailing list