From 8735c945507a3b4215df5c92de429364c907eda8 Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Thu, 9 Feb 2023 11:12:29 -0800 Subject: [PATCH 01/82] Enable x64 Alpine crossbuild This change enables cross-building for Alpine x64 on other x64 distro. --- eng/common/cross/build-rootfs.sh | 1 + eng/common/cross/toolchain.cmake | 6 ++++-- eng/native/tryrun.cmake | 5 +++-- src/native/libs/System.Globalization.Native/CMakeLists.txt | 2 +- .../libs/System.Security.Cryptography.Native/CMakeLists.txt | 4 ++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 1ebf454f3cf284..65d37efeedaba0 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -177,6 +177,7 @@ while :; do ;; x64) __BuildArch=x64 + __AlpineArch=x86_64 __UbuntuArch=amd64 __FreeBSDArch=amd64 __FreeBSDMachineArch=amd64 diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index ccfb9951a52cb7..aee390e48c51ec 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -76,7 +76,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "s390x") set(TOOLCHAIN "s390x-linux-gnu") elseif(TARGET_ARCH_NAME STREQUAL "x64") set(CMAKE_SYSTEM_PROCESSOR x86_64) - if(LINUX) + if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/x86_64-alpine-linux-musl) + set(TOOLCHAIN "x86_64-alpine-linux-musl") + elseif(LINUX) set(TOOLCHAIN "x86_64-linux-gnu") if(TIZEN) set(TIZEN_TOOLCHAIN "x86_64-tizen-linux-gnu/9.2.0") @@ -279,7 +281,7 @@ endif() # Specify compile options -if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU) +if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x|x64)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) diff --git a/eng/native/tryrun.cmake b/eng/native/tryrun.cmake index ed330fd25d4326..571f8eb3b25944 100644 --- a/eng/native/tryrun.cmake +++ b/eng/native/tryrun.cmake @@ -12,6 +12,7 @@ if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv7-alpine-linux-musleabihf OR EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/s390x-alpine-linux-musl OR EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/ppc64le-alpine-linux-musl OR EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/i586-alpine-linux-musl OR + EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/x86_64-alpine-linux-musl OR EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/riscv64-alpine-linux-musl) set(ALPINE_LINUX 1) @@ -74,7 +75,7 @@ if(DARWIN) else() message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm64 or x64 is supported for OSX cross build!") endif() -elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|armv6|arm64|loongarch64|riscv64|s390x|ppc64le|x86)$" OR FREEBSD OR ILLUMOS OR TIZEN) +elseif(TARGET_ARCH_NAME MATCHES "^(armel|arm|armv6|arm64|loongarch64|riscv64|s390x|ppc64le|x86|x64)$" OR FREEBSD OR ILLUMOS OR TIZEN) set_cache_value(FILE_OPS_CHECK_FERROR_OF_PREVIOUS_CALL_EXITCODE 1) set_cache_value(GETPWUID_R_SETS_ERRNO_EXITCODE 0) set_cache_value(HAS_POSIX_SEMAPHORES_EXITCODE 0) @@ -160,6 +161,6 @@ else() message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv6, arm64, loongarch64, s390x, ppc64le and x86 are supported!") endif() -if(TARGET_ARCH_NAME MATCHES "^(x86|s390x|armv6|loongarch64|riscv64|ppc64le)$") +if(TARGET_ARCH_NAME MATCHES "^(x86|x64|s390x|armv6|loongarch64|riscv64|ppc64le)$") set_cache_value(HAVE_FUNCTIONAL_PTHREAD_ROBUST_MUTEXES_EXITCODE 0) endif() diff --git a/src/native/libs/System.Globalization.Native/CMakeLists.txt b/src/native/libs/System.Globalization.Native/CMakeLists.txt index bbf9737d6e135d..dbe276b2f01a2c 100644 --- a/src/native/libs/System.Globalization.Native/CMakeLists.txt +++ b/src/native/libs/System.Globalization.Native/CMakeLists.txt @@ -123,7 +123,7 @@ endif() install (TARGETS System.Globalization.Native-Static DESTINATION ${STATIC_LIB_DESTINATION} COMPONENT libs) -if(NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID) +if(NOT CLR_CMAKE_TARGET_OSX AND NOT CLR_CMAKE_TARGET_MACCATALYST AND NOT CLR_CMAKE_TARGET_IOS AND NOT CLR_CMAKE_TARGET_TVOS AND NOT CLR_CMAKE_TARGET_ANDROID AND NOT CLR_CMAKE_TARGET_ALPINE_LINUX) if (GEN_SHARED_LIB) add_custom_command(TARGET System.Globalization.Native POST_BUILD COMMENT "Verifying System.Globalization.Native.so dependencies" diff --git a/src/native/libs/System.Security.Cryptography.Native/CMakeLists.txt b/src/native/libs/System.Security.Cryptography.Native/CMakeLists.txt index 7278e31ca60dbb..d17a0091097bb8 100644 --- a/src/native/libs/System.Security.Cryptography.Native/CMakeLists.txt +++ b/src/native/libs/System.Security.Cryptography.Native/CMakeLists.txt @@ -98,12 +98,12 @@ set_target_properties(System.Security.Cryptography.Native.OpenSsl-Static PROPERT if (GEN_SHARED_LIB) if (FEATURE_DISTRO_AGNOSTIC_SSL) - # on macOS the link step fails with undefined symbols, and the script doesn't run. + # on macOS and Alpine the link step fails with undefined symbols, and the script doesn't run. # if the build succeeds, the script would succeed, except it uses a Linux-only command. # # on Linux, the build will succeed with undefined symbols, then the script reports them # and fails the build for us. - if (NOT APPLE) + if (NOT APPLE AND NOT CLR_CMAKE_TARGET_ALPINE_LINUX) add_custom_command(TARGET System.Security.Cryptography.Native.OpenSsl POST_BUILD COMMENT "Verifying System.Security.Cryptography.Native.OpenSsl.so dependencies" COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/../verify-so.sh From 00849663f7999c03efb7a0b36b783d7c6d5cd1b5 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 22 Feb 2023 23:01:54 +0000 Subject: [PATCH 02/82] Set PKG_CONFIG_SYSROOT_DIR Necessary because pkg-config on mariner is a shim for pkgconf, which doesn't support override variables. --- src/mono/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 6fbfbce25053fd..c624b6af8bc88f 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -707,7 +707,7 @@ elseif(HOST_ANDROID) elseif(HOST_LINUX) include(FindPkgConfig) if(CROSS_ROOTFS) - set(ENV{PKG_CONFIG_ICU_UC_INCLUDEDIR} "${CROSS_ROOTFS}/usr/include") + set(ENV{PKG_CONFIG_SYSROOT_DIR} "${CROSS_ROOTFS}") endif(CROSS_ROOTFS) pkg_check_modules(ICU icu-uc) set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations") From bb39763c44332a0f53a5210bb5347a2161e3f7e6 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 3 Mar 2023 16:58:44 +0000 Subject: [PATCH 03/82] More build fixes - Use lld for LTO instead of ld.gold - Set cross toolchain options for x64 mono build - Prefer llvm-objcopy for mono symbol stripping --- src/coreclr/pgosupport.cmake | 2 +- src/mono/mono.proj | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/coreclr/pgosupport.cmake b/src/coreclr/pgosupport.cmake index 71d90b49e94192..a9337a577f3f58 100644 --- a/src/coreclr/pgosupport.cmake +++ b/src/coreclr/pgosupport.cmake @@ -6,7 +6,7 @@ if(NOT WIN32) # Function required to give CMAKE_REQUIRED_* local scope function(check_have_lto) set(CMAKE_REQUIRED_FLAGS -flto) - set(CMAKE_REQUIRED_LIBRARIES -flto -fuse-ld=gold) + set(CMAKE_REQUIRED_LIBRARIES -flto -fuse-ld=lld) check_cxx_source_compiles("int main() { return 0; }" HAVE_LTO) endfunction(check_have_lto) check_have_lto() diff --git a/src/mono/mono.proj b/src/mono/mono.proj index d6a4a8fbdee567..b91b23b1e22e29 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -307,6 +307,13 @@ <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/lib/pkgconfig" /> + + + <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> + <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x64" /> + <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> + + <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> @@ -652,7 +659,13 @@ <_ObjcopyPrefix Condition="'$(MonoCrossDir)' != '' and '$(Platform)' == 'riscv64'">llvm-objcopy- - + + + + + <_Objcopy Condition="'$(_ObjcopyFound)' == '0'">llvm-objcopy + + From a5f2dbda0a7f77bdc97148d6f35915ff6f0d1bdb Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 6 Mar 2023 23:40:06 +0000 Subject: [PATCH 04/82] test --- build.sh | 1 + eng/common/native/init-compiler.sh | 9 +++++++++ src/coreclr/tools/aot/crossgen2/crossgen2.csproj | 5 +++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index da2ba1a158ec1b..7c25b80ca7cade 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash + source="${BASH_SOURCE[0]}" function is_cygwin_or_mingw() diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh index 7aee4213e1b069..a47b0c5b680b1a 100644 --- a/eng/common/native/init-compiler.sh +++ b/eng/common/native/init-compiler.sh @@ -125,12 +125,21 @@ if [ -z "$CC" ]; then exit 1 fi +>&2 echo HERE +>&2 echo $complier +>&2 echo $majorVersion +>&2 echo $CC +>&2 echo $CXX +>&2 "$CC" -fuse-ld=lld -Wl,--version # Only lld version >= 9 can be considered stable. lld doesn't support s390x. if [ "$compiler" = "clang" ] && [ -n "$majorVersion" ] && [ "$majorVersion" -ge 9 ] && [ "$build_arch" != "s390x" ]; then + >&2 echo HERE2 if "$CC" -fuse-ld=lld -Wl,--version >/dev/null 2>&1; then + >&2 echo HERE3 LDFLAGS="-fuse-ld=lld" fi fi +# exit 23 SCAN_BUILD_COMMAND="$(command -v "scan-build$desired_version")" diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj index ad52edf783d19f..970096bea5c053 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj @@ -64,12 +64,13 @@ clang - + From db7bf3e1c56a1a3896c442be1c8c590b694d52ca Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 7 Mar 2023 23:50:32 +0000 Subject: [PATCH 05/82] Print full clang command to show selected linker --- .../nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets | 1 + 1 file changed, 1 insertion(+) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 5caefcd10b26f1..75134c48b4b208 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -308,6 +308,7 @@ The .NET Foundation licenses this file to you under the MIT license. + From 597a30455ae51c286c0908c82b4285074fee7082 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 8 Mar 2023 06:39:58 +0000 Subject: [PATCH 06/82] Build scripts --- build/arm64-alpine.sh | 10 ++++++++++ build/arm64.sh | 10 ++++++++++ build/x64-alpine.sh | 10 ++++++++++ build/x64.sh | 22 ++++++++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100755 build/arm64-alpine.sh create mode 100755 build/arm64.sh create mode 100755 build/x64-alpine.sh create mode 100755 build/x64.sh diff --git a/build/arm64-alpine.sh b/build/arm64-alpine.sh new file mode 100755 index 00000000000000..230400bcaf75f1 --- /dev/null +++ b/build/arm64-alpine.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +docker run \ + -it \ + --mount 'type=bind,src=/home/svbomer/src/crossBuild,dst=/runtime' \ + --mount 'type=volume,src=root_nuget,dst=/root/.nuget' \ + -e 'ROOTFS_DIR=/crossrootfs/arm64' \ + -w /runtime \ + mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpinelocal \ + ./build.sh -s clr+libs+clr.tools+packs.product --configuration Release --arch arm64 --cross -bl diff --git a/build/arm64.sh b/build/arm64.sh new file mode 100755 index 00000000000000..ba304412e5c6f1 --- /dev/null +++ b/build/arm64.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +docker run \ + -it \ + --mount 'type=bind,src=/home/svbomer/src/crossBuild,dst=/runtime' \ + --mount 'type=volume,src=root_nuget,dst=/root/.nuget' \ + -e 'ROOTFS_DIR=/crossrootfs/arm64' \ + -w /runtime \ + mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64local \ + ./build.sh -s clr+libs+clr.tools+packs.product --configuration Release --arch arm64 --cross -bl diff --git a/build/x64-alpine.sh b/build/x64-alpine.sh new file mode 100755 index 00000000000000..69ffb9595454be --- /dev/null +++ b/build/x64-alpine.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +docker run \ + -it \ + --mount 'type=bind,src=/home/svbomer/src/crossBuild,dst=/runtime' \ + --mount 'type=volume,src=root_nuget,dst=/root/.nuget' \ + -e 'ROOTFS_DIR=/crossrootfs/x64' \ + -w /runtime \ + mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpinelocal \ + ./build.sh -s clr+libs+clr.tools+packs.product --configuration Release --arch x64 --cross -bl diff --git a/build/x64.sh b/build/x64.sh new file mode 100755 index 00000000000000..87a709d91527fd --- /dev/null +++ b/build/x64.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env sh + +docker run \ + -it \ + --mount 'type=bind,src=/home/svbomer/src/crossBuild,dst=/runtime' \ + -e 'ROOTFS_DIR=/crossrootfs/x64' \ + -w /runtime \ + mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64local \ + ./build.sh -c Release --arch x64 --cross -bl --pgoinstrument + + + # "/runtime/src/coreclr/build-runtime.sh" -x64 -release -cross -os linux -pgodatapath "/root/.nuget/packages/optimization.linux-x64.pgo.coreclr/1.0.0-prerelease.23068.4" + + + # --mount 'type=volume,src=root_nuget,dst=/root/.nuget' \ + +# ./build.sh -s clr+libs+clr.tools+packs.product --configuration Release --arch x64 --cross -bl + + # ./src/coreclr/build-runtime.sh -release -x64 -cross -pgoinstrument + + + From 3e5a3660f9970a00b42328a6d4585f9ace5ef9ef Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 10 Mar 2023 07:50:21 +0000 Subject: [PATCH 07/82] Fix x64 -> x64 musl cross-build --- eng/Subsets.props | 13 ++++++++----- eng/liveBuilds.targets | 2 +- eng/native/build-commons.sh | 1 + src/coreclr/build-runtime.sh | 2 +- src/coreclr/tools/aot/crossgen2/crossgen2.csproj | 5 +++-- .../Microsoft.NETCore.App.Crossgen2.sfxproj | 4 ++-- .../sfx/Microsoft.NETCore.App/ReadyToRun.targets | 2 +- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/eng/Subsets.props b/eng/Subsets.props index 047cbeddf7b1ab..b94f03a3994707 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -248,8 +248,9 @@ Category="clr" /> - - + + + - + + @@ -366,8 +368,9 @@ - - + + + diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index 5df409f12a2591..d8133266ef6d83 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -25,7 +25,7 @@ $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'sharedFramework')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'crossgen2')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'ilc-published')) - $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', '$(BuildArchitecture)', 'ilc')) + $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', '$(BuildArchitecture)', 'ilc')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'aotsdk')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'build')) diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh index 7246b091e331cb..2eb11be34fde0a 100755 --- a/eng/native/build-commons.sh +++ b/eng/native/build-commons.sh @@ -421,6 +421,7 @@ while :; do hostarch|-hostarch) if [[ -n "$2" ]]; then __HostArch="$2" + __ExplicitHostArch=1 shift else echo "ERROR: 'hostarch' requires a non-empty option argument" diff --git a/src/coreclr/build-runtime.sh b/src/coreclr/build-runtime.sh index f7474ad2350f4f..228cb987625c33 100755 --- a/src/coreclr/build-runtime.sh +++ b/src/coreclr/build-runtime.sh @@ -114,7 +114,7 @@ __IntermediatesDir="$__ArtifactsIntermediatesDir/$__ConfigTriplet" export __IntermediatesDir __ArtifactsIntermediatesDir -if [[ "$__TargetArch" != "$__HostArch" ]]; then +if [[ "$__ExplicitHostArch" == 1 ]]; then __IntermediatesDir="$__IntermediatesDir/$__HostArch" __BinDir="$__BinDir/$__HostArch" fi diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj index 970096bea5c053..8886bf831e2e36 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj @@ -29,9 +29,10 @@ + true $(CoreCLRILCompilerDir) - $(CoreCLRCrossILCompilerDir) - $(ROOTFS_DIR) + $(CoreCLRCrossILCompilerDir) + $(ROOTFS_DIR) $(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll $(CoreCLRAotSdkDir) $(MicrosoftNetCoreAppRuntimePackRidLibTfmDir) diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj index 81aa510c27b918..ffa80cd3206383 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj @@ -18,7 +18,7 @@ true false - + false false @@ -71,7 +71,7 @@ + Condition="'$(CrossBuild)' != 'true'"> diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets b/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets index d29f12364fe24e..1778c091161d0c 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets @@ -15,7 +15,7 @@ - x64 + $(BuildArchitecture) $(CoreCLRArtifactsPath)\$(CrossDir)\crossgen2\crossgen2.dll true From 4c369f35bee212835099f1c41d7a1605d52834b2 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 14 Mar 2023 21:25:16 +0000 Subject: [PATCH 08/82] Enable thumb-2 in mono build Our custom LLVM build seems to have different defaults when targeting ARM than the clang-12 available in ubuntu. Probably related to https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/commit/b7363248b115339c4fb838fcd3ae43671eedae0a. Passing the -march explicitly should not hurt. --- src/mono/mono.proj | 1 + test/CMakeLists.txt | 61 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 test/CMakeLists.txt diff --git a/src/mono/mono.proj b/src/mono/mono.proj index b91b23b1e22e29..b72d7d00e34f61 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -546,6 +546,7 @@ <_MonoCFLAGS Include="-Wl,--build-id=sha1" /> + <_MonoCFLAGS Condition="'$(Platform)' == 'arm'" Include="-march=armv7-a" /> <_MonoCXXFLAGS Include="-Wl,--build-id=sha1" /> diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 00000000000000..5919bf8a72a1c8 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,61 @@ +cmake_minimum_required(VERSION 3.14.5) + +project(SvenProj) +# print out CHECK_INCLUDE_FILE_C_INCLUDE_DIRS: +message(STATUS "SVEN: CHECK_INCLUDE_FILE_C_INCLUDE_DIRS: ${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}") +# print out CMAKE_REQUIRED_INCLUDES +message(STATUS "SVEN: CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}") + +include(CheckIncludeFile) +include(CheckCCompilerFlag) + +# Print all env vars by runnin env command: +#execute_process(COMMAND env +# OUTPUT_VARIABLE ENVIRONMENT_VARIABLES) +#message(STATUS "SVEN: ENVIRONMENT_VARIABLES: ${ENVIRONMENT_VARIABLES}") +#message(STATUS "SVEN: CC: $ENV{CC}") +#message(STATUS "SVEN: CCC_CC: $ENV{CCC_CC}") +message("SVEN: CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES: ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}") +message("SVEN: CMAKE_C_STANDARD_INCLUDE_DIRECTORIES: ${CMAKE_C_STANDARD_INCLUDE_DIRECTORIES}") +message("SVEN: CMAKE_INCLUDE_PATH: ${CMAKE_INCLUDE_PATH}") +message("SVEN: CMAKE_SYSTEM_INCLUDE_PATH: ${CMAKE_SYSTEM_INCLUDE_PATH}") +message("SVEN: CMAKE_REQUIRED_QUIET: ${CMAKE_REQUIRED_QUIET}") +message("SVEN: CMAKE_FILES_DIRECTORY: ${CMAKE_FILES_DIRECTORY}") +message("SVEN: ${CMAKE_ROOT}") +# Show contents of ${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in +file(READ ${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in _CIF_SOURCE_CONTENT) +message("SVEN: ${_CIF_SOURCE_CONTENT}") + +set(CHECK_INCLUDE_FILE_VAR "/usr/include/malloc.h") + configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c) + try_compile(SVEN_MALLOC_FOUND + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c + COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + ${_CIF_LINK_OPTIONS} + ${_CIF_LINK_LIBRARIES} + CMAKE_FLAGS + -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS} + "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}" + OUTPUT_VARIABLE OUTPUT) + +message("SVEN: OUTPUT: ${OUTPUT}") + +#file(READ ${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in _CIF_SOURCE_CONTENT) +#try_compile(SVEN_MALLOC_FOUND +# SOURCE_FROM_VAR CheckIncludeFile.c _CIF_SOURCE_CONTENT +# COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} +# ${_CIF_LINK_OPTIONS} +# ${_CIF_LINK_LIBRARIES} +# CMAKE_FLAGS +# -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS} +# "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}" +# ) +message("SVEN: SVEN_MALLOC_FOUND: ${SVEN_MALLOC_FOUND}") + + + +check_include_file ("/usr/include/malloc.h" FOUND_MALLOC) +message(STATUS "SVEN: MALLOC? ${FOUND_MALLOC}") +return() From 612c686707151773ae82f907c84d57efe00a6de4 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 24 Mar 2023 00:04:03 +0000 Subject: [PATCH 09/82] Allow cross compiling for x86 --- eng/common/cross/toolchain.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index aee390e48c51ec..d47ad2bb89f52d 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -281,7 +281,7 @@ endif() # Specify compile options -if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x|x64)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU) +if((TARGET_ARCH_NAME MATCHES "^(arm|arm64|armel|armv6|ppc64le|riscv64|s390x|x64|x86)$" AND NOT ANDROID AND NOT FREEBSD) OR ILLUMOS OR HAIKU) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) From a9fd0839a941bcdcd0578b3f6be075fea1cf655e Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 24 Mar 2023 00:05:06 +0000 Subject: [PATCH 10/82] Enable x86 build with lld Allow text relocations. The lld defaults differ from ld, which will add text relocations on demand by default. See https://maskray.me/blog/2020-12-19-lld-and-gnu-linker-incompatibilities --- src/coreclr/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index 9f632a5194ebaa..d1e88b23fec3c3 100644 --- a/src/coreclr/CMakeLists.txt +++ b/src/coreclr/CMakeLists.txt @@ -105,6 +105,10 @@ if(CLR_CMAKE_HOST_UNIX) endif() endif() + if(CLR_CMAKE_TARGET_LINUX AND CLR_CMAKE_TARGET_ARCH_I386) + add_linker_flag(-Wl,-z,notext) + endif() + add_subdirectory(pal) add_subdirectory(hosts) else() From d0a1560e87f2b2561affa09e8d934191f05e2101 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 24 Mar 2023 00:06:00 +0000 Subject: [PATCH 11/82] Fix x86 mono cross-build --- src/mono/mono.proj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index b72d7d00e34f61..3770d118573793 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -314,6 +314,13 @@ <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> + + + <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> + <_MonoBuildEnv Include="TARGET_BUILD_ARCH=x86" /> + <_MonoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/pkgconfig" /> + + <_MonoCMakeArgs Include="-DCMAKE_TOOLCHAIN_FILE=$(CrossToolchainFile)" /> From 2abee9be81159465273f8e5277ef5bad33663231 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 24 Mar 2023 23:22:29 +0000 Subject: [PATCH 12/82] Some cleanup --- build/arm64-alpine.sh | 10 --- build/arm64.sh | 10 --- build/x64-alpine.sh | 10 --- build/x64.sh | 22 ------- eng/common/native/init-compiler.sh | 9 --- .../Microsoft.NETCore.Native.targets | 1 - .../tools/aot/crossgen2/crossgen2.csproj | 3 +- test/CMakeLists.txt | 61 ------------------- 8 files changed, 1 insertion(+), 125 deletions(-) delete mode 100755 build/arm64-alpine.sh delete mode 100755 build/arm64.sh delete mode 100755 build/x64-alpine.sh delete mode 100755 build/x64.sh delete mode 100644 test/CMakeLists.txt diff --git a/build/arm64-alpine.sh b/build/arm64-alpine.sh deleted file mode 100755 index 230400bcaf75f1..00000000000000 --- a/build/arm64-alpine.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -docker run \ - -it \ - --mount 'type=bind,src=/home/svbomer/src/crossBuild,dst=/runtime' \ - --mount 'type=volume,src=root_nuget,dst=/root/.nuget' \ - -e 'ROOTFS_DIR=/crossrootfs/arm64' \ - -w /runtime \ - mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpinelocal \ - ./build.sh -s clr+libs+clr.tools+packs.product --configuration Release --arch arm64 --cross -bl diff --git a/build/arm64.sh b/build/arm64.sh deleted file mode 100755 index ba304412e5c6f1..00000000000000 --- a/build/arm64.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -docker run \ - -it \ - --mount 'type=bind,src=/home/svbomer/src/crossBuild,dst=/runtime' \ - --mount 'type=volume,src=root_nuget,dst=/root/.nuget' \ - -e 'ROOTFS_DIR=/crossrootfs/arm64' \ - -w /runtime \ - mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64local \ - ./build.sh -s clr+libs+clr.tools+packs.product --configuration Release --arch arm64 --cross -bl diff --git a/build/x64-alpine.sh b/build/x64-alpine.sh deleted file mode 100755 index 69ffb9595454be..00000000000000 --- a/build/x64-alpine.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env sh - -docker run \ - -it \ - --mount 'type=bind,src=/home/svbomer/src/crossBuild,dst=/runtime' \ - --mount 'type=volume,src=root_nuget,dst=/root/.nuget' \ - -e 'ROOTFS_DIR=/crossrootfs/x64' \ - -w /runtime \ - mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpinelocal \ - ./build.sh -s clr+libs+clr.tools+packs.product --configuration Release --arch x64 --cross -bl diff --git a/build/x64.sh b/build/x64.sh deleted file mode 100755 index 87a709d91527fd..00000000000000 --- a/build/x64.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env sh - -docker run \ - -it \ - --mount 'type=bind,src=/home/svbomer/src/crossBuild,dst=/runtime' \ - -e 'ROOTFS_DIR=/crossrootfs/x64' \ - -w /runtime \ - mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64local \ - ./build.sh -c Release --arch x64 --cross -bl --pgoinstrument - - - # "/runtime/src/coreclr/build-runtime.sh" -x64 -release -cross -os linux -pgodatapath "/root/.nuget/packages/optimization.linux-x64.pgo.coreclr/1.0.0-prerelease.23068.4" - - - # --mount 'type=volume,src=root_nuget,dst=/root/.nuget' \ - -# ./build.sh -s clr+libs+clr.tools+packs.product --configuration Release --arch x64 --cross -bl - - # ./src/coreclr/build-runtime.sh -release -x64 -cross -pgoinstrument - - - diff --git a/eng/common/native/init-compiler.sh b/eng/common/native/init-compiler.sh index a47b0c5b680b1a..7aee4213e1b069 100644 --- a/eng/common/native/init-compiler.sh +++ b/eng/common/native/init-compiler.sh @@ -125,21 +125,12 @@ if [ -z "$CC" ]; then exit 1 fi ->&2 echo HERE ->&2 echo $complier ->&2 echo $majorVersion ->&2 echo $CC ->&2 echo $CXX ->&2 "$CC" -fuse-ld=lld -Wl,--version # Only lld version >= 9 can be considered stable. lld doesn't support s390x. if [ "$compiler" = "clang" ] && [ -n "$majorVersion" ] && [ "$majorVersion" -ge 9 ] && [ "$build_arch" != "s390x" ]; then - >&2 echo HERE2 if "$CC" -fuse-ld=lld -Wl,--version >/dev/null 2>&1; then - >&2 echo HERE3 LDFLAGS="-fuse-ld=lld" fi fi -# exit 23 SCAN_BUILD_COMMAND="$(command -v "scan-build$desired_version")" diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 75134c48b4b208..5caefcd10b26f1 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -308,7 +308,6 @@ The .NET Foundation licenses this file to you under the MIT license. - diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj index 8886bf831e2e36..4001e46e4926b4 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj @@ -65,13 +65,12 @@ clang - - diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt deleted file mode 100644 index 5919bf8a72a1c8..00000000000000 --- a/test/CMakeLists.txt +++ /dev/null @@ -1,61 +0,0 @@ -cmake_minimum_required(VERSION 3.14.5) - -project(SvenProj) -# print out CHECK_INCLUDE_FILE_C_INCLUDE_DIRS: -message(STATUS "SVEN: CHECK_INCLUDE_FILE_C_INCLUDE_DIRS: ${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}") -# print out CMAKE_REQUIRED_INCLUDES -message(STATUS "SVEN: CMAKE_REQUIRED_INCLUDES: ${CMAKE_REQUIRED_INCLUDES}") - -include(CheckIncludeFile) -include(CheckCCompilerFlag) - -# Print all env vars by runnin env command: -#execute_process(COMMAND env -# OUTPUT_VARIABLE ENVIRONMENT_VARIABLES) -#message(STATUS "SVEN: ENVIRONMENT_VARIABLES: ${ENVIRONMENT_VARIABLES}") -#message(STATUS "SVEN: CC: $ENV{CC}") -#message(STATUS "SVEN: CCC_CC: $ENV{CCC_CC}") -message("SVEN: CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES: ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}") -message("SVEN: CMAKE_C_STANDARD_INCLUDE_DIRECTORIES: ${CMAKE_C_STANDARD_INCLUDE_DIRECTORIES}") -message("SVEN: CMAKE_INCLUDE_PATH: ${CMAKE_INCLUDE_PATH}") -message("SVEN: CMAKE_SYSTEM_INCLUDE_PATH: ${CMAKE_SYSTEM_INCLUDE_PATH}") -message("SVEN: CMAKE_REQUIRED_QUIET: ${CMAKE_REQUIRED_QUIET}") -message("SVEN: CMAKE_FILES_DIRECTORY: ${CMAKE_FILES_DIRECTORY}") -message("SVEN: ${CMAKE_ROOT}") -# Show contents of ${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in -file(READ ${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in _CIF_SOURCE_CONTENT) -message("SVEN: ${_CIF_SOURCE_CONTENT}") - -set(CHECK_INCLUDE_FILE_VAR "/usr/include/malloc.h") - configure_file(${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c) - try_compile(SVEN_MALLOC_FOUND - ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c - COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} - ${_CIF_LINK_OPTIONS} - ${_CIF_LINK_LIBRARIES} - CMAKE_FLAGS - -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS} - "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}" - OUTPUT_VARIABLE OUTPUT) - -message("SVEN: OUTPUT: ${OUTPUT}") - -#file(READ ${CMAKE_ROOT}/Modules/CheckIncludeFile.c.in _CIF_SOURCE_CONTENT) -#try_compile(SVEN_MALLOC_FOUND -# SOURCE_FROM_VAR CheckIncludeFile.c _CIF_SOURCE_CONTENT -# COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -# ${_CIF_LINK_OPTIONS} -# ${_CIF_LINK_LIBRARIES} -# CMAKE_FLAGS -# -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS} -# "${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}" -# ) -message("SVEN: SVEN_MALLOC_FOUND: ${SVEN_MALLOC_FOUND}") - - - -check_include_file ("/usr/include/malloc.h" FOUND_MALLOC) -message(STATUS "SVEN: MALLOC? ${FOUND_MALLOC}") -return() From 54dc6413189247568e54192d7f7f5cf1742b22ed Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 24 Mar 2023 23:42:21 +0000 Subject: [PATCH 13/82] Add gcc-toolchain arg when aot-ing crossgen + more cleanup --- eng/Subsets.props | 2 -- src/coreclr/tools/aot/crossgen2/crossgen2.csproj | 6 +++++- .../Microsoft.NETCore.App.Crossgen2.sfxproj | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/eng/Subsets.props b/eng/Subsets.props index b94f03a3994707..1a79e416fb1a0d 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -249,7 +249,6 @@ - - diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj index 4001e46e4926b4..c908259b0f40f1 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj @@ -40,6 +40,10 @@ false + + + + @@ -66,7 +70,7 @@ diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj index ffa80cd3206383..a1344ea92ca788 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj @@ -18,7 +18,7 @@ true false - + false false From 825a1d9785f06cd14ee30ed7fc552610ecd7b67c Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 27 Mar 2023 21:35:28 +0000 Subject: [PATCH 14/82] Fix AOT compilation of ILCompiler and crossgen2 --- eng/Subsets.props | 1 - .../tools/aot/ILCompiler/ILCompiler.csproj | 43 +++++++++++++++++++ .../tools/aot/crossgen2/crossgen2.csproj | 26 ++++++++++- 3 files changed, 68 insertions(+), 2 deletions(-) diff --git a/eng/Subsets.props b/eng/Subsets.props index 73eb9260fbedff..d184cbc22f3fa0 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -367,7 +367,6 @@ - diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj index db48433db73f85..c4f973d96d5d1d 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj @@ -13,11 +13,54 @@ false false true + + true + $(ROOTFS_DIR) true true true + + + + <_hostOS>$(NETCoreSdkPortableRuntimeIdentifier.SubString(0, $(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-')))) + $(_hostOS) + runtime.$(OSIdentifier)-$(IlcHostArch).Microsoft.DotNet.ILCompiler + + + + + + + + $(RuntimeIdentifier) + + + x86_64 + aarch64 + arm64 + + + $(CrossCompileArch)-linux-gnu + $(CrossCompileArch)-alpine-linux-musl + $(CrossCompileArch)-unknown-freebsd12 + + + + + + + + + + + + - true + lld $(CoreCLRILCompilerDir) $(CoreCLRCrossILCompilerDir) $(ROOTFS_DIR) @@ -62,6 +62,30 @@ + + + + + $(RuntimeIdentifier) + + + x86_64 + aarch64 + arm64 + + + $(CrossCompileArch)-linux-gnu + $(CrossCompileArch)-alpine-linux-musl + $(CrossCompileArch)-unknown-freebsd12 + + + + + + + From c7468f62be10638d324a3e8152f2f5f608c02374 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 27 Mar 2023 22:29:54 +0000 Subject: [PATCH 15/82] Only pass --gcc-toolchain where required To locate gcc toolchain in target sysroot, when host arch matches target arch. --- src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj | 3 +-- src/coreclr/tools/aot/crossgen2/crossgen2.csproj | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj index c4f973d96d5d1d..52f5d7334be56f 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj @@ -57,10 +57,9 @@ - + - - + From ae6c6ab3fe1b7bd36fb979a3799353e259d5b2eb Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 27 Mar 2023 22:37:00 +0000 Subject: [PATCH 16/82] Cleanup --- build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/build.sh b/build.sh index 7c25b80ca7cade..da2ba1a158ec1b 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash - source="${BASH_SOURCE[0]}" function is_cygwin_or_mingw() From 3d7035255a4d0d777535e9ea1afcbf85c37d2d91 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 29 Mar 2023 21:53:00 +0000 Subject: [PATCH 17/82] Fix symbol stripping on ci builds --- .../Microsoft.NETCore.App.Crossgen2.sfxproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj index 3c583fbebbbd96..730ce251e59c4a 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj @@ -22,8 +22,6 @@ false false - llvm-objcopy-15 - aarch64-linux-gnu-objcopy Date: Thu, 30 Mar 2023 00:40:39 +0000 Subject: [PATCH 18/82] Fix nativeaot test build --- src/tests/Directory.Build.targets | 3 +++ src/tests/build.proj | 1 + .../SmokeTests/HardwareIntrinsics/X64Baseline.csproj | 5 +---- .../nativeaot/SmokeTests/HardwareIntrinsics/x64NonVex.csproj | 3 --- .../nativeaot/SmokeTests/HardwareIntrinsics/x64Vex.csproj | 3 --- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index 81b4fc841a8c88..fb619c6efce893 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -664,12 +664,15 @@ $(MicrosoftNetCoreAppRuntimePackNativeDir) $(OutputRid) + lld + $(ROOTFS_DIR) true true $(IlcSdkPath) + diff --git a/src/tests/build.proj b/src/tests/build.proj index 597ec67d803dab..8a00ffa945fe0c 100644 --- a/src/tests/build.proj +++ b/src/tests/build.proj @@ -486,6 +486,7 @@ $(GroupBuildCmd) /nodeReuse:false $(GroupBuildCmd) /maxcpucount $(GroupBuildCmd) /bl:$(ArtifactsDir)/log/$(Configuration)/InnerManagedTestBuild.$(__TestGroupToBuild).binlog + $(GroupBuildCmd) "/p:CrossBuild=true" $(GroupBuildCmd) "/p:DefaultBuildAllTarget=BuildNativeAot" $(GroupBuildCmd) "/p:IlcMultiModule=true" $(GroupBuildCmd) "/p:BuildNativeAotFrameworkObjects=true" diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj index 28fc56a41439c4..02add3ff86fafd 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj @@ -7,10 +7,7 @@ true $(DefineConstants);BASELINE_INTRINSICS true - - - objcopy - + diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64NonVex.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64NonVex.csproj index c00af0ea752e47..86c1e23e9dfa51 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64NonVex.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64NonVex.csproj @@ -7,9 +7,6 @@ true $(DefineConstants);NON_VEX_INTRINSICS true - - - objcopy diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64Vex.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64Vex.csproj index 92ad8638993057..d485e9dae32cc8 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64Vex.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64Vex.csproj @@ -7,9 +7,6 @@ true $(DefineConstants);VEX_INTRINSICS true - - - objcopy From f6bd3e5ca324bdaa9b3d4e9c882ece15eecf3a42 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 30 Mar 2023 21:29:27 +0000 Subject: [PATCH 19/82] Pick up mariner images, set cross-build arguments --- eng/pipelines/common/platform-matrix.yml | 2 ++ .../common/templates/pipeline-with-resources.yml | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 6e7736b584fffa..06f685f47ee01a 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -108,6 +108,7 @@ jobs: runtimeFlavor: ${{ parameters.runtimeFlavor }} buildConfig: ${{ parameters.buildConfig }} helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true ${{ insert }}: ${{ parameters.jobParameters }} # Linux musl arm @@ -222,6 +223,7 @@ jobs: runtimeFlavor: ${{ parameters.runtimeFlavor }} buildConfig: ${{ parameters.buildConfig }} helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true ${{ insert }}: ${{ parameters.jobParameters }} # Linux x86 diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index e849da704781cb..65545bc80d011f 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -15,12 +15,14 @@ resources: ROOTFS_DIR: /crossrootfs/armv6 - container: linux_arm64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-arm64 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64 env: ROOTFS_DIR: /crossrootfs/arm64 - container: linux_musl_x64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.13-WithNode + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpine + env: + ROOTFS_DIR: /crossrootfs/x64 - container: linux_musl_arm image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm-alpine @@ -28,7 +30,7 @@ resources: ROOTFS_DIR: /crossrootfs/arm - container: linux_musl_arm64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm64-alpine + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpine env: ROOTFS_DIR: /crossrootfs/arm64 # This container contains all required toolsets to build for Android and for Linux with bionic libc. @@ -37,10 +39,12 @@ resources: image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-android - container: linux_x64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64 + env: + ROOTFS_DIR: /crossrootfs/x64 - container: linux_x86 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-x86-linux + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-x86 env: ROOTFS_DIR: /crossrootfs/x86 From e9f17fb8e07d351b5173be90c0b5b8f1282d01fe Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Mar 2023 16:27:11 +0000 Subject: [PATCH 20/82] Don't use lld on macos --- src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj | 2 +- src/coreclr/tools/aot/crossgen2/crossgen2.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj index 52f5d7334be56f..9bb670788b0a5e 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj @@ -14,7 +14,7 @@ false true - true + true $(ROOTFS_DIR) true true diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj index afa237ba419d58..69b2e5abd04fc6 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj @@ -29,7 +29,7 @@ - lld + lld $(CoreCLRILCompilerDir) $(CoreCLRCrossILCompilerDir) $(ROOTFS_DIR) From 26621ab26083623179182283f52fc2c17b7fff39 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Mar 2023 10:24:15 -0700 Subject: [PATCH 21/82] Update src/coreclr/pgosupport.cmake Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> --- src/coreclr/pgosupport.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/pgosupport.cmake b/src/coreclr/pgosupport.cmake index a9337a577f3f58..edcffea53954fb 100644 --- a/src/coreclr/pgosupport.cmake +++ b/src/coreclr/pgosupport.cmake @@ -6,7 +6,7 @@ if(NOT WIN32) # Function required to give CMAKE_REQUIRED_* local scope function(check_have_lto) set(CMAKE_REQUIRED_FLAGS -flto) - set(CMAKE_REQUIRED_LIBRARIES -flto -fuse-ld=lld) + set(CMAKE_REQUIRED_LIBRARIES -flto) check_cxx_source_compiles("int main() { return 0; }" HAVE_LTO) endfunction(check_have_lto) check_have_lto() From 39ca0c0c2a83d94ecd15b640842fbe186f20c1fc Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Mar 2023 17:45:42 +0000 Subject: [PATCH 22/82] Don't pass clang9 --- .../templates/runtimes/build-test-job.yml | 17 +---------------- .../coreclr/templates/build-jit-job.yml | 11 ----------- eng/pipelines/coreclr/templates/build-job.yml | 11 ----------- 3 files changed, 1 insertion(+), 38 deletions(-) diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index f5f306713fc8eb..5ef0109968a7ea 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -36,11 +36,7 @@ jobs: testGroup: ${{ parameters.testGroup }} pool: ${{ parameters.pool }} dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }} - - ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc'), not(and(eq(parameters.osGroup, 'linux'), eq(parameters.osSubgroup, '_musl'))), not(eq(parameters.osGroup, 'osx'))) }}: - compilerArg: '-clang9' - ${{ if not(and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc'), not(and(eq(parameters.osGroup, 'linux'), eq(parameters.osSubgroup, '_musl'))), not(eq(parameters.osGroup, 'osx')))) }}: - compilerArg: '' + compilerArg: '' # Test jobs should continue on error for internal builds ${{ if eq(variables['System.TeamProject'], 'internal') }}: @@ -74,17 +70,6 @@ jobs: value: 'libs.sfx+libs.oob+clr.iltools /p:RefOnly=true -c Release -ci' - name: compilerArg value: '' - - ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc')) }}: - - name: compilerArg - value: '-clang9' - # We need to use the stable version available on Alpine Linux - - ${{ if and(eq(parameters.osGroup, 'linux'), eq(parameters.osSubgroup, '_musl')) }}: - - name: compilerArg - value: '' - # AppleClang has different version scheme, so we let compiler introspection pick up the available clang from PATH - - ${{ if eq(parameters.osGroup, 'osx') }}: - - name: compilerArg - value: '' - name: runtimeFlavorArgs value: '' diff --git a/eng/pipelines/coreclr/templates/build-jit-job.yml b/eng/pipelines/coreclr/templates/build-jit-job.yml index 8aeaa489f9b1d8..1c4e4541876222 100644 --- a/eng/pipelines/coreclr/templates/build-jit-job.yml +++ b/eng/pipelines/coreclr/templates/build-jit-job.yml @@ -53,17 +53,6 @@ jobs: - name: compilerArg value: '' - - ${{ if ne(parameters.osGroup, 'windows') }}: - - name: compilerArg - value: '-clang9' - # We need to use the stable version available on Alpine Linux - - ${{ if and(eq(parameters.osGroup, 'linux'), eq(parameters.osSubgroup, '_musl')) }}: - - name: compilerArg - value: '' - # AppleClang has different version scheme, so we let compiler introspection pick up the available clang from PATH - - ${{ if eq(parameters.osGroup, 'osx') }}: - - name: compilerArg - value: '' - ${{ if eq(parameters.osGroup, 'windows') }}: - name: PythonScript diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index a7f68e34220559..4e269c0a3d5775 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -86,17 +86,6 @@ jobs: value: '-gcc' - name: publishLogsArtifactPrefix value: 'BuildLogs_CoreCLR_GCC' - - ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc')) }}: - - name: compilerArg - value: '-clang9' - # We need to use the stable version available on Alpine Linux - - ${{ if and(eq(parameters.osGroup, 'linux'), eq(parameters.osSubgroup, '_musl')) }}: - - name: compilerArg - value: '' - # AppleClang has different version scheme, so we let compiler introspection pick up the available clang from PATH - - ${{ if eq(parameters.osGroup, 'osx') }}: - - name: compilerArg - value: '' - ${{ if and(ne(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}: # Variables used to publish packages to blob feed - name: dotnetfeedUrl From 220094a6227c909879a3be8d5a1686021d8755df Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Mar 2023 20:21:54 +0000 Subject: [PATCH 23/82] Fix osx linker in tests too --- src/tests/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Directory.Build.targets b/src/tests/Directory.Build.targets index fb619c6efce893..65b5621ed30faa 100644 --- a/src/tests/Directory.Build.targets +++ b/src/tests/Directory.Build.targets @@ -664,7 +664,7 @@ $(MicrosoftNetCoreAppRuntimePackNativeDir) $(OutputRid) - lld + lld $(ROOTFS_DIR) true true From d4f71e93613cceeaa480fb3818bbe98c58603870 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Mar 2023 21:19:20 +0000 Subject: [PATCH 24/82] Define separate platform for GCC build This allows passing compilerName: gcc without also passing crossBuild: true (which is the new default for the linux_x64 platform). --- eng/pipelines/common/platform-matrix.yml | 22 ++++++++++++++++++++++ eng/pipelines/runtime.yml | 5 ++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 06f685f47ee01a..f00087b2418e7a 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -318,6 +318,28 @@ jobs: isNonPortableSourceBuild: false ${{ insert }}: ${{ parameters.jobParameters }} +# GCC Linux x64 Build + +- ${{ if or(containsValue(parameters.platforms, 'gcc_linux_x64')) }} + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: x64 + targetRid: linux-x64 + platform: linux_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: debian-11-gcc12-amd64 + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + compilerName: gcc + ${{ insert }}: ${{ parameters.jobParameters }} + + # Linux s390x - ${{ if containsValue(parameters.platforms, 'linux_s390x') }}: diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index c3903d3728b895..d1bdece7713d9f 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -100,11 +100,10 @@ extends: jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml buildConfig: checked platforms: - - linux_x64 - container: debian-11-gcc12-amd64 + - gcc_linux_x64 + container: jobParameters: testGroup: innerloop - compilerName: gcc condition: >- or( eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true), From d85c7d66870168995b795bc5c16c687017d83e5f Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Mar 2023 21:54:55 +0000 Subject: [PATCH 25/82] Disable PGO for linux x64 and musl-x64 --- eng/pipelines/common/platform-matrix.yml | 4 ++++ eng/pipelines/coreclr/templates/build-job.yml | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index f00087b2418e7a..086a1bd0f73991 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -109,6 +109,8 @@ jobs: buildConfig: ${{ parameters.buildConfig }} helixQueueGroup: ${{ parameters.helixQueueGroup }} crossBuild: true + # Disable PGO until we get profile data collected with a new clang + pgoType: noPgo ${{ insert }}: ${{ parameters.jobParameters }} # Linux musl arm @@ -224,6 +226,8 @@ jobs: buildConfig: ${{ parameters.buildConfig }} helixQueueGroup: ${{ parameters.helixQueueGroup }} crossBuild: true + # Disable PGO until we get profile data collected with a new clang + pgoType: noPgo ${{ insert }}: ${{ parameters.jobParameters }} # Linux x86 diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 4e269c0a3d5775..a7d99812634591 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -127,6 +127,11 @@ jobs: - ${{ if eq(parameters.pgoType, 'PGO' )}}: - name: pgoInstrumentArg value: '-pgoinstrument ' + - name: noPgoArg + value: '' + - ${{ if eq(parameters.pgoType, 'noPgo' )}}: + - name: noPgoArg + value: '/p:NoPgoOptimize=true ' - name: SignType value: $[ coalesce(variables.OfficialSignType, 'real') ] @@ -190,7 +195,7 @@ jobs: # Build CoreCLR Runtime - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) $(osArg) -ci $(compilerArg) $(clrRuntimeComponentsBuildArg) $(pgoInstrumentArg) $(officialBuildIdArg) $(clrInterpreterBuildArg) $(clrRuntimePortableBuildArg) $(CoreClrPgoDataArg) $(nativeSymbols) + - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) $(osArg) -ci $(compilerArg) $(clrRuntimeComponentsBuildArg) $(pgoInstrumentArg) $(noPgoArg) $(officialBuildIdArg) $(clrInterpreterBuildArg) $(clrRuntimePortableBuildArg) $(CoreClrPgoDataArg) $(nativeSymbols) displayName: Build CoreCLR Runtime - ${{ if eq(parameters.osGroup, 'windows') }}: - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci $(enforcePgoArg) $(pgoInstrumentArg) $(officialBuildIdArg) $(clrInterpreterBuildArg) $(CoreClrPgoDataArg) From 1b3afcb86d0656ad83b46d0d01613ac0f60679ca Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Mar 2023 22:27:11 +0000 Subject: [PATCH 26/82] Build cross tools for x64 and musl-x64 --- eng/pipelines/coreclr/templates/build-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index a7d99812634591..04af0e138ba1dc 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -201,7 +201,7 @@ jobs: - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci $(enforcePgoArg) $(pgoInstrumentArg) $(officialBuildIdArg) $(clrInterpreterBuildArg) $(CoreClrPgoDataArg) displayName: Build CoreCLR Runtime - - ${{ if ne(parameters.archType, 'x64') }}: + - ${{ if or(eq(parameters.crossBuild, 'true'), ne(parameters.archType, 'x64')) }}: - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -hostarch x64 $(osArg) -ci $(compilerArg) -component crosscomponents -cmakeargs "-DCLR_CROSS_COMPONENTS_BUILD=1" $(officialBuildIdArg) $(clrRuntimePortableBuildArg) displayName: Build CoreCLR Cross-Arch Tools (Tools that run on x64 targeting x86) From 938cdf171a42166f3628f68328eede8b26fce273 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Mar 2023 22:51:42 +0000 Subject: [PATCH 27/82] Pass crossArg to mono build --- eng/pipelines/mono/templates/build-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/mono/templates/build-job.yml b/eng/pipelines/mono/templates/build-job.yml index ddce3b6f0070ca..0b68999e0c68a4 100644 --- a/eng/pipelines/mono/templates/build-job.yml +++ b/eng/pipelines/mono/templates/build-job.yml @@ -145,7 +145,7 @@ jobs: # Build - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: ./build$(scriptExt) -subset mono$(msCorDbi)+clr.hosts -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) $(darwinFrameworks) + - script: ./build$(scriptExt) -subset mono$(msCorDbi)+clr.hosts $(crossArg) -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) $(darwinFrameworks) displayName: Build product - ${{ if eq(parameters.osGroup, 'windows') }}: - script: build$(scriptExt) -subset mono$(msCorDbi)+clr.hosts -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) From 749ee9c79b033963be8f306243cb907189c4d73d Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Mar 2023 22:56:46 +0000 Subject: [PATCH 28/82] Pass cross arg in build-test-job.yml --- .../runtimes/build-runtime-tests-and-send-to-helix.yml | 2 +- eng/pipelines/common/templates/runtimes/build-test-job.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml b/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml index 651ecdeed5b4f6..174832216912bd 100644 --- a/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml +++ b/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml @@ -33,7 +33,7 @@ steps: - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) ci ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }} displayName: Build Tests - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) ci os ${{ parameters.osGroup }} ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }} + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(crossArg) ci os ${{ parameters.osGroup }} ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }} displayName: Build Tests diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index 5ef0109968a7ea..4601c7bd609991 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -94,7 +94,7 @@ jobs: displayName: Install native dependencies # Build core/libraries dependencies of test build - - script: $(Build.SourcesDirectory)/build$(scriptExt) $(liveRuntimeBuildParams) $(compilerArg) + - script: $(Build.SourcesDirectory)/build$(scriptExt) $(crossArg) $(liveRuntimeBuildParams) $(compilerArg) displayName: Build coreclr/libs components needed by test build - ${{ if in(parameters.osGroup, 'osx', 'ios', 'tvos') }}: From 6cb0b8ed148648043f9be7c39a805516c156c97a Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Mar 2023 23:07:24 +0000 Subject: [PATCH 29/82] Fix typo --- eng/pipelines/common/platform-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 086a1bd0f73991..91fa4c95a94873 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -324,7 +324,7 @@ jobs: # GCC Linux x64 Build -- ${{ if or(containsValue(parameters.platforms, 'gcc_linux_x64')) }} +- ${{ if containsValue(parameters.platforms, 'gcc_linux_x64') }}: - template: xplat-setup.yml parameters: jobTemplate: ${{ parameters.jobTemplate }} From 96243bdeb0406f390fed6af7d837efe27f97fab4 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 31 Mar 2023 23:38:38 +0000 Subject: [PATCH 30/82] Pass through no-PGO arg in global-build-job.yml --- eng/pipelines/common/global-build-job.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index 80c263eea7c6b4..69e3feab6e8f1f 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -79,6 +79,12 @@ jobs: - name: _crossBuildPropertyArg value: /p:CrossBuild=${{ parameters.crossBuild }} + - name: _noPgoArg + value: '' + - ${{ if eq(parameters.pgoType, 'noPgo' )}}: + - name: _noPgoArg + value: '/p:NoPgoOptimize=true ' + - ${{ if ne(parameters.jobParameters.crossrootfsDir, '') }}: # This is only required for cross builds. - name: ROOTFS_DIR @@ -187,7 +193,7 @@ jobs: - task: CodeQL3000Init@0 displayName: Initialize CodeQL (manually-injected) - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter) $(_buildDarwinFrameworksParameter) $(_overrideTestScriptWindowsCmdParameter) + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) $(_noPgoArg) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter) $(_buildDarwinFrameworksParameter) $(_overrideTestScriptWindowsCmdParameter) displayName: Build product ${{ if eq(parameters.useContinueOnErrorDuringBuild, true) }}: continueOnError: ${{ parameters.shouldContinueOnError }} From b84beba2c98e4d9d5205a5fb6078a288049f69ca Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Sat, 1 Apr 2023 00:03:34 +0000 Subject: [PATCH 31/82] Remove pgoType from job name To fix dependencies between jobs --- eng/pipelines/coreclr/templates/build-job.yml | 5 ++--- eng/pipelines/installer/jobs/build-job.yml | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 04af0e138ba1dc..02b8900f37b81d 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -44,13 +44,12 @@ jobs: name: ${{ format('coreclr_{0}_product_build_{1}{1}_{3}_{4}', parameters.compilerName, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} displayName: ${{ format('GCC Product Build {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} ${{ if and(ne(parameters.testGroup, 'clrTools'), ne(parameters.compilerName, 'gcc')) }}: - name: ${{ format('coreclr_{0}_product_build_{1}{2}_{3}_{4}{5}', + name: ${{ format('coreclr_{0}_product_build_{1}{2}_{3}_{4}', parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, - parameters.buildConfig, - parameters.pgoType) }} + parameters.buildConfig) }} displayName: ${{ format('CoreCLR {0} Product Build {1}{2} {3} {4} {5}', parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, diff --git a/eng/pipelines/installer/jobs/build-job.yml b/eng/pipelines/installer/jobs/build-job.yml index cdcf5a40471da3..53a5fb19ecda25 100644 --- a/eng/pipelines/installer/jobs/build-job.yml +++ b/eng/pipelines/installer/jobs/build-job.yml @@ -278,14 +278,13 @@ jobs: - evaluate_paths - ${{ parameters.dependsOn }} - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: - - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}{6}', + - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, - parameters.liveRuntimeBuildConfig, - parameters.pgoType) }} + parameters.liveRuntimeBuildConfig) }} - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: - libraries_build_${{ format('{0}{1}_{2}_{3}', parameters.osGroup, From c9137b396ea336fd14087cbdd5964e3c4860442d Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Sun, 2 Apr 2023 17:36:01 +0000 Subject: [PATCH 32/82] Pass noPgo arg to native prereqs step Otherwase it sets a variable tha causes pgodatapath to be passed to next step --- eng/pipelines/coreclr/templates/build-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 02b8900f37b81d..8445a22feb9fc1 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -189,7 +189,7 @@ jobs: displayName: Disk Usage before Build # Build/Generate native prerequisites - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.nativeprereqs $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(officialBuildIdArg) -ci /bl:$(Build.SourcesDirectory)artifacts/log/$(buildConfig)/CoreCLRNativePrereqs.binlog + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.nativeprereqs $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(noPgoArg) $(officialBuildIdArg) -ci /bl:$(Build.SourcesDirectory)artifacts/log/$(buildConfig)/CoreCLRNativePrereqs.binlog displayName: Build and generate native prerequisites # Build CoreCLR Runtime From d0d331221811a35bc53a95678bab511bc411f0b5 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Sun, 2 Apr 2023 18:01:25 +0000 Subject: [PATCH 33/82] Fix crossArg not defined for NativeAOT test build --- .../runtimes/build-runtime-tests-and-send-to-helix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml b/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml index 174832216912bd..acf2cc6e9f0a00 100644 --- a/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml +++ b/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml @@ -33,7 +33,7 @@ steps: - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) ci ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }} displayName: Build Tests - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(crossArg) ci os ${{ parameters.osGroup }} ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }} + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(_crossBuildPropertyArg) ci os ${{ parameters.osGroup }} ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }} displayName: Build Tests From ed0c01345cf4b4554d8382cc8596b2aa9b9328a1 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Sun, 2 Apr 2023 18:34:43 +0000 Subject: [PATCH 34/82] Pass crossBuild through build-test-job.yml To ensure it reaches common pri0 test build --- eng/pipelines/common/templates/runtimes/build-test-job.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index 4601c7bd609991..93372d53935a23 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -13,6 +13,7 @@ parameters: runtimeVariant: '' dependsOn: [] dependOnEvaluatePaths: false + crossBuild: false pgoType: '' ### Build managed test components (native components are getting built as part @@ -31,6 +32,7 @@ jobs: archType: ${{ parameters.archType }} osGroup: ${{ parameters.osGroup }} osSubgroup: ${{ parameters.osSubgroup }} + crossBuild: ${{ parameters.crossBuild }} container: ${{ parameters.container }} runtimeVariant: ${{ parameters.runtimeVariant }} testGroup: ${{ parameters.testGroup }} From 2367f3f7c65ddfffefd2984ffc9ac2e5a1a8ec50 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Sun, 2 Apr 2023 19:51:34 +0000 Subject: [PATCH 35/82] Set linker flavor, sysroot in nativeaot library tests --- eng/testing/tests.singlefile.targets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index 6bbbcc7834fd55..c36ed1cb7bd088 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -24,11 +24,12 @@ $(CoreCLRILCompilerDir) $(CoreCLRCrossILCompilerDir) - $(ROOTFS_DIR) + $(ROOTFS_DIR) $(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll $(CoreCLRAotSdkDir) $(NetCoreAppCurrentTestHostSharedFrameworkPath) $(NetCoreAppCurrentTestHostSharedFrameworkPath) + lld $(NoWarn);IL1005;IL3000;IL3001;IL3002;IL3003 partial true From a51dbde024bf8fdb294a17a4239b0b342168de24 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 3 Apr 2023 01:45:48 +0000 Subject: [PATCH 36/82] Use git diff for AsnXml --- .../Common/src/System/Security/Cryptography/Asn1/AsnXml.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets b/src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets index 940c73ca57237c..c34064eccff343 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets @@ -1,7 +1,7 @@ - <_AsnXmlDiffCmd>%24%28command -v diff%29 -q -a + <_AsnXmlDiffCmd>%24%28command -v git%29 diff --quiet <_AsnXmlDiffCmd Condition="$([MSBuild]::IsOsPlatform('windows')) == 'true'">$(SystemRoot)\System32\fc.exe /a <_AsnXmlDiffCmd Condition="$([MSBuild]::IsOsPlatform('osx')) == 'true'">diff From c30a2148ee072d0c0fbe737442bb5902771a5512 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 3 Apr 2023 16:10:13 +0000 Subject: [PATCH 37/82] Pass crossBuild through mono's xplat-pipeline-job.yml --- eng/pipelines/mono/templates/xplat-pipeline-job.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/pipelines/mono/templates/xplat-pipeline-job.yml b/eng/pipelines/mono/templates/xplat-pipeline-job.yml index addebb94903f03..2c369f71f30bb6 100644 --- a/eng/pipelines/mono/templates/xplat-pipeline-job.yml +++ b/eng/pipelines/mono/templates/xplat-pipeline-job.yml @@ -6,6 +6,7 @@ parameters: name: '' helixType: '(unspecified)' container: '' + crossBuild: false liveLibrariesBuildConfig: '' strategy: '' pool: '' @@ -34,6 +35,7 @@ jobs: name: ${{ parameters.name }} helixType: ${{ parameters.helixType }} container: ${{ parameters.container }} + crossBuild: ${{ parameters.crossBuild }} strategy: ${{ parameters.strategy }} pool: ${{ parameters.pool }} runtimeVariant: ${{ parameters.runtimeVariant }} From dd593010315a294bc5545c58bd404a4cd91ff495 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 3 Apr 2023 16:41:00 +0000 Subject: [PATCH 38/82] Move crossArg after runtime build params Should fix Common Pri0 test build --- eng/pipelines/common/templates/runtimes/build-test-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml index 93372d53935a23..2813c45915c5e3 100644 --- a/eng/pipelines/common/templates/runtimes/build-test-job.yml +++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml @@ -96,7 +96,7 @@ jobs: displayName: Install native dependencies # Build core/libraries dependencies of test build - - script: $(Build.SourcesDirectory)/build$(scriptExt) $(crossArg) $(liveRuntimeBuildParams) $(compilerArg) + - script: $(Build.SourcesDirectory)/build$(scriptExt) $(liveRuntimeBuildParams) $(crossArg) $(compilerArg) displayName: Build coreclr/libs components needed by test build - ${{ if in(parameters.osGroup, 'osx', 'ios', 'tvos') }}: From c4c5fa7d65ef075a1d447c21f5ad477a936fba58 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 3 Apr 2023 17:04:00 +0000 Subject: [PATCH 39/82] Disable PGO from MSBuild instead --- eng/nativepgo.targets | 3 ++- eng/pipelines/common/global-build-job.yml | 8 +------- eng/pipelines/common/platform-matrix.yml | 4 ---- eng/pipelines/coreclr/templates/build-job.yml | 9 ++------- eng/pipelines/installer/jobs/build-job.yml | 5 +++-- 5 files changed, 8 insertions(+), 21 deletions(-) diff --git a/eng/nativepgo.targets b/eng/nativepgo.targets index 9f5984efdb6332..cfd41d5e975a8f 100644 --- a/eng/nativepgo.targets +++ b/eng/nativepgo.targets @@ -1,7 +1,8 @@ true - true + + false false false diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index 69e3feab6e8f1f..80c263eea7c6b4 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -79,12 +79,6 @@ jobs: - name: _crossBuildPropertyArg value: /p:CrossBuild=${{ parameters.crossBuild }} - - name: _noPgoArg - value: '' - - ${{ if eq(parameters.pgoType, 'noPgo' )}}: - - name: _noPgoArg - value: '/p:NoPgoOptimize=true ' - - ${{ if ne(parameters.jobParameters.crossrootfsDir, '') }}: # This is only required for cross builds. - name: ROOTFS_DIR @@ -193,7 +187,7 @@ jobs: - task: CodeQL3000Init@0 displayName: Initialize CodeQL (manually-injected) - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) $(_noPgoArg) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter) $(_buildDarwinFrameworksParameter) $(_overrideTestScriptWindowsCmdParameter) + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter) $(_buildDarwinFrameworksParameter) $(_overrideTestScriptWindowsCmdParameter) displayName: Build product ${{ if eq(parameters.useContinueOnErrorDuringBuild, true) }}: continueOnError: ${{ parameters.shouldContinueOnError }} diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 91fa4c95a94873..ac7bbc56e4ad9e 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -109,8 +109,6 @@ jobs: buildConfig: ${{ parameters.buildConfig }} helixQueueGroup: ${{ parameters.helixQueueGroup }} crossBuild: true - # Disable PGO until we get profile data collected with a new clang - pgoType: noPgo ${{ insert }}: ${{ parameters.jobParameters }} # Linux musl arm @@ -226,8 +224,6 @@ jobs: buildConfig: ${{ parameters.buildConfig }} helixQueueGroup: ${{ parameters.helixQueueGroup }} crossBuild: true - # Disable PGO until we get profile data collected with a new clang - pgoType: noPgo ${{ insert }}: ${{ parameters.jobParameters }} # Linux x86 diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 8445a22feb9fc1..1c6e0e92a8821f 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -126,11 +126,6 @@ jobs: - ${{ if eq(parameters.pgoType, 'PGO' )}}: - name: pgoInstrumentArg value: '-pgoinstrument ' - - name: noPgoArg - value: '' - - ${{ if eq(parameters.pgoType, 'noPgo' )}}: - - name: noPgoArg - value: '/p:NoPgoOptimize=true ' - name: SignType value: $[ coalesce(variables.OfficialSignType, 'real') ] @@ -189,12 +184,12 @@ jobs: displayName: Disk Usage before Build # Build/Generate native prerequisites - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.nativeprereqs $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(noPgoArg) $(officialBuildIdArg) -ci /bl:$(Build.SourcesDirectory)artifacts/log/$(buildConfig)/CoreCLRNativePrereqs.binlog + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.nativeprereqs $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(officialBuildIdArg) -ci /bl:$(Build.SourcesDirectory)artifacts/log/$(buildConfig)/CoreCLRNativePrereqs.binlog displayName: Build and generate native prerequisites # Build CoreCLR Runtime - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) $(osArg) -ci $(compilerArg) $(clrRuntimeComponentsBuildArg) $(pgoInstrumentArg) $(noPgoArg) $(officialBuildIdArg) $(clrInterpreterBuildArg) $(clrRuntimePortableBuildArg) $(CoreClrPgoDataArg) $(nativeSymbols) + - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) $(osArg) -ci $(compilerArg) $(clrRuntimeComponentsBuildArg) $(pgoInstrumentArg) $(officialBuildIdArg) $(clrInterpreterBuildArg) $(clrRuntimePortableBuildArg) $(CoreClrPgoDataArg) $(nativeSymbols) displayName: Build CoreCLR Runtime - ${{ if eq(parameters.osGroup, 'windows') }}: - script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci $(enforcePgoArg) $(pgoInstrumentArg) $(officialBuildIdArg) $(clrInterpreterBuildArg) $(CoreClrPgoDataArg) diff --git a/eng/pipelines/installer/jobs/build-job.yml b/eng/pipelines/installer/jobs/build-job.yml index 53a5fb19ecda25..cdcf5a40471da3 100644 --- a/eng/pipelines/installer/jobs/build-job.yml +++ b/eng/pipelines/installer/jobs/build-job.yml @@ -278,13 +278,14 @@ jobs: - evaluate_paths - ${{ parameters.dependsOn }} - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}: - - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', + - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}{6}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, - parameters.liveRuntimeBuildConfig) }} + parameters.liveRuntimeBuildConfig, + parameters.pgoType) }} - ${{ if ne(parameters.liveLibrariesBuildConfig, '') }}: - libraries_build_${{ format('{0}{1}_{2}_{3}', parameters.osGroup, From 8a194756f55f7f2c0915300e04b83bb235d57755 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 3 Apr 2023 17:06:24 +0000 Subject: [PATCH 40/82] Fix empty container --- eng/pipelines/runtime.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index d1bdece7713d9f..84c47e8ccfa583 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -101,7 +101,6 @@ extends: buildConfig: checked platforms: - gcc_linux_x64 - container: jobParameters: testGroup: innerloop condition: >- From 8c41d416afbed096bb81755954c27a94cebe6073 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 3 Apr 2023 17:41:24 +0000 Subject: [PATCH 41/82] Pass crossArg to mono Build packages step --- eng/pipelines/mono/templates/build-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/mono/templates/build-job.yml b/eng/pipelines/mono/templates/build-job.yml index 0b68999e0c68a4..cdcf76143f5fdc 100644 --- a/eng/pipelines/mono/templates/build-job.yml +++ b/eng/pipelines/mono/templates/build-job.yml @@ -170,7 +170,7 @@ jobs: # Build packages - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: ./build$(scriptExt) -subset mono$(msCorDbi)+clr.hosts -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) -pack $(OutputRidArg) + - script: ./build$(scriptExt) -subset mono$(msCorDbi)+clr.hosts $(crossArg) -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) -pack $(OutputRidArg) displayName: Build nupkg - ${{ if eq(parameters.osGroup, 'windows') }}: - script: build$(scriptExt) -subset mono$(msCorDbi)+clr.hosts -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(aotCrossParameter) $(llvmParameter) -pack $(OutputRidArg) From a8cc38d14842356135a148880108db4bb88471c8 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 3 Apr 2023 17:50:40 +0000 Subject: [PATCH 42/82] Fix gcc container definition --- eng/pipelines/common/templates/pipeline-with-resources.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index c94e19a8b45ec0..632794a09f7d6c 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -63,6 +63,9 @@ resources: env: ROOTFS_DIR: /crossrootfs/ppc64le + - container: debian-11-gcc12-amd64 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-gcc12-amd64 + - container: browser_wasm image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-webassembly-net8-20230322221728-80fdceb From 9aa3527b1b1242fb2839f38d8cd2908640a958a0 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 3 Apr 2023 20:52:27 +0000 Subject: [PATCH 43/82] Use init-compiler.sh for mono cross build Also replace 'which' with 'command -v' --- src/mono/mono.proj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index c3755a020958e3..ed617e6c1a12fd 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -877,6 +877,7 @@ <_MonoSkipInitCompiler Condition="'$(RealTargetArchitecture)' != '' and '$(RealTargetArchitecture)' != '$(BuildArchitecture)'">false + <_MonoSkipInitCompiler Condition="'$(CrossBuild)' == 'true'">false <_MonoAotCrossOffsetsCommand Condition="'$(MonoUseCrossTool)' == 'true'">$(PythonCmd) $(MonoProjectRoot)mono/tools/offsets-tool/offsets-tool.py @(MonoAotCrossOffsetsToolParams, ' ') <_MonoAotCMakeConfigureCommand>cmake @(MonoAOTCMakeArgs, ' ') $(MonoCMakeExtraArgs) "$(MonoProjectRoot.TrimEnd('\/'))" <_MonoAotCMakeConfigureCommand Condition="'$(_MonoSkipInitCompiler)' != 'true' and '$(HostOS)' != 'windows'">sh -c 'build_arch="$(_CompilerTargetArch)" compiler="$(MonoCCompiler)" . "$(RepositoryEngineeringCommonDir)native/init-compiler.sh" && @(_MonoAotBuildEnv, ' ') $(_MonoAotCMakeConfigureCommand)' From cd1f16ab577c452abd1680afb2d60c71eea06676 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 3 Apr 2023 23:16:13 +0000 Subject: [PATCH 44/82] Condition linker selection based on compiler To help with gcc builds. Same may need to be done for nativeaot test builds. --- .../tools/aot/ILCompiler/ILCompiler.csproj | 19 +++++++++++++++++-- .../tools/aot/crossgen2/crossgen2.csproj | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj index 9bb670788b0a5e..01ebdf26682987 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj @@ -13,8 +13,6 @@ false false true - - true $(ROOTFS_DIR) true true @@ -56,6 +54,23 @@ + + + clang + + true + + + + + + + diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj index 69b2e5abd04fc6..4c9087fce98e49 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj @@ -29,7 +29,6 @@ - lld $(CoreCLRILCompilerDir) $(CoreCLRCrossILCompilerDir) $(ROOTFS_DIR) @@ -91,6 +90,7 @@ BeforeTargets="SetupOSSpecificProps"> clang + lld Date: Tue, 4 Apr 2023 00:24:59 +0000 Subject: [PATCH 45/82] Fix publish condition --- src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj index 01ebdf26682987..7ffc15676e5253 100644 --- a/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj +++ b/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj @@ -55,7 +55,7 @@ clang From 04e6182e99526d58e3764a116e9d1655bba48dde Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 4 Apr 2023 02:40:47 +0000 Subject: [PATCH 46/82] Pass compilerArg to managed component build Should allow clr.tools to build, using gcc to AOT-compile ILCompiler --- eng/pipelines/coreclr/templates/build-job.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 1c6e0e92a8821f..431165913eb7e8 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -211,7 +211,7 @@ jobs: # Build CoreCLR Managed Components - ${{ if or(ne(parameters.osGroup, 'linux'), ne(parameters.archType, 'x86')) }}: - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.corelib+clr.nativecorelib+clr.nativeaotlibs+clr.tools+clr.packages+clr.paltestlist $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(pgoInstrumentArg) $(officialBuildIdArg) -ci + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.corelib+clr.nativecorelib+clr.nativeaotlibs+clr.tools+clr.packages+clr.paltestlist $(crossArg) $(compilerArg) -arch $(archType) $(osArg) -c $(buildConfig) $(pgoInstrumentArg) $(officialBuildIdArg) -ci displayName: Build managed product components and packages - ${{ if and(eq(parameters.osGroup, 'linux'), eq(parameters.archType, 'x86')) }}: - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.corelib $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(pgoInstrumentArg) $(officialBuildIdArg) -ci From 47246a307e5716043a7126bcfb1b37737195356a Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 4 Apr 2023 16:52:59 +0000 Subject: [PATCH 47/82] Use command -v instead of which (Missing from earlier commit) --- src/mono/mono.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index ed617e6c1a12fd..a0d2c9a02854b3 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -105,7 +105,7 @@ - + From 7ecd0818123b64289f8e36e556cdef86ad2ca95f Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 4 Apr 2023 17:29:46 +0000 Subject: [PATCH 48/82] Use crossArg instead of _crossBuildPropertyArg Should let nativeaot test native build use toolchain file. --- eng/pipelines/common/global-build-job.yml | 10 ++++++---- .../runtimes/build-runtime-tests-and-send-to-helix.yml | 2 +- eng/pipelines/coreclr/nativeaot-post-build-steps.yml | 2 +- .../libraries/execute-trimming-tests-steps.yml | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml index 80c263eea7c6b4..6124c13390ee6f 100644 --- a/eng/pipelines/common/global-build-job.yml +++ b/eng/pipelines/common/global-build-job.yml @@ -75,9 +75,11 @@ jobs: - name: _osParameter value: /p:RuntimeOS=linux-bionic - # Do not rename as it clashes with MSBuild property in libraries/build-native.proj - - name: _crossBuildPropertyArg - value: /p:CrossBuild=${{ parameters.crossBuild }} + - name: crossArg + value: '' + - ${{ if eq(parameters.crossBuild, true) }}: + - name: crossArg + value: '-cross' - ${{ if ne(parameters.jobParameters.crossrootfsDir, '') }}: # This is only required for cross builds. @@ -187,7 +189,7 @@ jobs: - task: CodeQL3000Init@0 displayName: Initialize CodeQL (manually-injected) - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter) $(_buildDarwinFrameworksParameter) $(_overrideTestScriptWindowsCmdParameter) + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) $(crossArg) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_cxx11Parameter) $(_buildDarwinFrameworksParameter) $(_overrideTestScriptWindowsCmdParameter) displayName: Build product ${{ if eq(parameters.useContinueOnErrorDuringBuild, true) }}: continueOnError: ${{ parameters.shouldContinueOnError }} diff --git a/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml b/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml index acf2cc6e9f0a00..174832216912bd 100644 --- a/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml +++ b/eng/pipelines/common/templates/runtimes/build-runtime-tests-and-send-to-helix.yml @@ -33,7 +33,7 @@ steps: - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) ci ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }} displayName: Build Tests - ${{ if ne(parameters.osGroup, 'windows') }}: - - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(_crossBuildPropertyArg) ci os ${{ parameters.osGroup }} ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }} + - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) $(crossArg) ci os ${{ parameters.osGroup }} ${{ parameters.archType }} $(buildConfigUpper) $(priorityArg) $(runtimeFlavorArgs) ${{ parameters.testBuildArgs }} $(runtimeVariantArg) /p:LibrariesConfiguration=${{ coalesce(parameters.liveLibrariesBuildConfig, parameters.buildConfig) }} displayName: Build Tests diff --git a/eng/pipelines/coreclr/nativeaot-post-build-steps.yml b/eng/pipelines/coreclr/nativeaot-post-build-steps.yml index c971d239edc9e4..491e663230fcb1 100644 --- a/eng/pipelines/coreclr/nativeaot-post-build-steps.yml +++ b/eng/pipelines/coreclr/nativeaot-post-build-steps.yml @@ -27,5 +27,5 @@ steps: # Publishing tooling doesn't support different configs between runtime and libs, so only run tests in Release config - ${{ if eq(parameters.buildConfig, 'release') }}: - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) /p:TestAssemblies=false /p:RunNativeAotTestApps=true $(_officialBuildParameter) $(_crossBuildPropertyArg) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/NativeAotTests.binlog ${{ parameters.extraTestArgs }} + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) /p:TestAssemblies=false /p:RunNativeAotTestApps=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/NativeAotTests.binlog ${{ parameters.extraTestArgs }} displayName: Run NativeAot Library Tests diff --git a/eng/pipelines/libraries/execute-trimming-tests-steps.yml b/eng/pipelines/libraries/execute-trimming-tests-steps.yml index a0172e2363428b..567abab0bb984e 100644 --- a/eng/pipelines/libraries/execute-trimming-tests-steps.yml +++ b/eng/pipelines/libraries/execute-trimming-tests-steps.yml @@ -4,5 +4,5 @@ parameters: steps: # Execute tests - - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) /p:TestAssemblies=false /p:TestTrimming=true $(_officialBuildParameter) $(_crossBuildPropertyArg) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/TrimmingTests.binlog ${{ parameters.extraTestArgs }} + - script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) -s libs.tests -c $(_BuildConfig) $(crossArg) /p:TestAssemblies=false /p:TestTrimming=true $(_officialBuildParameter) /bl:$(Build.SourcesDirectory)/artifacts/log/$(buildConfigUpper)/TrimmingTests.binlog ${{ parameters.extraTestArgs }} displayName: Run Trimming Tests From 405fbaeaed974c14a73b0eff4dfac83f8b0f341a Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 4 Apr 2023 18:52:28 +0000 Subject: [PATCH 49/82] Set mono toolchain for aot build --- src/mono/mono.proj | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index a0d2c9a02854b3..10e486769303c5 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -839,6 +839,13 @@ + + + + <_MonoAotBuildEnv Include="TARGET_BUILD_ARCH=x64" /> + <_MonAotoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/x86_64-linux-gnu/pkgconfig" /> + + From c1da152483c71192f75fdcb7b97d31d6ec210dce Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 4 Apr 2023 19:27:46 +0000 Subject: [PATCH 50/82] Adjust DwarfDump baseline, show expected AOT size --- src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs | 4 ++-- src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs b/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs index f0996dd070ea51..9441f2948b0e1e 100644 --- a/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs +++ b/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs @@ -54,8 +54,8 @@ public static int Main(string[] args) const int MinWarnings = 17000; const int MaxWarnings = 18500; #else - const int MinWarnings = 12000; - const int MaxWarnings = 13000; + const int MinWarnings = 9500; + const int MaxWarnings = 10500; #endif int count = 0; string line; diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs index 98c561f3eddd10..e26749ec368e0e 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs @@ -40,7 +40,7 @@ static int Main() if (fileSize < lowerBound || fileSize > upperBound) { - Console.WriteLine("BUG: File size is not in the expected range. Did a libraries change regress size of Hello World?"); + Console.WriteLine($"BUG: File size is not in the expected range ({lowerBound} to {upperBound} bytes). Did a libraries change regress size of Hello World?"); return 1; } From 9cd348b67b5991742f87550451aaa22021b3823f Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 4 Apr 2023 22:07:12 +0000 Subject: [PATCH 51/82] Don't use new images for Mono LLVMAot test build --- eng/pipelines/common/platform-matrix.yml | 20 +++++++++++++++++++ .../templates/pipeline-with-resources.yml | 3 +++ eng/pipelines/runtime.yml | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index ac7bbc56e4ad9e..5de0213ee3ffab 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -339,6 +339,26 @@ jobs: compilerName: gcc ${{ insert }}: ${{ parameters.jobParameters }} +# Mono LLVMAot test build + +- ${{ if or(containsValue(parameters.platforms, 'linux_x64_llvmaot')) }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: x64 + targetRid: linux-x64 + platform: linux_x64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: linux_x64_llvmaot + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} # Linux s390x diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index 632794a09f7d6c..8d89ee9387feca 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -66,6 +66,9 @@ resources: - container: debian-11-gcc12-amd64 image: mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-gcc12-amd64 + - container: linux_x64_llvmaot + image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7 + - container: browser_wasm image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-webassembly-net8-20230322221728-80fdceb diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 84c47e8ccfa583..12ae155c48e7e3 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -1210,7 +1210,7 @@ extends: buildConfig: Release runtimeFlavor: mono platforms: - - linux_x64 + - linux_x64_llvmaot # Disabled pending outcome of https://github.com/dotnet/runtime/issues/60234 investigation #- linux_arm64 variables: From d6b0649135473189e18d7ae0300a81c4c2c4df64 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 4 Apr 2023 22:17:16 +0000 Subject: [PATCH 52/82] Build cross tools when BuildArch != TargetArch --- eng/Subsets.props | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/Subsets.props b/eng/Subsets.props index d184cbc22f3fa0..4af6e90f9172be 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -250,7 +250,7 @@ - + - + @@ -367,8 +367,8 @@ - - + + From 8e12626f220192214078dd33e983f6c98083d622 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Tue, 4 Apr 2023 22:22:13 +0000 Subject: [PATCH 53/82] Fix typo --- eng/pipelines/common/platform-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 5de0213ee3ffab..31e5046c53f160 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -341,7 +341,7 @@ jobs: # Mono LLVMAot test build -- ${{ if or(containsValue(parameters.platforms, 'linux_x64_llvmaot')) }}: +- ${{ if containsValue(parameters.platforms, 'linux_x64_llvmaot') }}: - template: xplat-setup.yml parameters: jobTemplate: ${{ parameters.jobTemplate }} From ecd408141035686e4450fde5e51d6d03ff6b3e9d Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 5 Apr 2023 00:17:33 +0000 Subject: [PATCH 54/82] Don't set crossBuild for mono llvmaot --- eng/pipelines/common/platform-matrix.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 31e5046c53f160..77591820302daa 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -357,7 +357,6 @@ jobs: runtimeFlavor: ${{ parameters.runtimeFlavor }} buildConfig: ${{ parameters.buildConfig }} helixQueueGroup: ${{ parameters.helixQueueGroup }} - crossBuild: true ${{ insert }}: ${{ parameters.jobParameters }} # Linux s390x From 028a88929cbb6c98a69f83eec34c98816b27de70 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 6 Apr 2023 14:53:12 -0700 Subject: [PATCH 55/82] Fix ILCompiler, crossgen invocation for windows --- eng/liveBuilds.targets | 2 +- src/coreclr/tools/aot/crossgen2/crossgen2.csproj | 4 ++-- .../Microsoft.NETCore.App.Crossgen2.sfxproj | 2 +- .../pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets index 19a9a0bcf46037..286a5d9606d4e9 100644 --- a/eng/liveBuilds.targets +++ b/eng/liveBuilds.targets @@ -25,7 +25,7 @@ $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'sharedFramework')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'crossgen2')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'ilc-published')) - $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', '$(BuildArchitecture)', 'ilc')) + $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', '$(BuildArchitecture)', 'ilc')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'aotsdk')) $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'build')) diff --git a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj index 4c9087fce98e49..e19cbbeae9f6ef 100644 --- a/src/coreclr/tools/aot/crossgen2/crossgen2.csproj +++ b/src/coreclr/tools/aot/crossgen2/crossgen2.csproj @@ -30,8 +30,8 @@ $(CoreCLRILCompilerDir) - $(CoreCLRCrossILCompilerDir) - $(ROOTFS_DIR) + $(CoreCLRCrossILCompilerDir) + $(ROOTFS_DIR) $(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll $(CoreCLRAotSdkDir) $(MicrosoftNetCoreAppRuntimePackRidLibTfmDir) diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj index 730ce251e59c4a..edc0979063db0f 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj @@ -73,7 +73,7 @@ + Condition="'$(TargetOS)' == '$(HostOS)' and '$(TargetArchitecture)' == '$(BuildArchitecture)'"> diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets b/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets index 1778c091161d0c..0b82891e6c42e4 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets @@ -15,7 +15,7 @@ - $(BuildArchitecture) + $(BuildArchitecture) $(CoreCLRArtifactsPath)\$(CrossDir)\crossgen2\crossgen2.dll true From 7fc39d33c1bd47d36b57a01c7b69e133be123544 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 6 Apr 2023 21:58:39 +0000 Subject: [PATCH 56/82] Add PGO instrumentation legs --- eng/pipelines/runtime.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 12ae155c48e7e3..fb62b2c23d4ca1 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -163,6 +163,35 @@ extends: eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), eq(variables['isRollingBuild'], true)) + # Temporarily define PGO jobs to get PR validation of PGO instrumented builds + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml + buildConfig: release + platforms: + - linux_x64 + - linux_arm64 + jobParameters: + isOfficialBuild: ${{ variables.isOfficialBuild }} + signBinaries: false + testGroup: innerloop + pgoType: 'PGO' + + + # Temporarily define PGO jobs to get PR validation of PGO instrumented builds + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/installer/jobs/build-job.yml + buildConfig: Release + jobParameters: + isOfficialBuild: ${{ variables.isOfficialBuild }} + liveRuntimeBuildConfig: release + liveLibrariesBuildConfig: Release + pgoType: 'PGO' + platforms: + - linux_x64 + - linux_arm64 + # # Build CoreCLR Formatting Job # Only when CoreCLR is changed, and only in the 'main' branch (no release branches; From 6aa9f0abba8eecc2351f020ced6ee1509521d4f2 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Thu, 6 Apr 2023 22:04:45 +0000 Subject: [PATCH 57/82] Run source-build legs --- eng/pipelines/runtime.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index fb62b2c23d4ca1..55913d6a3032eb 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -1460,7 +1460,7 @@ extends: extraStepsParameters: name: SourceBuildPackages timeoutInMinutes: 95 - condition: eq(variables['isRollingBuild'], true) + condition: true - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -1474,4 +1474,4 @@ extends: extraStepsParameters: name: SourceBuildPackages timeoutInMinutes: 95 - condition: eq(variables['isRollingBuild'], true) + condition: true \ No newline at end of file From 667921b0781ea9b22718cfec3c8b7ddf8611081e Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 7 Apr 2023 15:27:33 +0000 Subject: [PATCH 58/82] Pick up arm images --- eng/pipelines/common/templates/pipeline-with-resources.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index 8d89ee9387feca..f2079a155a0e19 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -5,7 +5,7 @@ parameters: resources: containers: - container: linux_arm - image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm env: ROOTFS_DIR: /crossrootfs/arm From cf0ffefad5b3def44da63486fda84043528f52e8 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 7 Apr 2023 15:29:28 +0000 Subject: [PATCH 59/82] Fix indentation --- eng/pipelines/runtime.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 55913d6a3032eb..f00ae9b2ec7dd6 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -179,7 +179,7 @@ extends: # Temporarily define PGO jobs to get PR validation of PGO instrumented builds - - template: /eng/pipelines/common/platform-matrix.yml + - template: /eng/pipelines/common/platform-matrix.yml parameters: jobTemplate: /eng/pipelines/installer/jobs/build-job.yml buildConfig: Release From 6c0b0262eff4efff7ca5a4d03e50e2dedb45fbbe Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 7 Apr 2023 15:33:37 +0000 Subject: [PATCH 60/82] Undo job name change --- eng/pipelines/coreclr/templates/build-job.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml index 431165913eb7e8..e2e1e731c5fea9 100644 --- a/eng/pipelines/coreclr/templates/build-job.yml +++ b/eng/pipelines/coreclr/templates/build-job.yml @@ -44,12 +44,13 @@ jobs: name: ${{ format('coreclr_{0}_product_build_{1}{1}_{3}_{4}', parameters.compilerName, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} displayName: ${{ format('GCC Product Build {0}{1} {2} {3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }} ${{ if and(ne(parameters.testGroup, 'clrTools'), ne(parameters.compilerName, 'gcc')) }}: - name: ${{ format('coreclr_{0}_product_build_{1}{2}_{3}_{4}', + name: ${{ format('coreclr_{0}_product_build_{1}{2}_{3}_{4}{5}', parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, - parameters.buildConfig) }} + parameters.buildConfig, + parameters.pgoType) }} displayName: ${{ format('CoreCLR {0} Product Build {1}{2} {3} {4} {5}', parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, From fc9c302c67856abba2ff2a1f65899ebb740f6d91 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 7 Apr 2023 15:50:59 +0000 Subject: [PATCH 61/82] Add linux arm64 libraries build --- eng/pipelines/runtime.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index f00ae9b2ec7dd6..9fd51d9ead3c0e 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -895,6 +895,7 @@ extends: buildConfig: Release platforms: - linux_arm + - linux_arm64 - linux_musl_arm - linux_musl_arm64 - windows_arm From a5e22a04784fc04853bf8eb90f694fdc2e7aaf0c Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 7 Apr 2023 19:20:42 +0000 Subject: [PATCH 62/82] Don't run AOT'd crossgen that targets musl --- .../Microsoft.NETCore.App.Crossgen2.sfxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj index edc0979063db0f..067a6f72f844c7 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj @@ -73,7 +73,7 @@ + Condition="'$(TargetOS)' == '$(HostOS)' and '$(TargetArchitecture)' == '$(BuildArchitecture)' and '$(TargetsLinuxMusl)' != 'true'"> From 09f6889db824e86e4c0dd0599bb28e5badc21bb6 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 7 Apr 2023 22:05:41 +0000 Subject: [PATCH 63/82] Fix crossgen-corelib logic BuildDll should be true for x64 and x64-alpine builds --- src/coreclr/crossgen-corelib.proj | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/coreclr/crossgen-corelib.proj b/src/coreclr/crossgen-corelib.proj index 553eee0b38d37e..7c3ac1e3e47233 100644 --- a/src/coreclr/crossgen-corelib.proj +++ b/src/coreclr/crossgen-corelib.proj @@ -13,15 +13,9 @@ - - - x64 - $(BuildArchitecture) - + $(BuildArchitecture) - true - false false true From d23534a1ef5ed8d22ea41a1ee3bb489045c1649b Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 7 Apr 2023 22:09:45 +0000 Subject: [PATCH 64/82] Freeze image versions Until we can use LLVM 16 --- .../common/templates/pipeline-with-resources.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index f2079a155a0e19..458ee76569575f 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -5,7 +5,7 @@ parameters: resources: containers: - container: linux_arm - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-0230407130525-290f679 env: ROOTFS_DIR: /crossrootfs/arm @@ -15,22 +15,22 @@ resources: ROOTFS_DIR: /crossrootfs/armv6 - container: linux_arm64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-20230407130525-2288685 env: ROOTFS_DIR: /crossrootfs/arm64 - container: linux_musl_x64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpine + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpine-20230407130525-2288685 env: ROOTFS_DIR: /crossrootfs/x64 - container: linux_musl_arm - image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm-alpine + image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm-alpine-20230407130525-290f679 env: ROOTFS_DIR: /crossrootfs/arm - container: linux_musl_arm64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpine + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpine-20230407130525-2288685 env: ROOTFS_DIR: /crossrootfs/arm64 # This container contains all required toolsets to build for Android and for Linux with bionic libc. @@ -39,12 +39,12 @@ resources: image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-android - container: linux_x64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-20230407130525-2288685 env: ROOTFS_DIR: /crossrootfs/x64 - container: linux_x86 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-x86 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-x86-20230407130525-2288685 env: ROOTFS_DIR: /crossrootfs/x86 From 609f19b954ac53dd5217ad4495446a2f05d974a3 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 7 Apr 2023 22:16:57 +0000 Subject: [PATCH 65/82] Use existing images for mono arm64 build --- eng/pipelines/common/platform-matrix.yml | 21 +++++++++++++++++++ .../templates/pipeline-with-resources.yml | 5 +++++ eng/pipelines/runtime.yml | 3 +++ 3 files changed, 29 insertions(+) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 77591820302daa..000e0fa5758ea6 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -339,6 +339,27 @@ jobs: compilerName: gcc ${{ insert }}: ${{ parameters.jobParameters }} +# Mono Linux arm64 product build + +- ${{ if containsValue(parameters.platforms, 'linux_arm64') }}: + - template: xplat-setup.yml + parameters: + jobTemplate: ${{ parameters.jobTemplate }} + helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }} + variables: ${{ parameters.variables }} + osGroup: linux + archType: arm64 + targetRid: linux-arm64 + platform: linux_arm64 + shouldContinueOnError: ${{ parameters.shouldContinueOnError }} + container: mono_linux_arm64 + jobParameters: + runtimeFlavor: ${{ parameters.runtimeFlavor }} + buildConfig: ${{ parameters.buildConfig }} + helixQueueGroup: ${{ parameters.helixQueueGroup }} + crossBuild: true + ${{ insert }}: ${{ parameters.jobParameters }} + # Mono LLVMAot test build - ${{ if containsValue(parameters.platforms, 'linux_x64_llvmaot') }}: diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index 458ee76569575f..6b40b45eb5c4ef 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -14,6 +14,11 @@ resources: env: ROOTFS_DIR: /crossrootfs/armv6 + - container: mono_linux_arm64 + image: cr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-arm64 + env: + ROOTFS_DIR: /crossrootfs/arm64 + - container: linux_arm64 image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-20230407130525-2288685 env: diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 9fd51d9ead3c0e..4e707d0fe3f9b1 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -730,6 +730,9 @@ extends: - osx_x64 - osx_arm64 - linux_x64 + # - linux_arm64 + # Remove once we can use linux_arm64 + - mono_linux_arm64 - linux_arm64 # - linux_musl_arm64 - windows_x64 From bedfad7e73c19097e2dd67e690f2f13d014ddd78 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 7 Apr 2023 22:18:19 +0000 Subject: [PATCH 66/82] Don't trigger source-build This is broken in rolling builds already --- eng/pipelines/runtime.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 4e707d0fe3f9b1..264361b214ba55 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -1464,7 +1464,7 @@ extends: extraStepsParameters: name: SourceBuildPackages timeoutInMinutes: 95 - condition: true + condition: eq(variables['isRollingBuild'], true) - template: /eng/pipelines/common/platform-matrix.yml parameters: @@ -1478,4 +1478,4 @@ extends: extraStepsParameters: name: SourceBuildPackages timeoutInMinutes: 95 - condition: true \ No newline at end of file + condition: eq(variables['isRollingBuild'], true) \ No newline at end of file From 02ec62968fd5b154291ff6945835b79bc0faf0e8 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 7 Apr 2023 22:30:55 +0000 Subject: [PATCH 67/82] Update dwarfdump, size baseline There are fewer dwarfdump warnings when building with lld. We don't support --gc-sections when ILCompiler uses lld. --- src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs | 2 +- src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs b/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs index 9441f2948b0e1e..0096a28c92f1eb 100644 --- a/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs +++ b/src/tests/nativeaot/SmokeTests/DwarfDump/Program.cs @@ -51,7 +51,7 @@ public static int Main(string[] args) // Just count the number of warnings and errors. There are so many right now that it's not worth enumerating the list #if DEBUG - const int MinWarnings = 17000; + const int MinWarnings = 16500; const int MaxWarnings = 18500; #else const int MinWarnings = 9500; diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs index 9ea53681e9e852..06f6a027c94dda 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs @@ -30,7 +30,7 @@ static int Main() else { lowerBound = 1300 * 1024; // ~1.3 MB - upperBound = 1600 * 1024; // ~1.6 MB + upperBound = 1750 * 1024; // ~1.75 MB } if (fileSize < lowerBound || fileSize > upperBound) From e130eb5ec9a13c959371fb384c5ec4b6415bd99d Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 7 Apr 2023 23:39:28 +0000 Subject: [PATCH 68/82] Fix yaml mistakes --- eng/pipelines/common/platform-matrix.yml | 2 +- eng/pipelines/common/templates/pipeline-with-resources.yml | 2 +- eng/pipelines/runtime.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml index 000e0fa5758ea6..7918cb0d137891 100644 --- a/eng/pipelines/common/platform-matrix.yml +++ b/eng/pipelines/common/platform-matrix.yml @@ -341,7 +341,7 @@ jobs: # Mono Linux arm64 product build -- ${{ if containsValue(parameters.platforms, 'linux_arm64') }}: +- ${{ if containsValue(parameters.platforms, 'mono_linux_arm64') }}: - template: xplat-setup.yml parameters: jobTemplate: ${{ parameters.jobTemplate }} diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index 6b40b45eb5c4ef..9a9467802939fa 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -15,7 +15,7 @@ resources: ROOTFS_DIR: /crossrootfs/armv6 - container: mono_linux_arm64 - image: cr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-arm64 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-arm64 env: ROOTFS_DIR: /crossrootfs/arm64 diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 264361b214ba55..39d3eaff49c001 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -1478,4 +1478,4 @@ extends: extraStepsParameters: name: SourceBuildPackages timeoutInMinutes: 95 - condition: eq(variables['isRollingBuild'], true) \ No newline at end of file + condition: eq(variables['isRollingBuild'], true) From 0fcef9056df8cbe43511fd59ffcbc5b69880a8d7 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Fri, 7 Apr 2023 16:48:29 -0700 Subject: [PATCH 69/82] Update src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj Co-authored-by: Jeremy Koritzinsky --- .../nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj index 02add3ff86fafd..51ef171354befa 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj @@ -7,7 +7,7 @@ true $(DefineConstants);BASELINE_INTRINSICS true - + From f1ea8ad291cb8624f52e443b22ffe79093b70fd9 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Sat, 8 Apr 2023 00:50:24 +0000 Subject: [PATCH 70/82] PR feedback - Fix condition in tests.singlefile.targets - Add issue link Also actually remove linux_arm64 mono leg --- eng/pipelines/common/templates/pipeline-with-resources.yml | 1 + eng/pipelines/runtime.yml | 3 +-- eng/testing/tests.singlefile.targets | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index 9a9467802939fa..0f093ed42de44d 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -14,6 +14,7 @@ resources: env: ROOTFS_DIR: /crossrootfs/armv6 + # Use old build images until we can avoid a clang-12 crash: https://github.com/dotnet/runtime/issues/84503 - container: mono_linux_arm64 image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-arm64 env: diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 39d3eaff49c001..be88b056ef7bbf 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -731,9 +731,8 @@ extends: - osx_arm64 - linux_x64 # - linux_arm64 - # Remove once we can use linux_arm64 + # Remove once we can use linux_arm64: https://github.com/dotnet/runtime/issues/84503 - mono_linux_arm64 - - linux_arm64 # - linux_musl_arm64 - windows_x64 - windows_x86 diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets index 386e416118f65d..821e8f93750b40 100644 --- a/eng/testing/tests.singlefile.targets +++ b/eng/testing/tests.singlefile.targets @@ -24,7 +24,7 @@ $(CoreCLRILCompilerDir) $(CoreCLRCrossILCompilerDir) - $(ROOTFS_DIR) + $(ROOTFS_DIR) $(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll $(CoreCLRAotSdkDir) $(NetCoreAppCurrentTestHostSharedFrameworkPath) From 04571e5355b7b7989ab0e92e6a59a1204b9f2451 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Sat, 8 Apr 2023 01:08:51 +0000 Subject: [PATCH 71/82] Fix arm image tags --- eng/pipelines/common/templates/pipeline-with-resources.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index 0f093ed42de44d..8233ad3f91b97d 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -5,7 +5,7 @@ parameters: resources: containers: - container: linux_arm - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-0230407130525-290f679 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-20230407130525-290f679 env: ROOTFS_DIR: /crossrootfs/arm @@ -31,7 +31,7 @@ resources: ROOTFS_DIR: /crossrootfs/x64 - container: linux_musl_arm - image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm-alpine-20230407130525-290f679 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-20230407130525-290f679 env: ROOTFS_DIR: /crossrootfs/arm From 45bb34dde0669e8f9df75171e0b475ab7bd21d62 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 10 Apr 2023 09:18:13 -0700 Subject: [PATCH 72/82] Update src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> --- .../Microsoft.NETCore.App.Crossgen2.sfxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj index 067a6f72f844c7..e442fdcfc41895 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj @@ -73,7 +73,7 @@ + Condition="'$(TargetOS)' == '$(HostOS)' and '$(TargetArchitecture)' == '$(BuildArchitecture)' and '$(CrossBuild)' != 'true'"> From d80a584ae1c1fc27d3fd24c03f755eccdd7baa99 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 10 Apr 2023 19:04:23 +0000 Subject: [PATCH 73/82] Revert "Write linker script for lld to enable gc-sections (#84493)" This reverts commit 3ab663e128e233ad1f4a1a4a0df64b08a846bcd5. --- .../BuildIntegration/Microsoft.NETCore.Native.targets | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 5b62b6f8906f0c..44703efeb45cdf 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -318,8 +318,7 @@ The .NET Foundation licenses this file to you under the MIT license. - - + @@ -336,9 +335,6 @@ The .NET Foundation licenses this file to you under the MIT license. -x - - - From ddcd261adb1d03c72258be836f99bf76f13412c1 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 10 Apr 2023 20:00:01 +0000 Subject: [PATCH 74/82] Update image tags To pick up diffutils --- .../common/templates/pipeline-with-resources.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index 8233ad3f91b97d..ea70f2c410672c 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -5,7 +5,7 @@ parameters: resources: containers: - container: linux_arm - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-20230407130525-290f679 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-20230410173854-290f679 env: ROOTFS_DIR: /crossrootfs/arm @@ -21,22 +21,22 @@ resources: ROOTFS_DIR: /crossrootfs/arm64 - container: linux_arm64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-20230407130525-2288685 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-20230410173854-2288685 env: ROOTFS_DIR: /crossrootfs/arm64 - container: linux_musl_x64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpine-20230407130525-2288685 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpine-20230410173854-2288685 env: ROOTFS_DIR: /crossrootfs/x64 - container: linux_musl_arm - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-20230407130525-290f679 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-20230410173854-290f679 env: ROOTFS_DIR: /crossrootfs/arm - container: linux_musl_arm64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpine-20230407130525-2288685 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpine-20230410173854-2288685 env: ROOTFS_DIR: /crossrootfs/arm64 # This container contains all required toolsets to build for Android and for Linux with bionic libc. @@ -45,12 +45,12 @@ resources: image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-android - container: linux_x64 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-20230407130525-2288685 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-20230410173854-2288685 env: ROOTFS_DIR: /crossrootfs/x64 - container: linux_x86 - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-x86-20230407130525-2288685 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-x86-20230410173854-2288685 env: ROOTFS_DIR: /crossrootfs/x86 From 812d284d1872f9d7e2a83a558b2174265bc10e7f Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 10 Apr 2023 20:00:04 +0000 Subject: [PATCH 75/82] Revert "Use git diff for AsnXml" This reverts commit a51dbde024bf8fdb294a17a4239b0b342168de24. --- .../Common/src/System/Security/Cryptography/Asn1/AsnXml.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets b/src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets index c34064eccff343..940c73ca57237c 100644 --- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets +++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets @@ -1,7 +1,7 @@ - <_AsnXmlDiffCmd>%24%28command -v git%29 diff --quiet + <_AsnXmlDiffCmd>%24%28command -v diff%29 -q -a <_AsnXmlDiffCmd Condition="$([MSBuild]::IsOsPlatform('windows')) == 'true'">$(SystemRoot)\System32\fc.exe /a <_AsnXmlDiffCmd Condition="$([MSBuild]::IsOsPlatform('osx')) == 'true'">diff From e25b5c9286f93f579053bcc319955401812f745f Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 10 Apr 2023 20:20:18 +0000 Subject: [PATCH 76/82] Fix nativeaot libraries test build --- eng/testing/linker/project.csproj.template | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eng/testing/linker/project.csproj.template b/eng/testing/linker/project.csproj.template index fe3d1ba28871e8..6dcd1c5754dd95 100644 --- a/eng/testing/linker/project.csproj.template +++ b/eng/testing/linker/project.csproj.template @@ -36,9 +36,15 @@ {IlcSdkPath} {IlcFrameworkPath} {IlcFrameworkNativePath} + lld + $(ROOTFS_DIR) {CoreCLRBuildIntegrationDir} + + + + {RuntimeHostConfigurationOptions} From 0fe6ac6c480edee9024d2510c16060b63feaa64c Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 10 Apr 2023 20:20:33 +0000 Subject: [PATCH 77/82] Remove temporary PGO instrumentation legs --- eng/pipelines/runtime.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index be88b056ef7bbf..5ffe8e401532ad 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -163,35 +163,6 @@ extends: eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true), eq(variables['isRollingBuild'], true)) - # Temporarily define PGO jobs to get PR validation of PGO instrumented builds - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml - buildConfig: release - platforms: - - linux_x64 - - linux_arm64 - jobParameters: - isOfficialBuild: ${{ variables.isOfficialBuild }} - signBinaries: false - testGroup: innerloop - pgoType: 'PGO' - - - # Temporarily define PGO jobs to get PR validation of PGO instrumented builds - - template: /eng/pipelines/common/platform-matrix.yml - parameters: - jobTemplate: /eng/pipelines/installer/jobs/build-job.yml - buildConfig: Release - jobParameters: - isOfficialBuild: ${{ variables.isOfficialBuild }} - liveRuntimeBuildConfig: release - liveLibrariesBuildConfig: Release - pgoType: 'PGO' - platforms: - - linux_x64 - - linux_arm64 - # # Build CoreCLR Formatting Job # Only when CoreCLR is changed, and only in the 'main' branch (no release branches; From 8406c40f81dd08c4d03c879fd57cb643e07d683d Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 10 Apr 2023 23:43:56 +0000 Subject: [PATCH 78/82] Fix musl_arm tag --- eng/pipelines/common/templates/pipeline-with-resources.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/common/templates/pipeline-with-resources.yml b/eng/pipelines/common/templates/pipeline-with-resources.yml index ea70f2c410672c..d9222efc1a8dd0 100644 --- a/eng/pipelines/common/templates/pipeline-with-resources.yml +++ b/eng/pipelines/common/templates/pipeline-with-resources.yml @@ -31,7 +31,7 @@ resources: ROOTFS_DIR: /crossrootfs/x64 - container: linux_musl_arm - image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-20230410173854-290f679 + image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-alpine-20230410173854-290f679 env: ROOTFS_DIR: /crossrootfs/arm From 97a9fafb48a586036ceda7e993a8bae6003839fd Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Mon, 10 Apr 2023 23:46:24 +0000 Subject: [PATCH 79/82] Remove left-over leg Was dependency for PGO instrumentation --- eng/pipelines/runtime.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 5ffe8e401532ad..dfb06547eeb8af 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -868,7 +868,6 @@ extends: buildConfig: Release platforms: - linux_arm - - linux_arm64 - linux_musl_arm - linux_musl_arm64 - windows_arm From 1e2e056fe27a49ffb007312859be283d60170632 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 12 Apr 2023 16:49:03 +0000 Subject: [PATCH 80/82] PR feedback - Add armv7-a to _MonoAOTCFLAGS Also similar for CXX flags --- src/mono/mono.proj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index ce78391b31d481..8af97b7f6e0d0c 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -562,10 +562,13 @@ <_MonoCFLAGS Include="-Wl,--build-id=sha1" /> <_MonoCFLAGS Condition="'$(Platform)' == 'arm'" Include="-march=armv7-a" /> <_MonoCXXFLAGS Include="-Wl,--build-id=sha1" /> + <_MonoCXXFLAGS Condition="'$(Platform)' == 'arm'" Include="-march=armv7-a" /> <_MonoAOTCFLAGS Include="-Wl,--build-id=sha1" /> + <_MonoAOTCFLAGS Condition="'$(Platform)' == 'arm'" Include="-march=armv7-a" /> <_MonoAOTCXXFLAGS Include="-Wl,--build-id=sha1" /> + <_MonoAOTCXXFLAGS Condition="'$(Platform)' == 'arm'" Include="-march=armv7-a" /> From ba6001ccb5ae4008ad526627a3b56d96ffef3f67 Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 12 Apr 2023 09:50:28 -0700 Subject: [PATCH 81/82] Update src/mono/mono.proj MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alexander Köplinger --- src/mono/mono.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index 8af97b7f6e0d0c..a33e7c7a87509a 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -846,7 +846,7 @@ <_MonoAotBuildEnv Include="TARGET_BUILD_ARCH=x64" /> - <_MonAotoBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/x86_64-linux-gnu/pkgconfig" /> + <_MonoAotBuildEnv Include="PKG_CONFIG_PATH=$(MonoCrossDir)/usr/lib/x86_64-linux-gnu/pkgconfig" /> From 92d1f2217649103e3f3e5121b8ad35dca5a81bbb Mon Sep 17 00:00:00 2001 From: Sven Boemer Date: Wed, 12 Apr 2023 17:32:54 +0000 Subject: [PATCH 82/82] Fix condition for mono aot flags I think this should check RealTargetArchitecture, not Platform --- src/mono/mono.proj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index a33e7c7a87509a..ec4168167b2834 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -566,9 +566,9 @@ <_MonoAOTCFLAGS Include="-Wl,--build-id=sha1" /> - <_MonoAOTCFLAGS Condition="'$(Platform)' == 'arm'" Include="-march=armv7-a" /> + <_MonoAOTCFLAGS Condition="'$(RealTargetArchitecture)' == 'arm'" Include="-march=armv7-a" /> <_MonoAOTCXXFLAGS Include="-Wl,--build-id=sha1" /> - <_MonoAOTCXXFLAGS Condition="'$(Platform)' == 'arm'" Include="-march=armv7-a" /> + <_MonoAOTCXXFLAGS Condition="'$(RealTargetArchitecture)' == 'arm'" Include="-march=armv7-a" />