-
Notifications
You must be signed in to change notification settings - Fork 26
linux-cross: use glibc-2.14/gcc-4.8 for the arm toolchain #69
Changes from 1 commit
2a8a424
2004de6
3b19b3a
65cdb54
c12d174
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,6 @@ RUN apt-get install -y --force-yes --no-install-recommends \ | |
curl make git wget file \ | ||
python-dev python-pip stunnel \ | ||
g++ gcc libc6-dev \ | ||
gcc-4.7-arm-linux-gnueabi libc6-dev-armel-cross \ | ||
gcc-4.7-arm-linux-gnueabihf libc6-dev-armhf-cross \ | ||
gcc-4.8-aarch64-linux-gnu libc6-dev-arm64-cross \ | ||
gcc-4.8-powerpc-linux-gnu libc6-dev-powerpc-cross \ | ||
gcc-4.8-powerpc64le-linux-gnu libc6-dev-ppc64el-cross \ | ||
|
@@ -38,6 +36,30 @@ RUN pip install buildbot-slave | |
RUN groupadd -r rustbuild && useradd -r -g rustbuild rustbuild | ||
RUN mkdir /buildslave && chown rustbuild:rustbuild /buildslave | ||
|
||
# Install arm cross compiler | ||
WORKDIR /build | ||
COPY linux-cross/build_arm_toolchain_root.sh /build/ | ||
RUN /bin/bash build_arm_toolchain_root.sh && chown rustbuild:rustbuild /build | ||
RUN mkdir /x-tools && chown rustbuild:rustbuild /x-tools | ||
COPY linux-cross/build_arm_toolchain.sh /build/ | ||
COPY linux-cross/arm-linux-gnueabi.config /build/ | ||
COPY linux-cross/arm-linux-gnueabihf.config /build/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can collapse these all into one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed! |
||
USER rustbuild | ||
RUN /bin/bash build_arm_toolchain.sh arm-linux-gnueabi | ||
RUN /bin/bash build_arm_toolchain.sh arm-linux-gnueabihf | ||
USER root | ||
RUN rm -rf /build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've found that not having a bunch of intermediate artifacts can hugely reduce the size of docker containers, could this be done as part of each step? Some examples I've done in the past are:
(or something like that) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Great tip! I'll try to condense these commands as much as possible. |
||
|
||
RUN \ | ||
for f in `ls /x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-*`; do \ | ||
g=`basename $f`; \ | ||
ln -vs $f /usr/bin/`echo $g | sed -e 's/-unknown//'`; \ | ||
done && \ | ||
for f in `ls /x-tools/arm-unknown-linux-gnueabihf/bin/arm-unknown-linux-gnueabihf-*`; do \ | ||
g=`basename $f`; \ | ||
ln -vs $f /usr/bin/`echo $g | sed -e 's/-unknown//'`; \ | ||
done | ||
|
||
# When running this container, startup buildbot | ||
WORKDIR /buildslave | ||
USER rustbuild | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to
chown
? rustbuild shouldn't want to modify anything in these directories, right? It's fine to just run all the builds asroot
I think.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a catch here's that I forgot to mention. crosstool-ng can't be run as root, so we run it under the rustbuild user. That's the reason
/x-tools
directory needs to be writable by rustbuild.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha! makes sense to me, could you throw a comment here about that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!