OLD | NEW |
1 # Tips for improving build speed on Linux | 1 # Tips for improving build speed on Linux |
2 | 2 |
3 This list is sorted such that the largest speedup is first; see | 3 This list is sorted such that the largest speedup is first; see |
4 [Linux build instructions](linux_build_instructions.md) for context and | 4 [Linux build instructions](linux_build_instructions.md) for context and |
5 [Faster Builds](common_build_tasks.md) for non-Linux-specific techniques. | 5 [Faster Builds](common_build_tasks.md) for non-Linux-specific techniques. |
6 | 6 |
7 [TOC] | 7 [TOC] |
8 | 8 |
| 9 ## General configuration |
| 10 |
| 11 The [GN build configuration](https://www.chromium.org/developers/gn-build-config
uration) |
| 12 page discusses a number of options that will speed up your build. In particular: |
| 13 |
| 14 is_component_build = true |
| 15 enable_nacl = false |
| 16 symbol_level = 0 |
| 17 remove_webcore_debug_symbols = true |
| 18 |
9 ## Use goma | 19 ## Use goma |
10 | 20 |
11 If you work at Google, you can use goma for distributed builds; this is similar | 21 If you work at Google, you can use goma for distributed builds; this is similar |
12 to [distcc](http://en.wikipedia.org/wiki/Distcc). See [go/ma](http://go/ma) for | 22 to [distcc](http://en.wikipedia.org/wiki/Distcc). See [go/ma](http://go/ma) for |
13 documentation. | 23 documentation. |
14 | 24 |
15 Even without goma, you can do distributed builds with distcc (if you have access | 25 Even without goma, you can do distributed builds with distcc (if you have access |
16 to other machines), or a parallel build locally if have multiple cores. | 26 to other machines), or a parallel build locally if have multiple cores. |
17 | 27 |
18 Whether using goma, distcc, or parallel building, you can specify the number of | 28 Whether using goma, distcc, or parallel building, you can specify the number of |
19 build processes with `-jX` where `X` is the number of processes to start. | 29 build processes with `-jX` where `X` is the number of processes to start. |
20 | 30 |
21 ## Use Icecc | 31 ## Use Icecc |
22 | 32 |
23 [Icecc](https://github.com/icecc/icecream) is the distributed compiler with a | 33 [Icecc](https://github.com/icecc/icecream) is the distributed compiler with a |
24 central scheduler to share build load. Currently, many external contributors use | 34 central scheduler to share build load. Currently, many external contributors use |
25 it. e.g. Intel, Opera, Samsung. | 35 it. e.g. Intel, Opera, Samsung. |
26 | 36 |
27 When you use Icecc, you need to set some gyp variables. | 37 When you use Icecc, you need to [set some GN variables](https://www.chromium.org
/developers/gn-build-configuration). |
28 | 38 |
29 linux_use_bundled_binutils=0** | 39 linux_use_bundled_binutils = false |
30 | 40 |
31 `-B` option is not supported. | 41 The `-B` option is not supported. |
32 [relevant commit](https://github.com/icecc/icecream/commit/b2ce5b9cc4bd1900f55c3
684214e409fa81e7a92) | 42 [relevant commit](https://github.com/icecc/icecream/commit/b2ce5b9cc4bd1900f55c3
684214e409fa81e7a92) |
33 | 43 |
34 linux_use_debug_fission=0 | 44 linux_use_debug_fission = false |
35 | 45 |
36 [debug fission](http://gcc.gnu.org/wiki/DebugFission) is not supported. | 46 [debug fission](http://gcc.gnu.org/wiki/DebugFission) is not supported. |
37 [bug](https://github.com/icecc/icecream/issues/86) | 47 [bug](https://github.com/icecc/icecream/issues/86) |
38 | 48 |
39 clang=0 | 49 is_clang = false |
40 | 50 |
41 Icecc doesn't support clang yet. | 51 Icecc doesn't support clang yet. |
42 | 52 |
43 use_sysroot=0 | 53 use_sysroot = false |
44 | 54 |
45 Icecc doesn't work with sysroot. | 55 Icecc doesn't work with sysroot. |
46 | 56 |
47 linux_use_bundled_gold=0 | |
48 | |
49 Using the system linker is necessary when using glibc 2.21 or newer. See | 57 Using the system linker is necessary when using glibc 2.21 or newer. See |
50 [related bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808181). | 58 [related bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808181). |
51 | 59 Previously these instructions listed the linux_use_bundled_gold GYP variable |
52 ## Build only specific targets | 60 which no longer exists. If you know about this, please update or delete this |
53 | 61 section. |
54 If you specify just the target(s) you want built, the build will only walk that | |
55 portion of the dependency graph: | |
56 | |
57 cd $CHROMIUM_ROOT/src | |
58 ninja -C out/Debug base_unittests | |
59 | |
60 ## Linking | |
61 | |
62 ### Dynamically link | |
63 | |
64 We normally statically link everything into one final executable, which produces | |
65 enormous (nearly 1gb in debug mode) files. If you dynamically link, you save a | |
66 lot of time linking for a bit of time during startup, which is fine especially | |
67 when you're in an edit/compile/test cycle. | |
68 | |
69 Add the flag `is_component_build=true` in your build args (to edit build args | |
70 run `gn args out/foo` where `out/foo` is your build directory). | |
71 | |
72 See the | |
73 [component build page](http://www.chromium.org/developers/how-tos/component-buil
d) | |
74 for more information. | |
75 | |
76 ### Linking using gold | |
77 | |
78 The experimental "gold" linker is much faster than the standard BFD linker. | |
79 | |
80 On some systems (including Debian experimental, Ubuntu Karmic and beyond), there | |
81 exists a `binutils-gold` package. Do not install this version! Having gold as | |
82 the default linker is known to break kernel / kernel module builds. | |
83 | |
84 The Chrome tree now includes a binary of gold compiled for x64 Linux. It is used | |
85 by default on those systems. | |
86 | |
87 On other systems, to safely install gold, make sure the final binary is named | |
88 `ld` and then set `CC/CXX` appropriately, e.g. | |
89 `export CC="gcc -B/usr/local/gold/bin"` and similarly for `CXX`. Alternatively, | |
90 you can add `/usr/local/gold/bin` to your `PATH` in front of `/usr/bin`. | |
91 | 62 |
92 ## WebKit | 63 ## WebKit |
93 | 64 |
94 ### Build WebKit without debug symbols | 65 ### Build WebKit without debug symbols |
95 | 66 |
96 WebKit is about half our weight in terms of debug symbols. (Lots of templates!) | 67 WebKit is about half our weight in terms of debug symbols. (Lots of templates!) |
97 If you're working on UI bits where you don't care to trace into WebKit you can | 68 If you're working on UI bits where you don't care to trace into WebKit you can |
98 cut down the size and slowness of debug builds significantly by building WebKit | 69 cut down the size and slowness of debug builds significantly by building WebKit |
99 without debug symbols. | 70 without debug symbols. |
100 | 71 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 or for a release build. | 116 or for a release build. |
146 *** | 117 *** |
147 | 118 |
148 Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores | 119 Quick and dirty benchmark numbers on a HP Z600 (Intel core i7, 16 cores |
149 hyperthreaded, 12 GB RAM) | 120 hyperthreaded, 12 GB RAM) |
150 | 121 |
151 * With tmpfs: | 122 * With tmpfs: |
152 * 12m:20s | 123 * 12m:20s |
153 * Without tmpfs | 124 * Without tmpfs |
154 * 15m:40s | 125 * 15m:40s |
OLD | NEW |