|
| 1 | +# Docker images for CI |
| 2 | + |
| 3 | +This folder contains a bunch of docker images used by the continuous integration |
| 4 | +(CI) of Rust. An script is accompanied (`run.sh`) with these images to actually |
| 5 | +execute them. To test out an image execute: |
| 6 | + |
| 7 | +``` |
| 8 | +./src/ci/docker/run.sh $image_name |
| 9 | +``` |
| 10 | + |
| 11 | +for example: |
| 12 | + |
| 13 | +``` |
| 14 | +./src/ci/docker/run.sh x86_64-gnu |
| 15 | +``` |
| 16 | + |
| 17 | +Images will output artifacts in an `obj` dir at the root of a repository. |
| 18 | + |
| 19 | +## Cross toolchains |
| 20 | + |
| 21 | +A number of these images take quite a long time to compile as they're building |
| 22 | +whole gcc toolchains to do cross builds with. Much of this is relatively |
| 23 | +self-explanatory but some images use [crosstool-ng] which isn't quite as self |
| 24 | +explanatory. Below is a description of where these `*.config` files come form, |
| 25 | +how to generate them, and how the existing ones were generated. |
| 26 | + |
| 27 | +[crosstool-ng]: https://github.com/crosstool-ng/crosstool-ng |
| 28 | + |
| 29 | +### Generating a `.config` file |
| 30 | + |
| 31 | +If you have a `linux-cross` image lying around you can use that and skip the |
| 32 | +next two steps. |
| 33 | + |
| 34 | +- First we spin up a container and copy `build_toolchain_root.sh` into it. All |
| 35 | + these steps are outside the container: |
| 36 | + |
| 37 | +``` |
| 38 | +# Note: We use ubuntu:15.10 because that's the "base" of linux-cross Docker |
| 39 | +# image |
| 40 | +$ docker run -it ubuntu:15.10 bash |
| 41 | +$ docker ps |
| 42 | +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
| 43 | +cfbec05ed730 ubuntu:15.10 "bash" 16 seconds ago Up 15 seconds drunk_murdock |
| 44 | +$ docker cp build_toolchain_root.sh drunk_murdock:/ |
| 45 | +``` |
| 46 | + |
| 47 | +- Then inside the container we build crosstool-ng by simply calling the bash |
| 48 | + script we copied in the previous step: |
| 49 | + |
| 50 | +``` |
| 51 | +$ bash build_toolchain_root.sh |
| 52 | +``` |
| 53 | + |
| 54 | +- Now, inside the container run the following command to configure the |
| 55 | + toolchain. To get a clue of which options need to be changed check the next |
| 56 | + section and come back. |
| 57 | + |
| 58 | +``` |
| 59 | +$ ct-ng menuconfig |
| 60 | +``` |
| 61 | + |
| 62 | +- Finally, we retrieve the `.config` file from the container and give it a |
| 63 | + meaningful name. This is done outside the container. |
| 64 | + |
| 65 | +``` |
| 66 | +$ docker drunk_murdock:/.config arm-linux-gnueabi.config |
| 67 | +``` |
| 68 | + |
| 69 | +- Now you can shutdown the container or repeat the two last steps to generate a |
| 70 | + new `.config` file. |
| 71 | + |
| 72 | +### Toolchain configuration |
| 73 | + |
| 74 | +Changes on top of the default toolchain configuration used to generate the |
| 75 | +`.config` files in this directory. The changes are formatted as follows: |
| 76 | + |
| 77 | +``` |
| 78 | +$category > $option = $value -- $comment |
| 79 | +``` |
| 80 | + |
| 81 | +### `arm-linux-gnueabi.config` |
| 82 | + |
| 83 | +For targets: `arm-unknown-linux-gnueabi` |
| 84 | + |
| 85 | +- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET} |
| 86 | +- Target options > Target Architecture = arm |
| 87 | +- Target options > Architecture level = armv6 -- (+) |
| 88 | +- Target options > Floating point = software (no FPU) -- (\*) |
| 89 | +- Operating System > Target OS = linux |
| 90 | +- Operating System > Linux kernel version = 3.2.72 -- Precise kernel |
| 91 | +- C-library > glibc version = 2.14.1 |
| 92 | +- C compiler > gcc version = 4.9.3 |
| 93 | +- C compiler > C++ = ENABLE -- to cross compile LLVM |
| 94 | + |
| 95 | +### `arm-linux-gnueabihf.config` |
| 96 | + |
| 97 | +For targets: `arm-unknown-linux-gnueabihf` |
| 98 | + |
| 99 | +- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET} |
| 100 | +- Target options > Target Architecture = arm |
| 101 | +- Target options > Architecture level = armv6 -- (+) |
| 102 | +- Target options > Use specific FPU = vfp -- (+) |
| 103 | +- Target options > Floating point = hardware (FPU) -- (\*) |
| 104 | +- Target options > Default instruction set mode = arm -- (+) |
| 105 | +- Operating System > Target OS = linux |
| 106 | +- Operating System > Linux kernel version = 3.2.72 -- Precise kernel |
| 107 | +- C-library > glibc version = 2.14.1 |
| 108 | +- C compiler > gcc version = 4.9.3 |
| 109 | +- C compiler > C++ = ENABLE -- to cross compile LLVM |
| 110 | + |
| 111 | +### `armv7-linux-gnueabihf.config` |
| 112 | + |
| 113 | +For targets: `armv7-unknown-linux-gnueabihf` |
| 114 | + |
| 115 | +- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET} |
| 116 | +- Target options > Target Architecture = arm |
| 117 | +- Target options > Suffix to the arch-part = v7 |
| 118 | +- Target options > Architecture level = armv7-a -- (+) |
| 119 | +- Target options > Use specific FPU = vfpv3-d16 -- (\*) |
| 120 | +- Target options > Floating point = hardware (FPU) -- (\*) |
| 121 | +- Target options > Default instruction set mode = thumb -- (\*) |
| 122 | +- Operating System > Target OS = linux |
| 123 | +- Operating System > Linux kernel version = 3.2.72 -- Precise kernel |
| 124 | +- C-library > glibc version = 2.14.1 |
| 125 | +- C compiler > gcc version = 4.9.3 |
| 126 | +- C compiler > C++ = ENABLE -- to cross compile LLVM |
| 127 | + |
| 128 | +(\*) These options have been selected to match the configuration of the arm |
| 129 | + toolchains shipped with Ubuntu 15.10 |
| 130 | +(+) These options have been selected to match the gcc flags we use to compile C |
| 131 | + libraries like jemalloc. See the mk/cfg/arm(v7)-uknown-linux-gnueabi{,hf}.mk |
| 132 | + file in Rust's source code. |
| 133 | + |
| 134 | +## `aarch64-linux-gnu.config` |
| 135 | + |
| 136 | +For targets: `aarch64-unknown-linux-gnu` |
| 137 | + |
| 138 | +- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET} |
| 139 | +- Target options > Target Architecture = arm |
| 140 | +- Target options > Bitness = 64-bit |
| 141 | +- Operating System > Target OS = linux |
| 142 | +- Operating System > Linux kernel version = 4.2.6 |
| 143 | +- C-library > glibc version = 2.17 -- aarch64 support was introduced in this version |
| 144 | +- C compiler > gcc version = 5.2.0 |
| 145 | +- C compiler > C++ = ENABLE -- to cross compile LLVM |
0 commit comments