Skip to content

Commit 0a7420a

Browse files
committed
travis: Move glibc backwards in time
This commit updates the compilers for many of the artifacts that we're producing on Travis. These compilers are all compiled by crosstool-ng as they're currently done for the images in which we're building all our cross compiled compilers. The purpose of this commit is that when we ship binaries the artifacts won't require a newer glibc, but rather be as compatible as possible with Linux distributions by working with a very old version of glibc. This commit always allocates a new matrix entry for the i686/x86_64 builder. This builder is dedicated to just producing artifacts and eventually we'll expand it to building other tools like Cargo and the RLS. The other builders testing i686 and x86_64 won't use these historical toolchains.
1 parent c07a6ae commit 0a7420a

19 files changed

+2857
-34
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ matrix:
2323
- env: IMAGE=dist-powerpc-linux DEPLOY=1
2424
- env: IMAGE=dist-powerpc64-linux DEPLOY=1
2525
- env: IMAGE=dist-s390x-linux-netbsd DEPLOY=1
26-
- env: IMAGE=i686-gnu DEPLOY=1
26+
- env: IMAGE=dist-x86-linux DEPLOY=1
27+
- env: IMAGE=i686-gnu
2728
- env: IMAGE=i686-gnu-nopt
28-
- env: IMAGE=x86_64-gnu DEPLOY=1
29+
- env: IMAGE=x86_64-gnu
2930
- env: IMAGE=x86_64-gnu-full-bootstrap
3031
- env: IMAGE=x86_64-gnu-aux
3132
- env: IMAGE=x86_64-gnu-debug

src/ci/docker/README.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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

src/ci/docker/dist-arm-linux/Dockerfile

Lines changed: 72 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
FROM ubuntu:16.04
22

33
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
automake \
5+
bison \
6+
bzip2 \
7+
ca-certificates \
8+
cmake \
9+
curl \
10+
file \
11+
flex \
412
g++ \
13+
gawk \
14+
gdb \
15+
git \
16+
gperf \
17+
help2man \
18+
libncurses-dev \
19+
libtool-bin \
520
make \
6-
file \
7-
curl \
8-
ca-certificates \
21+
patch \
922
python2.7 \
10-
git \
11-
cmake \
1223
sudo \
13-
gdb \
14-
xz-utils \
15-
g++-arm-linux-gnueabi \
16-
g++-arm-linux-gnueabihf
24+
texinfo \
25+
wget \
26+
xz-utils
1727

1828
ENV SCCACHE_DIGEST=7237e38e029342fa27b7ac25412cb9d52554008b12389727320bd533fd7f05b6a96d55485f305caf95e5c8f5f97c3313e10012ccad3e752aba2518f3522ba783
1929
RUN curl -L https://api.pub.build.mozilla.org/tooltool/sha512/$SCCACHE_DIGEST | \
@@ -24,6 +34,59 @@ RUN curl -OL https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-ini
2434
rm dumb-init_*.deb
2535
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
2636

37+
# Ubuntu 16.04 (this contianer) ships with make 4, but something in the
38+
# toolchains we build below chokes on that, so go back to make 3
39+
RUN curl https://ftp.gnu.org/gnu/make/make-3.81.tar.gz | tar xzf - && \
40+
cd make-3.81 && \
41+
./configure --prefix=/usr && \
42+
make && \
43+
make install && \
44+
cd .. && \
45+
rm -rf make-3.81
46+
47+
RUN curl http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.22.0.tar.bz2 | \
48+
tar xjf - && \
49+
cd crosstool-ng && \
50+
./configure --prefix=/usr/local && \
51+
make -j$(nproc) && \
52+
make install && \
53+
cd .. && \
54+
rm -rf crosstool-ng
55+
56+
RUN groupadd -r rustbuild && useradd -m -r -g rustbuild rustbuild
57+
RUN mkdir /x-tools && chown rustbuild:rustbuild /x-tools
58+
USER rustbuild
59+
WORKDIR /tmp
60+
61+
COPY arm-linux-gnueabi.config /tmp/
62+
RUN mkdir build && \
63+
cd build && \
64+
cp ../arm-linux-gnueabi.config .config && \
65+
ct-ng oldconfig && \
66+
ct-ng build && \
67+
cd .. && \
68+
rm -rf build
69+
COPY arm-linux-gnueabihf.config /tmp/
70+
RUN mkdir build && \
71+
cd build && \
72+
cp ../arm-linux-gnueabihf.config .config && \
73+
ct-ng oldconfig && \
74+
ct-ng build && \
75+
cd .. && \
76+
rm -rf build
77+
78+
USER root
79+
80+
ENV PATH=$PATH:/x-tools/arm-unknown-linux-gnueabi/bin
81+
ENV PATH=$PATH:/x-tools/arm-unknown-linux-gnueabihf/bin
82+
83+
ENV CC_arm_unknown_linux_gnueabi=arm-unknown-linux-gnueabi-gcc \
84+
AR_arm_unknown_linux_gnueabi=arm-unknown-linux-gnueabi-ar \
85+
CXX_arm_unknown_linux_gnueabi=arm-unknown-linux-gnueabi-g++ \
86+
CC_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-gcc \
87+
AR_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-ar \
88+
CXX_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-g++
89+
2790
ENV RUST_CONFIGURE_ARGS \
2891
--host=arm-unknown-linux-gnueabi,arm-unknown-linux-gnueabihf
2992
ENV SCRIPT \

0 commit comments

Comments
 (0)