Bug 75492 - [chromium] Fix compilation with clang and the shared build
Summary: [chromium] Fix compilation with clang and the shared build
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tony Chang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-03 14:02 PST by Tony Chang
Modified: 2012-01-03 15:59 PST (History)
4 users (show)

See Also:


Attachments
Patch (25.64 KB, patch)
2012-01-03 14:03 PST, Tony Chang
no flags Details | Formatted Diff | Diff
Patch (25.79 KB, patch)
2012-01-03 14:19 PST, Tony Chang
ojan: review+
ojan: commit-queue+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>