blob: 927be6e79497a92460fc6f0df9f21e2b9645a430 [file] [log] [blame] [view]
andybons3322f762015-08-24 21:37:091Note this currently contains various recipes:
2
3
4
5---
6
7
8# Recipe1: Building for an ARM CrOS device
9This recipe uses `ninja` (instead of `make`) so its startup time is much lower (sub-1s, instead of tens of seconds), is integrated with goma (for google-internal users) for very high parallelism, and uses `sshfs` instead of `scp` to significantly speed up the compile-run cycle. It has moved to https://sites.google.com/a/chromium.org/dev/developers/how-tos/-quickly-building-for-cros-arm-x64 (mostly b/c of the ease of attaching files to sites).
10
11
12
13---
14
15
16# Recipe2: Explicit Cross compiling
17
18Due to the lack of ARM hardware with the grunt to build Chromium native, cross compiling is currently the recommended method of building for ARM.
19
20These instruction are designed to run on Ubuntu Precise.
21
22### Installing the toolchain
23
24The install-build-deps script can be used to install all the compiler
25and library dependencies directly from Ubuntu:
26
27```
28$ ./build/install-build-deps.sh --arm
29```
30
31### Installing the rootfs
32
33A prebuilt rootfs image is kept up-to-date on Cloud Storage. It will
34automatically be installed by gclient runhooks installed if you have 'target\_arch=arm' in your GYP\_DEFINES.
35
36To install the sysroot manually you can run:
37```
38$ ./chrome/installer/linux/sysroot_scripts/install-debian.wheezy.sysroot.py --arch=arm
39```
40
41### Building
42
43To build for ARM, using the clang binary in the chrome tree, use the following settings:
44
45```
46export GYP_CROSSCOMPILE=1
47export GYP_DEFINES="target_arch=arm"
48```
49
50There variables need to be set at gyp-time (when you run gyp\_chromium),
51but are not needed at build-time (when you run make/ninja).
52
53## Testing
54
55### Automated Build and Testing
56
57Chromium's testing infrastructure for ARM/Linux is (to say the least)
58in its infancy. There are currently two builders setup, one on the
59FYI waterfall and one the the trybot waterfall:
60
61http://build.chromium.org/p/chromium.fyi/builders/Linux%20ARM%20Cross-Compile
62http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_arm
63
64
65These builders cross compile on x86-64 and then trigger testing
66on real ARM hard bots:
67
68http://build.chromium.org/p/chromium.fyi/builders/Linux%20ARM%20Tests%20%28Panda%29/
69http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_arm_tester
70
71Unfortunately, even those the builders are usually green, the testers
72are not yet well maintained or monitored.
73
74There is compile-only trybot and fyi bot also:
75
76http://build.chromium.org/p/chromium.fyi/builders/Linux%20ARM
77http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_arm_compile
78
79### Testing with QEMU
80
81If you don't have a real ARM machine, you can test with QEMU. For instance, there are some prebuilt QEMU Debian images here: http://people.debian.org/~aurel32/qemu/. Another option is to use the rootfs generated by rootstock, as mentioned above.
82
83Here's a minimal xorg.conf if needed:
84
85```
86Section "InputDevice"
87 Identifier "Generic Keyboard"
88 Driver "kbd"
89 Option "XkbRules" "xorg"
90 Option "XkbModel" "pc105"
91 Option "XkbLayout" "us"
92EndSection
93
94Section "InputDevice"
95 Identifier "Configured Mouse"
96 Driver "mouse"
97EndSection
98
99Section "Device"
100 Identifier "Configured Video Device"
101 Driver "fbdev"
102 Option "UseFBDev" "true"
103EndSection
104
105Section "Monitor"
106 Identifier "Configured Monitor"
107EndSection
108
109Section "Screen"
110 Identifier "Default Screen"
111 Monitor "Configured Monitor"
112 Device "Configured Video Device"
113 DefaultDepth 8
114 SubSection "Display"
115 Depth 8
116 Modes "1024x768" "800x600" "640x480"
117 EndSubSection
118EndSection
119```
120
121### Notes
122 * To building for thumb reduces the stripped release binary by around 9MB, equating to ~33% of the binary size. To enable thumb, set 'arm\_thumb': 1
123 * TCmalloc does not have an ARM port, so it is disabled.