blob: 0466a3ab6fe838c364a029f0d20a7c6fd11b50db [file] [log] [blame] [view]
andybonsad92aa32015-08-31 02:27:441# Linux Chromium Arm Recipes
2
3[TOC]
4
5## Recipe1: Building for an ARM CrOS device
6
7This recipe uses `ninja` (instead of `make`) so its startup time is much lower
8(sub-1s, instead of tens of seconds), is integrated with goma (for
9google-internal users) for very high parallelism, and uses `sshfs` instead of
10`scp` to significantly speed up the compile-run cycle. It has moved to
11https://sites.google.com/a/chromium.org/dev/developers/how-tos/-quickly-building-for-cros-arm-x64
12(mostly b/c of the ease of attaching files to sites).
andybons3322f762015-08-24 21:37:0913
14
andybonsad92aa32015-08-31 02:27:4415## Recipe2: Explicit Cross compiling
andybons3322f762015-08-24 21:37:0916
andybonsad92aa32015-08-31 02:27:4417Due to the lack of ARM hardware with the grunt to build Chromium native, cross
18compiling is currently the recommended method of building for ARM.
andybons3322f762015-08-24 21:37:0919
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
andybonsad92aa32015-08-31 02:27:4427 $ ./build/install-build-deps.sh --arm
andybons3322f762015-08-24 21:37:0928
29### Installing the rootfs
30
andybonsad92aa32015-08-31 02:27:4431A prebuilt rootfs image is kept up-to-date on Cloud Storage. It will
32automatically be installed by gclient runhooks installed if you have
33`target_arch=arm` in your `GYP_DEFINES`.
andybons3322f762015-08-24 21:37:0934
35To install the sysroot manually you can run:
andybonsad92aa32015-08-31 02:27:4436
37 ./chrome/installer/linux/sysroot_scripts/install-debian.wheezy.sysroot.py \
38 --arch=arm
andybons3322f762015-08-24 21:37:0939
40### Building
41
andybonsad92aa32015-08-31 02:27:4442To build for ARM, using the clang binary in the chrome tree, use the following
43settings:
andybons3322f762015-08-24 21:37:0944
andybonsad92aa32015-08-31 02:27:4445 export GYP_CROSSCOMPILE=1
46 export GYP_DEFINES="target_arch=arm"
andybons3322f762015-08-24 21:37:0947
andybonsad92aa32015-08-31 02:27:4448There variables need to be set at gyp-time (when you run `gyp_chromium`),
andybons3322f762015-08-24 21:37:0949but are not needed at build-time (when you run make/ninja).
50
51## Testing
52
53### Automated Build and Testing
54
55Chromium's testing infrastructure for ARM/Linux is (to say the least)
andybonsad92aa32015-08-31 02:27:4456in its infancy. There are currently two builders setup, one on the
andybons3322f762015-08-24 21:37:0957FYI waterfall and one the the trybot waterfall:
58
nodira6074d4c2015-09-01 04:26:4559* [Linux ARM Cross-Compile](http://build.chromium.org/p/chromium.fyi/builders/Linux%20ARM%20Cross-Compile)
60* [linux_arm](http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_arm)
andybons3322f762015-08-24 21:37:0961
andybonsad92aa32015-08-31 02:27:4462These builders cross compile on x86-64 and then trigger testing on real ARM hard
63bots:
andybons3322f762015-08-24 21:37:0964
nodira6074d4c2015-09-01 04:26:4565* [Linux ARM Tests (Panda)](http://build.chromium.org/p/chromium.fyi/builders/Linux%20ARM%20Tests%20%28Panda%29/)
66* [linux_arm_tester](http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_arm_tester)
andybons3322f762015-08-24 21:37:0967
andybonsad92aa32015-08-31 02:27:4468Unfortunately, even those the builders are usually green, the testers are not
69yet well maintained or monitored.
andybons3322f762015-08-24 21:37:0970
71There is compile-only trybot and fyi bot also:
72
nodira6074d4c2015-09-01 04:26:4573* [Linux ARM](http://build.chromium.org/p/chromium.fyi/builders/Linux%20ARM)
74* [linux_arm_compile](http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_arm_compile)
andybons3322f762015-08-24 21:37:0975
76### Testing with QEMU
77
andybonsad92aa32015-08-31 02:27:4478If you don't have a real ARM machine, you can test with QEMU. For instance,
79there are some prebuilt QEMU Debian images here:
80http://people.debian.org/~aurel32/qemu/. Another option is to use the rootfs
81generated by rootstock, as mentioned above.
andybons3322f762015-08-24 21:37:0982
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
andybonsad92aa32015-08-31 02:27:44122
123* To building for thumb reduces the stripped release binary by around 9MB,
124 equating to ~33% of the binary size. To enable thumb, set `'arm_thumb': 1`
125* TCmalloc does not have an ARM port, so it is disabled.