Skip to content

Commit 884640b

Browse files
committed
fix arm cross compilation
1 parent b6188b4 commit 884640b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ RUN apt-get update && \
1818
echo arm-linux-gnueabihf-gcc > LINKER && \
1919
apt-get install -y gcc-arm-linux-gnueabihf libgcc-s1-armhf-cross cmake libclang1 libc6-dev-armhf-cross && \
2020
cargo install --force --locked bindgen-cli && \
21+
echo "-I/usr/lib/gcc-cross/arm-linux-gnueabihf/12/include -I/usr/arm-linux-gnueabihf/include" > BINDGEN_EXTRA_CLANG_ARGS; \
2122
cp /usr/arm-linux-gnueabihf/lib/libgcc_s.so.1 .; \
2223
else \
2324
echo "Unsupported cross compilation target: $TARGETARCH"; \
@@ -28,7 +29,8 @@ RUN apt-get update && \
2829

2930
# Build dependencies (creates a layer that avoids recompiling dependencies on every build)
3031
COPY Cargo.toml Cargo.lock ./
31-
RUN cargo build \
32+
RUN BINDGEN_EXTRA_CLANG_ARGS=$(cat BINDGEN_EXTRA_CLANG_ARGS || true) \
33+
cargo build \
3234
--target $(cat TARGET) \
3335
--config target.$(cat TARGET).linker='"'$(cat LINKER)'"' \
3436
--profile superoptimized

0 commit comments

Comments
 (0)