Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build using glibc 2.17 #249

Merged
merged 2 commits into from
Jun 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions build-version.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -euxo pipefail

GLIBC_VERSION="${GLIBC_VERSION:-2.17}"

cd "$(dirname "$0")"

CRATE=${1?"USAGE: $0 CRATE"}
Expand Down Expand Up @@ -93,19 +95,14 @@ else
exit 1
fi

# Install cargo-zigbuild if necessary
if [ "$TARGET_ARCH" == "aarch64-unknown-linux-gnu" ]; then
install_zig_cc_and_config_to_use_it
elif [ "$TARGET_ARCH" == "x86_64-unknown-linux-musl" ]; then
install_zig_cc_and_config_to_use_it
elif [ "$TARGET_ARCH" == "aarch64-unknown-linux-musl" ]; then
install_zig_cc_and_config_to_use_it
elif [ "$TARGET_ARCH" == "armv7-unknown-linux-musleabihf" ]; then
install_zig_cc_and_config_to_use_it
elif [ "$TARGET_ARCH" == "armv7-unknown-linux-gnueabihf" ]; then
if [[ "$TARGET_ARCH" == *"-linux-"* ]]; then
install_zig_cc_and_config_to_use_it
fi

if [[ "$TARGET_ARCH" == *"-linux-gnu"* ]]; then
CARGO_TARGET_ARCH="${TARGET_ARCH}.${GLIBC_VERSION}"
fi

# Install rustup target
rustup target add "$TARGET_ARCH"

Expand All @@ -120,7 +117,7 @@ build_and_install() {
# shellcheck disable=SC2086
cargo-auditable auditable install "$CRATE" \
--version "$VERSION" \
--target "$TARGET_ARCH" \
--target "${CARGO_TARGET_ARCH:-$TARGET_ARCH}" \
--root "$CARGO_ROOT" \
${1:-} \
$no_default_features \
Expand Down