From 96fb4c4fa914c5f1f92dabc920ab1f1079333a7d Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Wed, 20 Jan 2021 17:24:05 -0500 Subject: [PATCH] Update for 5.0.102 and bootstrapping --- build-dotnet-tarball | 2 +- dotnet5.0.spec | 42 ++++++++++++++++++------------ runtime-47020-gcc11.patch | 55 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 17 deletions(-) create mode 100644 runtime-47020-gcc11.patch diff --git a/build-dotnet-tarball b/build-dotnet-tarball index 6eba1bf..6135973 100755 --- a/build-dotnet-tarball +++ b/build-dotnet-tarball @@ -125,7 +125,7 @@ if [ ! -f "${unmodified_tarball_name}.tar.gz" ]; then git submodule update --init --recursive clean_dotnet_cache # FIXME remove contineuonprebuilterror - ./build.sh -p:SkipPrebuiltEnforcement=true -p:ContinueOnPrebuiltBaselineError=true -p:ArchiveDownloadedPackages=true -p:UseSystemLibraries=true + ./build.sh -p:SkipPrebuiltEnforcement=true -p:ContinueOnPrebuiltBaselineError=true -p:ArchiveDownloadedPackages=true -p:UseSystemLibraries=true -p:UseSystemLibunwind=false ./build-source-tarball.sh "${unmodified_tarball_name}" --skip-build -- -p:ContinueOnPrebuiltBaselineError=true -p:SkipPrebuiltEnforcement=true if [[ ${build_bootstrap} == true ]]; then diff --git a/dotnet5.0.spec b/dotnet5.0.spec index 5523053..5cd020d 100644 --- a/dotnet5.0.spec +++ b/dotnet5.0.spec @@ -20,11 +20,11 @@ # until that's done, disable LTO. This has to happen before setting the flags below. %define _lto_cflags %{nil} -%global host_version 5.0.0 -%global runtime_version 5.0.0 -%global aspnetcore_runtime_version 5.0.0 -%global sdk_version 5.0.100 -%global templates_version 5.0.0 +%global host_version 5.0.2 +%global runtime_version 5.0.2 +%global aspnetcore_runtime_version 5.0.2 +%global sdk_version 5.0.102 +%global templates_version %{runtime_version} #%%global templates_version %%(echo %%{runtime_version} | awk 'BEGIN { FS="."; OFS="." } {print $1, $2, $3+1 }') %global host_rpm_version %{host_version} @@ -63,15 +63,20 @@ URL: https://github.com/dotnet/ # The source is generated on a Fedora box via: # ./build-dotnet-tarball v%%{src_version}-SDK -Source0: dotnet-9c4e5de-x64-bootstrap.tar.gz -Source1: check-debug-symbols.py -Source2: dotnet.sh.in +Source0: dotnet-v%{src_version}-SDK-x64-bootstrap.tar.gz +Source1: dotnet-v%{src_version}-SDK-arm64-bootstrap.tar.gz + +Source10: check-debug-symbols.py +Source11: dotnet.sh.in Patch1: source-build-runtime-fixup-linker-order.patch # https://github.com/dotnet/runtime/pull/42094 # Fix linker order when linking with --as-needed Patch100: runtime-linker-order.patch +# https://github.com/dotnet/runtime/pull/47020 +# Fix build with gcc 11 +Patch101: runtime-47020-gcc11.patch # Disable telemetry by default; make it opt-in Patch500: sdk-telemetry-optout.patch @@ -310,7 +315,16 @@ These are not meant for general use. %prep -%setup -q -n dotnet-9c4e5de-x64-bootstrap +%if %{without bootstrap} +%setup -q -n dotnet-v%{src_version}-SDK +%else +%ifarch x86_64 +%setup -q -T -b 0 -n dotnet-v%{src_version}-SDK-%{runtime_arch}-bootstrap +%endif +%ifarch aarch64 +%setup -q -T -b 1 -n dotnet-v%{src_version}-SDK-%{runtime_arch}-bootstrap +%endif +%endif %if %{without bootstrap} # Remove all prebuilts @@ -339,17 +353,13 @@ sed -i 's|skiptests|skiptests ignorewarnings|' repos/runtime.common.props pushd src/runtime.* %patch100 -p1 +%patch101 -p1 popd pushd src/sdk.* %patch500 -p1 popd -%ifnarch x86_64 -mkdir -p artifacts/obj/%{runtime_arch}/Release -cp artifacts/obj/x64/Release/PackageVersions.props artifacts/obj/%{runtime_arch}/Release/PackageVersions.props -%endif - cat source-build-info.txt find -iname 'nuget.config' -exec echo {}: \; -exec cat {} \; -exec echo \; @@ -418,7 +428,7 @@ VERBOSE=1 ./build.sh \ %endif -sed -e 's|[@]LIBDIR[@]|%{_libdir}|g' %{SOURCE2} > dotnet.sh +sed -e 's|[@]LIBDIR[@]|%{_libdir}|g' %{SOURCE11} > dotnet.sh %install @@ -473,7 +483,7 @@ install artifacts/%{runtime_arch}/Release/Private.SourceBuilt.Artifacts.*.tar.gz # because native binaries are stripped by rpm-build after %%install. # So we need to do this check earlier. echo "Testing build results for debug symbols..." -%{SOURCE1} -v %{buildroot}%{_libdir}/dotnet/ +%{SOURCE10} -v %{buildroot}%{_libdir}/dotnet/ %check diff --git a/runtime-47020-gcc11.patch b/runtime-47020-gcc11.patch new file mode 100644 index 0000000..3751fcf --- /dev/null +++ b/runtime-47020-gcc11.patch @@ -0,0 +1,55 @@ +From 7123b8344ddc1c883483f13d34abbd22d4170452 Mon Sep 17 00:00:00 2001 +From: Omair Majid +Date: Tue, 5 Jan 2021 18:50:18 -0500 +Subject: [PATCH] Fix build errors using GCC 11 (#46334) + +Building runtime with GCC 11 leads to some new errors. The errors are +consistent with the "Header dependency changes" section documented at +https://gcc.gnu.org/gcc-11/porting_to.html + +The first set of errors looks like this: + + runtime/src/coreclr/pal/src/misc/cgroup.cpp:403:29: + error: no member named 'numeric_limits' in namespace 'std' + if (temp > std::numeric_limits::max()) + ~~~~~^ + +Fix that by including . + +The second set of errors looks like this: + + runtime/src/installer/corehost/cli/test/nativehost/host_context_test.cpp:634:31: + error: no member named 'sleep_for' in namespace 'std::this_thread' + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + ~~~~~~~~~~~~~~~~~~^ + +Fix that by including . +--- + src/coreclr/src/pal/src/misc/cgroup.cpp | 1 + + src/installer/corehost/cli/test/nativehost/host_context_test.cpp | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/src/coreclr/src/pal/src/misc/cgroup.cpp b/src/coreclr/src/pal/src/misc/cgroup.cpp +index f3e20012c539..24617359a21b 100644 +--- a/src/coreclr/src/pal/src/misc/cgroup.cpp ++++ b/src/coreclr/src/pal/src/misc/cgroup.cpp +@@ -14,6 +14,7 @@ Module Name: + #include "pal/dbgmsg.h" + SET_DEFAULT_DEBUG_CHANNEL(MISC); + #include "pal/palinternal.h" ++#include + #include + #include + #include "pal/virtual.h" +diff --git a/src/installer/corehost/cli/test/nativehost/host_context_test.cpp b/src/installer/corehost/cli/test/nativehost/host_context_test.cpp +index cea98db6673a..371ec2d7e2aa 100644 +--- a/src/installer/corehost/cli/test/nativehost/host_context_test.cpp ++++ b/src/installer/corehost/cli/test/nativehost/host_context_test.cpp +@@ -11,6 +11,7 @@ + #include + #include "hostfxr_exports.h" + #include "host_context_test.h" ++#include + #include + + namespace