Skip to content

Commit 0ae9072

Browse files
committed
fix Dockerfile: enhance cross-compilation setup by adding clang and updating BINDGEN_EXTRA_CLANG_ARGS
1 parent fbde06e commit 0ae9072

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ RUN apt-get update && \
2121
echo armv7-unknown-linux-gnueabihf > TARGET && \
2222
echo arm-linux-gnueabihf-gcc > LINKER && \
2323
dpkg --add-architecture armhf && apt-get update && \
24-
apt-get install -y gcc-arm-linux-gnueabihf libgcc-s1-armhf-cross cmake libclang1 unixodbc-dev:armhf libodbc2:armhf libltdl7:armhf && \
24+
apt-get install -y gcc-arm-linux-gnueabihf libgcc-s1-armhf-cross cmake libclang1 clang unixodbc-dev:armhf libodbc2:armhf libltdl7:armhf && \
2525
cargo install --force --locked bindgen-cli && \
26-
echo "-I/usr/lib/gcc-cross/arm-linux-gnueabihf/12/include -I/usr/arm-linux-gnueabihf/include" > BINDGEN_EXTRA_CLANG_ARGS; \
26+
SYSROOT=$(arm-linux-gnueabihf-gcc -print-sysroot); \
27+
echo "--sysroot=$SYSROOT -I$SYSROOT/usr/include -I$SYSROOT/usr/include/arm-linux-gnueabihf" > BINDGEN_EXTRA_CLANG_ARGS; \
2728
LIBDIR="/lib/arm-linux-gnueabihf"; \
2829
USRLIBDIR="/usr/lib/arm-linux-gnueabihf"; \
2930
else \

0 commit comments

Comments
 (0)