From a097ff6d35546fed1ebb4a9ad2c5f181381c5113 Mon Sep 17 00:00:00 2001
From: Alex Crichton <alex@alexcrichton.com>
Date: Fri, 26 Aug 2016 19:48:54 -0700
Subject: [PATCH] Add ci for i686-unknown-linux-musl

---
 .travis.yml                                  |  3 +++
 ci/docker/i686-unknown-linux-musl/Dockerfile | 13 +++++++++++++
 libc-test/Cargo.lock                         | 16 +++++++++++-----
 libc-test/Cargo.toml                         |  3 +++
 4 files changed, 30 insertions(+), 5 deletions(-)
 create mode 100644 ci/docker/i686-unknown-linux-musl/Dockerfile

diff --git a/.travis.yml b/.travis.yml
index e258303a..75f53307 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -55,6 +55,9 @@ matrix:
     - os: linux
       env: TARGET=x86_64-unknown-linux-musl
       rust: stable
+    - os: linux
+      env: TARGET=i686-unknown-linux-musl
+      rust: stable
     - os: linux
       env: TARGET=arm-unknown-linux-gnueabihf
       rust: stable
diff --git a/ci/docker/i686-unknown-linux-musl/Dockerfile b/ci/docker/i686-unknown-linux-musl/Dockerfile
new file mode 100644
index 00000000..89d60ff7
--- /dev/null
+++ b/ci/docker/i686-unknown-linux-musl/Dockerfile
@@ -0,0 +1,13 @@
+FROM ubuntu:16.04
+
+RUN apt-get update
+RUN apt-get install -y --no-install-recommends \
+  gcc make libc6-dev git curl ca-certificates
+RUN curl https://www.musl-libc.org/releases/musl-1.1.14.tar.gz | \
+    tar xzf - && \
+    cd musl-1.1.14 && \
+    CFLAGS=-m32 ./configure --prefix=/musl-i686 --disable-shared --target=i686 && \
+    make install -j4 && \
+    cd .. && \
+    rm -rf musl-1.1.14
+ENV PATH=$PATH:/musl-i686/bin:/rust/bin
diff --git a/libc-test/Cargo.lock b/libc-test/Cargo.lock
index d15562dc..55914754 100644
--- a/libc-test/Cargo.lock
+++ b/libc-test/Cargo.lock
@@ -16,21 +16,27 @@ name = "ctest"
 version = "0.1.0"
 source = "git+https://github.com/alexcrichton/ctest#a6becb6d7fd23d9863cba86eac31d1ffc4082734"
 dependencies = [
- "gcc 0.3.28 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)",
  "syntex_syntax 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "gcc"
-version = "0.3.28"
+version = "0.3.35"
+source = "git+https://github.com/alexcrichton/gcc-rs#03e22a4425c011fa8c96681591432456fa70d60c"
+
+[[package]]
+name = "gcc"
+version = "0.3.35"
 source = "registry+https://github.com/rust-lang/crates.io-index"
+replace = "gcc 0.3.35 (git+https://github.com/alexcrichton/gcc-rs)"
 
 [[package]]
 name = "kernel32-sys"
 version = "0.2.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
@@ -72,7 +78,7 @@ version = "0.2.14"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
@@ -82,7 +88,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "winapi"
-version = "0.2.6"
+version = "0.2.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml
index 9ff47657..dfcf127c 100644
--- a/libc-test/Cargo.toml
+++ b/libc-test/Cargo.toml
@@ -9,3 +9,6 @@ libc = { path = ".." }
 
 [build-dependencies]
 ctest = { git = "https://github.com/alexcrichton/ctest" }
+
+[replace]
+"gcc:0.3.35" = { git = "https://github.com/alexcrichton/gcc-rs" }
-- 
GitLab