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 |
(...skipping 18 matching lines...) Expand all Loading... |
29 Build: `ninja -C out/gn chrome` | 29 Build: `ninja -C out/gn chrome` |
30 | 30 |
31 ## Reverting to gcc on linux | 31 ## Reverting to gcc on linux |
32 | 32 |
33 We don't have bots that test this, but building with gcc4.8+ should still work | 33 We don't have bots that test this, but building with gcc4.8+ should still work |
34 on Linux. If your system gcc is new enough, run `gn args` and add `is_clang = | 34 on Linux. If your system gcc is new enough, run `gn args` and add `is_clang = |
35 false`. | 35 false`. |
36 | 36 |
37 ## Mailing List | 37 ## Mailing List |
38 | 38 |
39 http://groups.google.com/a/chromium.org/group/clang/topics | 39 https://groups.google.com/a/chromium.org/group/clang/topics |
40 | 40 |
41 ## Using plugins | 41 ## Using plugins |
42 | 42 |
43 The | 43 The |
44 [chromium style plugin](http://dev.chromium.org/developers/coding-style/chromium
-style-checker-errors) | 44 [chromium style plugin](https://dev.chromium.org/developers/coding-style/chromiu
m-style-checker-errors) |
45 is used by default when clang is used. | 45 is used by default when clang is used. |
46 | 46 |
47 If you're working on the plugin, you can build it locally like so: | 47 If you're working on the plugin, you can build it locally like so: |
48 | 48 |
49 1. Run `./tools/clang/scripts/update.py --force-local-build --without-android` | 49 1. Run `./tools/clang/scripts/update.py --force-local-build --without-android` |
50 to build the plugin. | 50 to build the plugin. |
51 1. Run `ninja -C third_party/llvm-build/Release+Asserts/` to build incrementall
y. | 51 1. Run `ninja -C third_party/llvm-build/Release+Asserts/` to build incrementall
y. |
52 1. Build with clang like described above, but, if you use goma, disable it. | 52 1. Build with clang like described above, but, if you use goma, disable it. |
53 | 53 |
54 To test the FindBadConstructs plugin, run: | 54 To test the FindBadConstructs plugin, run: |
55 | 55 |
56 (cd tools/clang/plugins/tests && \ | 56 (cd tools/clang/plugins/tests && \ |
57 ./test.py ../../../../third_party/llvm-build/Release+Asserts/bin/clang \ | 57 ./test.py ../../../../third_party/llvm-build/Release+Asserts/bin/clang \ |
58 ../../../../third_party/llvm-build/Release+Asserts/lib/libFindBad
Constructs.so) | 58 ../../../../third_party/llvm-build/Release+Asserts/lib/libFindBad
Constructs.so) |
59 | 59 |
60 ## Using the clang static analyzer | 60 ## Using the clang static analyzer |
61 | 61 |
62 See [clang_static_analyzer.md](clang_static_analyzer.md). | 62 See [clang_static_analyzer.md](clang_static_analyzer.md). |
63 | 63 |
64 ## Windows | 64 ## Windows |
65 | 65 |
66 clang can be used as compiler on Windows. Clang uses Visual Studio's linker and | 66 clang can be used as compiler on Windows. Clang uses Visual Studio's linker and |
67 SDK, so you still need to have Visual Studio installed. | 67 SDK, so you still need to have Visual Studio installed. |
68 | 68 |
69 Things should compile, and all tests should pass. You can check these bots for | 69 Things should compile, and all tests should pass. You can check these bots for |
70 how things are currently looking: | 70 how things are currently looking: |
71 http://build.chromium.org/p/chromium.fyi/console?category=win%20clang | 71 https://build.chromium.org/p/chromium.fyi/console?category=win%20clang |
72 | 72 |
73 ```shell | 73 ```shell |
74 python tools\clang\scripts\update.py | 74 python tools\clang\scripts\update.py |
75 # run `gn args` and add `is_clang = true` to your args.gn, then... | 75 # run `gn args` and add `is_clang = true` to your args.gn, then... |
76 ninja -C out\gn chrome | 76 ninja -C out\gn chrome |
77 ``` | 77 ``` |
78 | 78 |
79 The `update.py` script only needs to be run once per checkout. Clang will be | 79 The `update.py` script only needs to be run once per checkout. Clang will be |
80 kept up to date by `gclient runhooks`. | 80 kept up to date by `gclient runhooks`. |
81 | 81 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 **Experimental!** | 119 **Experimental!** |
120 | 120 |
121 LLD is a relatively new linker from LLVM. The current focus is on Windows and | 121 LLD is a relatively new linker from LLVM. The current focus is on Windows and |
122 Linux support, where it can link Chrome approximately twice as fast as gold and | 122 Linux support, where it can link Chrome approximately twice as fast as gold and |
123 MSVC's link.exe as of this writing. LLD does not yet support generating PDB | 123 MSVC's link.exe as of this writing. LLD does not yet support generating PDB |
124 files, which makes it hard to debug Chrome while using LLD. | 124 files, which makes it hard to debug Chrome while using LLD. |
125 | 125 |
126 on Windows. | 126 on Windows. |
127 Set `use_lld = true` in args.gn. | 127 Set `use_lld = true` in args.gn. |
OLD | NEW |