Bug 75492

Summary: [chromium] Fix compilation with clang and the shared build
Product: WebKit Reporter: Tony Chang <tony>
Component: New BugsAssignee: Tony Chang <tony>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, fischman, ojan, thakis
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch ojan: review+, ojan: commit-queue+

Description Tony Chang 2012-01-03 14:02:14 PST
[chromium] Fix compilation with clang and the shared build
Comment 1 Tony Chang 2012-01-03 14:03:17 PST
Created attachment 120990 [details]
Patch
Comment 2 Tony Chang 2012-01-03 14:03:58 PST
The clang+components build still fails for me at link time with:

/usr/local/gold/bin/ld: obj/gpu/command_buffer_service.a(obj/gpu/command_buffer/service/command_buffer_service.feature_info.o): in function gpu::gles2::FeatureInfo::AddFeatures(char const*):../../gpu/command_buffer/service/feature_info.cc(.text._ZN3gpu5gles211FeatureInfo11AddFeaturesEPKc+0x2db4): error: undefined reference to 'base::internal::StringPieceDetail<std::string>::npos'

But this gets us closer.
Comment 3 Nico Weber 2012-01-03 14:06:30 PST
Comment on attachment 120990 [details]
Patch

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

lgtm

> Source/WebKit/chromium/WebKit.gyp:751
> +                                    # but the test files have global constructors from the GTEST macro.

maybe mention somehow that that's because we pull in test files into the main webkit target for the shared build
Comment 4 Ami Fischman 2012-01-03 14:16:58 PST
(In reply to comment #2)
> The clang+components build still fails for me at link time with:
> 
> /usr/local/gold/bin/ld: obj/gpu/command_buffer_service.a(obj/gpu/command_buffer/service/command_buffer_service.feature_info.o): in function gpu::gles2::FeatureInfo::AddFeatures(char const*):../../gpu/command_buffer/service/feature_info.cc(.text._ZN3gpu5gles211FeatureInfo11AddFeaturesEPKc+0x2db4): error: undefined reference to 'base::internal::StringPieceDetail<std::string>::npos'
> 
> But this gets us closer.

Are you at clang r147441 or later?  
I didn't need to hack StringPiece to link chrome (only needed to change base/{logging,string16}.h), although I did have to hack at StringPiece with an earlier clang rev.

FTR, the clang-side bug is http://llvm.org/bugs/show_bug.cgi?id=11690 and the chromium-side bug is http://code.google.com/p/chromium/issues/detail?id=97532
Comment 5 Tony Chang 2012-01-03 14:19:15 PST
Created attachment 120997 [details]
Patch
Comment 6 Tony Chang 2012-01-03 14:20:14 PST
(In reply to comment #3)
> (From update of attachment 120990 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=120990&action=review
> 
> > Source/WebKit/chromium/WebKit.gyp:751
> > +                                    # but the test files have global constructors from the GTEST macro.
> 
> maybe mention somehow that that's because we pull in test files into the main webkit target for the shared build

Done.

(In reply to comment #4)
> Are you at clang r147441 or later?  

Ah, I'm not. That would probably fix it.

Thanks!
Comment 7 Nico Weber 2012-01-03 14:26:44 PST
Comment on attachment 120997 [details]
Patch

LGTM, thanks!
Comment 8 Tony Chang 2012-01-03 15:59:09 PST
Committed r103980: <http://trac.webkit.org/changeset/103980>