From ba7372fbffc6948878e887d4974d14bcbf8cb9f1 Mon Sep 17 00:00:00 2001 From: Andrii Radyk Date: Wed, 23 May 2018 00:18:03 +0200 Subject: [PATCH] add musl as libc --- .travis.yml | 4 ++-- ci/openssl.sh | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 390baa4..8813b9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,8 @@ script: - cargo build --verbose --all - cargo test --verbose --all before_deploy: - - sudo bash -x ci/openssl.sh linux-x86_64 - - OPENSSL_STATIC=yes OPENSSL_LIB_DIR=/openssl/lib OPENSSL_INCLUDE_DIR=/openssl/include cargo build --release + - sudo bash -x ci/openssl.sh linux-x86_64 musl- -static + - CC_x86_64_unknown_linux_musl=musl-gcc OPENSSL_STATIC=yes OPENSSL_LIB_DIR=/openssl/lib OPENSSL_INCLUDE_DIR=/openssl/include cargo build --release - tar -C target/release -czf $(pwd)/s3find-$TRAVIS_TAG-x86_64-$TRAVIS_OS_NAME.tar.gz s3find deploy: api_key: diff --git a/ci/openssl.sh b/ci/openssl.sh index 24c80cb..2e27b55 100644 --- a/ci/openssl.sh +++ b/ci/openssl.sh @@ -10,6 +10,7 @@ main() { local version=1.0.2m local os=$1 \ triple=$2 + local m_version=1.1.15 local dependencies=( ca-certificates @@ -32,6 +33,22 @@ main() { fi done + local td=$(mktemp -d) + + pushd $td + curl https://www.musl-libc.org/releases/musl-$m_version.tar.gz | \ + tar --strip-components=1 -xz + + CFLAGS="-fPIC ${@:3}" ./configure \ + --disable-shared \ + --prefix=/usr/local \ + $(test -z $target || echo --target=$target) + nice make -j$(nproc) + nice make install + ln -s /usr/bin/ar /usr/local/bin/musl-ar + + popd + td=$(mktemp -d) pushd $td