Commit 30d0f8c9 authored by danakj's avatar danakj Committed by Commit bot

clang tools: Add --bootstrap to the documentation for update.py

This lets us build the clang tools with clang not gcc, which appears to
have bugs!

Also work around the gcc bug in one place we know it happens anyways,
just because.

R=dcheng
BUG=580745

Review URL: https://codereview.chromium.org/1647733002

Cr-Commit-Position: refs/heads/master@{#371933}
parent 727bd37e
...@@ -97,7 +97,7 @@ doesn't work well for Chromium: ...@@ -97,7 +97,7 @@ doesn't work well for Chromium:
Synopsis: Synopsis:
```shell ```shell
tools/clang/scripts/update.py --force-local-build --without-android \ tools/clang/scripts/update.py --bootstrap --force-local-build --without-android \
--tools blink_gc_plugin plugins rewrite_to_chrome_style --tools blink_gc_plugin plugins rewrite_to_chrome_style
``` ```
...@@ -109,6 +109,9 @@ subdirectories in ...@@ -109,6 +109,9 @@ subdirectories in
[//tools/clang](https://chromium.googlesource.com/chromium/src/+/master/tools/clang). [//tools/clang](https://chromium.googlesource.com/chromium/src/+/master/tools/clang).
Generally, `--tools` should always include `blink_gc_plugin` and `plugins`: otherwise, Chromium won't build. Generally, `--tools` should always include `blink_gc_plugin` and `plugins`: otherwise, Chromium won't build.
It is important to use --bootstrap as there appear to be [bugs](https://crbug.com/580745)
in the clang library this script produces if you build it with gcc, which is the default.
## Running ## Running
First, build all chromium targets to avoid failures due to missing dependecies First, build all chromium targets to avoid failures due to missing dependecies
that are generated as part of the build: that are generated as part of the build:
......
...@@ -111,7 +111,10 @@ bool GetNameForDecl(const clang::FieldDecl& decl, ...@@ -111,7 +111,10 @@ bool GetNameForDecl(const clang::FieldDecl& decl,
original_name.substr(strlen(kBlinkFieldPrefix))); original_name.substr(strlen(kBlinkFieldPrefix)));
// The few examples I could find used struct-style naming with no `_` suffix // The few examples I could find used struct-style naming with no `_` suffix
// for unions. // for unions.
if (decl.getParent()->isClass()) bool c = decl.getParent()->isClass();
// There appears to be a GCC bug that makes this branch incorrectly if we
// don't use a temp variable!! Clang works right. crbug.com/580745
if (c)
name += '_'; name += '_';
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment