Only link WTF from JavaScriptCore and only link PAL from WebCore in Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=225070
Summary Only link WTF from JavaScriptCore and only link PAL from WebCore in Mac CMake...
Alex Christensen
Reported 2021-04-26 12:43:36 PDT
Only link WTF from JavaScriptCore and only link PAL from WebCore in Mac CMake build
Attachments
Patch (8.07 KB, patch)
2021-04-26 12:47 PDT, Alex Christensen
no flags
Patch (43.60 KB, patch)
2021-09-28 23:14 PDT, Alex Christensen
don.olmstead: review-
ews-feeder: commit-queue-
Alex Christensen
Comment 1 2021-04-26 12:47:21 PDT
Alex Christensen
Comment 2 2021-04-26 13:20:36 PDT
Comment on attachment 427082 [details] Patch I'm. going to try object libraries instead of this.
Alex Christensen
Comment 3 2021-04-27 09:59:02 PDT
Object libraries don't seem to work. JavaScriptCore.framework needs to be linked with -force_load libWTF.a which doesn't seem to be able to be done with object libraries.
Don Olmstead
Comment 4 2021-04-27 20:26:56 PDT
(In reply to Alex Christensen from comment #3) > Object libraries don't seem to work. JavaScriptCore.framework needs to be > linked with -force_load libWTF.a which doesn't seem to be able to be done > with object libraries. Can you show me what the linker errors are and what the patch looks like? I would expect the WebKit library to build properly but it’s likely there will be problems with the executables around testing.
Radar WebKit Bug Importer
Comment 5 2021-05-03 12:44:13 PDT
Alex Christensen
Comment 6 2021-09-28 23:14:21 PDT
Don Olmstead
Comment 7 2021-09-29 08:17:26 PDT
Comment on attachment 439569 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=439569&action=review The _FRAMEWORKS actually computes how to link the frameworks. So in the Mac case if you were linking WTF it would be linked through JavaScriptCore because that's the library that exposes WTF. There may be an issue around making WebCoreTestSupport being SHARED but other than that it SHOULD work properly after you use OBJECT with bmalloc, WTF, PAL. If not then there's a bug in the macro with computing it. > Source/WebKit/CMakeLists.txt:303 > -set(WebKit_FRAMEWORKS > +set(WebKit_PRIVATE_LIBRARIES > JavaScriptCore > - PAL > - WTF > WebCore This change is incorrect. > Source/cmake/OptionsMac.cmake:-113 > set(JavaScriptCore_LIBRARY_TYPE SHARED) > set(WebCore_LIBRARY_TYPE SHARED) > -set(WebCoreTestSupport_LIBRARY_TYPE SHARED) Please modify things so its set(bmalloc_LIBRARY_TYPE OBJECT) set(WTF_LIBRARY_TYPE OBJECT) set(JavaScriptCore_LIBRARY_TYPE SHARED) set(PAL_LIBRARY_TYPE OBJECT) set(WebCore_LIBRARY_TYPE SHARED) > Tools/TestWebKitAPI/CMakeLists.txt:206 > set(TestWebCore_FRAMEWORKS > JavaScriptCore > - PAL > - WTF > - WebCore > + WebKit This change is incorrect.
Alex Christensen
Comment 8 2021-09-29 09:58:28 PDT
Yeah, I'm not sure what's going on, but this patch gets it to compile and anything less doesn't. I think it may be CMake linking all of a framework's dependencies when you link the framework unless you use PRIVATE when linking the framework. We will eventually need to change the shared CMakeLists.txt to not link as many things.
Note You need to log in before you can comment on or make changes to this bug.