From 835f5d753d45c6e638dc1519cd108a0a97bfa545 Mon Sep 17 00:00:00 2001 From: Chris Rummel Date: Thu, 9 Apr 2020 18:40:42 -0500 Subject: [PATCH] Update to 3.1.103 SDK and 3.1.3 runtime. - Update version numbers and sources. - Add CoreFx patch from PR#42900 to fix clang10 build. --- .gitignore | 1 + build-dotnet-tarball | 10 +++-- corefx-42900-clang-10.patch | 70 +++++++++++++++++++++++++++++++++++ corefx-optflags-support.patch | 3 +- dotnet3.1.spec | 21 +++++++---- sources | 2 +- 6 files changed, 94 insertions(+), 13 deletions(-) create mode 100644 corefx-42900-clang-10.patch diff --git a/.gitignore b/.gitignore index 1337900..6fa687b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /dotnet-v3.1.101-SDK.tar.gz /dotnet-v3.1.102-SDK.tar.gz +/dotnet-v3.1.103.2-SDK.tar.gz diff --git a/build-dotnet-tarball b/build-dotnet-tarball index ef7f742..3314c7e 100755 --- a/build-dotnet-tarball +++ b/build-dotnet-tarball @@ -94,7 +94,11 @@ if [ ! -f "${unmodified_tarball_name}.tar.gz" ]; then sed -i -e 's|cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE||' repos/coreclr.proj mkdir -p patches/coreclr/ cp ../../build-coreclr-clang10.patch patches/coreclr - ./build-source-tarball.sh "${unmodified_tarball_name}" + mkdir -p patches/corefx/ + cp ../../corefx-42900-clang-10.patch patches/corefx + cp -r /usr/lib64/dotnet "${temp_dir}" + ./build.sh --with-sdk ../dotnet /p:ArchiveDownloadedPackages=true + ./build-source-tarball.sh "${unmodified_tarball_name}" --skip-build --with-sdk ../dotnet popd popd @@ -111,8 +115,8 @@ pushd "${tarball_name}" # Remove files with funny licenses, crypto implementations and other # not-very-useful artifacts to reduce tarball size find -type f -iname '*.tar.gz' -delete -rm -r src/AspNetCore.*/src/SignalR/clients/java/signalr/gradle* -find src/AspNetCore.*/src -type d -name samples -print0 | xargs -0 rm -r +rm -r src/aspnetcore.*/src/SignalR/clients/java/signalr/gradle* +find src/aspnetcore.*/src -type d -name samples -print0 | xargs -0 rm -r rm -r src/NuGet.Client.*/test/EndToEnd/ProjectTemplates/NetCoreWebApplication1.0.zip find src/coreclr.*/ -depth -name tests -print0 | xargs -0 rm -r popd diff --git a/corefx-42900-clang-10.patch b/corefx-42900-clang-10.patch new file mode 100644 index 0000000..b898f34 --- /dev/null +++ b/corefx-42900-clang-10.patch @@ -0,0 +1,70 @@ +From 58d6cd09bd2d5b1085c6572c1d97b8533cf8294b Mon Sep 17 00:00:00 2001 +From: Omair Majid +Date: Fri, 3 Apr 2020 13:53:09 -0400 +Subject: [PATCH] Fix corefx to build on clang 10 + +Clang 10 adds/enables new warnings, some of which is affecting +the corefx code. + +Clang 10 has added -Walloca to warn about uses of alloca. This commit +replaces the only non-compliant use of that with a single fixed +stack-allocated buffer. + +Clang 10 has also added -Wimplicit-int-float-conversion. This commit +uses explicit casts to double to avoid the warnings. + +This is a backport of dotnet/runtime#33734 to corefx. + +After this commit, I can build all of corefx with Clang 10. +--- + src/Native/Unix/System.Native/pal_io.c | 20 +++++++++++--------- + src/Native/Unix/System.Native/pal_time.c | 2 +- + 2 files changed, 12 insertions(+), 10 deletions(-) + +diff --git a/src/Native/Unix/System.Native/pal_io.c b/src/Native/Unix/System.Native/pal_io.c +index 2d51edacf5ee..c7c42eb3e72b 100644 +--- a/src/Native/Unix/System.Native/pal_io.c ++++ b/src/Native/Unix/System.Native/pal_io.c +@@ -906,18 +906,20 @@ int32_t SystemNative_Poll(PollEvent* pollEvents, uint32_t eventCount, int32_t mi + return Error_EINVAL; + } + +- size_t bufferSize; +- if (!multiply_s(sizeof(struct pollfd), (size_t)eventCount, &bufferSize)) ++ struct pollfd stackBuffer[(uint32_t)(2048/sizeof(struct pollfd))]; ++ int useStackBuffer = eventCount <= (sizeof(stackBuffer)/sizeof(stackBuffer[0])); ++ struct pollfd* pollfds = NULL; ++ if (useStackBuffer) + { +- return SystemNative_ConvertErrorPlatformToPal(EOVERFLOW); ++ pollfds = (struct pollfd*)&stackBuffer[0]; + } +- +- +- int useStackBuffer = bufferSize <= 2048; +- struct pollfd* pollfds = (struct pollfd*)(useStackBuffer ? alloca(bufferSize) : malloc(bufferSize)); +- if (pollfds == NULL) ++ else + { +- return Error_ENOMEM; ++ pollfds = (struct pollfd*)calloc(eventCount, sizeof(*pollfds)); ++ if (pollfds == NULL) ++ { ++ return Error_ENOMEM; ++ } + } + + for (uint32_t i = 0; i < eventCount; i++) +diff --git a/src/Native/Unix/System.Native/pal_time.c b/src/Native/Unix/System.Native/pal_time.c +index 1a7c862749d1..54ebde60a83b 100644 +--- a/src/Native/Unix/System.Native/pal_time.c ++++ b/src/Native/Unix/System.Native/pal_time.c +@@ -169,7 +169,7 @@ int32_t SystemNative_GetCpuUtilization(ProcessCpuInformation* previousCpuInfo) + uint64_t resolution = SystemNative_GetTimestampResolution(); + uint64_t timestamp = SystemNative_GetTimestamp(); + +- uint64_t currentTime = (uint64_t)(timestamp * ((double)SecondsToNanoSeconds / resolution)); ++ uint64_t currentTime = (uint64_t)((double)timestamp * ((double)SecondsToNanoSeconds / (double)resolution)); + + uint64_t lastRecordedCurrentTime = previousCpuInfo->lastRecordedCurrentTime; + uint64_t lastRecordedKernelTime = previousCpuInfo->lastRecordedKernelTime; diff --git a/corefx-optflags-support.patch b/corefx-optflags-support.patch index 6f76d7f..9b08f1f 100644 --- a/corefx-optflags-support.patch +++ b/corefx-optflags-support.patch @@ -2,9 +2,10 @@ diff --git a/src/Native/Unix/CMakeLists.txt b/src/Native/Unix/CMakeLists.txt index 7d804a1e54..717c2718d7 100644 --- a/src/Native/Unix/CMakeLists.txt +++ b/src/Native/Unix/CMakeLists.txt -@@ -25,7 +25,6 @@ add_compile_options(-fPIC) +@@ -25,7 +25,7 @@ add_compile_options(-fPIC) add_compile_options(-Wthread-safety) add_compile_options(-Wno-thread-safety-analysis) ++ add_compile_options(-Wno-alloca) endif() -add_compile_options(-Werror) diff --git a/dotnet3.1.spec b/dotnet3.1.spec index c08312f..44ff8fb 100644 --- a/dotnet3.1.spec +++ b/dotnet3.1.spec @@ -20,10 +20,12 @@ %global dotnet_cflags %(echo %optflags | sed -e 's/-fstack-clash-protection//' | sed -re 's/-specs=[^ ]*//g') %global dotnet_ldflags %(echo %{__global_ldflags} | sed -re 's/-specs=[^ ]*//g') -%global host_version 3.1.2 -%global runtime_version 3.1.2 +%global host_version 3.1.3 +%global runtime_version 3.1.3 %global aspnetcore_runtime_version %{runtime_version} -%global sdk_version 3.1.102 +%global sdk_version 3.1.103 +# upstream respun this release, so the tag doesn't exactly match +%global src_version %{sdk_version}.2 %global templates_version %(echo %{runtime_version} | awk 'BEGIN { FS="."; OFS="." } {print $1, $2, $3+1 }') %global host_rpm_version %{host_version} @@ -62,8 +64,8 @@ License: MIT and ASL 2.0 and BSD and LGPLv2+ and CC-BY and CC0 and MS-PL URL: https://github.com/dotnet/ # The source is generated on a Fedora box via: -# ./build-dotnet-tarball v%%{sdk_version}-SDK -Source0: dotnet-v%{sdk_version}-SDK.tar.gz +# ./build-dotnet-tarball v%%{src_version}-SDK +Source0: dotnet-v%{src_version}-SDK.tar.gz Source1: check-debug-symbols.py Source2: dotnet.sh.in @@ -319,7 +321,7 @@ These are not meant for general use. %prep -%setup -q -n dotnet-v%{sdk_version}-SDK +%setup -q -n dotnet-v%{src_version}-SDK %if %{without bootstrap} # Remove all prebuilts @@ -328,12 +330,12 @@ find -iname '*.so' -type f -delete find -iname '*.tar.gz' -type f -delete find -iname '*.nupkg' -type f -delete find -iname '*.zip' -type f -delete -rm -r .dotnet/ +rm -rf .dotnet/ rm -r packages/source-built %endif %if %{without bootstrap} -sed -i -e 's|3.1.100-preview1-014459|3.1.101|' global.json +sed -i -e 's|3.1.100-preview1-014459|3.1.102|' global.json mkdir -p packages/archive ln -s %{_libdir}/dotnet/source-built-artifacts/*.tar.gz packages/archive/ ln -s %{_libdir}/dotnet/reference-packages/Private.SourceBuild.ReferencePackages*.tar.gz packages/archive @@ -514,6 +516,9 @@ echo "Testing build results for debug symbols..." %changelog +* Thu Apr 09 2020 Chris Rummel - 3.1.103-1 +- Update to .NET Core Runtime 3.1.3 and SDK 3.1.103 + * Mon Mar 16 2020 Omair Majid - 3.1.102-1 - Update to .NET Core Runtime 3.1.2 and SDK 3.1.102 diff --git a/sources b/sources index 9bc51e2..6762903 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (dotnet-v3.1.102-SDK.tar.gz) = f46f54b996883ecced44d377e2052b59461781bd2a0c8453a31e90e6822998ca5e97957a4b16a2aa00f7e803c17ce68c2128b8aad9aa2e0a399b7b15ea5af168 +SHA512 (dotnet-v3.1.103.2-SDK.tar.gz) = 6c4de4914f6d107e59300efb43fae24fffdbb983a5ffeb36fbe26c8071a87e76162ebde0f0aa270ab7cbb666b4ee0ab65cfab98f1dbba2ea9d48809372417ec2