summaryrefslogtreecommitdiffstats
path: root/docs/linux_chromium_arm.md
blob: 8168a0613c6edc2d2713a541e19fb6eb4aad8471 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Linux Chromium Arm Recipes

[TOC]

## Recipe1: Building for an ARM CrOS device

https://sites.google.com/a/chromium.org/dev/developers/how-tos/-quickly-building-for-cros-arm-x64

## Recipe2: Explicit Cross compiling

Due to the lack of ARM hardware with the grunt to build Chromium native, cross
compiling is currently the recommended method of building for ARM.

These instruction are designed to run on Ubuntu Precise.

### Installing the toolchain

The install-build-deps script can be used to install all the compiler
and library dependencies directly from Ubuntu:

    $ ./build/install-build-deps.sh

### Installing the sysroot

A prebuilt sysroot image is kept up-to-date on Cloud Storage. It will
automatically be installed by gclient runhooks installed if you have
`target_arch=arm` in your `GYP_DEFINES`.

To install the sysroot manually you can run:

    ./chrome/installer/linux/sysroot_scripts/install-debian.wheezy.sysroot.py \
        --arch=arm

### Building

To build for ARM, using the clang binary in the chrome tree, use the following
gn args:

    target_cpu = "arm"

Or the following gyp settings:

    GYP_CROSSCOMPILE=1
    GYP_DEFINES="target_arch=arm"

## Testing

### Automated Build and Testing

Chromium's testing infrastructure for ARM/Linux is somewhat limited.
There are currently two builders setup, one on the FYI waterfall and one
the the trybot waterfall:

*   [Linux ARM](http://build.chromium.org/p/chromium.fyi/builders/Linux%20ARM)
*   [linux_arm](http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_arm)

These bots run x86-64 linux and cross-compile the ARM targets.  Tests are
run on ARM hardware via swarming.

### Testing with QEMU

If 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.

Here's a minimal xorg.conf if needed:

```
Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "kbd"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc105"
        Option          "XkbLayout"     "us"
EndSection

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
EndSection

Section "Device"
        Identifier      "Configured Video Device"
        Driver  "fbdev"
        Option          "UseFBDev"              "true"
EndSection

Section "Monitor"
        Identifier      "Configured Monitor"
EndSection

Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        Device          "Configured Video Device"
        DefaultDepth 8
        SubSection "Display"
            Depth 8
            Modes "1024x768" "800x600" "640x480"
        EndSubSection
EndSection
```

### Notes

*   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`
*   TCmalloc does not have an ARM port, so it is disabled.