left some arch-specific stuff in there

This commit is contained in:
finn 2022-12-20 02:20:10 -08:00
parent 66d5bc11d8
commit a0fe6aeead
2 changed files with 30 additions and 9 deletions

View file

@ -43,13 +43,10 @@ compile:
- rustup toolchain install nightly
- rustup target add "${TARGET}"
- if [[ -d ../target ]]; then mv ../target target; fi
- RUSTFLAGS="$(../rustflags.sh)" CARGO_BUILD_TARGET=${TARGET} cargo build -p libsignal-jni --target "${TARGET}" --release --verbose
- . ../rustflags.sh
- cargo build -p libsignal-jni --target "${TARGET}" --release --verbose
- cp -v target/${TARGET}/release/libsignal_jni.so ../libsignal_jni-${TARGET}.so
- cp -r target/ ../target
variables:
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++
CPATH: /usr/aarch64-linux-gnu/include
cache:
paths:
- target/

View file

@ -1,8 +1,32 @@
#!/bin/bash
flags="-C link-arg=-s"
#!/bin/bash -exuo pipefail
RUSTFLAGS="-C link-arg=-s"
if [[ "${TARGET}" == *musl ]]; then
flags="${flags} -C target-feature=-crt-static"
RUSTFLAGS="${flags} -C target-feature=-crt-static"
fi
echo "${flags}"
export RUSTFLAGS="${RUSTFLAGS}"
target_debian=""
case "${TARGET}" in
aarch64-unknown-linux-gnu|aarch64-unknown-linux-musl)
target_debian="aarch64-linux-gnu"
;;
arm-unknown-linux-gnueabi|arm-unknown-linux-musleabi)
target_debian="arm-linux-gnueabi"
;;
arm-unknown-linux-gnueabihf|arm-unknown-linux-musleabihf)
target_debian="arm-linux-gnueabihf"
;;
armv7-unknown-linux-gnueabihf|armv7-unknown-linux-musleabihf)
target_debian="arm-linux-gnueabihf"
;;
esac
if [[ "${target_debian}" != "" ]]; then
export CC="${target_debian}-gcc"
export CCX="${target_debian}-g++"
export CPATH="/usr/${target_debian}/include"
fi
export CARGO_BUILD_TARGET="${TARGET}"