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:
8 ./src/ci/docker/run.sh $image_name
14 ./src/ci/docker/run.sh x86_64-gnu
17 Images will output artifacts in an `obj` dir at the root of a repository.
21 - Each directory, excluding `scripts` and `disabled`, corresponds to a docker image
22 - `scripts` contains files shared by docker images
23 - `disabled` contains images that are not built on travis
25 ## Docker Toolbox on Windows
27 For Windows before Windows 10, the docker images can be run on Windows via
28 [Docker Toolbox]. There are several preparation needs to be made before running
31 1. Stop the virtual machine from the terminal with `docker-machine stop`
33 2. If your Rust source is placed outside of `C:\Users\**`, e.g. if you place the
34 repository in the `E:\rust` folder, please add a shared folder from
37 1. Select the "default" virtual machine inside VirtualBox, then click
39 2. Go to "Shared Folders", click "Add shared foldrer" (the folder icon with
40 a plus sign), fill in the following information, then click "OK":
42 * Folder path: `E:\rust`
43 * Folder name: `e/rust`
44 * Read-only: ☐ *unchecked*
45 * Auto-mount: ☑ *checked*
46 * Make Permanant: ☑ *checked*
48 3. VirtualBox might not support creating symbolic links inside a shared folder
49 by default. You can enable it manually by running these from `cmd.exe`:
52 cd "C:\Program Files\Oracle\VirtualBox"
53 VBoxManage setextradata default VBoxInternal2/SharedFoldersEnableSymlinksCreate/e/rust 1
58 4. Restart the virtual machine from terminal with `docker-machine start`.
62 1. Launch the "Docker Quickstart Terminal".
63 2. Execute `./src/ci/docker/run.sh $image_name` as explained at the beginning.
65 [Docker Toolbox]: https://www.docker.com/products/docker-toolbox
69 A number of these images take quite a long time to compile as they're building
70 whole gcc toolchains to do cross builds with. Much of this is relatively
71 self-explanatory but some images use [crosstool-ng] which isn't quite as self
72 explanatory. Below is a description of where these `*.config` files come form,
73 how to generate them, and how the existing ones were generated.
75 [crosstool-ng]: https://github.com/crosstool-ng/crosstool-ng
77 ### Generating a `.config` file
79 If you have a `linux-cross` image lying around you can use that and skip the
82 - First we spin up a container and copy `build_toolchain_root.sh` into it. All
83 these steps are outside the container:
86 # Note: We use ubuntu:15.10 because that's the "base" of linux-cross Docker
88 $ docker run -it ubuntu:15.10 bash
90 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
91 cfbec05ed730 ubuntu:15.10 "bash" 16 seconds ago Up 15 seconds drunk_murdock
92 $ docker cp build_toolchain_root.sh drunk_murdock:/
95 - Then inside the container we build crosstool-ng by simply calling the bash
96 script we copied in the previous step:
99 $ bash build_toolchain_root.sh
102 - Now, inside the container run the following command to configure the
103 toolchain. To get a clue of which options need to be changed check the next
104 section and come back.
110 - Finally, we retrieve the `.config` file from the container and give it a
111 meaningful name. This is done outside the container.
114 $ docker drunk_murdock:/.config arm-linux-gnueabi.config
117 - Now you can shutdown the container or repeat the two last steps to generate a
120 ### Toolchain configuration
122 Changes on top of the default toolchain configuration used to generate the
123 `.config` files in this directory. The changes are formatted as follows:
126 $category > $option = $value -- $comment
129 ### `arm-linux-gnueabi.config`
131 For targets: `arm-unknown-linux-gnueabi`
133 - Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
134 - Target options > Target Architecture = arm
135 - Target options > Architecture level = armv6 -- (+)
136 - Target options > Floating point = software (no FPU) -- (\*)
137 - Operating System > Target OS = linux
138 - Operating System > Linux kernel version = 3.2.72 -- Precise kernel
139 - C-library > glibc version = 2.14.1
140 - C compiler > gcc version = 4.9.3
141 - C compiler > C++ = ENABLE -- to cross compile LLVM
143 ### `arm-linux-gnueabihf.config`
145 For targets: `arm-unknown-linux-gnueabihf`
147 - Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
148 - Target options > Target Architecture = arm
149 - Target options > Architecture level = armv6 -- (+)
150 - Target options > Use specific FPU = vfp -- (+)
151 - Target options > Floating point = hardware (FPU) -- (\*)
152 - Target options > Default instruction set mode = arm -- (+)
153 - Operating System > Target OS = linux
154 - Operating System > Linux kernel version = 3.2.72 -- Precise kernel
155 - C-library > glibc version = 2.14.1
156 - C compiler > gcc version = 4.9.3
157 - C compiler > C++ = ENABLE -- to cross compile LLVM
159 ### `armv7-linux-gnueabihf.config`
161 For targets: `armv7-unknown-linux-gnueabihf`
163 - Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
164 - Target options > Target Architecture = arm
165 - Target options > Suffix to the arch-part = v7
166 - Target options > Architecture level = armv7-a -- (+)
167 - Target options > Use specific FPU = vfpv3-d16 -- (\*)
168 - Target options > Floating point = hardware (FPU) -- (\*)
169 - Target options > Default instruction set mode = thumb -- (\*)
170 - Operating System > Target OS = linux
171 - Operating System > Linux kernel version = 3.2.72 -- Precise kernel
172 - C-library > glibc version = 2.14.1
173 - C compiler > gcc version = 4.9.3
174 - C compiler > C++ = ENABLE -- to cross compile LLVM
176 (\*) These options have been selected to match the configuration of the arm
177 toolchains shipped with Ubuntu 15.10
178 (+) These options have been selected to match the gcc flags we use to compile C
179 libraries like jemalloc. See the mk/cfg/arm(v7)-uknown-linux-gnueabi{,hf}.mk
180 file in Rust's source code.
182 ### `aarch64-linux-gnu.config`
184 For targets: `aarch64-unknown-linux-gnu`
186 - Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
187 - Target options > Target Architecture = arm
188 - Target options > Bitness = 64-bit
189 - Operating System > Target OS = linux
190 - Operating System > Linux kernel version = 4.2.6
191 - C-library > glibc version = 2.17 -- aarch64 support was introduced in this version
192 - C compiler > gcc version = 5.2.0
193 - C compiler > C++ = ENABLE -- to cross compile LLVM
195 ### `powerpc-linux-gnu.config`
197 For targets: `powerpc-unknown-linux-gnu`
199 - Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
200 - Path and misc options > Patches origin = Bundled, then local
201 - Path and misc options > Local patch directory = /tmp/patches
202 - Target options > Target Architecture = powerpc
203 - Target options > Emit assembly for CPU = powerpc -- pure 32-bit PowerPC
204 - Operating System > Target OS = linux
205 - Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
206 - C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
207 - C compiler > gcc version = 4.9.3
208 - C compiler > C++ = ENABLE -- to cross compile LLVM
210 ### `powerpc64-linux-gnu.config`
212 For targets: `powerpc64-unknown-linux-gnu`
214 - Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
215 - Path and misc options > Patches origin = Bundled, then local
216 - Path and misc options > Local patch directory = /tmp/patches
217 - Target options > Target Architecture = powerpc
218 - Target options > Bitness = 64-bit
219 - Target options > Emit assembly for CPU = power4 -- (+)
220 - Target options > Tune for CPU = power6 -- (+)
221 - Operating System > Target OS = linux
222 - Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
223 - C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
224 - C compiler > gcc version = 4.9.3
225 - C compiler > C++ = ENABLE -- to cross compile LLVM
227 (+) These CPU options match the configuration of the toolchains in RHEL6.
229 ### `s390x-linux-gnu.config`
231 For targets: `s390x-unknown-linux-gnu`
233 - Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
234 - Path and misc options > Patches origin = Bundled, then local
235 - Path and misc options > Local patch directory = /build/patches
236 - Target options > Target Architecture = s390
237 - Target options > Bitness = 64-bit
238 - Operating System > Target OS = linux
239 - Operating System > Linux kernel version = 2.6.32.68 -- ~RHEL6 kernel
240 - C-library > glibc version = 2.12.2 -- ~RHEL6 glibc
241 - C compiler > gcc version = 4.9.3
242 - C compiler > gcc extra config = --with-arch=z10 -- LLVM's minimum support
243 - C compiler > C++ = ENABLE -- to cross compile LLVM