Skip to content
This repository was archived by the owner on Nov 21, 2018. It is now read-only.

prepare for binary releases of std for arm-musl #109

Merged
merged 1 commit into from
Jul 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions slaves/linux-cross/Dockerfile
Original file line number Diff line number Diff line change
@@ -51,10 +51,13 @@ RUN /bin/bash build_toolchain_root.sh && \
COPY linux-cross/build_toolchain.sh \
linux-cross/aarch64-linux-gnu.config \
linux-cross/arm-linux-gnueabi.config \
linux-cross/arm-linux-musleabi.config \
linux-cross/arm-linux-gnueabihf.config \
linux-cross/arm-linux-musleabihf.config \
linux-cross/mips-linux-musl.config \
linux-cross/mipsel-linux-musl.config \
linux-cross/armv7-linux-gnueabihf.config \
linux-cross/armv7-linux-musleabihf.config \
/build/
USER rustbuild

@@ -98,6 +101,11 @@ RUN /bin/bash build_toolchain.sh mipsel-linux-musl
# for armv7 instead of for armv6 should make rustc (slightly) faster.
RUN /bin/bash build_toolchain.sh armv7-linux-gnueabihf

# Build a bunch of toolchains for ARM musl targets
RUN /bin/bash build_toolchain.sh arm-linux-musleabi
RUN /bin/bash build_toolchain.sh arm-linux-musleabihf
RUN /bin/bash build_toolchain.sh armv7-linux-musleabihf

USER root

# Rename all the compilers we just built into /usr/bin and also without
@@ -124,12 +132,27 @@ RUN bash /tmp/build_dragonfly_toolchain.sh
COPY linux-cross/build_netbsd_toolchain.sh /tmp/
RUN bash /tmp/build_netbsd_toolchain.sh

# Also build libunwind.a for the ARM musl targets
COPY linux-cross/build-libunwind.sh \
/build/
RUN /bin/bash build-libunwind.sh arm-unknown-linux-musleabi
RUN /bin/bash build-libunwind.sh arm-unknown-linux-musleabihf
RUN /bin/bash build-libunwind.sh armv7-unknown-linux-musleabihf

# Instruct rustbuild to use the armv7-linux-gnueabihf toolchain instead of the
# default arm-linux-gnueabihf one
ENV AR_armv7_unknown_linux_gnueabihf=armv7-linux-gnueabihf-ar \
CC_armv7_unknown_linux_gnueabihf=armv7-linux-gnueabihf-gcc \
CXX_armv7_unknown_linux_gnueabihf=armv7-linux-gnueabihf-g++ \
AR_arm_unknown_linux_musleabi=arm-linux-musleabi-ar \
CC_arm_unknown_linux_musleabi=arm-linux-musleabi-gcc \
CXX_arm_unknown_linux_musleabi=arm-linux-musleabi-g++ \
AR_arm_unknown_linux_musleabihf=arm-linux-musleabihf-ar \
CC_arm_unknown_linux_musleabihf=arm-linux-musleabihf-gcc \
CXX_arm_unknown_linux_musleabihf=arm-linux-musleabihf-g++ \
AR_armv7_unknown_linux_musleabihf=armv7-linux-musleabihf-ar \
CC_armv7_unknown_linux_musleabihf=armv7-linux-musleabihf-gcc \
CXX_armv7_unknown_linux_musleabihf=armv7-linux-musleabihf-g++ \
AR_x86_64_unknown_freebsd=x86_64-unknown-freebsd10-ar \
CC_x86_64_unknown_freebsd=x86_64-unknown-freebsd10-gcc \
CXX_x86_64_unknown_freebsd=x86_64-unknown-freebsd10-g++ \
47 changes: 47 additions & 0 deletions slaves/linux-cross/README.md
Original file line number Diff line number Diff line change
@@ -89,6 +89,20 @@ For targets: `arm-unknown-linux-gnueabi`
- C compiler > gcc version = 4.9.3
- C compiler > C++ = ENABLE -- to cross compile LLVM

## `arm-linux-musleabi.config`

For targets: `arm-unknown-linux-musleabi`

- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
- Target options > Target Architecture = arm
- Target options > Architecture level = armv6 -- (+)
- Target options > Floating point = software (no FPU) -- (\*)
- Operating System > Target OS = linux
- Operating System > Linux kernel version = 3.2.72 -- Precise kernel
- C-library > C library = musl
- C compiler > gcc version = 5.2.0
- C compiler > C++ = ENABLE -- to cross compile LLVM

## `arm-linux-gnueabihf.config`

For targets: `arm-unknown-linux-gnueabihf`
@@ -105,6 +119,22 @@ For targets: `arm-unknown-linux-gnueabihf`
- C compiler > gcc version = 4.9.3
- C compiler > C++ = ENABLE -- to cross compile LLVM

## `arm-linux-musleabihf.config`

For targets: `arm-unknown-linux-musleabihf`

- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
- Target options > Target Architecture = arm
- Target options > Architecture level = armv6 -- (+)
- Target options > Use specific FPU = vfp -- (+)
- Target options > Floating point = hardware (FPU) -- (\*)
- Target options > Default instruction set mode = arm -- (+)
- Operating System > Target OS = linux
- Operating System > Linux kernel version = 3.2.72 -- Precise kernel
- C-library > C library = musl
- C compiler > gcc version = 5.2.0
- C compiler > C++ = ENABLE -- to cross compile LLVM

## `armv7-linux-gnueabihf.config`

For targets: `armv7-unknown-linux-gnueabihf`
@@ -128,6 +158,23 @@ For targets: `armv7-unknown-linux-gnueabihf`
libraries like jemalloc. See the mk/cfg/arm(v7)-uknown-linux-gnueabi{,hf}.mk
file in Rust's source code.

## `armv7-linux-musleabihf.config`

For targets: `armv7-unknown-linux-musleabihf`

- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}
- Target options > Target Architecture = arm
- Target options > Suffix to the arch-part = v7
- Target options > Architecture level = armv7-a -- (+)
- Target options > Use specific FPU = vfpv3-d16 -- (\*)
- Target options > Floating point = hardware (FPU) -- (\*)
- Target options > Default instruction set mode = thumb -- (\*)
- Operating System > Target OS = linux
- Operating System > Linux kernel version = 3.2.72 -- Precise kernel
- C-library > C library = musl
- C compiler > gcc version = 5.2.0
- C compiler > C++ = ENABLE -- to cross compile LLVM

## `aarch64-linux-gnu.config`

For targets: `aarch64-unknown-linux-gnu`
527 changes: 527 additions & 0 deletions slaves/linux-cross/arm-linux-musleabi.config

Large diffs are not rendered by default.

528 changes: 528 additions & 0 deletions slaves/linux-cross/arm-linux-musleabihf.config

Large diffs are not rendered by default.

522 changes: 522 additions & 0 deletions slaves/linux-cross/armv7-linux-musleabihf.config

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions slaves/linux-cross/build-libunwind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -ex

# To build MUSL targets we're going to need a libunwind lying around, so acquire that
# here and build it.
if [ ! -d "llvm-3.8.0.src" ]; then
curl http://llvm.org/releases/3.8.0/llvm-3.8.0.src.tar.xz | tar xJf -
fi

if [ ! -d "libunwind-3.8.0.src" ]; then
curl http://llvm.org/releases/3.8.0/libunwind-3.8.0.src.tar.xz | tar xJf -
fi

rm -rf libunwind-build
mkdir libunwind-build
cd libunwind-build
CC=${1/unknown-/}-gcc CXX=${1/unknown-/}-gcc cmake \
../libunwind-3.8.0.src \
-DLLVM_PATH=../llvm-3.8.0.src \
-DLIBUNWIND_ENABLE_SHARED=0
VERBOSE=1 make -j1
cp lib/libunwind.a /x-tools/${1}/${1}/sysroot/usr/lib/