Bug 119847 - [Windows] Incorrect DLL Linkage for JavaScriptCore ArrayBuffer and ArrayBufferView
Summary: [Windows] Incorrect DLL Linkage for JavaScriptCore ArrayBuffer and ArrayBuffe...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-08-15 09:55 PDT by Brent Fulgham
Modified: 2013-08-15 12:29 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.39 KB, patch)
2013-08-15 10:01 PDT, Brent Fulgham
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2013-08-15 09:55:04 PDT
I noticed the following warnings in my build output:

7>..\runtime\ArrayBuffer.cpp(37): warning C4273: 'JSC::ArrayBuffer::transfer' : inconsistent dll linkage
7>          c:\projects\webkit\opensource\source\javascriptcore\runtime\ArrayBuffer.h(109) : see previous definition of 'transfer'
7>..\runtime\ArrayBufferView.cpp(34): warning C4273: 'JSC::ArrayBufferView::ArrayBufferView' : inconsistent dll linkage
7>          c:\projects\webkit\opensource\source\javascriptcore\runtime\ArrayBufferView.h(78) : see previous definition of '{ctor}'
7>..\runtime\ArrayBufferView.cpp(46): warning C4273: 'JSC::ArrayBufferView::~ArrayBufferView' : inconsistent dll linkage
7>          c:\projects\webkit\opensource\source\javascriptcore\runtime\ArrayBufferView.h(75) : see previous definition of '{dtor}'
7>..\runtime\ArrayBufferView.cpp(52): warning C4273: 'JSC::ArrayBufferView::neuter' : inconsistent dll linkage
7>          c:\projects\webkit\opensource\source\javascriptcore\runtime\ArrayBufferView.h(122) : see previous definition of 'neuter'

These are caused by the use of a WTF export macro when building JSC:

From JavaScriptCore/runtime/ArrayBuffer.h:
    WTF_EXPORT_PRIVATE bool transfer(ArrayBufferContents&, Vector<RefPtr<ArrayBufferView> >& neuteredViews);

From JavaScriptCore/runtime/ArrayBufferView.h:
    WTF_EXPORT_PRIVATE virtual ~ArrayBufferView();
    WTF_EXPORT_PRIVATE ArrayBufferView(PassRefPtr<ArrayBuffer>, unsigned byteOffset);
    WTF_EXPORT_PRIVATE virtual void neuter();

Unless you have WTF_IS_LINKED_IN_SAME_BINARY defined (which is only true when building the WTF.dll), WTF_EXPORT_PRIVATE is mapped to __declspec(dllimport).

This means the linker will try to find these definitions in an external library.  This should result in a compile failure, but I guess Visual Studio sees the definition in the implementation file and uses it.
Comment 1 Radar WebKit Bug Importer 2013-08-15 09:58:29 PDT
<rdar://problem/14747056>
Comment 2 Brent Fulgham 2013-08-15 10:01:21 PDT
Created attachment 208817 [details]
Patch
Comment 3 Mark Lam 2013-08-15 10:03:50 PDT
Comment on attachment 208817 [details]
Patch

LGTM, but need someone else to r+.
Comment 4 Brent Fulgham 2013-08-15 12:29:08 PDT
Committed r154119: <http://trac.webkit.org/changeset/154119>