Bug 153719

Summary: Debug build fails to link due to missing implementation of WebCore::Frame::isMainFrame()
Product: WebKit Reporter: Jeremy Huddleston Sequoia <jeremyhu>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, kondapallykalyan
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch none

Description Jeremy Huddleston Sequoia 2016-01-30 15:49:50 PST
When building the debug configuration, libwebkit2gtk fails to link with:

:info:build Undefined symbols for architecture x86_64:
:info:build   "WebCore::Frame::isMainFrame() const", referenced from:
:info:build       WebCore::printRenderTreeForLiveDocuments() in libWebCoreGTK.a(RenderObject.cpp.o)
:info:build ld: symbol(s) not found for architecture x86_64
:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
:info:build make[2]: *** [lib/libwebkit2gtk-4.0.37.13.1.dylib] Error 1

The function is only present in debug builds, so it's certainly no surprise that the release build compiles fine:

#ifndef NDEBUG
void printRenderTreeForLiveDocuments()
{
    for (const auto* document : Document::allDocuments()) {
        if (!document->renderView() || document->inPageCache())
            continue;
        if (document->frame() && document->frame()->isMainFrame())
            fprintf(stderr, "----------------------main frame--------------------------\n");
        fprintf(stderr, "%s", document->url().string().utf8().data());
        showRenderTree(document->renderView());
    }
}
#endif
} // namespace WebCore

This was observed on OSX with webkitgtk-2.11.4 configured as:
cmake -DCMAKE_INSTALL_PREFIX=/opt/local -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON -DCMAKE_INSTALL_RPATH=/opt/local/lib -DCMAKE_INSTALL_NAME_DIR=/opt/local/lib -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_MODULE_PATH=/opt/local/share/cmake/Modules -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev -DPORT=GTK -DUSE_SYSTEM_MALLOC=ON -DENABLE_MINIBROWSER=OFF -DENABLE_VIDEO=ON -DENABLE_INTROSPECTION=OFF -DLLVM_CONFIG_EXE=/opt/local/bin/llvm-config-mp-3.7 -DENABLE_QUARTZ_TARGET=OFF -DENABLE_X11_TARGET=ON -DENABLE_OPENGL=ON -DENABLE_PLUGIN_PROCESS_GTK2=ON -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.11" -DCMAKE_OSX_SYSROOT="/"
Comment 1 Jeremy Huddleston Sequoia 2016-01-30 15:59:39 PST
I suspect this is just a missing include of MainFrame.h.  Testing that out now.
Comment 2 Jeremy Huddleston Sequoia 2016-01-30 16:03:57 PST
Created attachment 270324 [details]
patch
Comment 3 WebKit Commit Bot 2016-01-30 17:15:58 PST
Comment on attachment 270324 [details]
patch

Clearing flags on attachment: 270324

Committed r195918: <http://trac.webkit.org/changeset/195918>
Comment 4 WebKit Commit Bot 2016-01-30 17:16:01 PST
All reviewed patches have been landed.  Closing bug.