Skip to content

Commit 6f06325

Browse files
martellmartell
authored and
martell
committed
Add x86_64-unknown-linux-musl build support
1 parent 819ddda commit 6f06325

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ matrix:
3131
- { <<: *linux, env: SKIP_TESTS=1 TARGET=mips64-unknown-linux-gnuabi64 }
3232
- { <<: *linux, env: SKIP_TESTS=1 TARGET=mips64el-unknown-linux-gnuabi64 }
3333
- { <<: *linux, env: SKIP_TESTS=1 TARGET=s390x-unknown-linux-gnu }
34+
- { <<: *linux, env: SKIP_TESTS=1 TARGET=x86_64-unknown-linux-musl }
3435
- { <<: *linux, env: SKIP_TESTS=1 TARGET=arm-linux-androideabi }
3536
- { <<: *linux, env: SKIP_TESTS=1 TARGET=armv7-linux-androideabi }
3637
- { <<: *linux, env: SKIP_TESTS=1 TARGET=aarch64-linux-android }

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ platform of your choice:
659659
- [x86_64-pc-windows-msvc](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe)<sup>[](#vs2015)</sup>
660660
- [x86_64-unknown-freebsd](https://static.rust-lang.org/rustup/dist/x86_64-unknown-freebsd/rustup-init)
661661
- [x86_64-unknown-linux-gnu](https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init)
662+
- [x86_64-unknown-linux-musl](https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-musl/rustup-init)
662663
- [x86_64-unknown-netbsd](https://static.rust-lang.org/rustup/dist/x86_64-unknown-netbsd/rustup-init)
663664

664665
<a name="vs2015">†</a>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM alpine:3.9
2+
3+
RUN apk update && \
4+
apk add \
5+
curl \
6+
ca-certificates \
7+
perl \
8+
make \
9+
gcc
10+
11+
ENV CC_x86_64_unknown_linux_musl=gcc

rustup-init.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,18 @@ get_endianness() {
172172
}
173173

174174
get_architecture() {
175-
local _ostype _cputype _bitness _arch
175+
local _ostype _cputype _bitness _arch _clibtype
176176
_ostype="$(uname -s)"
177177
_cputype="$(uname -m)"
178+
_clibtype="gnu"
178179

179180
if [ "$_ostype" = Linux ]; then
180181
if [ "$(uname -o)" = Android ]; then
181182
_ostype=Android
182183
fi
184+
if [ "$(ldd --version 2>&1 | grep 'musl')" ]; then
185+
_clibtype="musl"
186+
fi
183187
fi
184188

185189
if [ "$_ostype" = Darwin ] && [ "$_cputype" = i386 ]; then
@@ -196,7 +200,7 @@ get_architecture() {
196200
;;
197201

198202
Linux)
199-
_ostype=unknown-linux-gnu
203+
_ostype=unknown-linux-$_clibtype
200204
_bitness=$(get_bitness)
201205
;;
202206

0 commit comments

Comments
 (0)