andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 1 | # Linux Chromium Arm Recipes |
| 2 | |
| 3 | [TOC] |
| 4 | |
| 5 | ## Recipe1: Building for an ARM CrOS device |
| 6 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 7 | https://sites.google.com/a/chromium.org/dev/developers/how-tos/-quickly-building-for-cros-arm-x64 |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 8 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 9 | ## Recipe2: Explicit Cross compiling |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 10 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 11 | Due to the lack of ARM hardware with the grunt to build Chromium native, cross |
| 12 | compiling is currently the recommended method of building for ARM. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 13 | |
| 14 | These instruction are designed to run on Ubuntu Precise. |
| 15 | |
| 16 | ### Installing the toolchain |
| 17 | |
| 18 | The install-build-deps script can be used to install all the compiler |
| 19 | and library dependencies directly from Ubuntu: |
| 20 | |
sbc | edd75c2 | 2015-11-22 04:53:43 | [diff] [blame] | 21 | $ ./build/install-build-deps.sh |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 22 | |
sbc | 9f033f8 | 2015-11-26 00:50:52 | [diff] [blame] | 23 | ### Installing the sysroot |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 24 | |
thakis | 3e861de | 2016-06-14 14:24:01 | [diff] [blame] | 25 | A prebuilt sysroot image is kept up to date on Cloud Storage. It will |
Daniel Bratell | f73f0df | 2018-09-24 13:52:49 | [diff] [blame] | 26 | automatically be installed by gclient runhooks if `target_cpu=["arm"]` |
| 27 | is present in your `.gclient` file. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 28 | |
| 29 | To install the sysroot manually you can run: |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 30 | |
sbc | 325bd8b | 2017-04-05 19:36:16 | [diff] [blame] | 31 | ./build/linux/sysroot_scripts/install-sysroot.py --arch=arm |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 32 | |
| 33 | ### Building |
| 34 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 35 | To build for ARM, using the clang binary in the chrome tree, use the following |
sbc | 84dfa8ed | 2015-12-02 23:45:37 | [diff] [blame] | 36 | gn args: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 37 | |
sbc | 84dfa8ed | 2015-12-02 23:45:37 | [diff] [blame] | 38 | target_cpu = "arm" |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 39 | |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 40 | ## Testing |
| 41 | |
| 42 | ### Automated Build and Testing |
| 43 | |
sbc | edd75c2 | 2015-11-22 04:53:43 | [diff] [blame] | 44 | Chromium's testing infrastructure for ARM/Linux is somewhat limited. |
| 45 | There are currently two builders setup, one on the FYI waterfall and one |
qyearsley | c0dc6f4 | 2016-12-02 22:13:39 | [diff] [blame] | 46 | the the try bot waterfall: |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 47 | |
xiaoyin.l | 1003c0b | 2016-12-06 02:51:17 | [diff] [blame] | 48 | * [Linux ARM](https://build.chromium.org/p/chromium.fyi/builders/Linux%20ARM) |
| 49 | * [linux_arm](https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_arm) |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 50 | |
sbc | edd75c2 | 2015-11-22 04:53:43 | [diff] [blame] | 51 | These bots run x86-64 linux and cross-compile the ARM targets. Tests are |
| 52 | run on ARM hardware via swarming. |
| 53 | |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 54 | ### Testing with QEMU |
| 55 | |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 56 | If you don't have a real ARM machine, you can test with QEMU. For instance, |
| 57 | there are some prebuilt QEMU Debian images here: |
| 58 | http://people.debian.org/~aurel32/qemu/. Another option is to use the rootfs |
| 59 | generated by rootstock, as mentioned above. |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 60 | |
| 61 | Here's a minimal xorg.conf if needed: |
| 62 | |
| 63 | ``` |
| 64 | Section "InputDevice" |
| 65 | Identifier "Generic Keyboard" |
| 66 | Driver "kbd" |
| 67 | Option "XkbRules" "xorg" |
| 68 | Option "XkbModel" "pc105" |
| 69 | Option "XkbLayout" "us" |
| 70 | EndSection |
| 71 | |
| 72 | Section "InputDevice" |
| 73 | Identifier "Configured Mouse" |
| 74 | Driver "mouse" |
| 75 | EndSection |
| 76 | |
| 77 | Section "Device" |
| 78 | Identifier "Configured Video Device" |
| 79 | Driver "fbdev" |
| 80 | Option "UseFBDev" "true" |
| 81 | EndSection |
| 82 | |
| 83 | Section "Monitor" |
| 84 | Identifier "Configured Monitor" |
| 85 | EndSection |
| 86 | |
| 87 | Section "Screen" |
| 88 | Identifier "Default Screen" |
| 89 | Monitor "Configured Monitor" |
| 90 | Device "Configured Video Device" |
| 91 | DefaultDepth 8 |
| 92 | SubSection "Display" |
| 93 | Depth 8 |
| 94 | Modes "1024x768" "800x600" "640x480" |
| 95 | EndSubSection |
| 96 | EndSection |
| 97 | ``` |
| 98 | |
| 99 | ### Notes |
andybons | ad92aa3 | 2015-08-31 02:27:44 | [diff] [blame] | 100 | |
| 101 | * To building for thumb reduces the stripped release binary by around 9MB, |
| 102 | equating to ~33% of the binary size. To enable thumb, set `'arm_thumb': 1` |
| 103 | * TCmalloc does not have an ARM port, so it is disabled. |