Bug 31477 - [V8] Fix V8Bindings link error in Linux+GCC 4.4
Summary: [V8] Fix V8Bindings link error in Linux+GCC 4.4
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P3 Minor
Assignee: Jens Alfke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-13 09:59 PST by Jens Alfke
Modified: 2009-11-13 13:27 PST (History)
1 user (show)

See Also:


Attachments
patch (1.31 KB, patch)
2009-11-13 10:33 PST, Jens Alfke
dglazkov: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Alfke 2009-11-13 09:59:00 PST
Craig Schlenter alerted me that my patch in r50846 (bug 31383) caused a link error building Chromium on Linux with GCC 4.4:

undefined reference to `WebCore::AtomicString WebCore::v8StringToWebCoreString<WebCore::AtomicString>(v8::Handle<v8::String>, WebCore::ExternalMode)'

He tracked it down to an issue with the compiler not knowing which instantiations of the template to create, since the template body is in a .cpp file, as described here:
    http://stackoverflow.com/questions/1639797/template-issue-causes-linker-error-c
The fix is to explicitly instantiate both the String and AtomicString versions in the .cpp file.

This isn't a serious issue because we haven't moved up to GCC 4.4 for Chromium's Linux build yet, but it's a good idea to fix this now. I'm preparing a patch.
Comment 1 Jens Alfke 2009-11-13 10:33:24 PST
Created attachment 43168 [details]
patch

Here's the patch. Waiting to set 'review?' flag till after I make sure it builds on Win/Linux.
Comment 2 Jens Alfke 2009-11-13 12:50:53 PST
Comment on attachment 43168 [details]
patch

OK, this has passed the trybots, so requesting a review.
Comment 3 Eric Seidel (no email) 2009-11-13 13:13:15 PST
Comment on attachment 43168 [details]
patch

Wrong mime type on the attachment. :)  Tools like "bugzilla-tool post-diff" will take care of all the silly check-boxes and mime types for you if you like.
Comment 4 Eric Seidel (no email) 2009-11-13 13:14:00 PST
This looks sane to me, but I'm really not enough of a c++ expert to comment here.
Comment 5 Dimitri Glazkov (Google) 2009-11-13 13:18:28 PST
Comment on attachment 43168 [details]
patch

I am not teh expert, but I believe jens! :)
Comment 6 Jens Alfke 2009-11-13 13:27:50 PST
Committed revision 50967.