Skip to content

Instantly share code, notes, and snippets.

@michaelsproul
Last active November 22, 2021 01:30
Show Gist options
  • Save michaelsproul/4423ed2e627007c69558846fb409d543 to your computer and use it in GitHub Desktop.
Save michaelsproul/4423ed2e627007c69558846fb409d543 to your computer and use it in GitHub Desktop.
Cross with Clang Dockerfiles
FROM rustembedded/cross:aarch64-unknown-linux-gnu-0.2.1
RUN dpkg --add-architecture arm64 && \
apt-get update && \
apt-get install -y apt-transport-https wget && \
(wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -) && \
printf "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-12 main\ndeb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-12 main" > /etc/apt/sources.list.d/backports.list && \
apt-get update && \
apt-get install -y llvm-3.9-dev libclang-3.9-dev clang-3.9 && \
apt-get purge -y apt-transport-https wget
# See: https://github.com/rust-lang/rust-bindgen/issues/1229
ENV BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/usr/aarch64-linux-gnu"
FROM rustembedded/cross:x86_64-unknown-linux-gnu-0.2.1
RUN apt-get update && \
apt-get install -y apt-transport-https wget && \
(wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -) && \
printf "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-12 main\ndeb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-12 main" > /etc/apt/sources.list.d/backports.list && \
apt-get update && \
apt-get install -y llvm-3.9-dev libclang-3.9-dev clang-3.9 && \
apt-get purge -y apt-transport-https wget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment