-
-
Notifications
You must be signed in to change notification settings - Fork 83
/
Dockerfile.clang
27 lines (22 loc) · 967 Bytes
/
Dockerfile.clang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
ARG BASE=msvc-wine
FROM $BASE
RUN apt-get update && \
apt-get install -y curl xz-utils && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
# Newer versions of Ubuntu also provide a new enough version of Clang/lld
# to work with MSVC 2022 headers/libs, but clang-cl is only available with
# a version suffix, like "clang-cl-14" anyway.
RUN curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz && \
tar -Jxf clang+llvm*.tar.xz && \
rm clang+llvm*.tar.xz && \
mv clang+llvm* /opt/clang
ENV PATH=/opt/clang/bin:$PATH
COPY test/hello.c ./
RUN \
for arch in x86 x64 arm arm64; do \
(BIN=/opt/msvc/bin/$arch . /opt/msvc/msvcenv-native.sh && \
clang-cl --target=$TARGET_TRIPLE hello.c -fuse-ld=lld -Fehello-$arch.exe && \
clang --target=$TARGET_TRIPLE hello.c -fuse-ld=lld -o hello-$arch.exe \
) || exit 1; \
done