Bug 226088 - [CMake] Cannot link libTestRunnerInjectedBundle.so in non unified build
Summary: [CMake] Cannot link libTestRunnerInjectedBundle.so in non unified build
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords: InRadar
: 235416 (view as bug list)
Depends on: 225990 226322 226401 226471 226763 228579 233493 234106 234392 235013
Blocks:
  Show dependency treegraph
 
Reported: 2021-05-21 09:39 PDT by Adrian Perez
Modified: 2022-01-23 19:29 PST (History)
25 users (show)

See Also:


Attachments
WIP Patch (1.88 KB, patch)
2021-05-22 08:26 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff
Tentative patch (5.64 KB, patch)
2021-12-13 20:43 PST, Lauro Moura
no flags Details | Formatted Diff | Diff
Rebased patch (6.41 KB, patch)
2021-12-14 05:10 PST, Lauro Moura
no flags Details | Formatted Diff | Diff
Rebased patch with new nonunified fixes (8.17 KB, patch)
2022-01-18 20:09 PST, Lauro Moura
no flags Details | Formatted Diff | Diff
Updated patch with different cmake approach (8.79 KB, patch)
2022-01-20 16:36 PST, Lauro Moura
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2021-05-21 09:39:52 PDT
Build error (some things a bit formatted for legibility):

% CXX=clang++ CC=clang build-webkit --wpe --no-unified-builds
...
[1492/1547] Linking CXX shared library lib/libTestRunnerInjectedBundle.so                                                                                                                                                                      
FAILED: lib/libTestRunnerInjectedBundle.so                                                                                                                                                                                                     
: && /usr/lib/sdk/llvm11/bin/clang++ -fPIC -fdiagnostics-color=always -fcolor-diagnostics -Wextra -Wall -Wno-noexcept-type -Wno-psabi 
   -Wno-misleading-indentation -Wno-parentheses-equality -Qunused-arguments -Wwrite-strings -Wundef -Wpointer-arith 
   -Wmissing-format-attribute -Wformat-security -Wcast-align -Wno-tautological-compare  -fno-strict-aliasing -fno-exceptions
   -fno-rtti -O3 -DNDEBUG  -Wl,--no-undefined  -fuse-ld=gold -Wl,--disable-new-dtags -shared -Wl,-soname,libTestRunnerInjectedBundle.so 
   -o lib/libTestRunnerInjectedBundle.so 
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/AccessibilityController.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/AccessibilityTextMarker.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/AccessibilityTextMarkerRange.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/AccessibilityUIElement.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/EventSendingController.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/GCController.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/InjectedBundle.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/InjectedBundleMain.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/InjectedBundlePage.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/TestRunner.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/TextInputController.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/__/__/WebKitTestRunner/DerivedSources/InjectedBundle/JSAccessibilityController.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/__/__/WebKitTestRunner/DerivedSources/InjectedBundle/JSAccessibilityTextMarker.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/__/__/WebKitTestRunner/DerivedSources/InjectedBundle/JSAccessibilityTextMarkerRange.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/__/__/WebKitTestRunner/DerivedSources/InjectedBundle/JSAccessibilityUIElement.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/__/__/WebKitTestRunner/DerivedSources/InjectedBundle/JSEventSendingController.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/__/__/WebKitTestRunner/DerivedSources/InjectedBundle/JSGCController.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/__/__/WebKitTestRunner/DerivedSources/InjectedBundle/JSTestRunner.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/__/__/WebKitTestRunner/DerivedSources/InjectedBundle/JSTextInputController.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/atk/AccessibilityControllerAtk.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/atk/AccessibilityUIElementAtk.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/wpe/ActivateFontsWPE.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/wpe/InjectedBundleWPE.cpp.o
   Tools/WebKitTestRunner/CMakeFiles/TestRunnerInjectedBundle.dir/InjectedBundle/wpe/TestRunnerWPE.cpp.o
   -Wl,-rpath,/app/webkit/WebKitBuild/Release/lib  lib/libTestRunnerShared.a
   /usr/lib/x86_64-linux-gnu/libatk-1.0.so  /usr/lib/x86_64-linux-gnu/libglib-2.0.so  /usr/lib/x86_64-linux-gnu/libcairo.so
   lib/libWebCoreTestSupport.a  lib/libPAL.a  lib/libJavaScriptCore.a  lib/libWTF.a  lib/libbmalloc.a 
   lib/libWPEWebKit-1.1.so.0.0.0  /usr/lib/x86_64-linux-gnu/libcairo.so  /usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so
   /usr/lib/x86_64-linux-gnu/libicudata.so  /usr/lib/x86_64-linux-gnu/libicui18n.so  /usr/lib/x86_64-linux-gnu/libicuuc.so
   -lpthread  /usr/lib/x86_64-linux-gnu/libsystemd.so  /usr/lib/x86_64-linux-gnu/libxml2.so  /usr/lib/x86_64-linux-gnu/libsqlite3.so
   /usr/lib/x86_64-linux-gnu/libxslt.so  /usr/lib/x86_64-linux-gnu/libepoxy.so  lib/libANGLE.a  -ldl
   /usr/lib/x86_64-linux-gnu/libwoff2dec.so  lib/libxdgmime.a  lib/libwebrtc.a  /usr/lib/x86_64-linux-gnu/libvpx.so
   /usr/lib/x86_64-linux-gnu/libevent.so  /usr/lib/x86_64-linux-gnu/libopus.so  /usr/lib/x86_64-linux-gnu/libopenh264.so
   /usr/lib/x86_64-linux-gnu/libfontconfig.so  /usr/lib/x86_64-linux-gnu/libfreetype.so  /usr/lib/x86_64-linux-gnu/libharfbuzz.so
   /usr/lib/x86_64-linux-gnu/libharfbuzz-icu.so  /usr/lib/x86_64-linux-gnu/libgcrypt.so  /usr/lib/x86_64-linux-gnu/libgstapp-1.0.so
   /usr/lib/x86_64-linux-gnu/libgstbase-1.0.so  /usr/lib/x86_64-linux-gnu/libgstpbutils-1.0.so  /usr/lib/x86_64-linux-gnu/libgstaudio-1.0.so
   /usr/lib/x86_64-linux-gnu/libgsttag-1.0.so  /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so  /usr/lib/x86_64-linux-gnu/libgstgl-1.0.so
   /usr/lib/x86_64-linux-gnu/libgstcodecparsers-1.0.so  /usr/lib/x86_64-linux-gnu/libgstfft-1.0.so  /usr/lib/x86_64-linux-gnu/libgcrypt.so
   /usr/lib/x86_64-linux-gnu/libgstapp-1.0.so  /usr/lib/x86_64-linux-gnu/libgstbase-1.0.so  /usr/lib/x86_64-linux-gnu/libgstpbutils-1.0.so
   /usr/lib/x86_64-linux-gnu/libgstaudio-1.0.so  /usr/lib/x86_64-linux-gnu/libgsttag-1.0.so  /usr/lib/x86_64-linux-gnu/libgstvideo-1.0.so
   /usr/lib/x86_64-linux-gnu/libgstgl-1.0.so  /usr/lib/x86_64-linux-gnu/libgstcodecparsers-1.0.so  /usr/lib/x86_64-linux-gnu/libgstfft-1.0.so
   /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so  -lgpg-error  /usr/lib/x86_64-linux-gnu/libatk-1.0.so  /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so
   /usr/lib/x86_64-linux-gnu/libgio-2.0.so  /usr/lib/x86_64-linux-gnu/libgobject-2.0.so  /usr/lib/x86_64-linux-gnu/libglib-2.0.so
   /usr/lib/x86_64-linux-gnu/libjpeg.so  /usr/lib/x86_64-linux-gnu/libpng.so  /usr/lib/x86_64-linux-gnu/libz.so
   /usr/lib/x86_64-linux-gnu/libopenjp2.so  /usr/lib/x86_64-linux-gnu/libwebpdemux.so  /usr/lib/x86_64-linux-gnu/libwebp.so
   /usr/lib/x86_64-linux-gnu/libavif.so  /usr/lib/x86_64-linux-gnu/libsoup-3.0.so  /usr/lib/x86_64-linux-gnu/libwpe-1.0.so
   /usr/lib/x86_64-linux-gnu/libtasn1.so  /usr/lib/x86_64-linux-gnu/liblcms2.so  /usr/lib/x86_64-linux-gnu/libWPEBackend-fdo-1.0.so
   /usr/lib/x86_64-linux-gnu/libopenxr_loader.so && : 

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::InspectorStubFrontend::InspectorStubFrontend(WebCore::Page&, WTF::RefPtr<WebCore::DOMWindow, WTF::RawPtrTraits<WebCore::DOMWindow>, WTF::DefaultRefDerefTraits<WebCore::DOMWindow> >&&):
    error: undefined reference to 'vtable for WebCore::InspectorFrontendClientLocal::Settings'
/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::InspectorStubFrontend::InspectorStubFrontend(WebCore::Page&, WTF::RefPtr<WebCore::DOMWindow, WTF::RawPtrTraits<WebCore::DOMWindow>, WTF::DefaultRefDerefTraits<WebCore::DOMWindow> >&&):
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal(WebCore::InspectorController*, WebCore::Page*, std::unique_ptr<WebCore::InspectorFrontendClientLocal::Settings, std::default_delete<WebCore::InspectorFrontendClientLocal::Settings> >)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::InspectorStubFrontend::~InspectorStubFrontend():
    error: undefined reference to 'WebCore::Inspector FrontendClientLocal::inspectedPage() const'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::InspectorStubFrontend::~InspectorStubFrontend():
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal()'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::InspectorStubFrontend::closeWindow():
     error: undefined reference to 'WebCore::InspectorFrontendClientLocal::inspectedPage() const'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::createRecorderMockSource(WebCore::MediaStreamPrivate&, WebCore::MediaRecorderPrivateOptions const&):
    error: undefined reference to 'WebCore::MediaRecorderPrivateMock::MediaRecorderPrivateMock(WebCore::MediaStreamPrivate&)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::Internals::initializeMockMediaSource():
    error: undefined reference to 'WebCore::MockMediaPlayerMediaSource::registerMediaEngine(void (*)(std::unique_ptr<WebCore::MediaPlayerFactory, std::default_delete<WebCore::MediaPlayerFactory> >&&))'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::Internals::setPlatformMomentumScrollingPredictionEnabled(bool):
    error: undefined reference to 'WebCore::ScrollingMomentumCalculator::setPlatformMomentumScrollingPredictionEnabled(bool)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::Internals::parseHEVCCodecParameters(WTF::StringView):
     error: undefined reference to 'WebCore::parseHEVCCodecParameters(WTF::StringView)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::Internals::parseDoViCodecParameters(WTF::StringView):
    error: undefined reference to 'WebCore::parseDoViCodecParameters(WTF::StringView)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::Internals::parseVPCodecParameters(WTF::StringView):
    error: undefined reference to 'WebCore::parseVPCodecParameters(WTF::StringView)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::Internals::rangeContainsNode(WebCore::AbstractRange const&, WebCore::Node&, WebCore::Internals::TreeType):
    error: undefined reference to 'WebCore::makeSimpleRange(WebCore::AbstractRange const&)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::Internals::rangeContainsBoundaryPoint(WebCore::AbstractRange const&, WebCore::Node&, unsigned int, WebCore::Internals::TreeType):
    error: undefined reference to 'WebCore::makeSimpleRange(WebCore::AbstractRange const&)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::Internals::rangeContainsRange(WebCore::AbstractRange const&, WebCore::AbstractRange const&, WebCore::Internals::TreeType): error: undefined reference to 'WebCore::makeSimpleRange(WebCore::AbstractRange const&)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  function WebCore::Internals::rangeContainsRange(WebCore::AbstractRange const&, WebCore::AbstractRange const&, WebCore::Internals::TreeType):
    error: undefined reference to 'WebCore::makeSimpleRange(WebCore::AbstractRange const&)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::windowObjectCleared()'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::frontendLoaded()'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::pagePaused()'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::pageUnpaused()'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::moveWindowBy(float, float)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::inspectionLevel() const'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::resetState()'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::userInterfaceLayoutDirection() const'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to WebCore::InspectorFrontendClientLocal::requestSetDockSide(WebCore::InspectorFrontendClient::DockSide)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::changeAttachedWindowHeight(unsigned int)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::changeAttachedWindowWidth(unsigned int)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::changeSheetRect(WebCore::FloatRect const&)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::openURLExternally(WTF::String const&)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend:
    error: undefined reference to 'WebCore::InspectorFrontendClientLocal::sendMessageToBackend(WTF::String const&)'

lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/testing/Internals.cpp.o):Internals.cpp:
  vtable for WebCore::InspectorStubFrontend: error: undefined reference to 'WebCore::InspectorFrontendClientLocal::isUnderTest()'

clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 1 Adrian Perez 2021-05-22 08:26:29 PDT
Created attachment 429411 [details]
WIP Patch
Comment 2 Adrian Perez 2021-05-22 11:13:09 PDT
(In reply to Adrian Perez from comment #1)
> Created attachment 429411 [details]
> WIP Patch

This patch solves the underlinking issue but then it runs in a multiple
definition issue:

/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld.gold: error:   
  lib/libWebCore.a(lib/../Source/WebCore/CMakeFiles/WebCore.dir/platform/audio/PlatformMediaSession.cpp.o):
    multiple definition of 'WebCore::convertEnumerationToString(WebCore::PlatformMediaSession::State)'
/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld.gold:
  lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/WebCoreTestSupport.dir/__/__/WebCore/DerivedSources/JSInternals.cpp.o):
    previous definition here
Comment 3 Lauro Moura 2021-12-10 21:44:35 PST
(In reply to Adrian Perez from comment #2)
> (In reply to Adrian Perez from comment #1)
> > Created attachment 429411 [details]
> > WIP Patch
> 
> This patch solves the underlinking issue but then it runs in a multiple
> definition issue:
> 
> /usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-
> linux-gnu/bin/ld.gold: error:   
>  
> lib/libWebCore.a(lib/../Source/WebCore/CMakeFiles/WebCore.dir/platform/audio/
> PlatformMediaSession.cpp.o):
>     multiple definition of
> 'WebCore::convertEnumerationToString(WebCore::PlatformMediaSession::State)'
> /usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-
> linux-gnu/bin/ld.gold:
>  
> lib/libWebCoreTestSupport.a(lib/../Source/WebCore/CMakeFiles/
> WebCoreTestSupport.dir/__/__/WebCore/DerivedSources/JSInternals.cpp.o):
>     previous definition here

I've got this with GTK too.

This seems to be caused by a collision between convertEnumerationToString for Internals::MediaSessionState (generated) and for PlatformMediaSession::State (manual). The internals enum is an alias to the Platform one.

Searching through the Internals idl, this is the only case of a enum declared in the IDL that's both an alias to an "external" enum AND defines a manual convertEnumerationToString.

These two enums seems to be quite old (pre-2018), didn't a few months ago GTK used to build non-unified to the end?
Comment 4 Lauro Moura 2021-12-13 20:43:14 PST
Created attachment 447105 [details]
Tentative patch

Patch based on Adrian's, building unified/non-unified on top of r286914 (Last sunday). It replaces the alias for the MediaSession enum in the Internals.h with separate enum with the same values. Not sure if it's the best approach, though.
Comment 5 Lauro Moura 2021-12-14 05:10:50 PST
Created attachment 447125 [details]
Rebased patch
Comment 6 Adrian Perez 2021-12-14 05:18:24 PST
Comment on attachment 447125 [details]
Rebased patch

LGTM with a nit to change before landing -- and thanks to looking into this,
I hadn't had the time to bring myself to fix it yet 💪️

View in context: https://bugs.webkit.org/attachment.cgi?id=447125&action=review

> Source/WebCore/testing/Internals.h:1006
> +    // directly with libWebCore (e.g. with non-unified builds)

I think we don't want to mention here anything about unified vs. non-unified
builds, because with an unlucky combination of unified sources the issue could
come up anyway. The rest of the comment is good to have it here for clarity,
as this may not be obvious to the people reading the code =)
Comment 7 Lauro Moura 2021-12-15 14:03:03 PST
The WinCairo EWS failure is mostly composed of errors like these:

```
JSInternals.cpp.obj : error LNK2001: unresolved external symbol "protected: static struct JSC::ClassInfo const WebCore::JSFile::s_info" (?s_info@JSFile@WebCore@@1UClassInfo@JSC@@B)
```

Where `s_info` is defined in the derived source `JSFile.cpp`:

```
template<> const ClassInfo JSFileDOMConstructor::s_info = { "File", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSFileDOMConstructor) };
```

Could find out why this is happening yet (Tried building on Windows locally but it failed before this step).
Comment 8 Lauro Moura 2022-01-18 20:09:17 PST
Created attachment 449457 [details]
Rebased patch with new nonunified fixes
Comment 9 Joseph Griego 2022-01-20 13:56:57 PST
*** Bug 235416 has been marked as a duplicate of this bug. ***
Comment 10 Lauro Moura 2022-01-20 16:36:14 PST
Created attachment 449623 [details]
Updated patch with different cmake approach

Instead of pulling WebCore as WebCoreTestSupport dependency directly, make WTR/WTRInjected bundle pull it instead. As the CMake-related code changed, cleared the Reviewed-By field (will wait for green bubbles before rq'ing it).
Comment 11 Adrian Perez 2022-01-21 03:11:52 PST
Comment on attachment 449623 [details]
Updated patch with different cmake approach

Wooohoo! I'm stoked to see this issue being axed, good one Lauro!
Comment 12 EWS 2022-01-21 05:12:41 PST
Committed r288361 (246265@main): <https://commits.webkit.org/246265@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 449623 [details].
Comment 13 Radar WebKit Bug Importer 2022-01-21 05:13:21 PST
<rdar://problem/87879972>