diff --git a/src/cbl-mariner/2.0/cross/arm-alpine/Dockerfile b/src/cbl-mariner/2.0/cross/arm-alpine/Dockerfile new file mode 100644 index 000000000..79ed300fd --- /dev/null +++ b/src/cbl-mariner/2.0/cross/arm-alpine/Dockerfile @@ -0,0 +1,10 @@ +FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-builder-local AS builder +ARG ROOTFS_DIR=/crossrootfs/arm + +RUN /scripts/eng/common/cross/build-rootfs.sh arm alpine3.13 --skipunmount + + +FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-arm-local +ARG ROOTFS_DIR=/crossrootfs/arm + +COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR diff --git a/src/cbl-mariner/2.0/cross/arm/Dockerfile b/src/cbl-mariner/2.0/cross/arm/Dockerfile new file mode 100644 index 000000000..623520852 --- /dev/null +++ b/src/cbl-mariner/2.0/cross/arm/Dockerfile @@ -0,0 +1,40 @@ +FROM mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-crossdeps-builder-local AS builder +ARG ROOTFS_DIR=/crossrootfs/arm + +RUN tdnf install -y debootstrap + +RUN /scripts/eng/common/cross/build-rootfs.sh arm 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=arm-linux-gnueabihf && \ + cmake ../llvm-project.src/compiler-rt \ + -DCOMPILER_RT_BUILD_PROFILE=ON \ + -DCOMPILER_RT_BUILD_BUILTINS=OFF \ + -DCOMPILER_RT_BUILD_SANITIZERS=OFF \ + -DCOMPILER_RT_BUILD_XRAY=OFF \ + -DCOMPILER_RT_BUILD_LIBFUZZER=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 \ + -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}" && \ + make -j $(getconf _NPROCESSORS_ONLN) + +RUN LLVM_VERSION=12.0.1 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-armhf.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-arm-local +ARG ROOTFS_DIR=/crossrootfs/arm + +COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR diff --git a/src/cbl-mariner/manifest.json b/src/cbl-mariner/manifest.json index bd76c7b5b..04b073966 100644 --- a/src/cbl-mariner/manifest.json +++ b/src/cbl-mariner/manifest.json @@ -132,6 +132,32 @@ } ] }, + { + "platforms": [ + { + "dockerfile": "src/cbl-mariner/2.0/cross/arm", + "os": "linux", + "osVersion": "cbl-mariner2.0", + "tags": { + "cbl-mariner-2.0-cross-arm-$(System:TimeStamp)-$(System:DockerfileGitCommitSha)": {}, + "cbl-mariner-2.0-cross-arm$(FloatingTagSuffix)": {} + } + } + ] + }, + { + "platforms": [ + { + "dockerfile": "src/cbl-mariner/2.0/cross/arm-alpine", + "os": "linux", + "osVersion": "cbl-mariner2.0", + "tags": { + "cbl-mariner-2.0-cross-arm-alpine-$(System:TimeStamp)-$(System:DockerfileGitCommitSha)": {}, + "cbl-mariner-2.0-cross-arm-alpine$(FloatingTagSuffix)": {} + } + } + ] + }, { "platforms": [ {