-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,34 @@ | ||
# docker buildx build --tag clang-p2996 --progress=plain -f .github/DockerClang --load . | ||
# docker tag clang-p2996 yaraslaut/clang-p2996 | ||
# docker push yaraslaut/clang-p2996 | ||
FROM ubuntu:latest | ||
FROM ubuntu:latest AS builder | ||
|
||
#git clone -b p2996 https://github.com/bloomberg/clang-p2996.git && \ | ||
#git clone -b p2996 https://github.com/Yaraslaut/clang-p2996.git && \ | ||
WORKDIR / | ||
RUN apt-get update | ||
RUN bash -c "\ | ||
set -ex && \ | ||
apt-get install -y cmake python3 ninja-build git lsb-release software-properties-common wget binutils gcc g++ && \ | ||
wget https://apt.llvm.org/llvm.sh && \ | ||
chmod +x llvm.sh && \ | ||
./llvm.sh 18 && \ | ||
git clone -b p2996 https://github.com/Yaraslaut/clang-p2996.git && \ | ||
cmake -S /clang-p2996/llvm \ | ||
RUN apt-get install -y cmake python3 ninja-build git lsb-release software-properties-common wget binutils gcc g++ | ||
RUN wget https://apt.llvm.org/llvm.sh | ||
RUN chmod +x llvm.sh | ||
RUN ./llvm.sh 19 | ||
RUN git clone -b p2996 https://github.com/bloomberg/clang-p2996.git | ||
RUN cmake -S /clang-p2996/llvm \ | ||
-B build \ | ||
-G Ninja \ | ||
-D CMAKE_CXX_COMPILER=clang++-18 \ | ||
-D CMAKE_C_COMPILER=clang-18 \ | ||
-D CMAKE_CXX_COMPILER=clang++-19 \ | ||
-D CMAKE_C_COMPILER=clang-19 \ | ||
-D CMAKE_BUILD_TYPE=Release \ | ||
-D CMAKE_INSTALL_PREFIX=\/usr \ | ||
-D LLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind'\ | ||
-D LLVM_ENABLE_PROJECTS=clang\ | ||
-D LLVM_TARGETS_TO_BUILD=X86 && \ | ||
cmake --build build --parallel && \ | ||
cmake --build build --target install && \ | ||
echo "/usr/lib/x86_64-unknown-linux-gnu" >> /etc/ld.so.conf.d/x86_64-linux-gnu.conf && \ | ||
ldconfig && \ | ||
rm -rf /build && \ | ||
rm -rf /clang-p2996" | ||
-D LLVM_TARGETS_TO_BUILD=X86 | ||
RUN cmake --build build --parallel | ||
RUN cmake --install build --prefix /tmp/clang-install | ||
|
||
FROM ubuntu:latest | ||
# Install packages for minimal useful image. | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends build-essential ca-certificates libcurl4-openssl-dev cmake make wget python3 sudo curl ninja-build git binutils && \ | ||
rm -rf /var/lib/apt/lists/* | ||
# Copy build results of stage 1 to /usr/local. | ||
COPY --from=builder /tmp/clang-install/ /usr/local/ | ||
RUN P=`/usr/local/bin/clang++ -v 2>&1 | grep Target | cut -d' ' -f2-`; echo /usr/local/lib/$P > /etc/ld.so.conf.d/$P.conf | ||
RUN ldconfig |