From 374eb2ea16eb7436bc87f21d96188ae1af2b412f Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sat, 17 Dec 2022 15:26:02 -0500 Subject: [PATCH] community/dotnet6-build: security upgrade to 6.0.112 --- community/dotnet6-build/APKBUILD | 72 ++-- ...rt-building-with-nonportable-runtime.patch | 143 -------- .../build_14549-non-portable-build.patch | 36 +- ...49-stop-overridng-aspnetcore-version.patch | 68 ++++ .../installer_14549-crossgen2-rid.patch | 20 +- ...ftAspNetCoreAppRuntimePackageVersion.patch | 163 --------- ...ller_14647-update-portable-rid-logic.patch | 28 +- .../runtime_60315-momo-remove-ilstrip.patch | 43 --- .../runtime_60675-mono-sterror.patch | 173 ---------- .../runtime_66594-keep-native-symbols.patch | 45 --- ...-define-cpuidex-only-when-no-builtin.patch | 178 ---------- ...504-pass-targetrid-to-native-scripts.patch | 217 ------------ ...mejson-when-building-sharedframework.patch | 83 ----- .../runtime_76500-mono-musl-support.patch | 149 +++++--- .../runtime_76500-mono-musl-support.patch.new | 326 ++++++++++++++++++ ...downgrade-targetframework-buildtasks.patch | 24 ++ .../runtime_enable-system-libunwind.diff | 4 +- ...ble-rids-when-targetos-is-determined.patch | 127 ------- 18 files changed, 612 insertions(+), 1287 deletions(-) delete mode 100644 community/dotnet6-build/aspnetcore_43937-support-building-with-nonportable-runtime.patch create mode 100644 community/dotnet6-build/build_14549-stop-overridng-aspnetcore-version.patch delete mode 100644 community/dotnet6-build/installer_14549-rename-MicrosoftAspNetCoreAppRuntimePackageVersion.patch delete mode 100644 community/dotnet6-build/runtime_60315-momo-remove-ilstrip.patch delete mode 100644 community/dotnet6-build/runtime_60675-mono-sterror.patch delete mode 100644 community/dotnet6-build/runtime_66594-keep-native-symbols.patch delete mode 100644 community/dotnet6-build/runtime_73065-define-cpuidex-only-when-no-builtin.patch delete mode 100644 community/dotnet6-build/runtime_74504-pass-targetrid-to-native-scripts.patch delete mode 100644 community/dotnet6-build/runtime_76068-use-generated-runtimejson-when-building-sharedframework.patch create mode 100644 community/dotnet6-build/runtime_76500-mono-musl-support.patch.new create mode 100644 community/dotnet6-build/runtime_downgrade-targetframework-buildtasks.patch delete mode 100644 community/dotnet6-build/sdk_28380-map-nonportable-rids-when-targetos-is-determined.patch diff --git a/community/dotnet6-build/APKBUILD b/community/dotnet6-build/APKBUILD index a71f8669f0b..94b5b5e488a 100644 --- a/community/dotnet6-build/APKBUILD +++ b/community/dotnet6-build/APKBUILD @@ -10,42 +10,36 @@ # - CVE-2022-38013 # 6.0.110-r0: # - CVE-2022-41032 +# 6.0.112-r0: +# - CVE-2022-41089 pkgname=dotnet6-build -pkgver=6.0.111 +pkgver=6.0.112 pkgrel=0 _gittag=v$pkgver _giturl="https://github.com/dotnet/installer" _testtag=4832cef147bac35fdd5c57275a795e683bba0bb8 _bunnytag=71880bd94711519f7b786248a88a827a401207a2 _patches=" - aspnetcore_43937-support-building-with-nonportable-runtime.patch build_13378-arm-build.patch build_14549-non-portable-build.patch + build_14549-stop-overridng-aspnetcore-version.patch build_14647-update-portable-rid-logic.patch build_disable-apphost.diff check_rid-alpine-generation.diff installer_13378-arm-build.patch installer_14549-crossgen2-rid.patch - installer_14549-rename-MicrosoftAspNetCoreAppRuntimePackageVersion.patch installer_14647-update-portable-rid-logic.patch installer_2780-reprodicible-tarball.patch msbuild_optional-systemconfiguration.patch msbuild_optional-systemsecurity.patch roslyn_57003-mono-namedmutex.patch - runtime_60315-momo-remove-ilstrip.patch - runtime_60675-mono-sterror.patch - runtime_66594-keep-native-symbols.patch - runtime_73065-define-cpuidex-only-when-no-builtin.patch - runtime_74504-pass-targetrid-to-native-scripts.patch - runtime_75597-support-building-runtime-with-non-portable-runtime.patch - runtime_76068-use-generated-runtimejson-when-building-sharedframework.patch runtime_76500-mono-musl-support.patch + runtime_downgrade-targetframework-buildtasks.patch runtime_enable-system-libunwind.diff runtime_lld-fix.patch sdk_14239-add-zsh-compdef-completion-script.patch sdk_22373-portable-runtime-id.patch - sdk_28380-map-nonportable-rids-when-targetos-is-determined.patch sdk_telemetry-optout.patch " @@ -130,8 +124,17 @@ builddir="$srcdir"/dotnet-v$pkgver _checkdir="$srcdir"/dotnet-bunny-${_bunnytag/v} _testdir="$srcdir"/dotnet-regular-tests-$_testtag _cli_root="$srcdir"/bootstrap +_nugetdir="$srcdir"/nuget-cache _artifactsdir="$_cli_root"/artifacts _libdir="/usr/lib" +# if true, then within pipeline environment, in which case send logs there +# to be scooped +if [ -d "$APORTSDIR/logs" ]; then + _logdir="$APORTSDIR"/logs/$pkgname +else + _logdir="$srcdir"/logs +fi + case $CARCH in x86_64) _dotnet_arch="x64";; @@ -170,7 +173,10 @@ _fix_executable() { # generates tarball containing all components built by dotnet snapshot() { local _pkg="$srcdir"/${builddir##*/}.tar + ulimit -n 4096 + export NUGET_PACKAGES=$_nugetdir + if [ -d "$srcdir" ]; then cd "$srcdir" else @@ -205,6 +211,9 @@ snapshot() { prepare() { default_prepare + ulimit -n 4096 + export NUGET_PACKAGES=$_nugetdir + # check patches msg "check_rid-alpine-generation.diff" patch -p1 -d "$_testdir" -i "$srcdir"/check_rid-alpine-generation.diff @@ -226,6 +235,18 @@ prepare() { ;; esac + # links logfiles to pipeline logs for easy pickup in pipelines + mkdir -p "$_logdir" "$builddir"/artifacts + ln -s "$_logdir" "$builddir"/artifacts/logs + ln -s "$_logdir" "$builddir"/artifacts/log + for i in "$builddir"/src/*; do + if [ -f "$i" ]; then + continue + fi + mkdir -p "$_logdir"/${i##*\/} "$builddir"/src/${i##*\/}/artifacts + ln -s "$_logdir"/${i##*\/} "$builddir"/src/${i##*\/}/artifacts/log + done + # dotnet requires its bootstrap to be in a writable dir msg "Setting up bootstrap" local _bootstrapdir=$(find $_libdir/dotnet/bootstrap/$_pkgver_macro* -maxdepth 0 | sort -r | head -n 1) @@ -242,6 +263,7 @@ build() { msg "Building $pkgname-$pkgver" ulimit -n 4096 + export NUGET_PACKAGES=$_nugetdir # Disable use of LTTng as tracing on lttng <=2,13,0 is broken # See https://github.com/dotnet/runtime/issues/57784. @@ -287,6 +309,10 @@ build() { } check() { + + ulimit -n 4096 + export NUGET_PACKAGES=$_nugetdir + # Tests timeout (in seconds) local _tests_timeout=600 # Test suite disable flags @@ -506,35 +532,27 @@ doc() { } sha512sums=" -6a2b742ebd2459004dac32af17700c9338a31b361ec6353ed5110193426ea14dece07fcd34f20966a636b8aa6b9a9ba9b07ecbfb98984cf256c8b874e00e1a86 dotnet-v6.0.111.tar.xz +a308859d2b3e2946c38b400e9711cd34c52fbabf927fca7212ed3a87ba495b8fa125e043b4890d01c59a152930e92fdced40fd2eed9e7da3b13345cfe2a7dc6f dotnet-v6.0.112.tar.xz 994e5145653698551408a87e34d19368e85a2531af9e2bfe61b903af0f016bfd5e4a7691795bdf09ba74bf6f41fc666973ee8cfde9088738f9a2f83f4bafa5e4 dotnet-testsuite-4832cef147bac35fdd5c57275a795e683bba0bb8.tar.gz fc281df5fcf0d31dc9ff7f5b0e870960cfbe3c4fa0f6a6bb50b22c4ee18d2c608c827205bc79bd7f686d77ac917582fc26f68432cdd86c4a33b910c0c7416d09 dotnet-bunny-71880bd94711519f7b786248a88a827a401207a2.tar.gz -4e20561da7ea4a7d32bf98c16db1d6848e217a528482ec0e4b9951849af24d6ff86ec49220a693ac0256d23be436818593bd1c435cdd65c44bbd849f5d8608b2 aspnetcore_43937-support-building-with-nonportable-runtime.patch 6e9663f466007fc5fa7010e6859f054b6a4e59affa7aae7fd4d9ab4ba8410d4855b680f58f938ad21d0b3d2a7c7b097c7e9494a4dde2c43478ddddbf37539545 build_13378-arm-build.patch -b795ebf414f61d2412636805c6c8d5f798862919129c36851f4929c36b33210e88d6fcf49498adb47e6897832a4279ddffc8113f9e948f738b7bfe7ef4157a76 build_14549-non-portable-build.patch +cf1249368f1cfbb612fc89c4938a4bf73cf04560a30919a3795f1f06863892742c742c04be0ffd68d06e71dccdae056f258d45be4c252a825c8ce3e8804967e3 build_14549-non-portable-build.patch +0165bbc1f892fea735af343504d4c0ee27a1d91cbda804623b6e43d24366177def41297c8875884619c9d3bdd81ec0522eb573b28aad918853cbfe9f732ef74f build_14549-stop-overridng-aspnetcore-version.patch 023e496c82046ad4e751cf95cad10250c576cafa025c0c696c897541bace41e308ddfff25d0264312054cc033849413ebb5c9f43a100b57fd929fbc0dee2ee4c build_14647-update-portable-rid-logic.patch a5a359af816595fbf19482e5dccf874c78d2fc4b59f38223118aac603b33e00c9fed22580eee3112519477205c2c8ed16177d100f09f45275e3da3c20b0ed7f7 build_disable-apphost.diff 941b430b55e323f723bbc5160447f060f40d18ce32e5803ab7dda16bfc60a0f5ec1dccd246e68475d7115ee265a9433824d8a5d997c302531311194a90deeca9 check_rid-alpine-generation.diff 23b712d7a088e780cd0994c5577b4c015cc1478e3a6bbca9b6e97ff2f2711562ef3a01ed483582a6861b31989b949972e2159caa4a34e0b18b6e8c062bb82c9e installer_13378-arm-build.patch -202d927a67f5d7c11f55e19df2de05ed63d2c5cedbbf47ba08d268f43202c3f20fd50cdc3247bb58d1a2d97168f6a64ad06ef37989caa161cc183d90ecb482d6 installer_14549-crossgen2-rid.patch -1d9cfb638f47837d81cae9a45a7f271247afee34b50f150d2bb88ed29fba16cdb69a11a3b76474c6652830ff6d74dce7019652a925ebaba8b626f42bcfcd343f installer_14549-rename-MicrosoftAspNetCoreAppRuntimePackageVersion.patch -5507b78242a0d3d6dee00c355f6e1955021d6d05bf03f2b84c77e2ea0b007a0af92c344c379351310c57c55d35c350ed40a86ef15a16343a811e5d857d1b6c17 installer_14647-update-portable-rid-logic.patch +54687c46cb1f6ba064e928329515e24c5025ad09af5c52b582cdd48d626de4e1d4bb2f8e39632df0ae667aed3655884d7c1f2f40752a2f9030d8d46c5e38335b installer_14549-crossgen2-rid.patch +926e5f2599065388a766fb3bf52f32c3019279d9c1caeda941605943fb5abcc336b151e6b09971a02ef1833d2ab3bf89f699a7d10b6dcaed06045d0ac2732ef4 installer_14647-update-portable-rid-logic.patch c2451ab9c3bf5c25998105869aabc36f741964040775b53eb78ba41ac5f5d0e25f2514664080393e621011487501bc1f1d18b34dfdf8f99649f407792891779f installer_2780-reprodicible-tarball.patch 86e14ecc0269c8b2c2a2a679790de4fa4e15ac06b2a831e1129c4a7de1499d60583fcdc79b3705652c3c4ced73afac2e0ee3edce2cfa3b00fddf94180fb26e10 msbuild_optional-systemconfiguration.patch f4d27624f735ce77e0030fa791594fc12fb325a3ce8620791a7856bd5c0067a042df2196ec97ed4d0309db64bd51e6a48cafaad316d9ea45e34134214a7f3ca4 msbuild_optional-systemsecurity.patch 42779a7bf1004fe0f7054cfa4f09f49d7f2a57c0543ec994ffbd54fb349abb508295476098ed35d60e9676be8bcc15aa8a9ec5c814cd1e058357530b5cdfb2b6 roslyn_57003-mono-namedmutex.patch -e0ff5e45b2e51571e6f332a07176290a9de1bf883350e9b8421c68de705a23a5ef8364276a35723677f30b6caa447ece0f75a50ff1b4568283486fb22c39de93 runtime_60315-momo-remove-ilstrip.patch -f28c3fa0fcff8fbf4d29b31e44532dcba43c4d90587a4e2da21f5e112ee231eb2e9c081d4c1c4893ec7e8f8afd8624b7b9284d5577e57c070a18f5846b9cbf2c runtime_60675-mono-sterror.patch -48ddb86969fb0df916cb0d1581ca57cb24def3adc746fbb8ade96c8b5f0f08e5e184c15d7bcc4e5ca87acf38c5a3430baea99f01ed2d826131dffbd0eba230a4 runtime_66594-keep-native-symbols.patch -14e5bb47f9265f2768696091587c153342f6e217b1c4541467a381bd6491600c2cf47e05599d76b13afce6701f797c74194a3e308b73306c082b09553256b7ed runtime_73065-define-cpuidex-only-when-no-builtin.patch -7609bcb8978d01165a36e45db678eba91dbeed815ccb3e103c0dc1055d664ebbd22506be736f44c1c9d93d3a82341a4140b6269fe791ab79bef79c8210ec3af7 runtime_74504-pass-targetrid-to-native-scripts.patch -635794e36da525c628b7a166eef2b705159ce9d7dcb0df7f0e22d946751175b706588085e7407cb9a1b4d20c015de7c3fd6ecf790140d134f6da69f48f852d24 runtime_75597-support-building-runtime-with-non-portable-runtime.patch -4381b4ccb2e7c8f01fd097f9e551524779e19fb340203b3ed198bda1ba1b52f0884f5d8b2ed0a36708a867fb5c8aeb57eeb8e63f76830a6ff2fb7e3c94b4808c runtime_76068-use-generated-runtimejson-when-building-sharedframework.patch -4328383925067d69ea1a0c6ef3bc2579c5fd3b83118069372ab1caee9a55f44c3f958e2dbccd81a1293eb52c8bd5c220fe1ae1fd643ed59a0ce582e90b733b1a runtime_76500-mono-musl-support.patch -a0dbf7c0809ad7ef25ad1dbaeeeafa30bb10a035c055d66baf24a1efaff962d7e8041196bd7833ce20fc4236695a09b0e4a92a49d9ed0cef817cb6f6e6822352 runtime_enable-system-libunwind.diff +e67e0114bd324dae65eb19f6fa8c74414bee77cd30e299931b0d82b4ca1b6b6f88358a0c47ffb180f46c5cb28f61f79bb4a59d43c1ae3011bfe491e757de293a runtime_76500-mono-musl-support.patch +794b9c2c8f69ff7913afce2fc61cd64746bcc97913044deb5c59d2267116859849e5269199d3a459d3e3a85530981af63797468c65b383f6b4d27f36a940499d runtime_downgrade-targetframework-buildtasks.patch +91f237afe642d0170dbf0e9a2706a4145c937d9d869d22959acaf092f1fd11941144b2b1d041102abe7b70349dd5869d558896e9d13d01f176cace39b21ef1ef runtime_enable-system-libunwind.diff 5f465f6e3bfbff66551a5690eb41be46735f8e0b1e6e6503038521a8cc60cd66b7839426319ec304f785c9f074ef588b1f189ad6dbb6ced53257af28b09388f2 runtime_lld-fix.patch d1b4ebcbb1a6815fc0ce4c471485c232618e60968a879309fb8336821a9351d2e0028d9f7726c0c041c750b497a0baa47400c78c9ceff550b91b4a6c2816fc41 sdk_14239-add-zsh-compdef-completion-script.patch 9c2a22aba71357069ff77b739d3e8180a70812290a7e49dcd638b517f4fc3046e3055fd21a574c1758583cdb92bbf2269966f3c5e0f2db53aef4948387489832 sdk_22373-portable-runtime-id.patch -be95fdbb00aa4a38d8270dd74891143dd090018630526c0c9a270afa3c95022fca6c91b4f70158169b9767e9d37f0b1d4ebaacdab78d82f09473ec5cf8b93880 sdk_28380-map-nonportable-rids-when-targetos-is-determined.patch 815de1dad37412579b16d763debe2ecceffb44f5c46bd3f4ac00b3e431b20c677db435794eac41cea5601030b4e0f03f19e2d53c7a1ead896de2ffbca787eb84 sdk_telemetry-optout.patch " diff --git a/community/dotnet6-build/aspnetcore_43937-support-building-with-nonportable-runtime.patch b/community/dotnet6-build/aspnetcore_43937-support-building-with-nonportable-runtime.patch deleted file mode 100644 index f094b98a522..00000000000 --- a/community/dotnet6-build/aspnetcore_43937-support-building-with-nonportable-runtime.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 4e92a776a0bb0b8a4ab02ad4e436352594b7eab2 Mon Sep 17 00:00:00 2001 -Patch-Source: https://github.com/dotnet/aspnetcore/pull/43937 -From: Tom Deseyn -Date: Tue, 13 Sep 2022 10:51:19 +0200 -Subject: [PATCH 1/3] source-build: support building aspnetcore using - non-portable runtime packages. - -Currently source-build performs 'runtime-portable' build that produces 'linux-{arch}' -packages that are used when building ASP.NET Core. - -With this change, we can use the non-portable packages that are produced by the -source-build 'runtime' build, and eliminate the 'runtime-portable' build. - ---- - src/aspnetcore/Directory.Build.props | 2 ++ - src/aspnetcore/eng/Common.props | 2 ++ - src/aspnetcore/eng/Dependencies.props | 2 ++ - .../eng/tools/GenerateFiles/Directory.Build.targets.in | 7 +++++++ - .../Wasm.Performance/Driver/Wasm.Performance.Driver.csproj | 2 +- - .../src/Microsoft.AspNetCore.App.Runtime.csproj | 5 +++-- - src/aspnetcore/src/Tools/Directory.Build.targets | 2 +- - 7 files changed, 18 insertions(+), 4 deletions(-) - -diff --git a/src/aspnetcore/Directory.Build.props b/src/aspnetcore/Directory.Build.props -index 721f099a7..9979b084f 100644 ---- a/src/aspnetcore/Directory.Build.props -+++ b/src/aspnetcore/Directory.Build.props -@@ -173,6 +173,8 @@ - freebsd-x64 - - -+ $(SupportedRuntimeIdentifiers);$(TargetRuntimeIdentifier) -+ - - true - -diff --git a/src/aspnetcore/eng/Common.props b/src/aspnetcore/eng/Common.props -index a9a69bde9..3dcca1c6b 100644 ---- a/src/aspnetcore/eng/Common.props -+++ b/src/aspnetcore/eng/Common.props -@@ -6,6 +6,8 @@ - freebsd - x64 - $(TargetOsName)-$(TargetArchitecture) -+ true -+ $(TargetRuntimeIdentifier) - - - -diff --git a/src/aspnetcore/eng/Dependencies.props b/src/aspnetcore/eng/Dependencies.props -index 75c41177f..d39473508 100644 ---- a/src/aspnetcore/eng/Dependencies.props -+++ b/src/aspnetcore/eng/Dependencies.props -@@ -95,6 +95,7 @@ and are generated based on the last package release. - - - -+ - - - -@@ -109,6 +110,7 @@ and are generated based on the last package release. - - - -+ - - - -diff --git a/src/aspnetcore/eng/tools/GenerateFiles/Directory.Build.targets.in b/src/aspnetcore/eng/tools/GenerateFiles/Directory.Build.targets.in -index c5206ec8c..5e693b6d7 100644 ---- a/src/aspnetcore/eng/tools/GenerateFiles/Directory.Build.targets.in -+++ b/src/aspnetcore/eng/tools/GenerateFiles/Directory.Build.targets.in -@@ -39,8 +39,15 @@ - ${MicrosoftNETCoreAppRuntimeVersion} -+ $(TargetRuntimeIdentifier) - - -+ -+ ${MicrosoftNETCoreAppRuntimeVersion} -+ $(TargetRuntimeIdentifier) -+ -+ - - - - false - true -- linux-x64 -+ linux-x64 - - - -diff --git a/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj b/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj -index aeb3c08f1..a23f607e4 100644 ---- a/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj -+++ b/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj -@@ -96,7 +96,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant - $(Crossgen2ToolFileName).exe - - -- PkgMicrosoft_NETCore_App_Runtime_$(RuntimeIdentifier) -+ PkgMicrosoft_NETCore_App_Runtime_$(RuntimeIdentifier.Replace('.', '_')) - - - $(TargetOsName) - linux -+ $(TargetRuntimeIdentifier.Substring(0,$(TargetRuntimeIdentifier.IndexOf('-')))) - x64 - $(BuildArchitecture) -- PkgMicrosoft_NETCore_App_Crossgen2_$(BuildOsName)-$(Crossgen2BuildArchitecture) -+ PkgMicrosoft_NETCore_App_Crossgen2_$(BuildOsName.Replace('.', '_'))-$(Crossgen2BuildArchitecture) - - $(AssetTargetFallback);native,Version=0.0 - -diff --git a/src/aspnetcore/src/Tools/Directory.Build.targets b/src/aspnetcore/src/Tools/Directory.Build.targets -index 854f90ab5..438ea3da0 100644 ---- a/src/aspnetcore/src/Tools/Directory.Build.targets -+++ b/src/aspnetcore/src/Tools/Directory.Build.targets -@@ -1,7 +1,7 @@ - - - -- win-x64;win-x86 -+ win-x64;win-x86 - - false - diff --git a/repos/aspnetcore.proj b/repos/aspnetcore.proj -index 480f3c7..5224302 100644 +index 480f3c713..52243024a 100644 --- a/repos/aspnetcore.proj +++ b/repos/aspnetcore.proj @@ -9,6 +9,7 @@ @@ -45,7 +53,7 @@ index 480f3c7..5224302 100644 included by Arcade --> $(BuildCommandArgs) /p:MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.0 diff --git a/repos/installer.proj b/repos/installer.proj -index e34337b..6c08a1f 100644 +index e34337b85..6c08a1f67 100644 --- a/repos/installer.proj +++ b/repos/installer.proj @@ -25,7 +25,7 @@ @@ -58,7 +66,7 @@ index e34337b..6c08a1f 100644 $(BuildCommandArgs) /p:CoreSetupRid=freebsd-x64 /p:PortableBuild=true $(BuildCommandArgs) /p:CoreSetupRid=osx-x64 diff --git a/repos/known-good.proj b/repos/known-good.proj -index c04cdac..7a84ecd 100644 +index eab516290..12d9943da 100644 --- a/repos/known-good.proj +++ b/repos/known-good.proj @@ -44,7 +44,6 @@ @@ -70,7 +78,7 @@ index c04cdac..7a84ecd 100644 diff --git a/repos/runtime.proj b/repos/runtime.proj -index f3ed143..073cd8b 100644 +index f3ed143f8..073cd8bc1 100644 --- a/repos/runtime.proj +++ b/repos/runtime.proj @@ -1,18 +1,57 @@ @@ -185,7 +193,7 @@ index f3ed143..073cd8b 100644 + diff --git a/repos/source-build-reference-packages.proj b/repos/source-build-reference-packages.proj -index 69ab564..9545b50 100644 +index 69ab564a2..9545b50e4 100644 --- a/repos/source-build-reference-packages.proj +++ b/repos/source-build-reference-packages.proj @@ -2,7 +2,9 @@ @@ -200,5 +208,5 @@ index 69ab564..9545b50 100644 $(ProjectDirectory)NuGet.config $(ProjectDirectory)global.json -- -2.38.0 +2.36.3 diff --git a/community/dotnet6-build/build_14549-stop-overridng-aspnetcore-version.patch b/community/dotnet6-build/build_14549-stop-overridng-aspnetcore-version.patch new file mode 100644 index 00000000000..018f53f2aba --- /dev/null +++ b/community/dotnet6-build/build_14549-stop-overridng-aspnetcore-version.patch @@ -0,0 +1,68 @@ +From c1d1072c438ab5644143d7a8909bd02cf589d2e8 Mon Sep 17 00:00:00 2001 +From: Antoine Martin +Date: Tue, 15 Nov 2022 01:08:29 -0500 +Subject: [PATCH 3/3] source-build: stop overriding aspnetcore version + (backport of #14938) + +--- + .../tarball/content/Directory.Build.props | 4 ---- + .../tarball/content/tools-local/init-build.proj | 12 ++++++++++++ + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/Directory.Build.props b/Directory.Build.props +index 2e2d7e8bc..6b08fa71b 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -222,12 +222,8 @@ + + + +- + + +- +- +- + + + +diff --git a/tools-local/init-build.proj b/tools-local/init-build.proj +index 701f76c0c..ac4508947 100644 +--- a/tools-local/init-build.proj ++++ b/tools-local/init-build.proj +@@ -9,6 +9,7 @@ + + + ++ + + + +@@ -22,6 +23,7 @@ + + + ++ ++ ++ ++ ++ ++ + +-- +2.36.3 + diff --git a/community/dotnet6-build/installer_14549-crossgen2-rid.patch b/community/dotnet6-build/installer_14549-crossgen2-rid.patch index 93bce500abb..81f020db74a 100644 --- a/community/dotnet6-build/installer_14549-crossgen2-rid.patch +++ b/community/dotnet6-build/installer_14549-crossgen2-rid.patch @@ -9,17 +9,31 @@ Subject: [PATCH] crossgen2 rid 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/installer/src/redist/targets/Crossgen.targets b/src/installer/src/redist/targets/Crossgen.targets -index c7a7642e4..41fa3861a 100644 +index 8949af132..a59ed388f 100644 --- a/src/installer/src/redist/targets/Crossgen.targets +++ b/src/installer/src/redist/targets/Crossgen.targets @@ -6,7 +6,7 @@ - + microsoft.netcore.app.runtime.$(SharedFrameworkRid) - microsoft.netcore.app.crossgen2.$(HostOSName)-$(BuildArchitecture) -+ microsoft.netcore.app.crossgen2.$(SharedFrameworkRid) ++ microsoft.netcore.app.crossgen2.$(Crossgen2Rid) $(NuGetPackageRoot)/$(RuntimeNETCrossgenPackageName)/$(MicrosoftNETCoreAppRuntimePackageVersion)/tools/crossgen2$(ExeExtension) +diff --git a/src/installer/src/redist/targets/GenerateLayout.targets b/src/installer/src/redist/targets/GenerateLayout.targets +index 88a053b61..ce5e09b69 100644 +--- a/src/installer/src/redist/targets/GenerateLayout.targets ++++ b/src/installer/src/redist/targets/GenerateLayout.targets +@@ -84,6 +84,9 @@ + dotnet-runtime$(PgoTerm)-$(VSRedistCommonNetCoreSharedFrameworkx6460PackageVersion)-$(SharedFrameworkRid)$(ArchiveExtension) + windowsdesktop-runtime-$(MicrosoftWindowsDesktopAppRuntimePackageVersion)-$(SharedFrameworkRid)$(ArchiveExtension) + ++ $(HostOSName)-$(BuildArchitecture) ++ $(SharedFrameworkRid) ++ + $(SharedFrameworkRid) + linux-x64 + $(AspNetCoreInstallerRid) -- 2.37.3 diff --git a/community/dotnet6-build/installer_14549-rename-MicrosoftAspNetCoreAppRuntimePackageVersion.patch b/community/dotnet6-build/installer_14549-rename-MicrosoftAspNetCoreAppRuntimePackageVersion.patch deleted file mode 100644 index 03363b6c15c..00000000000 --- a/community/dotnet6-build/installer_14549-rename-MicrosoftAspNetCoreAppRuntimePackageVersion.patch +++ /dev/null @@ -1,163 +0,0 @@ -From f54977e2fc84527fe58024ed5537cb63244168e2 Mon Sep 17 00:00:00 2001 -Patch-Source: https://github.com/dotnet/installer/pull/14549 -From: Tom Deseyn -Date: Tue, 13 Sep 2022 14:17:35 +0200 -Subject: [PATCH 1/1] - installer_14549-rename-MicrosoftAspNetCoreAppRuntimePackageVersion.patch - -Wrong version of aspnetcore-runtime-internal is pulled by installer when -building source-build on Alpine Linux. This is due to a workaround on -osx and windows that breaks on Alpine, patch renames variable to go -around workaround. - ---- - src/installer/eng/Versions.props | 4 ++-- - .../redist/targets/GenerateBundledVersions.targets | 4 ++-- - .../src/redist/targets/GenerateDebs.targets | 2 +- - .../src/redist/targets/GenerateLayout.targets | 13 +++++++------ - .../src/redist/targets/GenerateMSIs.targets | 2 +- - .../src/redist/targets/GeneratePKG.targets | 2 +- - .../LinuxNativeInstallerDependencyVersions.targets | 2 +- - 7 files changed, 15 insertions(+), 14 deletions(-) - -diff --git a/src/installer/eng/Versions.props b/src/installer/eng/Versions.props -index a52e53cca..fd69843ca 100644 ---- a/src/installer/eng/Versions.props -+++ b/src/installer/eng/Versions.props -@@ -88,7 +88,7 @@ - - $(MicrosoftNETCoreAppHostwinx64PackageVersion) - $(MicrosoftNETCoreAppRuntimewinx64PackageVersion) -- $(MicrosoftAspNetCoreAppRuntimewinx64PackageVersion) -+ $(MicrosoftAspNetCoreAppRuntimewinx64PackageVersion) - $(MicrosoftWindowsDesktopAppRuntimewinx64PackageVersion) - - -@@ -116,7 +116,7 @@ - $(NUnit3DotNetNewTemplatePackageVersion) - $(MicrosoftDotNetCommonItemTemplatesPackageVersion) - 6.0.111 -- $(MicrosoftAspNetCoreAppRuntimePackageVersion) -+ $(MicrosoftAspNetCoreAppRuntimePackageVersionBuilt) - - $(MicrosoftWinFormsProjectTemplates50PackageVersion) - $(MicrosoftWPFProjectTemplates50PackageVersion) -diff --git a/src/installer/src/redist/targets/GenerateBundledVersions.targets b/src/installer/src/redist/targets/GenerateBundledVersions.targets -index f98379cb9..aa0603e5e 100644 ---- a/src/installer/src/redist/targets/GenerateBundledVersions.targets -+++ b/src/installer/src/redist/targets/GenerateBundledVersions.targets -@@ -204,7 +204,7 @@ - - - -- -+ - - - -@@ -365,7 +365,7 @@ Copyright (c) .NET Foundation. All rights reserved. - TargetFramework="net6.0" - RuntimeFrameworkName="Microsoft.AspNetCore.App" - DefaultRuntimeFrameworkVersion="$(MicrosoftAspNetCoreAppDefaultRuntimeFrameworkVersion)" -- LatestRuntimeFrameworkVersion="$(MicrosoftAspNetCoreAppRuntimePackageVersion)" -+ LatestRuntimeFrameworkVersion="$(MicrosoftAspNetCoreAppRuntimePackageVersionBuilt)" - TargetingPackName="Microsoft.AspNetCore.App.Ref" - TargetingPackVersion="$(MicrosoftAspNetCoreAppRefPackageVersion)" - RuntimePackNamePatterns="Microsoft.AspNetCore.App.Runtime.**RID**" -diff --git a/src/installer/src/redist/targets/GenerateDebs.targets b/src/installer/src/redist/targets/GenerateDebs.targets -index f0e7e5d14..610b43182 100644 ---- a/src/installer/src/redist/targets/GenerateDebs.targets -+++ b/src/installer/src/redist/targets/GenerateDebs.targets -@@ -61,7 +61,7 @@ - $(DownloadsFolder)$(DownloadedHostFxrInstallerFileName) - dotnet-host - $(DownloadsFolder)$(DownloadedSharedHostInstallerFileName) -- aspnetcore-runtime-$(MicrosoftAspNetCoreAppRuntimePackageVersion) -+ aspnetcore-runtime-$(MicrosoftAspNetCoreAppRuntimePackageVersionBuilt) - $(AspNetCoreSharedFxDebianPackageFileName.ToLower()) - aspnetcore-runtime-$(AspNetCoreMajorMinorVersion) - $(AspNetCoreSharedFxDebianPackageName.ToLower()) -diff --git a/src/installer/src/redist/targets/GenerateLayout.targets b/src/installer/src/redist/targets/GenerateLayout.targets -index 88a053b61..819142a12 100644 ---- a/src/installer/src/redist/targets/GenerateLayout.targets -+++ b/src/installer/src/redist/targets/GenerateLayout.targets -@@ -9,7 +9,7 @@ - - - $(VSRedistCommonAspNetCoreSharedFrameworkx6460PackageVersion) -- $(MicrosoftAspNetCoreAppRuntimePackageVersion) -+ $(MicrosoftAspNetCoreAppRuntimePackageVersionBuilt) - - $(VSRedistCommonNetCoreSharedFrameworkx6460PackageVersion) - $(MicrosoftNETCoreAppRuntimePackageVersion) -@@ -90,15 +90,15 @@ - x64 - aarch64 - -- aspnetcore-runtime-$(MicrosoftAspNetCoreAppRuntimePackageVersion)-$(AspNetCoreInstallerRid)$(InstallerExtension) -+ aspnetcore-runtime-$(MicrosoftAspNetCoreAppRuntimePackageVersionBuilt)-$(AspNetCoreInstallerRid)$(InstallerExtension) - aspnetcore-runtime-$(VSRedistCommonAspNetCoreSharedFrameworkx6460PackageVersion)-$(AspNetCoreInstallerRid)$(InstallerExtension) - -- aspnetcore-runtime-internal-$(MicrosoftAspNetCoreAppRuntimePackageVersion)-$(AspNetCoreInstallerRid).wixlib -+ aspnetcore-runtime-internal-$(MicrosoftAspNetCoreAppRuntimePackageVersionBuilt)-$(AspNetCoreInstallerRid).wixlib - aspnetcore-targeting-pack-$(MicrosoftAspNetCoreAppRefPackageVersion)-$(AspNetCoreInstallerRid)$(InstallerExtension) - aspnetcore-targeting-pack-$(MicrosoftAspNetCoreAppRefInternalPackageVersion)-$(AspNetCoreInstallerRid)$(InstallerExtension) -- aspnetcoremodule_$(Architecture)_en_v2_$(MicrosoftAspNetCoreAppRuntimePackageVersion)$(InstallerExtension) -+ aspnetcoremodule_$(Architecture)_en_v2_$(MicrosoftAspNetCoreAppRuntimePackageVersionBuilt)$(InstallerExtension) - aspnetcore-targeting-pack-$(MicrosoftAspNetCoreAppRefPackageVersion)-$(AspNetCoreArchiveRid)$(ArchiveExtension) -- aspnetcore-runtime-internal-$(MicrosoftAspNetCoreAppRuntimePackageVersion)-$(AspNetCoreArchiveRid)$(ArchiveExtension) -+ aspnetcore-runtime-internal-$(MicrosoftAspNetCoreAppRuntimePackageVersionBuilt)-$(AspNetCoreArchiveRid)$(ArchiveExtension) - - - aspnetcore_base_runtime.version -@@ -450,7 +450,7 @@ - -+ MicrosoftAspNetCoreAppVersion="$(MicrosoftAspNetCoreAppRuntimePackageVersionBuilt)" /> - - - - -diff --git a/src/installer/src/redist/targets/GeneratePKG.targets b/src/installer/src/redist/targets/GeneratePKG.targets -index 39a79152d..322b9831c 100644 ---- a/src/installer/src/redist/targets/GeneratePKG.targets -+++ b/src/installer/src/redist/targets/GeneratePKG.targets -@@ -113,7 +113,7 @@ - $(MicrosoftNETCoreAppRuntimePackageVersion) - - -- $(MicrosoftAspNetCoreAppRuntimePackageVersion) -+ $(MicrosoftAspNetCoreAppRuntimePackageVersionBuilt) - - - -diff --git a/src/installer/src/redist/targets/LinuxNativeInstallerDependencyVersions.targets b/src/installer/src/redist/targets/LinuxNativeInstallerDependencyVersions.targets -index 82482b22a..e3ac13427 100644 ---- a/src/installer/src/redist/targets/LinuxNativeInstallerDependencyVersions.targets -+++ b/src/installer/src/redist/targets/LinuxNativeInstallerDependencyVersions.targets -@@ -11,7 +11,7 @@ - - - -- -+ - - - --- -2.38.0 - diff --git a/community/dotnet6-build/installer_14647-update-portable-rid-logic.patch b/community/dotnet6-build/installer_14647-update-portable-rid-logic.patch index fe5bdf3b963..ea18c884b15 100644 --- a/community/dotnet6-build/installer_14647-update-portable-rid-logic.patch +++ b/community/dotnet6-build/installer_14647-update-portable-rid-logic.patch @@ -10,31 +10,8 @@ Subject: [PATCH 2/2] BundledVersions: update portable rid logic (backport src/redist/targets/GetRuntimeInformation.targets | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) -diff --git a/src/installer/src/SourceBuild/tarball/content/repos/installer.proj b/src/installer/src/SourceBuild/tarball/content/repos/installer.proj -index 6c08a1f67d8..95d47c94152 100644 ---- a/src/installer/src/SourceBuild/tarball/content/repos/installer.proj -+++ b/src/installer/src/SourceBuild/tarball/content/repos/installer.proj -@@ -10,6 +10,10 @@ - osx-x64 - $(OverrideTargetRid.Substring(0, $(OverrideTargetRid.IndexOf("-")))) - -+ -+ <_platformIndex>$(NETCoreSdkPortableRuntimeIdentifier.LastIndexOf('-')) -+ $(NETCoreSdkPortableRuntimeIdentifier.Substring(0, $(_platformIndex))) -+ - --runtime-id $(OverrideTargetRid) - --runtime-id $(TargetRid) - -@@ -22,6 +26,7 @@ - --> - $(BuildCommandArgs) /p:NETCoreAppMaximumVersion=99.9 - $(BuildCommandArgs) /p:OSName=$(OSNameOverride) -+ $(BuildCommandArgs) /p:PortableOSName=$(PortableOS) - $(BuildCommandArgs) /p:Rid=$(TargetRid) - $(BuildCommandArgs) /p:DOTNET_INSTALL_DIR=$(DotNetCliToolDir) - diff --git a/src/installer/src/redist/targets/GetRuntimeInformation.targets b/src/installer/src/redist/targets/GetRuntimeInformation.targets -index a99a7e9daf5..89f00011994 100644 +index a99a7e9da..89f000119 100644 --- a/src/installer/src/redist/targets/GetRuntimeInformation.targets +++ b/src/installer/src/redist/targets/GetRuntimeInformation.targets @@ -9,10 +9,15 @@ @@ -69,3 +46,6 @@ index a99a7e9daf5..89f00011994 100644 $(HostOSName)-$(Architecture) +-- +2.36.3 + diff --git a/community/dotnet6-build/runtime_60315-momo-remove-ilstrip.patch b/community/dotnet6-build/runtime_60315-momo-remove-ilstrip.patch deleted file mode 100644 index d1ac06db782..00000000000 --- a/community/dotnet6-build/runtime_60315-momo-remove-ilstrip.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 5dd8cb4053546eaa1508cf24f96e7c4996a4a189 Mon Sep 17 00:00:00 2001 -Patch-Source: https://github.com/dotnet/runtime/pull/60315 -From: Eric Erhardt -Date: Tue, 12 Oct 2021 19:40:56 +0000 -Subject: Eliminate usages of pre-built packages during source-build - -Mono still has a dependency on (now unbuildable) ILStrip which was removed from CoreCLR - ---- - -diff --git a/src/runtime/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Microsoft.NET.Runtime.MonoTargets.Sdk.pkgproj b/src/runtime/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Microsoft.NET.Runtime.MonoTargets.Sdk.pkgproj -index 724b704f864..3dabdc81dae 100644 ---- a/src/runtime/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Microsoft.NET.Runtime.MonoTargets.Sdk.pkgproj -+++ b/src/runtime/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Microsoft.NET.Runtime.MonoTargets.Sdk.pkgproj -@@ -6,7 +6,7 @@ - - - -- -+ - - - -@@ -15,7 +15,7 @@ - - - -- -+ - - - -diff --git a/src/runtime/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/Sdk.props b/src/runtime/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/Sdk.props -index 8a7ede79242..cfd515eeca9 100644 ---- a/src/runtime/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/Sdk.props -+++ b/src/runtime/src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/Sdk.props -@@ -1,5 +1,5 @@ - -- -+ - - - diff --git a/community/dotnet6-build/runtime_60675-mono-sterror.patch b/community/dotnet6-build/runtime_60675-mono-sterror.patch deleted file mode 100644 index 1b2d13f7086..00000000000 --- a/community/dotnet6-build/runtime_60675-mono-sterror.patch +++ /dev/null @@ -1,173 +0,0 @@ -From 577a70afa472a2b7aa8e05947e185d920f42b23d Mon Sep 17 00:00:00 2001 -Patch-Source: https://github.com/dotnet/runtime/pull/60675 -From: Adeel Mujahid <3840695+am11@users.noreply.github.com> -Date: Tue, 2 Nov 2021 17:47:37 +0200 -Subject: [PATCH] Fix gcc warnings during mono linux-x64 build (#60675) - -* Fix gcc warnings during mono linux-x64 build - -main with Debug configuration: 822 warnings - http://sprunge.us/2GzrDE -PR with Debug configuration: 3 warnings related to deprecated sys/sysctl.h includes - http://sprunge.us/JuyA3K - -after fixing Debug warnings, there were 13 additional warnings in Release configuration: -http://sprunge.us/PJCivP - -PR with Release configuration: (same) 3 warnings - http://sprunge.us/NwKHNE - -* Address CR feedback ---- - src/mono/cmake/config.h.in | 7 +-- - src/mono/cmake/configure.cmake | 40 +++++++++++--- - src/mono/cmake/defines-todo.cmake | 1 - - src/mono/mono/eglib/src/runtime/gstr.c | 14 ++--- - src/mono/mono/utils/mono-proclib.c | 28 +++++----- - 5 files changed, 173 insertions(+), 192 deletions(-) - -diff --git a/src/runtime/src/mono/cmake/config.h.in b/src/runtime/src/mono/cmake/config.h.in -index 48a82ec6db8c4..648ad60dd0494 100644 ---- a/src/runtime/src/mono/cmake/config.h.in -+++ b/src/runtime/src/mono/cmake/config.h.in -@@ -510,14 +510,11 @@ - /* Define to 1 if you have the `strerror_r' function. */ - #cmakedefine HAVE_STRERROR_R 1 - --/* Define to 1 if strerror_r returns char *. */ --#cmakedefine STRERROR_R_CHAR_P 1 -- - /* Have GLIBC_BEFORE_2_3_4_SCHED_SETAFFINITY */ - #cmakedefine GLIBC_BEFORE_2_3_4_SCHED_SETAFFINITY 1 - - /* GLIBC has CPU_COUNT macro in sched.h */ --#cmakedefine GLIBC_HAS_CPU_COUNT 1 -+#cmakedefine HAVE_GNU_CPU_COUNT - - /* Have large file support */ - #cmakedefine HAVE_LARGE_FILE_SUPPORT 1 -@@ -712,6 +709,8 @@ - /* The size of `size_t', as computed by sizeof. */ - #define SIZEOF_SIZE_T @SIZEOF_SIZE_T@ - -+#cmakedefine01 HAVE_GNU_STRERROR_R -+ - /* Define to 1 if the system has the type `struct sockaddr'. */ - #cmakedefine HAVE_STRUCT_SOCKADDR 1 - -diff --git a/src/runtime/src/mono/cmake/configure.cmake b/src/runtime/src/mono/cmake/configure.cmake -index 7bee1c6b98553..e8e9fb9e67d79 100644 ---- a/src/runtime/src/mono/cmake/configure.cmake -+++ b/src/runtime/src/mono/cmake/configure.cmake -@@ -135,6 +135,37 @@ - check_type_size("long long" SIZEOF_LONG_LONG) - check_type_size("size_t" SIZEOF_SIZE_T) - -+if (HOST_LINUX OR HOST_ANDROID) -+ set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) -+endif() -+ -+check_c_source_compiles( -+ " -+ #include -+ int main(void) -+ { -+ char buffer[1]; -+ char c = *strerror_r(0, buffer, 0); -+ return 0; -+ } -+ " -+ HAVE_GNU_STRERROR_R) -+ -+check_c_source_compiles( -+ " -+ #include -+ int main(void) -+ { -+ CPU_COUNT((void *) 0); -+ return 0; -+ } -+ " -+ HAVE_GNU_CPU_COUNT) -+ -+if (HOST_LINUX OR HOST_ANDROID) -+ set(CMAKE_REQUIRED_DEFINITIONS) -+endif() -+ - # ICONV - set(ICONV_LIB) - find_library(LIBICONV_FOUND iconv) -@@ -142,14 +173,6 @@ - set(ICONV_LIB "iconv") - endif() - --file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test.c -- "#include \n" -- "void main () { CPU_COUNT((void *) 0); }\n" --) --try_compile(GLIBC_HAS_CPU_COUNT ${CMAKE_BINARY_DIR}/CMakeTmp SOURCES "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test.c" -- COMPILE_DEFINITIONS "-D_GNU_SOURCE") -- -- - if(HOST_WIN32) - # checking for this doesn't work for some reason, hardcode result - set(HAVE_WINTERNL_H 1) -diff --git a/src/runtime/src/mono/cmake/defines-todo.cmake b/src/runtime/src/mono/cmake/defines-todo.cmake -index d45098d4eea4f..8d2828d53e9ba 100644 ---- a/src/runtime/src/mono/cmake/defines-todo.cmake -+++ b/src/runtime/src/mono/cmake/defines-todo.cmake -@@ -4,7 +4,6 @@ - - #option (MAJOR_IN_MKDEV "Define to 1 if `major', `minor', and `makedev' are declared in .") - #option (MAJOR_IN_SYSMACROS "Define to 1 if `major', `minor', and `makedev' are declared in .") --#option (STRERROR_R_CHAR_P "Define to 1 if strerror_r returns char *.") - #option (HAVE_LIBICONV "Define to 1 if you have the `iconv' library (-liconv).") - #option (ANDROID_UNIFIED_HEADERS "Whether Android NDK unified headers are used") - #option (MONO_DL_NEED_USCORE "Does dlsym require leading underscore.") -diff --git a/src/runtime/src/mono/mono/eglib/src/runtime/gstr.c b/src/mono/mono/eglib/gstr.c -index c549b241894f1..cbf63d8f02b97 100644 ---- a/src/runtime/src/mono/mono/eglib/src/runtime/gstr.c -+++ b/src/runtime/src/mono/mono/eglib/gstr.c -@@ -249,7 +249,11 @@ g_strerror (gint errnum) - size_t buff_len = sizeof (tmp_buff); - buff [0] = 0; - --#ifndef STRERROR_R_CHAR_P -+#if HAVE_GNU_STRERROR_R -+ buff = strerror_r (errnum, buff, buff_len); -+ if (!error_messages [errnum]) -+ error_messages [errnum] = g_strdup (buff); -+#else /* HAVE_GNU_STRERROR_R */ - int r; - while ((r = strerror_r (errnum, buff, buff_len - 1))) { - if (r != ERANGE) { -@@ -261,17 +265,13 @@ g_strerror (gint errnum) - else - buff = g_realloc (buff, buff_len * 2); - buff_len *= 2; -- //Spec is not clean on whether size argument includes space for null terminator or not -+ //Spec is not clean on whether size argument includes space for null terminator or not - } - if (!error_messages [errnum]) - error_messages [errnum] = g_strdup (buff); - if (buff != tmp_buff) - g_free (buff); --#else /* STRERROR_R_CHAR_P */ -- buff = strerror_r (errnum, buff, buff_len); -- if (!error_messages [errnum]) -- error_messages [errnum] = g_strdup (buff); --#endif /* STRERROR_R_CHAR_P */ -+#endif /* HAVE_GNU_STRERROR_R */ - - #else /* HAVE_STRERROR_R */ - if (!error_messages [errnum]) -diff --git a/src/runtime/src/mono/mono/utils/mono-proclib.c b/src/runtime/src/mono/mono/utils/mono-proclib.c -index 1fe731d9fe0f5..9a33fc2924e6b 100644 ---- a/src/runtime/src/mono/mono/utils/mono-proclib.c -+++ b/src/runtime/src/mono/mono/utils/mono-proclib.c -@@ -81,7 +81,7 @@ - #endif - - #ifdef HAVE_SCHED_GETAFFINITY --# ifndef GLIBC_HAS_CPU_COUNT -+# ifndef HAVE_GNU_CPU_COUNT - static int - CPU_COUNT(cpu_set_t *set) - { diff --git a/community/dotnet6-build/runtime_66594-keep-native-symbols.patch b/community/dotnet6-build/runtime_66594-keep-native-symbols.patch deleted file mode 100644 index c09c178149a..00000000000 --- a/community/dotnet6-build/runtime_66594-keep-native-symbols.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 229c9d2c4371f68fad3bfe7ba50f6db87d493e71 Mon Sep 17 00:00:00 2001 -Patch-Source: https://github.com/dotnet/runtime/pull/66594 -From: Omair Majid -Date: Mon, 14 Mar 2022 12:09:04 -0400 -Subject: [PATCH] Fix KeepNativeSymbols to work on mono as well - -When packaging .NET on s390x through source-build, we want to keep debug -symbols enabled in the build. The package manager (debbuild, rpmbuild, -etc) generally strips the binaries to create distro-standard --debug/-debuginfo packages. This was supported in coreclr via ---keepnativesymbols flag, but wasn't supported in mono (ie, s390x). Fix -that. ---- - src/mono/mono.proj | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/src/runtime/src/mono/mono.proj b/src/runtime/src/mono/mono.proj -index fb98ffc1896..d6a0c9a8ec2 100644 ---- a/src/runtime/src/mono/mono.proj -+++ b/src/runtime/src/mono/mono.proj -@@ -519,17 +519,17 @@ - - <_Objcopy Condition="'$(_ObjcopyFound)' != '0'">objcopy - -- -+ - - - - -- -- -- -- -- -- -+ -+ -+ -+ -+ -+ - - - diff --git a/community/dotnet6-build/runtime_73065-define-cpuidex-only-when-no-builtin.patch b/community/dotnet6-build/runtime_73065-define-cpuidex-only-when-no-builtin.patch deleted file mode 100644 index 5a0dc603132..00000000000 --- a/community/dotnet6-build/runtime_73065-define-cpuidex-only-when-no-builtin.patch +++ /dev/null @@ -1,178 +0,0 @@ -From 992cf8c97cc71d4ca9a0a11e6604a6716ed4cefc Mon Sep 17 00:00:00 2001 -Patch-Source: https://github.com/dotnet/runtime/pull/73065/files -From: Adeel Mujahid <3840695+am11@users.noreply.github.com> -Date: Fri, 29 Jul 2022 19:34:00 +0300 -Subject: [PATCH] Define __cpuid{ex} only when there's no builtin one (#73065) - -* Define __cpuid{ex} only when there's no builtin one - -Fix clang 15 RC1 build: `error: definition of builtin function '__cpuid'` - -* Add clang-15 autodetection - ---- - eng/common/native/find-native-compiler.sh | 2 +- - src/coreclr/gc/env/gcenv.base.h | 19 ++++++------------- - src/coreclr/gc/unix/gcenv.unix.cpp | 6 ------ - src/coreclr/pal/inc/pal.h | 18 +++++++----------- - src/coreclr/vm/amd64/unixstubs.cpp | 4 ++++ - src/libraries/Native/Unix/CMakeLists.txt | 5 +++++ - 6 files changed, 23 insertions(+), 31 deletions(-) - -diff --git a/src/runtime/eng/common/native/find-native-compiler.sh b/src/runtime/eng/common/native/find-native-compiler.sh -index aed19d07d50..dd43d0f62dd 100644 ---- a/src/runtime/eng/common/native/find-native-compiler.sh -+++ b/src/runtime/eng/common/native/find-native-compiler.sh -@@ -55,7 +55,7 @@ if [ -z "$CLR_CC" ]; then - # Set default versions - if [ -z "$majorVersion" ]; then - # note: gcc (all versions) and clang versions higher than 6 do not have minor version in file name, if it is zero. -- if [ "$compiler" = "clang" ]; then versions=( 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) -+ if [[ "$compiler" == "clang" ]]; then versions=( 15 14 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8 3.7 3.6 3.5 ) - elif [ "$compiler" = "gcc" ]; then versions=( 9 8 7 6 5 4.9 ); fi - - for version in "${versions[@]}"; do -diff --git a/src/runtime/src/coreclr/gc/env/gcenv.base.h b/src/runtime/src/coreclr/gc/env/gcenv.base.h -index 5cb2f4178ce..c5e516ed15c 100644 ---- a/src/runtime/src/coreclr/gc/env/gcenv.base.h -+++ b/src/runtime/src/coreclr/gc/env/gcenv.base.h -@@ -43,6 +43,10 @@ - #define SSIZE_T_MAX ((ptrdiff_t)(SIZE_T_MAX / 2)) - #endif - -+#ifndef __has_builtin -+#define __has_builtin(x) 0 -+#endif -+ - #ifndef _INC_WINDOWS - // ----------------------------------------------------------------------------------------------------------- - // -@@ -191,26 +195,15 @@ typedef DWORD (WINAPI *PTHREAD_START_ROUTINE)(void* lpThreadParameter); - #endif - #else // _MSC_VER - --#ifdef __llvm__ --#define HAS_IA32_PAUSE __has_builtin(__builtin_ia32_pause) --#define HAS_IA32_MFENCE __has_builtin(__builtin_ia32_mfence) --#else --#define HAS_IA32_PAUSE 0 --#define HAS_IA32_MFENCE 0 --#endif -- --// Only clang defines __has_builtin, so we first test for a GCC define --// before using __has_builtin. -- - #if defined(__i386__) || defined(__x86_64__) - --#if (__GNUC__ > 4 && __GNUC_MINOR > 7) || HAS_IA32_PAUSE -+#if __has_builtin(__builtin_ia32_pause) - // clang added this intrinsic in 3.8 - // gcc added this intrinsic by 4.7.1 - #define YieldProcessor __builtin_ia32_pause - #endif // __has_builtin(__builtin_ia32_pause) - --#if defined(__GNUC__) || HAS_IA32_MFENCE -+#if __has_builtin(__builtin_ia32_mfence) - // clang has had this intrinsic since at least 3.0 - // gcc has had this intrinsic since forever - #define MemoryBarrier __builtin_ia32_mfence -diff --git a/src/runtime/src/coreclr/gc/unix/gcenv.unix.cpp b/src/runtime/src/coreclr/gc/unix/gcenv.unix.cpp -index 6319c519727..0cce732ebc4 100644 ---- a/src/runtime/src/coreclr/gc/unix/gcenv.unix.cpp -+++ b/src/runtime/src/coreclr/gc/unix/gcenv.unix.cpp -@@ -575,12 +575,6 @@ void GCToOSInterface::FlushProcessWriteBuffers() - // otherwise raises a SIGTRAP. - void GCToOSInterface::DebugBreak() - { -- // __has_builtin is only defined by clang. GCC doesn't have a debug -- // trap intrinsic anyway. --#ifndef __has_builtin -- #define __has_builtin(x) 0 --#endif // __has_builtin -- - #if __has_builtin(__builtin_debugtrap) - __builtin_debugtrap(); - #else -diff --git a/src/runtime/src/coreclr/pal/inc/pal.h b/src/runtime/src/coreclr/pal/inc/pal.h -index 912d82648c4..c17811b0853 100644 ---- a/src/runtime/src/coreclr/pal/inc/pal.h -+++ b/src/runtime/src/coreclr/pal/inc/pal.h -@@ -4092,15 +4092,11 @@ inline WCHAR *PAL_wcsstr(WCHAR* S, const WCHAR* P) - } - #endif - --#if defined(__llvm__) --#define HAS_ROTL __has_builtin(_rotl) --#define HAS_ROTR __has_builtin(_rotr) --#else --#define HAS_ROTL 0 --#define HAS_ROTR 0 -+#ifndef __has_builtin -+#define __has_builtin(x) 0 - #endif - --#if !HAS_ROTL -+#if !__has_builtin(_rotl) - /*++ - Function: - _rotl -@@ -4118,14 +4114,14 @@ unsigned int __cdecl _rotl(unsigned int value, int shift) - retval = (value << shift) | (value >> (sizeof(int) * CHAR_BIT - shift)); - return retval; - } --#endif // !HAS_ROTL -+#endif // !__has_builtin(_rotl) - - // On 64 bit unix, make the long an int. - #ifdef HOST_64BIT - #define _lrotl _rotl --#endif // HOST_64BIT -+#endif - --#if !HAS_ROTR -+#if !__has_builtin(_rotr) - - /*++ - Function: -@@ -4145,7 +4141,7 @@ unsigned int __cdecl _rotr(unsigned int value, int shift) - return retval; - } - --#endif // !HAS_ROTR -+#endif // !__has_builtin(_rotr) - - PALIMPORT int __cdecl abs(int); - // clang complains if this is declared with __int64 -diff --git a/src/runtime/src/coreclr/vm/amd64/unixstubs.cpp b/src/runtime/src/coreclr/vm/amd64/unixstubs.cpp -index 517eea98f6b..09d2568a927 100644 ---- a/src/runtime/src/coreclr/vm/amd64/unixstubs.cpp -+++ b/src/runtime/src/coreclr/vm/amd64/unixstubs.cpp -@@ -10,6 +10,7 @@ extern "C" - PORTABILITY_ASSERT("Implement for PAL"); - } - -+#if !__has_builtin(__cpuid) - void __cpuid(int cpuInfo[4], int function_id) - { - // Based on the Clang implementation provided in cpuid.h: -@@ -20,7 +21,9 @@ extern "C" - : "0"(function_id) - ); - } -+#endif - -+#if !__has_builtin(__cpuidex) - void __cpuidex(int cpuInfo[4], int function_id, int subFunction_id) - { - // Based on the Clang implementation provided in cpuid.h: -@@ -31,6 +34,7 @@ extern "C" - : "0"(function_id), "2"(subFunction_id) - ); - } -+#endif - - DWORD xmmYmmStateSupport() - { --- -2.36.3 - diff --git a/community/dotnet6-build/runtime_74504-pass-targetrid-to-native-scripts.patch b/community/dotnet6-build/runtime_74504-pass-targetrid-to-native-scripts.patch deleted file mode 100644 index 7e9d038e906..00000000000 --- a/community/dotnet6-build/runtime_74504-pass-targetrid-to-native-scripts.patch +++ /dev/null @@ -1,217 +0,0 @@ -From 45a8ea8332796816e943ce652d2d00f75705266c Mon Sep 17 00:00:00 2001 -From: Tom Deseyn -Date: Fri, 26 Aug 2022 13:09:17 +0200 -Subject: [PATCH 01/20] Pass SourceBuild TargetRid and SourceBuildPortable args - through the native script. - ---- - src/runtime/eng/SourceBuild.props | 21 ++++++++++++------- - src/runtime/eng/build.sh | 10 +++++++++ - .../common/templates/steps/source-build.yml | 6 ++++++ - src/runtime/eng/native/build-commons.sh | 15 +++++++++++++ - .../eng/pipelines/common/global-build-job.yml | 2 ++ - src/runtime/src/native/corehost/build.sh | 7 +++---- - src/runtime/src/native/corehost/corehost.proj | 1 + - 7 files changed, 51 insertions(+), 11 deletions(-) - -diff --git a/src/runtime/eng/SourceBuild.props b/src/runtime/eng/SourceBuild.props -index b70f668a1..9e9396585 100644 ---- a/src/runtime/eng/SourceBuild.props -+++ b/src/runtime/eng/SourceBuild.props -@@ -11,14 +11,20 @@ - true - false - -- -+ - $([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier) - $(__DistroRid) - - - <_targetRidPlatformIndex>$(TargetRid.LastIndexOfAny("-")) -- $(TargetRid.Substring(0, $(_targetRidPlatformIndex))) -- $(TargetRid.Substring($(_targetRidPlatformIndex)).TrimStart('-')) -+ $(TargetRid.Substring($(_targetRidPlatformIndex)).TrimStart('-')) -+ -+ -+ $(TargetRid.Substring(0, $(_targetRidPlatformIndex))) -+ -+ -+ $(RuntimeOS) - - minimal - -@@ -26,19 +32,20 @@ - - -- $(InnerBuildArgs) --arch $(TargetRidPlatform) -+ $(InnerBuildArgs) --arch $(TargetArch) - $(InnerBuildArgs) --configuration $(Configuration) - $(InnerBuildArgs) --allconfigurations - $(InnerBuildArgs) --verbosity $(LogVerbosity) - $(InnerBuildArgs) --nodereuse false - $(InnerBuildArgs) --warnAsError false - $(InnerBuildArgs) /p:MicrosoftNetFrameworkReferenceAssembliesVersion=1.0.2 -- $(InnerBuildArgs) /p:PackageRid=$(TargetRid) -+ $(InnerBuildArgs) --outputrid $(TargetRid) -+ $(InnerBuildArgs) --portablebuild $(SourceBuildPortable) - $(InnerBuildArgs) /p:NoPgoOptimize=true - $(InnerBuildArgs) /p:KeepNativeSymbols=true -- $(InnerBuildArgs) /p:RuntimeOS=$(TargetRidWithoutPlatform) -- $(InnerBuildArgs) /p:PortableBuild=$(SourceBuildPortable) -+ $(InnerBuildArgs) /p:RuntimeOS=$(RuntimeOS) - $(InnerBuildArgs) /p:BuildDebPackage=false -+ $(InnerBuildArgs) /p:RuntimeOS=$(RuntimeOS) - - - -diff --git a/src/runtime/eng/build.sh b/src/runtime/eng/build.sh -index 8836bde10..ea6be90af 100755 ---- a/src/runtime/eng/build.sh -+++ b/src/runtime/eng/build.sh -@@ -31,6 +31,7 @@ usage() - echo " --os Target operating system: windows, Linux, FreeBSD, OSX, MacCatalyst, tvOS," - echo " tvOSSimulator, iOS, iOSSimulator, Android, Browser, NetBSD, illumos or Solaris." - echo " [Default: Your machine's OS.]" -+ echo " --outputrid Optional argument that overrides the target rid name." - echo " --projects Project or solution file(s) to build." - echo " --runtimeConfiguration (-rc) Runtime build configuration: Debug, Release or Checked." - echo " Checked is exclusive to the CLR runtime. It is the same as Debug, except code is" -@@ -400,6 +401,15 @@ while [[ $# > 0 ]]; do - shift 1 - ;; - -+ -outputrid) -+ if [ -z ${2+x} ]; then -+ echo "No value for outputrid is supplied. See help (--help) for supported values." 1>&2 -+ exit 1 -+ fi -+ arguments="$arguments /p:OutputRid=$(echo "$2" | tr "[:upper:]" "[:lower:]")" -+ shift 2 -+ ;; -+ - -portablebuild) - if [ -z ${2+x} ]; then - echo "No value for portablebuild is supplied. See help (--help) for supported values." 1>&2 -diff --git a/src/runtime/eng/common/templates/steps/source-build.yml b/src/runtime/eng/common/templates/steps/source-build.yml -index abb1b2bcd..b5b3e5aeb 100644 ---- a/src/runtime/eng/common/templates/steps/source-build.yml -+++ b/src/runtime/eng/common/templates/steps/source-build.yml -@@ -63,6 +63,11 @@ steps: - targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}' - fi - -+ runtimeOsArgs= -+ if [ '${{ parameters.platform.runtimeOS }}' != '' ]; then -+ runtimeOsArgs='/p:RuntimeOS=${{ parameters.platform.runtimeOS }}' -+ fi -+ - publishArgs= - if [ '${{ parameters.platform.skipPublishValidation }}' != 'true' ]; then - publishArgs='--publish' -@@ -75,6 +80,7 @@ steps: - $internalRuntimeDownloadArgs \ - $internalRestoreArgs \ - $targetRidArgs \ -+ $runtimeOsArgs \ - /p:SourceBuildNonPortable=${{ parameters.platform.nonPortable }} \ - /p:ArcadeBuildFromSource=true - displayName: Build -diff --git a/src/runtime/eng/native/build-commons.sh b/src/runtime/eng/native/build-commons.sh -index 9600e346b..85a6f50ec 100755 ---- a/src/runtime/eng/native/build-commons.sh -+++ b/src/runtime/eng/native/build-commons.sh -@@ -246,6 +246,7 @@ usage() - echo "-msbuildonunsupportedplatform: build managed binaries even if distro is not officially supported." - echo "-ninja: target ninja instead of GNU make" - echo "-numproc: set the number of build processes." -+ echo "-outputrid: optional argument that overrides the target rid name." - echo "-portablebuild: pass -portablebuild=false to force a non-portable build." - echo "-skipconfigure: skip build configuration." - echo "-skipgenerateversion: disable version generation even if MSBuild is supported." -@@ -268,6 +269,7 @@ __HostArch=$arch - __TargetOS=$os - __HostOS=$os - __BuildOS=$os -+__OutputRid='' - - __msbuildonunsupportedplatform=0 - -@@ -443,6 +445,16 @@ while :; do - __BuildArch=wasm - ;; - -+ outputrid|-outputrid) -+ if [[ -n "$2" ]]; then -+ __OutputRid="$2" -+ shift -+ else -+ echo "ERROR: 'outputrid' requires a non-empty option argument" -+ exit 1 -+ fi -+ ;; -+ - os|-os) - if [[ -n "$2" ]]; then - __TargetOS="$2" -@@ -508,5 +520,8 @@ fi - # init the target distro name - initTargetDistroRid - -+if [ -z "$__OutputRid" ]; then -+ __OutputRid="$(echo $__DistroRid | tr '[:upper:]' '[:lower:]')" -+fi - # Init if MSBuild for .NET Core is supported for this platform - isMSBuildOnNETCoreSupported -diff --git a/src/runtime/eng/pipelines/common/global-build-job.yml b/src/runtime/eng/pipelines/common/global-build-job.yml -index c5d913a46..1dcd4aa5a 100644 ---- a/src/runtime/eng/pipelines/common/global-build-job.yml -+++ b/src/runtime/eng/pipelines/common/global-build-job.yml -@@ -129,6 +129,8 @@ jobs: - platform: - buildScript: $(_sclEnableCommand) $(Build.SourcesDirectory)$(dir)build$(scriptExt) - nonPortable: true -+ targetRID: banana.24-x64 -+ runtimeOS: linux - - - ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS', 'MacCatalyst') }}: - - script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO -diff --git a/src/runtime/src/native/corehost/build.sh b/src/runtime/src/native/corehost/build.sh -index 3aa6820e7..4d7828a00 100755 ---- a/src/runtime/src/native/corehost/build.sh -+++ b/src/runtime/src/native/corehost/build.sh -@@ -83,14 +83,13 @@ __LogsDir="$__RootBinDir/log" - __MsbuildDebugLogsDir="$__LogsDir/MsbuildDebugLogs" - - # Set the remaining variables based upon the determined build configuration --__DistroRidLower="$(echo $__DistroRid | tr '[:upper:]' '[:lower:]')" --__BinDir="$__RootBinDir/bin/$__DistroRidLower.$__BuildType" --__IntermediatesDir="$__RootBinDir/obj/$__DistroRidLower.$__BuildType" -+__BinDir="$__RootBinDir/bin/$__OutputRid.$__BuildType" -+__IntermediatesDir="$__RootBinDir/obj/$__OutputRid.$__BuildType" - - export __BinDir __IntermediatesDir __CoreClrArtifacts __RuntimeFlavor - - __CMakeArgs="-DCLI_CMAKE_HOST_VER=\"$__host_ver\" -DCLI_CMAKE_COMMON_HOST_VER=\"$__apphost_ver\" -DCLI_CMAKE_HOST_FXR_VER=\"$__fxr_ver\" $__CMakeArgs" --__CMakeArgs="-DCLI_CMAKE_HOST_POLICY_VER=\"$__policy_ver\" -DCLI_CMAKE_PKG_RID=\"$__DistroRid\" -DCLI_CMAKE_COMMIT_HASH=\"$__commit_hash\" $__CMakeArgs" -+__CMakeArgs="-DCLI_CMAKE_HOST_POLICY_VER=\"$__policy_ver\" -DCLI_CMAKE_PKG_RID=\"$__OutputRid\" -DCLI_CMAKE_COMMIT_HASH=\"$__commit_hash\" $__CMakeArgs" - __CMakeArgs="-DRUNTIME_FLAVOR=\"$__RuntimeFlavor\" $__CMakeArgs" - __CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableBuild $__CMakeArgs" - -diff --git a/src/runtime/src/native/corehost/corehost.proj b/src/runtime/src/native/corehost/corehost.proj -index ba630e8d2..004358388 100644 ---- a/src/runtime/src/native/corehost/corehost.proj -+++ b/src/runtime/src/native/corehost/corehost.proj -@@ -33,6 +33,7 @@ - $(BuildArgs) -ninja - $(BuildArgs) -runtimeflavor $(RuntimeFlavor) - $(BuildArgs) /p:OfficialBuildId="$(OfficialBuildId)" -+ $(BuildArgs) -outputrid $(OutputRid) - - - -+ $([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'Microsoft.NETCore.Platforms', 'runtime.json')) -+ $([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'Microsoft.NETCore.Platforms', 'src', 'runtime.json')) - - -diff --git a/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj b/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj -index 262b0aae1..637bc8261 100644 ---- a/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj -+++ b/src/runtime/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj -@@ -41,7 +41,7 @@ - - - -- -+ - - - -@@ -50,12 +50,12 @@ - - - -- -+ - - - - -diff --git a/src/runtime/src/libraries/pretest.proj b/src/runtime/src/libraries/pretest.proj -index fc2fee13d..ee9473523 100644 ---- a/src/runtime/src/libraries/pretest.proj -+++ b/src/runtime/src/libraries/pretest.proj -@@ -92,7 +92,7 @@ - Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''"> - - - - --- -2.38.0 - diff --git a/community/dotnet6-build/runtime_76500-mono-musl-support.patch b/community/dotnet6-build/runtime_76500-mono-musl-support.patch index 0196d1b4c6a..6bc15a8cf1f 100644 --- a/community/dotnet6-build/runtime_76500-mono-musl-support.patch +++ b/community/dotnet6-build/runtime_76500-mono-musl-support.patch @@ -1,24 +1,20 @@ From f54977e2fc84527fe58024ed5537cb63244168e2 Mon Sep 17 00:00:00 2001 -Patch-Source: https://github.com/dotnet/installer/pull/14549 -From: Tom Deseyn +Patch-Source: https://github.com/dotnet/runtime/pull/76500 +From: Antoine Martin Date: Tue, 13 Sep 2022 14:17:35 +0200 -Subject: [PATCH 1/1] - installer_14549-rename-MicrosoftAspNetCoreAppRuntimePackageVersion.patch - -Wrong version of aspnetcore-runtime-internal is pulled by installer when -building source-build on Alpine Linux. This is due to a workaround on -osx and windows that breaks on Alpine, patch renames variable to go -around workaround. +Subject: [PATCH 1/1] Mono musl support --- - .../src/coreclr/pal/src/misc/perfjitdump.cpp | 2 +- - src/runtime/src/mono/mono.proj | 20 +++++++++---------- - .../src/mono/mono/mini/exceptions-s390x.c | 1 - - .../src/mono/mono/utils/mono-context.h | 8 ++++++++ - 6 files changed, 26 insertions(+), 14 deletions(-) + src/coreclr/pal/src/misc/perfjitdump.cpp | 2 +- + src/mono/CMakeLists.txt | 29 ++++++++++++++++++++++++ + src/mono/mono.proj | 18 +++++++++------ + src/mono/mono/metadata/domain.c | 10 ++++++++ + src/mono/mono/mini/CMakeLists.txt | 10 ++++++++ + src/mono/mono/utils/mono-context.h | 8 +++++++ + 6 files changed, 69 insertions(+), 8 deletions(-) diff --git a/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp b/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp -index cc8d46ef1..f7d43b5ce 100644 +index d80bd58038c..3488397b0da 100644 --- a/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp +++ b/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp @@ -25,7 +25,7 @@ @@ -30,46 +26,63 @@ index cc8d46ef1..f7d43b5ce 100644 #include "../inc/llvm/ELF.h" -diff --git a/src/runtime/src/mono/mono/utils/mono-context.h b/src/runtime/src/mono/mono/utils/mono-context.h -index a1f0fe6f6..a9db2d336 100644 ---- a/src/runtime/src/mono/mono/utils/mono-context.h -+++ b/src/runtime/src/mono/mono/utils/mono-context.h -@@ -11,6 +11,14 @@ - #ifndef __MONO_MONO_CONTEXT_H__ - #define __MONO_MONO_CONTEXT_H__ - -+/* -+ * Handle non-gnu libc versions with nothing in features.h -+ * We have no idea what they're compatible with, so always fail. -+ */ -+#ifndef __GLIBC_PREREQ -+# define __GLIBC_PREREQ(x,y) 0 -+#endif +diff --git a/src/runtime/src/mono/CMakeLists.txt b/src/runtime/src/mono/CMakeLists.txt +index 49a73b1b709..7e596d69d35 100644 +--- a/src/runtime/src/mono/CMakeLists.txt ++++ b/src/runtime/src/mono/CMakeLists.txt +@@ -208,6 +208,35 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + # Enable the "full RELRO" options (RELRO & BIND_NOW) at link time + add_link_options(-Wl,-z,relro) + add_link_options(-Wl,-z,now) ++ # Detect Linux ID ++ # TODO: Eventually merge with eng/native/configureplatform.cmake ++ set(LINUX_ID_FILE "/etc/os-release") ++ if(CMAKE_CROSSCOMPILING) ++ set(LINUX_ID_FILE "${CMAKE_SYSROOT}${LINUX_ID_FILE}") ++ endif() + - #include "mono-compiler.h" - #include "mono-sigcontext.h" - #include "mono-machine.h" ++ if(EXISTS ${LINUX_ID_FILE}) ++ execute_process( ++ COMMAND bash -c "source ${LINUX_ID_FILE} && echo \$ID" ++ OUTPUT_VARIABLE CLR_CMAKE_LINUX_ID ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++ ++ execute_process( ++ COMMAND bash -c "if strings \"${CMAKE_SYSROOT}/usr/bin/ldd\" 2>&1 | grep -q musl; then echo musl; fi" ++ OUTPUT_VARIABLE CLR_CMAKE_LINUX_MUSL ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++ endif() ++ ++ if(DEFINED CLR_CMAKE_LINUX_ID) ++ if(CLR_CMAKE_LINUX_ID STREQUAL alpine) ++ set(CLR_CMAKE_HOST_ALPINE_LINUX 1) ++ set(CLR_CMAKE_HOST_OS ${CLR_CMAKE_LINUX_ID}) ++ endif() ++ ++ if(CLR_CMAKE_LINUX_MUSL STREQUAL musl) ++ set(CLR_CMAKE_HOST_LINUX_MUSL 1) ++ endif() ++ endif(DEFINED CLR_CMAKE_LINUX_ID) + elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") + set(HOST_LINUX 1) + add_definitions(-D_GNU_SOURCE -D_REENTRANT) diff --git a/src/runtime/src/mono/mono.proj b/src/runtime/src/mono/mono.proj -index fb98ffc1896..6c40dd8d8dd 100644 +index d6a0c9a8ec2..933ed60cea7 100644 --- a/src/runtime/src/mono/mono.proj -+++ b/src/runtme/src/mono/mono.proj -@@ -417,11 +417,19 @@ ++++ b/src/runtime/src/mono/mono.proj +@@ -417,11 +417,15 @@ <_MonoCFLAGS Include="-Wl,--build-id=sha1" /> + <_MonoCFLAGS Include="-Wno-strict-prototypes" /> -+ <_MonoCFLAGS Include="-lucontext" /> <_MonoCXXFLAGS Include="-Wl,--build-id=sha1" /> + <_MonoCXXFLAGS Include="-Wno-strict-prototypes" /> -+ <_MonoCXXFLAGS Include="-lucontext" /> <_MonoAOTCFLAGS Include="-Wl,--build-id=sha1" /> + <_MonoAOTCFLAGS Include="-Wno-strict-prototypes" /> -+ <_MonoAOTCFLAGS Include="-lucontext" /> <_MonoAOTCXXFLAGS Include="-Wl,--build-id=sha1" /> + <_MonoAOTCXXFLAGS Include="-Wno-strict-prototypes" /> -+ <_MonoAOTCXXFLAGS Include="-lucontext" /> @@ -96,9 +109,8 @@ index fb98ffc1896..6c40dd8d8dd 100644 <_Objcopy Condition="'$(TargetsAndroid)' == 'true'">$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/bin/$(_Objcopy) - diff --git a/src/runtime/src/mono/mono/metadata/domain.c b/src/runtime/src/mono/mono/metadata/domain.c -index 4a8e06d28a..920fdb34dd 100644 +index 4a8e06d28ae..e9868bd1b2c 100644 --- a/src/runtime/src/mono/mono/metadata/domain.c +++ b/src/runtime/src/mono/mono/metadata/domain.c @@ -138,6 +138,14 @@ create_root_domain (void) @@ -124,7 +136,54 @@ index 4a8e06d28a..920fdb34dd 100644 + mono_gc_base_init (); mono_thread_info_attach (); - - + +diff --git a/src/runtime/src/mono/mono/mini/CMakeLists.txt b/src/runtime/src/mono/mono/mini/CMakeLists.txt +index 128ed08f45b..17cbe696c4b 100644 +--- a/src/runtime/src/mono/mono/mini/CMakeLists.txt ++++ b/src/runtime/src/mono/mono/mini/CMakeLists.txt +@@ -364,6 +364,11 @@ if(NOT DISABLE_SHARED_LIBS) + set_target_properties(monosgen-shared PROPERTIES IMPORT_SUFFIX ".import.lib") + endif() + target_link_libraries(monosgen-shared PRIVATE ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS}) ++ # Alpine Linux implements ucontext in a different library ++ if(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X) ++ target_link_libraries(monosgen-shared PRIVATE ucontext) ++ endif(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X) ++ + if(ICU_LDFLAGS) + set_property(TARGET monosgen-shared APPEND_STRING PROPERTY LINK_FLAGS " ${ICU_LDFLAGS}") + endif() +@@ -488,6 +493,11 @@ if(NOT DISABLE_EXECUTABLES) + set_target_properties(mono-sgen PROPERTIES OUTPUT_NAME mono-aot-cross) + endif() + target_link_libraries(mono-sgen PRIVATE monosgen-static ${OS_LIBS} ${ICONV_LIB} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS}) ++ # Alpine Linux implements ucontext in a different library ++ if(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X) ++ target_link_libraries(mono-sgen PRIVATE ucontext) ++ endif(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X) ++ + if(NOT DISABLE_COMPONENTS AND STATIC_COMPONENTS AND NOT DISABLE_LINK_STATIC_COMPONENTS) + # if components are built statically, link them into runtime. + target_sources(mono-sgen PRIVATE "${mono-components-objects}") +diff --git a/src/runtime/src/mono/mono/utils/mono-context.h b/src/runtime/src/mono/mono/utils/mono-context.h +index bd1a3cd0104..db4ba452bcb 100644 +--- a/src/runtime/src/mono/mono/utils/mono-context.h ++++ b/src/runtime/src/mono/mono/utils/mono-context.h +@@ -11,6 +11,14 @@ + #ifndef __MONO_MONO_CONTEXT_H__ + #define __MONO_MONO_CONTEXT_H__ + ++/* ++ * Handle non-gnu libc versions with nothing in features.h ++ * We have no idea what they're compatible with, so always fail. ++ */ ++#ifndef __GLIBC_PREREQ ++# define __GLIBC_PREREQ(x,y) 0 ++#endif ++ + #include "mono-compiler.h" + #include "mono-sigcontext.h" + #include "mono-machine.h" -- -2.37.1 +2.36.3 + diff --git a/community/dotnet6-build/runtime_76500-mono-musl-support.patch.new b/community/dotnet6-build/runtime_76500-mono-musl-support.patch.new new file mode 100644 index 00000000000..6f4a1215e73 --- /dev/null +++ b/community/dotnet6-build/runtime_76500-mono-musl-support.patch.new @@ -0,0 +1,326 @@ +From 98054ea87ce70247bb09ceafd2ad1a0b36d2fef4 Mon Sep 17 00:00:00 2001 +Patch-Source: https://github.com/dotnet/runtime/pull/76500 +From: Antoine Martin +Date: Sat, 1 Oct 2022 09:21:58 -0400 +Subject: [PATCH] Mono musl support + +--- + Directory.Build.props | 1 + + eng/common/cross/toolchain.cmake | 38 +++++++++++++++++++----- + eng/native/configurecompiler.cmake | 7 +++++ + eng/native/tryrun.cmake | 6 +++- + src/coreclr/pal/src/CMakeLists.txt | 5 ++++ + src/coreclr/pal/src/misc/perfjitdump.cpp | 2 +- + src/coreclr/vm/i386/cgenx86.cpp | 4 +++ + src/mono/CMakeLists.txt | 33 ++++++++++++++++++++ + src/mono/mono.proj | 32 +++++++++++++------- + src/mono/mono/mini/mini-runtime.c | 29 ++++++++++++++++++ + src/mono/mono/utils/mono-context.h | 8 +++++ + 11 files changed, 146 insertions(+), 19 deletions(-) + +diff --git a/src/runtime/Directory.Build.props b/src/runtime/Directory.Build.props +index 6f9b97c0a9c..4298a6df1d3 100644 +--- a/src/runtime/Directory.Build.props ++++ b/src/runtime/Directory.Build.props +@@ -22,7 +22,6 @@ + $(_hostOS) + true + true +- true + + + +@@ -154,7 +154,7 @@ + <_runtimeOS Condition="'$(TargetsMobile)' == 'true'">$(TargetOS.ToLowerInvariant()) + + <_portableOS>linux +- <_portableOS Condition="'$(_runtimeOS)' == 'linux-musl'">linux-musl ++ <_portableOS Condition="'$(_runtimeOS)' == 'linux-musl' or $(_runtimeOS.StartsWith('alpine'))">linux-musl + <_portableOS Condition="'$(_runtimeOS)' == 'linux-bionic'">linux-bionic + <_portableOS Condition="'$(_hostOS)' == 'OSX'">osx + <_portableOS Condition="'$(_runtimeOS)' == 'win' or '$(TargetOS)' == 'windows'">win + +@@ -200,6 +199,9 @@ + + $(PackageRID) + $(_portableOS)-$(TargetArchitecture) ++ ++ true ++ true + + + +diff --git a/src/runtime/eng/native/tryrun.cmake b/src/runtime/eng/native/tryrun.cmake +index 6355b0988f7..056c6606b17 100644 +--- a/src/runtime/eng/native/tryrun.cmake ++++ b/src/runtime/eng/native/tryrun.cmake +@@ -8,7 +8,11 @@ endmacro() + + if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv7-alpine-linux-musleabihf OR + EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf OR +- EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl) ++ EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/aarch64-alpine-linux-musl 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/riscv64-alpine-linux-musl) + + set(ALPINE_LINUX 1) + elseif(EXISTS ${CROSS_ROOTFS}/bin/freebsd-version) +diff --git a/src/runtime/src/coreclr/pal/src/CMakeLists.txt b/src/runtime/src/coreclr/pal/src/CMakeLists.txt +index d9726460ccf..c28563f8619 100644 +--- a/src/runtime/src/coreclr/pal/src/CMakeLists.txt ++++ b/src/runtime/src/coreclr/pal/src/CMakeLists.txt +@@ -315,6 +315,11 @@ if(CLR_CMAKE_TARGET_LINUX) + target_link_libraries(coreclrpal ${UNWIND_LIBS}) + endif(CLR_CMAKE_USE_SYSTEM_LIBUNWIND) + ++ # bundled libunwind requires using libucontext on alpine and x86 and ppc64le ++ if(CLR_CMAKE_TARGET_ALPINE_LINUX AND (CLR_CMAKE_TARGET_ARCH_I386 OR CLR_CMAKE_TARGET_ARCH_POWERPC64)) ++ target_link_libraries(coreclrpal ucontext) ++ endif(CLR_CMAKE_TARGET_ALPINE_LINUX AND (CLR_CMAKE_TARGET_ARCH_I386 OR CLR_CMAKE_TARGET_ARCH_POWERPC64)) ++ + endif(CLR_CMAKE_TARGET_LINUX) + + if(CLR_CMAKE_TARGET_NETBSD) +diff --git a/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp b/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp +index 8d7f79ed3f0..043939ad2da 100644 +--- a/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp ++++ b/src/runtime/src/coreclr/pal/src/misc/perfjitdump.cpp +@@ -25,7 +25,7 @@ + #include + #include + #include +-#include ++#include + + #include "../inc/llvm/ELF.h" + +diff --git a/src/runtime/src/coreclr/vm/i386/cgenx86.cpp b/src/runtime/src/coreclr/vm/i386/cgenx86.cpp +index 811c84a140d..4e958a44b30 100644 +--- a/src/runtime/src/coreclr/vm/i386/cgenx86.cpp ++++ b/src/runtime/src/coreclr/vm/i386/cgenx86.cpp +@@ -1133,6 +1133,7 @@ extern "C" DWORD __stdcall avx512StateSupport() + + #else // !TARGET_UNIX + ++#if !__has_builtin(__cpuid) + void __cpuid(int cpuInfo[4], int function_id) + { + // Based on the Clang implementation provided in cpuid.h: +@@ -1143,7 +1144,9 @@ void __cpuid(int cpuInfo[4], int function_id) + : "0"(function_id) + ); + } ++#endif + ++#if !__has_builtin(__cpuidex) + void __cpuidex(int cpuInfo[4], int function_id, int subFunction_id) + { + // Based on the Clang implementation provided in cpuid.h: +@@ -1154,6 +1157,7 @@ void __cpuidex(int cpuInfo[4], int function_id, int subFunction_id) + : "0"(function_id), "2"(subFunction_id) + ); + } ++#endif + + extern "C" DWORD __stdcall xmmYmmStateSupport() + { +diff --git a/src/runtime/src/mono/CMakeLists.txt b/src/runtime/src/mono/CMakeLists.txt +index cdff32677c0..08a82cd7e83 100644 +--- a/src/runtime/src/mono/CMakeLists.txt ++++ b/src/runtime/src/mono/CMakeLists.txt +@@ -216,6 +216,35 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + # Enable the "full RELRO" options (RELRO & BIND_NOW) at link time + add_link_options(-Wl,-z,relro) + add_link_options(-Wl,-z,now) ++ # Detect Linux ID ++ # TODO: Eventually merge with eng/native/configureplatform.cmake ++ set(LINUX_ID_FILE "/etc/os-release") ++ if(CMAKE_CROSSCOMPILING) ++ set(LINUX_ID_FILE "${CMAKE_SYSROOT}${LINUX_ID_FILE}") ++ endif() ++ ++ if(EXISTS ${LINUX_ID_FILE}) ++ execute_process( ++ COMMAND bash -c "source ${LINUX_ID_FILE} && echo \$ID" ++ OUTPUT_VARIABLE CLR_CMAKE_LINUX_ID ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++ ++ execute_process( ++ COMMAND bash -c "if strings \"${CMAKE_SYSROOT}/usr/bin/ldd\" 2>&1 | grep -q musl; then echo musl; fi" ++ OUTPUT_VARIABLE CLR_CMAKE_LINUX_MUSL ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++ endif() ++ ++ if(DEFINED CLR_CMAKE_LINUX_ID) ++ if(CLR_CMAKE_LINUX_ID STREQUAL alpine) ++ set(CLR_CMAKE_HOST_ALPINE_LINUX 1) ++ set(CLR_CMAKE_HOST_OS ${CLR_CMAKE_LINUX_ID}) ++ endif() ++ ++ if(CLR_CMAKE_LINUX_MUSL STREQUAL musl) ++ set(CLR_CMAKE_HOST_LINUX_MUSL 1) ++ endif() ++ endif(DEFINED CLR_CMAKE_LINUX_ID) + elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") + set(HOST_LINUX 1) + add_definitions(-D_GNU_SOURCE -D_REENTRANT) +@@ -893,6 +922,12 @@ if(HOST_IOS OR HOST_ANDROID OR HOST_MACCAT) + else() + set(DISABLE_DLLMAP 1) + endif() ++ ++if(CLR_CMAKE_HOST_ALPINE_LINUX) ++ # On Alpine Linux, we need to ensure that the reported stack range for the primary thread is ++ # larger than the initial committed stack size. ++ add_definitions(-DENSURE_PRIMARY_STACK_SIZE) ++endif() + ### End of OS specific checks + + include_directories("${CLR_SRC_NATIVE_DIR}") +diff --git a/src/runtime/src/mono/mono.proj b/src/runtime/src/mono/mono.proj +index 59fea4a2f72..5bac7fdf1c6 100644 +--- a/src/runtime/src/mono/mono.proj ++++ b/src/runtime/src/mono/mono.proj +@@ -554,19 +560,21 @@ + darwin-x86_64 + windows-x86_64 + <_MonoRuntimeFilePath>$(MonoObjDir)out\lib\$(MonoFileName) +- <_LinuxAbi Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true'">gnu +- <_LinuxAbi Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">android ++ <_LinuxAbi Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true' and '$(TargetsLinuxMusl)' != 'true'">linux-gnu ++ <_LinuxAbi Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true' and '$(TargetsLinuxMusl)' == 'true'">alpine-linux-musl ++ <_LinuxAbi Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">linux-android + <_LinuxFloatAbi Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsLinuxBionic)' != 'true'">hf + <_Objcopy>objcopy +- <_Objcopy Condition="'$(Platform)' == 'arm'">arm-linux-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy) +- <_Objcopy Condition="'$(Platform)' == 'armv6'">arm-linux-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy) +- <_Objcopy Condition="'$(Platform)' == 'arm64'">aarch64-linux-$(_LinuxAbi)-$(_Objcopy) +- <_Objcopy Condition="'$(Platform)' == 'riscv64'">riscv64-linux-$(_LinuxAbi)-$(_Objcopy) +- <_Objcopy Condition="'$(Platform)' == 's390x'">s390x-linux-$(_LinuxAbi)-$(_Objcopy) +- <_Objcopy Condition="'$(Platform)' == 'ppc64le'">powerpc64le-linux-$(_LinuxAbi)-$(_Objcopy) +- <_Objcopy Condition="'$(Platform)' == 'x64'">x86_64-linux-$(_LinuxAbi)-$(_Objcopy) +- <_Objcopy Condition="'$(Platform)' == 'x86'">i686-linux-$(_LinuxAbi)-$(_Objcopy) ++ <_Objcopy Condition="'$(Platform)' == 'arm'">arm-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy) ++ <_Objcopy Condition="'$(Platform)' == 'armv6'">arm-$(_LinuxAbi)eabi$(_LinuxFloatAbi)-$(_Objcopy) ++ <_Objcopy Condition="'$(Platform)' == 'arm64'">aarch64-$(_LinuxAbi)-$(_Objcopy) ++ <_Objcopy Condition="'$(Platform)' == 'riscv64'">riscv64-$(_LinuxAbi)-$(_Objcopy) ++ <_Objcopy Condition="'$(Platform)' == 's390x'">s390x-$(_LinuxAbi)-$(_Objcopy) ++ <_Objcopy Condition="'$(Platform)' == 'ppc64le'">powerpc64le-$(_LinuxAbi)-$(_Objcopy) ++ <_Objcopy Condition="'$(Platform)' == 'x64'">x86_64-$(_LinuxAbi)-$(_Objcopy) ++ <_Objcopy Condition="'$(Platform)' == 'x86'">i686-$(_LinuxAbi)-$(_Objcopy) + <_Objcopy Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsLinuxBionic)' == 'true'">$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/bin/llvm-objcopy ++ <_Objcopy Condition="'$(TargetsLinuxMusl)' == 'true' and '$(CrossBuild)' != 'true'">objcopy + + <_ObjcopyPrefix Condition="'$(MonoCrossDir)' != '' and '$(Platform)' == 'riscv64'">llvm-objcopy- + +diff --git a/src/runtime/src/mono/mono/mini/CMakeLists.txt b/src/runtime/src/mono/mono/mini/CMakeLists.txt +index 30df4bac1f7..8698fd81206 100644 +--- a/src/runtime/src/mono/mono/mini/CMakeLists.txt ++++ b/src/runtime/src/mono/mono/mini/CMakeLists.txt +@@ -368,6 +368,11 @@ if(NOT DISABLE_SHARED_LIBS) + target_sources(monosgen-shared PRIVATE $) + set_target_properties(monosgen-shared PROPERTIES OUTPUT_NAME ${MONO_SHARED_LIB_NAME}) + target_link_libraries (monosgen-shared PRIVATE monoapi) ++ # Alpine Linux implements ucontext in a different library ++ if(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X) ++ target_link_libraries(monosgen-shared PRIVATE ucontext) ++ endif(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X) ++ + target_include_directories (monosgen-shared PRIVATE monoapi) + if(TARGET_WIN32) + # on Windows the import library for the shared mono library will have the same name as the static library, +@@ -527,6 +532,10 @@ if(NOT DISABLE_EXECUTABLES) + set_target_properties(mono-sgen PROPERTIES OUTPUT_NAME mono-aot-cross) + endif() + target_link_libraries(mono-sgen PRIVATE monoapi monosgen-static ${OS_LIBS} ${LLVM_LIBS} ${ICU_LIBS} ${Z_LIBS}) ++ # Alpine Linux implements ucontext in a different library ++ if(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X) ++ target_link_libraries(mono-sgen PRIVATE ucontext) ++ endif(CLR_CMAKE_HOST_ALPINE_LINUX AND TARGET_S390X) + if(NOT DISABLE_COMPONENTS AND STATIC_COMPONENTS AND NOT DISABLE_LINK_STATIC_COMPONENTS) + # if components are built statically, link them into runtime. + target_sources(mono-sgen PRIVATE "${mono-components-objects}") +diff --git a/src/runtime/src/mono/mono/mini/mini-runtime.c b/src/runtime/src/mono/mono/mini/mini-runtime.c +index c481f69adc8..4db6c9a0ae7 100644 +--- a/src/runtime/src/mono/mono/mini/mini-runtime.c ++++ b/src/runtime/src/mono/mono/mini/mini-runtime.c +@@ -4383,6 +4383,30 @@ mini_llvm_init (void) + #endif + } + ++#ifdef ENSURE_PRIMARY_STACK_SIZE ++/*++ ++ Function: ++ EnsureStackSize ++ ++ Abstract: ++ This fixes a problem on MUSL where the initial stack size reported by the ++ pthread_attr_getstack is about 128kB, but this limit is not fixed and ++ the stack can grow dynamically. The problem is that it makes the ++ functions ReflectionInvocation::[Try]EnsureSufficientExecutionStack ++ to fail for real life scenarios like e.g. compilation of corefx. ++ Since there is no real fixed limit for the stack, the code below ++ ensures moving the stack limit to a value that makes reasonable ++ real life scenarios work. ++ ++ --*/ ++static MONO_NO_OPTIMIZATION MONO_NEVER_INLINE void ++ensure_stack_size (size_t size) ++{ ++ volatile uint8_t *s = (uint8_t *)g_alloca(size); ++ *s = 0; ++} ++#endif // ENSURE_PRIMARY_STACK_SIZE ++ + void + mini_add_profiler_argument (const char *desc) + { +@@ -4544,6 +4568,11 @@ mini_init (const char *filename) + mono_w32handle_init (); + #endif + ++#ifdef ENSURE_PRIMARY_STACK_SIZE ++ // TODO: https://github.com/dotnet/runtime/issues/72920 ++ ensure_stack_size (5 * 1024 * 1024); ++#endif // ENSURE_PRIMARY_STACK_SIZE ++ + mono_thread_info_runtime_init (&ticallbacks); + + if (g_hasenv ("MONO_DEBUG")) { +diff --git a/src/runtime/src/mono/mono/utils/mono-context.h b/src/runtime/src/mono/mono/utils/mono-context.h +index a1f0fe6f68e..a9db2d336ca 100644 +--- a/src/runtime/src/mono/mono/utils/mono-context.h ++++ b/src/runtime/src/mono/mono/utils/mono-context.h +@@ -11,6 +11,14 @@ + #ifndef __MONO_MONO_CONTEXT_H__ + #define __MONO_MONO_CONTEXT_H__ + ++/* ++ * Handle non-gnu libc versions with nothing in features.h ++ * We have no idea what they're compatible with, so always fail. ++ */ ++#ifndef __GLIBC_PREREQ ++# define __GLIBC_PREREQ(x,y) 0 ++#endif ++ + #include "mono-compiler.h" + #include "mono-sigcontext.h" + #include "mono-machine.h" +diff --git a/src/runtime/src/native/libs/System.Native/pal_io.c b/src/runtime/src/native/libs/System.Native/pal_io.c +index 0929a0b49ec..86311e19507 100644 +--- a/src/runtime/src/native/libs/System.Native/pal_io.c ++++ b/src/runtime/src/native/libs/System.Native/pal_io.c +@@ -1267,7 +1267,7 @@ int32_t SystemNative_CopyFile(intptr_t sourceFd, intptr_t destinationFd, int64_t + // Try copying data using a copy-on-write clone. This shares storage between the files. + if (sourceLength != 0) + { +- while ((ret = ioctl(outFd, FICLONE, inFd)) < 0 && errno == EINTR); ++ while ((ret = ioctl(outFd, (int)FICLONE, inFd)) < 0 && errno == EINTR); + copied = ret == 0; + } + #endif +-- +2.36.3 + diff --git a/community/dotnet6-build/runtime_downgrade-targetframework-buildtasks.patch b/community/dotnet6-build/runtime_downgrade-targetframework-buildtasks.patch new file mode 100644 index 00000000000..a1920961e6a --- /dev/null +++ b/community/dotnet6-build/runtime_downgrade-targetframework-buildtasks.patch @@ -0,0 +1,24 @@ +From 75c3e74ea35219f257c80daf9a236e0f518a7875 Mon Sep 17 00:00:00 2001 +Patch-Source: https://github.com/dotnet/source-build/discussions/3176 +From: Antoine Martin +Date: Fri, 16 Dec 2022 20:16:03 +0000 +Subject: [PATCH 1/1] Downgrades Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk + +This version of Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk is broken +For some reason, it insists on trying to target every framework, which breaks +build of runtime. + +--- +diff --git a/src/runtime/global.json.orig b/src/runtime/global.json +index 22aecea4b48..cd4eccec952 100644 +--- a/src/runtime/global.json.orig ++++ b/src/runtime/global.json +@@ -12,7 +12,7 @@ + "python3": "3.7.1" + }, + "msbuild-sdks": { +- "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "6.0.0-beta.22564.9", ++ "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "6.0.0-beta.22512.3", + "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.22564.9", + "Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.22564.9", + "Microsoft.DotNet.SharedFramework.Sdk": "6.0.0-beta.22564.9", diff --git a/community/dotnet6-build/runtime_enable-system-libunwind.diff b/community/dotnet6-build/runtime_enable-system-libunwind.diff index 48f97a30d87..45358a0adf3 100644 --- a/community/dotnet6-build/runtime_enable-system-libunwind.diff +++ b/community/dotnet6-build/runtime_enable-system-libunwind.diff @@ -12,10 +12,10 @@ diff --git a/src/runtime/eng/SourceBuild.props b/src/runtime/eng/SourceBuild.pro index f595e9b7d1..d90fd47dbd 100644 --- a/src/runtime/eng/SourceBuild.props +++ b/src/runtime/eng/SourceBuild.props -@@ -46,6 +46,7 @@ - $(InnerBuildArgs) /p:RuntimeOS=$(RuntimeOS) +@@ -47,6 +47,7 @@ $(InnerBuildArgs) /p:BuildDebPackage=false $(InnerBuildArgs) /p:RuntimeOS=$(RuntimeOS) + $(InnerBuildArgs) /p:AdditionalRuntimeIdentifierParent=$(BaseOS) + $(InnerBuildArgs) --cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE diff --git a/community/dotnet6-build/sdk_28380-map-nonportable-rids-when-targetos-is-determined.patch b/community/dotnet6-build/sdk_28380-map-nonportable-rids-when-targetos-is-determined.patch deleted file mode 100644 index ba9328a28fa..00000000000 --- a/community/dotnet6-build/sdk_28380-map-nonportable-rids-when-targetos-is-determined.patch +++ /dev/null @@ -1,127 +0,0 @@ -From aea2bba5bdf86ac45cdaabaffb307c03c4d71c37 Mon Sep 17 00:00:00 2001 -Patch-Source: https://github.com/dotnet/sdk/pull/28380 -From: Tom Deseyn -Date: Fri, 7 Oct 2022 08:31:58 +0200 -Subject: [PATCH 1/2] ResolveReadyToRunCompilers: map non-portable rids when - targetOS is determined. - ---- - .../ResolveReadyToRunCompilers.cs | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs b/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs -index 716a7f37c3c..6967822aca1 100644 ---- a/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs -+++ b/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs -@@ -143,7 +143,15 @@ private bool ValidateCrossgen2Support() - - bool version5 = crossgen2PackVersion.Major < 6; - bool isSupportedTarget = ExtractTargetPlatformAndArchitecture(_targetRuntimeIdentifier, out _targetPlatform, out _targetArchitecture); -- string targetOS = _targetPlatform switch -+ -+ var runtimeGraph = new RuntimeGraphCache(this).GetRuntimeGraph(RuntimeGraphPath); -+ string portablePlatform = NuGetUtils.GetBestMatchingRid( -+ runtimeGraph, -+ _targetPlatform, -+ new[] { "linux", "linux-musl", "osx", "win" }, -+ out _); -+ -+ string targetOS = portablePlatform switch - { - "linux" => "linux", - "linux-musl" => "linux", - -From 389ad51a7ed0998be6f4a9baa2746882e249451b Mon Sep 17 00:00:00 2001 -From: Tom Deseyn -Date: Fri, 7 Oct 2022 13:39:54 +0200 -Subject: [PATCH 2/2] For source-build, allow using a rid that is not in the - graph if it matches the host rid. - ---- - .../ResolveReadyToRunCompilers.cs | 61 +++++++++++++------ - 1 file changed, 44 insertions(+), 17 deletions(-) - -diff --git a/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs b/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs -index 6967822aca1..5d21bc96e84 100644 ---- a/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs -+++ b/src/sdk/src/Tasks/Microsoft.NET.Build.Tasks/ResolveReadyToRunCompilers.cs -@@ -144,28 +144,13 @@ private bool ValidateCrossgen2Support() - bool version5 = crossgen2PackVersion.Major < 6; - bool isSupportedTarget = ExtractTargetPlatformAndArchitecture(_targetRuntimeIdentifier, out _targetPlatform, out _targetArchitecture); - -- var runtimeGraph = new RuntimeGraphCache(this).GetRuntimeGraph(RuntimeGraphPath); -- string portablePlatform = NuGetUtils.GetBestMatchingRid( -- runtimeGraph, -- _targetPlatform, -- new[] { "linux", "linux-musl", "osx", "win" }, -- out _); -- -- string targetOS = portablePlatform switch -- { -- "linux" => "linux", -- "linux-musl" => "linux", -- "osx" => "osx", -- "win" => "windows", -- _ => null -- }; -- - // In .NET 5 Crossgen2 supported only the following host->target compilation scenarios: - // win-x64 -> win-x64 - // linux-x64 -> linux-x64 - // linux-musl-x64 -> linux-musl-x64 -+ string targetOS = null; - isSupportedTarget = isSupportedTarget && -- targetOS != null && -+ GetCrossgen2TargetOS(out targetOS) && - (!version5 || _targetRuntimeIdentifier == _hostRuntimeIdentifier) && - GetCrossgen2ComponentsPaths(version5); - -@@ -196,6 +181,48 @@ private bool ValidateCrossgen2Support() - return true; - } - -+ private bool GetCrossgen2TargetOS(out string targetOS) -+ { -+ targetOS = null; -+ -+ // Determine targetOS based on target rid. -+ // Use the runtime graph to support non-portable target rids. -+ var runtimeGraph = new RuntimeGraphCache(this).GetRuntimeGraph(RuntimeGraphPath); -+ string portablePlatform = NuGetUtils.GetBestMatchingRid( -+ runtimeGraph, -+ _targetPlatform, -+ new[] { "linux", "linux-musl", "osx", "win" }, -+ out _); -+ -+ // For source-build, allow the bootstrap SDK rid to be unknown to the runtime repo graph. -+ if (portablePlatform == null && _targetRuntimeIdentifier == _hostRuntimeIdentifier) -+ { -+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) -+ { -+ portablePlatform = "linux"; -+ } -+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) -+ { -+ portablePlatform = "win"; -+ } -+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) -+ { -+ portablePlatform = "osx"; -+ } -+ } -+ -+ targetOS = portablePlatform switch -+ { -+ "linux" => "linux", -+ "linux-musl" => "linux", -+ "osx" => "osx", -+ "win" => "windows", -+ _ => null -+ }; -+ -+ return targetOS != null; -+ } -+ - private ITaskItem GetNETCoreAppRuntimePack() - { - return GetNETCoreAppPack(RuntimePacks, MetadataKeys.FrameworkName);