Skip to content

Commit

Permalink
Fix bindgen issues (aws-lc-rs) when cross-compiling for armv6hf
Browse files Browse the repository at this point in the history
Signed-off-by: Dariusz Olszewski <[email protected]>
  • Loading branch information
starypatyk committed Jan 25, 2025
1 parent 6bb009a commit 765f1f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contrib/cross-compile-armv6hf/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ FROM --platform=linux/amd64 ubuntu:18.04

# Install common packages.
RUN apt-get update
RUN apt-get install -y -qq git curl build-essential libasound2-dev libpulse-dev
RUN apt-get install -y -qq git curl build-essential cmake clang libclang-dev libasound2-dev libpulse-dev

# Install armhf packages.
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic main" | tee -a /etc/apt/sources.list
Expand Down
10 changes: 7 additions & 3 deletions contrib/cross-compile-armv6hf/docker-build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/usr/bin/env bash
set -eux

PI1_TOOLS_DIR="/pi/tools/arm-bcm2708/arm-linux-gnueabihf"
cargo install --force --locked bindgen-cli

PI1_TOOLS_DIR=/pi/tools/arm-bcm2708/arm-linux-gnueabihf
PI1_TOOLS_SYSROOT_DIR=$PI1_TOOLS_DIR/arm-linux-gnueabihf/sysroot

PI1_LIB_DIRS=(
"$PI1_TOOLS_DIR/arm-linux-gnueabihf/sysroot/lib"
"$PI1_TOOLS_DIR/arm-linux-gnueabihf/sysroot/usr/lib"
"$PI1_TOOLS_SYSROOT_DIR/lib"
"$PI1_TOOLS_SYSROOT_DIR/usr/lib"
"/sysroot/usr/lib/arm-linux-gnueabihf"
)
export RUSTFLAGS="-C linker=$PI1_TOOLS_DIR/bin/arm-linux-gnueabihf-gcc ${PI1_LIB_DIRS[*]/#/-L}"
export BINDGEN_EXTRA_CLANG_ARGS=--sysroot=$PI1_TOOLS_SYSROOT_DIR

cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features "alsa-backend with-libmdns"

0 comments on commit 765f1f2

Please sign in to comment.