-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade mariner images to LLVM 16 #840
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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
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
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,43 +1,35 @@ | ||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-builder-local AS builder | ||
ARG ROOTFS_DIR=/crossrootfs/x86 | ||
|
||
# Provides LLVMConfig.cmake, needed to build compiler-rt. Only needed on x86. | ||
# x64 doesn't need this because we use compiler-rt from the mariner package. | ||
# arm/arm64 don't need this because LLVMConfig.cmake is provided by the LLVM we build from source. | ||
RUN tdnf install -y llvm-devel | ||
|
||
RUN /scripts/eng/common/cross/build-rootfs.sh x86 xenial --skipunmount | ||
|
||
# Build compiler-rt profile library for PGO instrumentation | ||
RUN mkdir compiler-rt_build && cd compiler-rt_build && \ | ||
BUILD_FLAGS="-v --sysroot=$ROOTFS_DIR" \ | ||
TARGET_TRIPLE=i386-linux-gnu && \ | ||
cmake ../llvm-project.src/compiler-rt \ | ||
-DCOMPILER_RT_BUILD_PROFILE=ON \ | ||
-DCOMPILER_RT_BUILD_BUILTINS=OFF \ | ||
-DCOMPILER_RT_BUILD_CRT=OFF \ | ||
-DCOMPILER_RT_BUILD_MEMPROF=OFF \ | ||
-DCOMPILER_RT_BUILD_GWP_ASAN=OFF \ | ||
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \ | ||
-DCOMPILER_RT_BUILD_XRAY=OFF \ | ||
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ | ||
-DCOMPILER_RT_BUILD_ORC=OFF \ | ||
\ | ||
-DCMAKE_C_COMPILER=clang \ | ||
-DCMAKE_CXX_COMPILER=clang++ \ | ||
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ | ||
-DCMAKE_C_COMPILER_TARGET=${TARGET_TRIPLE} \ | ||
-DCMAKE_CXX_COMPILER_TARGET=${TARGET_TRIPLE} \ | ||
-DLLVM_CONFIG_PATH=llvm-config \ | ||
-DCMAKE_C_COMPILER_TARGET="i386-linux-gnu" \ | ||
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=$ROOTFS_DIR/usr \ | ||
-DCMAKE_C_FLAGS="${BUILD_FLAGS}" \ | ||
-DCMAKE_CXX_FLAGS="${BUILD_FLAGS}" && \ | ||
-DCMAKE_C_FLAGS="-v --sysroot=$ROOTFS_DIR" && \ | ||
make -j $(getconf _NPROCESSORS_ONLN) | ||
|
||
RUN LLVM_VERSION=12.0.1 LLVM_VERSION_MAJOR="${LLVM_VERSION%%.*}" && \ | ||
RUN LLVM_VERSION=16.0.0 LLVM_VERSION_MAJOR="${LLVM_VERSION%%.*}" && \ | ||
mkdir -p $ROOTFS_DIR/usr/lib/llvm-${LLVM_VERSION_MAJOR}/lib/clang/${LLVM_VERSION}/lib/linux/ && \ | ||
cp compiler-rt_build/lib/linux/libclang_rt.profile-i386.a $ROOTFS_DIR/usr/lib/llvm-${LLVM_VERSION_MAJOR}/lib/clang/${LLVM_VERSION}/lib/linux/ | ||
|
||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-amd64-local | ||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-llvm-local | ||
ARG ROOTFS_DIR=/crossrootfs/x86 | ||
|
||
COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR |
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crossdeps-builder
has extra contents (mostly sources and intermediate build outputs) that shouldn't be included in the final image, so we use it to build llvm, then only copy what we need out of it (llvm binaries, compiler-rt profile shared lib).crossdeps-llvm
is a shared base image for the othercross-ARCH
images, since it has the llvm cross-compiler. It is only one layer on top ofcrossdeps
.crossdeps
is used as the base image for bothcrossdeps-llvm
andcrossdeps-builder
.