Add one musl targets (the arm ones don't build)

This commit is contained in:
finn 2022-03-27 19:52:14 -07:00
parent 46e568ac2a
commit 44fee7f025
3 changed files with 17 additions and 5 deletions

View file

@ -11,10 +11,14 @@ variables:
matrix: matrix:
- TARGET: - TARGET:
- aarch64-unknown-linux-gnu - aarch64-unknown-linux-gnu
# - aarch64-unknown-linux-musl
- arm-unknown-linux-gnueabi - arm-unknown-linux-gnueabi
- arm-unknown-linux-gnueabihf - arm-unknown-linux-gnueabihf
# - arm-unknown-linux-musleabihf
- armv7-unknown-linux-gnueabihf - armv7-unknown-linux-gnueabihf
# - armv7-unknown-linux-musleabihf
- x86_64-unknown-linux-gnu - x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
rules: rules:
- when: on_success - when: on_success
@ -28,7 +32,7 @@ compile:
- git clone https://github.com/signalapp/libsignal-client - git clone https://github.com/signalapp/libsignal-client
- cd libsignal-client && git checkout "$libsignal_version" - cd libsignal-client && git checkout "$libsignal_version"
- rustup target add "${TARGET}" - rustup target add "${TARGET}"
- RUSTFLAGS='-C link-arg=-s' cargo build -p libsignal-jni --target "${TARGET}" --release --verbose - RUSTFLAGS="$(../rustflags.sh)" cargo build -p libsignal-jni --target "${TARGET}" --release --verbose
- cp -v target/${TARGET}/release/libsignal_jni.so ../libsignal_jni-${TARGET}.so - cp -v target/${TARGET}/release/libsignal_jni.so ../libsignal_jni-${TARGET}.so
artifacts: artifacts:
paths: paths:

View file

@ -5,16 +5,16 @@ apt-get update
PACKAGES="git" PACKAGES="git"
case "${TARGET}" in case "${TARGET}" in
aarch64-unknown-linux-gnu) aarch64-unknown-linux-gnu|aarch64-unknown-linux-musl)
apt-get install -y "${PACKAGES}" {cpp,g++,gcc}-aarch64-linux-gnu apt-get install -y "${PACKAGES}" {cpp,g++,gcc}-aarch64-linux-gnu
;; ;;
arm-unknown-linux-gnueabi) arm-unknown-linux-gnueabi|arm-unknown-linux-musleabi)
apt-get install -y "${PACKAGES}" {cpp,g++,gcc}-arm-linux-gnueabi apt-get install -y "${PACKAGES}" {cpp,g++,gcc}-arm-linux-gnueabi
;; ;;
arm-unknown-linux-gnueabihf) arm-unknown-linux-gnueabihf|arm-unknown-linux-musleabihf)
apt-get install -y "${PACKAGES}" {cpp,g++,gcc}-arm-linux-gnueabihf apt-get install -y "${PACKAGES}" {cpp,g++,gcc}-arm-linux-gnueabihf
;; ;;
armv7-unknown-linux-gnueabihf) armv7-unknown-linux-gnueabihf|armv7-unknown-linux-musleabihf)
apt-get install -y "${PACKAGES}" {cpp,g++,gcc}-arm-linux-gnueabihf apt-get install -y "${PACKAGES}" {cpp,g++,gcc}-arm-linux-gnueabihf
;; ;;
*) *)

8
rustflags.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/bash
flags="-C link-arg=-s"
if [[ "${TARGET}" == *musl ]]; then
flags="${flags} -C target-feature=-crt-static"
fi
echo "${flags}"