Bug 141912 - Weak symbol warning when linking TestWebKitAPI
Summary: Weak symbol warning when linking TestWebKitAPI
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords:
Depends on: 142320
Blocks:
  Show dependency treegraph
 
Reported: 2015-02-23 10:20 PST by Brian Burg
Modified: 2021-04-20 09:16 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.17 KB, patch)
2015-03-04 16:05 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (1.71 KB, patch)
2015-03-05 12:37 PST, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burg 2015-02-23 10:20:21 PST
I started noticing this issue a while ago, I think it was before the full switch away from WebCore.exp.in but I'm not sure. I have done several full builds since then IIRC. Full output as follows:

=== BUILD TARGET TestWebKitAPI OF PROJECT TestWebKitAPI WITH CONFIGURATION Release ===

Check dependencies
DebugRelease.xcconfig line 23: Unable to find included file "../../../../Internal/Configurations/HaveInternalSDK.xcconfig"

Ld /Users/burg/repos/replay-staging/OpenSource/WebKitBuild/Release/TestWebKitAPI normal x86_64
    cd /Users/burg/repos/replay-staging/OpenSource/Tools/TestWebKitAPI
    export MACOSX_DEPLOYMENT_TARGET=10.10
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -L/Users/burg/repos/replay-staging/OpenSource/WebKitBuild/Release -F/Users/burg/repos/replay-staging/OpenSource/WebKitBuild/Release -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Quartz.framework/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks -filelist /Users/burg/repos/replay-staging/OpenSource/WebKitBuild/TestWebKitAPI.build/Release/TestWebKitAPI.build/Objects-normal/x86_64/TestWebKitAPI.LinkFileList -Xlinker --no-demangle -mmacosx-version-min=10.10 -lgtest -force_load /Users/burg/repos/replay-staging/OpenSource/WebKitBuild/Release/libTestWebKitAPI.a -framework JavaScriptCore -framework WebKit -framework WebKit2 -framework Cocoa -framework Carbon -stdlib=libc++ -fobjc-link-runtime -Xlinker -dependency_info -Xlinker /Users/burg/repos/replay-staging/OpenSource/WebKitBuild/TestWebKitAPI.build/Release/TestWebKitAPI.build/Objects-normal/x86_64/TestWebKitAPI_dependency_info.dat -o /Users/burg/repos/replay-staging/OpenSource/WebKitBuild/Release/TestWebKitAPI
ld: warning: direct access in __GLOBAL__I_a to global weak symbol __ZN7testing4Test13SetUpTestCaseEv means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
ld: warning: direct access in __GLOBAL__I_a to global weak symbol __ZN7testing4Test16TearDownTestCaseEv means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
Comment 1 Alex Christensen 2015-02-23 12:10:25 PST
I'm pretty sure that I did indeed cause this when I switched away from WebCore.exp.in.  This doesn't seem to be breaking any builds, but this should be fixed along with the final cleaning up from that switch.
Comment 2 Alex Christensen 2015-03-04 16:05:45 PST
Created attachment 247907 [details]
Patch
Comment 3 David Kilzer (:ddkilzer) 2015-03-04 16:33:42 PST
Comment on attachment 247907 [details]
Patch

r=me
Comment 4 WebKit Commit Bot 2015-03-04 17:19:06 PST
Comment on attachment 247907 [details]
Patch

Clearing flags on attachment: 247907

Committed r181054: <http://trac.webkit.org/changeset/181054>
Comment 5 WebKit Commit Bot 2015-03-04 17:19:10 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 WebKit Commit Bot 2015-03-04 18:31:17 PST
Re-opened since this is blocked by bug 142320
Comment 7 Alex Christensen 2015-03-05 12:37:38 PST
Created attachment 247978 [details]
Patch
Comment 8 Alex Christensen 2015-03-05 12:38:45 PST
The previous patch broke some API tests even though it compiled correctly.  I'm honestly not sure why.

This patch compiles correctly and doesn't break run-api-tests.
Comment 9 David Kilzer (:ddkilzer) 2015-03-05 15:44:00 PST
Comment on attachment 247978 [details]
Patch

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

r=me

> Tools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:27
> +UNEXPORTED_SYMBOL_LDFLAGS = -Wl,-unexported_symbol -Wl,__ZN7testing4Test16TearDownTestCaseEv -Wl,-unexported_symbol -Wl,__ZN7testing4Test13SetUpTestCaseEv

If we have to add more of these symbols in the future, we should put them in an *.unexp file.  This is slightly ugly to maintain.
Comment 10 WebKit Commit Bot 2015-03-05 16:29:50 PST
Comment on attachment 247978 [details]
Patch

Clearing flags on attachment: 247978

Committed r181113: <http://trac.webkit.org/changeset/181113>
Comment 11 WebKit Commit Bot 2015-03-05 16:29:55 PST
All reviewed patches have been landed.  Closing bug.