| OLD | NEW |
| 1 # Clang | 1 # Clang |
| 2 | 2 |
| 3 [Clang](http://clang.llvm.org/) is a compiler with many desirable features | 3 [Clang](http://clang.llvm.org/) is a compiler with many desirable features |
| 4 (outlined on their website). | 4 (outlined on their website). |
| 5 | 5 |
| 6 Chrome can be built with Clang. It is now the default compiler on Mac and Linux | 6 Chrome can be built with Clang. It is now the default compiler on Mac and Linux |
| 7 for building Chrome, and it is currently useful for its warning and error | 7 for building Chrome, and it is currently useful for its warning and error |
| 8 messages on Android and Windows. | 8 messages on Android and Windows. |
| 9 | 9 |
| 10 See | 10 See |
| 11 [the open bugs](http://code.google.com/p/chromium/issues/list?q=label:clang). | 11 [the open bugs](http://code.google.com/p/chromium/issues/list?q=label:clang). |
| 12 | 12 |
| 13 [TOC] | 13 [TOC] |
| 14 | 14 |
| 15 ## Build instructions | 15 ## Build instructions |
| 16 | 16 |
| 17 Get clang (happens automatically during `gclient runhooks` on Mac and Linux): | 17 Get clang (happens automatically during `gclient runhooks` on Mac and Linux): |
| 18 | 18 |
| 19 tools/clang/scripts/update.sh | 19 tools/clang/scripts/update.py |
| 20 | 20 |
| 21 (Only needs to be run once per checkout, and clang will be automatically updated | 21 (Only needs to be run once per checkout, and clang will be automatically updated |
| 22 by `gclient runhooks`.) | 22 by `gclient runhooks`.) |
| 23 | 23 |
| 24 ### Reverting to gcc on linux | 24 ### Reverting to gcc on linux |
| 25 | 25 |
| 26 We don't have bots that test this, but building with gcc4.8+ should still work | 26 We don't have bots that test this, but building with gcc4.8+ should still work |
| 27 on Linux. If your system gcc is new enough, use this to build with gcc if you | 27 on Linux. If your system gcc is new enough, use this to build with gcc if you |
| 28 don't want to build with clang: | 28 don't want to build with clang: |
| 29 | 29 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 clang_use_chrome_plugins=0 make_clang_dir=$HOME/src/llvm-build" \ | 121 clang_use_chrome_plugins=0 make_clang_dir=$HOME/src/llvm-build" \ |
| 122 build/gyp_chromium | 122 build/gyp_chromium |
| 123 ``` | 123 ``` |
| 124 | 124 |
| 125 You can then run `head out/Release/build.ninja` and check that the first to | 125 You can then run `head out/Release/build.ninja` and check that the first to |
| 126 lines set `cc` and `cxx` to your clang binary. If things look good, run `ninja | 126 lines set `cc` and `cxx` to your clang binary. If things look good, run `ninja |
| 127 -C out/Release` to build. | 127 -C out/Release` to build. |
| 128 | 128 |
| 129 If your clang revision is very different from the one currently used in chromium | 129 If your clang revision is very different from the one currently used in chromium |
| 130 | 130 |
| 131 * Check `tools/clang/scripts/update.sh` to find chromium's clang revision | 131 * Check `tools/clang/scripts/update.py` to find chromium's clang revision |
| 132 * You might have to tweak warning flags. Or you could set `werror=` in the | 132 * You might have to tweak warning flags. Or you could set `werror=` in the |
| 133 line above to disable warnings as errors (but this only works on Linux). | 133 line above to disable warnings as errors (but this only works on Linux). |
| OLD | NEW |