Add upstream patches from milestone to cmake-3.27.5

This commit is contained in:
Björn Esser 2023-09-14 18:57:23 +02:00
parent 4b282d073f
commit dadba242b0
No known key found for this signature in database
GPG Key ID: F52E98007594C21D
10 changed files with 398 additions and 4 deletions

View File

@ -1,7 +1,8 @@
From fa3c4b6dbfaa4eb1d666c1bea4c759d221b7ad98 Mon Sep 17 00:00:00 2001 From fa3c4b6dbfaa4eb1d666c1bea4c759d221b7ad98 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com> From: Brad King <brad.king@kitware.com>
Date: Thu, 24 Aug 2023 13:00:13 -0400 Date: Thu, 24 Aug 2023 13:00:13 -0400
Subject: [PATCH] Source: Link libatomic when needed on any Linux architecture Subject: [PATCH 1/9] Source: Link libatomic when needed on any Linux
architecture
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit Content-Transfer-Encoding: 8bit

View File

@ -0,0 +1,38 @@
From 91dc94c4aca611865bf5cb4e9fec6b3422d1de9a Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Tue, 5 Sep 2023 14:54:04 -0400
Subject: [PATCH 2/9] Help: MSVC_DEBUG_INFORMATION_FORMAT is initialized from
associated variable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The `CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` variable docs mention that it
initializes the `MSVC_DEBUG_INFORMATION_FORMAT` target property, but the
property's docs was missing any mention of the variable.
Follow the pattern from commit c1b07ca9da (Help: MSVC_RUNTIME_LIBRARY is
initialized from associated variable, 2022-08-13, v3.25.0-rc1~317^2).
Fixes: #25216
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
---
Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst b/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst
index 0c7845ce4a..7e08b483c4 100644
--- a/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst
+++ b/Help/prop_tgt/MSVC_DEBUG_INFORMATION_FORMAT.rst
@@ -21,6 +21,8 @@ support per-configuration specification. For example, the code:
selects for the target ``foo`` the program database debug information format
for the Debug configuration.
+This property is initialized from the value of the
+:variable:`CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` variable, if it is set.
If this property is not set, CMake selects a debug information format using
the default value ``$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>``, if
supported by the compiler, and otherwise
--
2.41.0

View File

@ -0,0 +1,53 @@
From 6251edaed1c4f55625d96dc31e044a9fd23e1db2 Mon Sep 17 00:00:00 2001
From: Ben Boeckel <ben.boeckel@kitware.com>
Date: Tue, 5 Sep 2023 15:55:19 -0400
Subject: [PATCH 3/9] cmGeneratorTarget: support config-independent Fortran
source queries
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Some locations care about "any config with Fortran", so make a query for
such (they may not know any configuration names themselves).
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
---
Source/cmGeneratorTarget.cxx | 9 +++++++++
Source/cmGeneratorTarget.h | 1 +
2 files changed, 10 insertions(+)
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 357d0a66a1..7d1fcf3e5c 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -8873,6 +8873,15 @@ bool cmGeneratorTarget::HaveFortranSources(std::string const& config) const
});
}
+bool cmGeneratorTarget::HaveFortranSources() const
+{
+ auto sources = cmGeneratorTarget::GetAllConfigSources();
+ return std::any_of(sources.begin(), sources.end(),
+ [](AllConfigSource const& sf) -> bool {
+ return sf.Source->GetLanguage() == "Fortran"_s;
+ });
+}
+
bool cmGeneratorTarget::HaveCxx20ModuleSources() const
{
auto const& fs_names = this->Target->GetAllFileSetNames();
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 78945c3fa9..dca69fd001 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -1247,6 +1247,7 @@ public:
cmGeneratorTarget const* t2) const;
};
+ bool HaveFortranSources() const;
bool HaveFortranSources(std::string const& config) const;
// C++20 module support queries.
--
2.41.0

View File

@ -0,0 +1,43 @@
From 74b1d6caf31d9921b8311012ead4497865e77396 Mon Sep 17 00:00:00 2001
From: Ben Boeckel <ben.boeckel@kitware.com>
Date: Tue, 5 Sep 2023 15:56:03 -0400
Subject: [PATCH 4/9] cmComputeLinkInformation: compute link info for
module-using targets
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Targets which contain C++ module or Fortran sources need to participate
in link information unconditionally regardless of whether they actually
have link artifacts or not.
Fixes: #25223
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
---
Source/cmComputeLinkInformation.cxx | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index ebbb88f6a2..4804565840 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -533,11 +533,14 @@ cmComputeLinkInformation::GetObjectLibrariesLinked() const
bool cmComputeLinkInformation::Compute()
{
- // Skip targets that do not link.
+ // Skip targets that do not link or have link-like information consumers may
+ // need (namely modules).
if (!(this->Target->GetType() == cmStateEnums::EXECUTABLE ||
this->Target->GetType() == cmStateEnums::SHARED_LIBRARY ||
this->Target->GetType() == cmStateEnums::MODULE_LIBRARY ||
- this->Target->GetType() == cmStateEnums::STATIC_LIBRARY)) {
+ this->Target->GetType() == cmStateEnums::STATIC_LIBRARY ||
+ this->Target->HaveCxx20ModuleSources() ||
+ this->Target->HaveFortranSources())) {
return false;
}
--
2.41.0

View File

@ -0,0 +1,44 @@
From 26ce8dc290710ddbad49335f36968d850176b634 Mon Sep 17 00:00:00 2001
From: Zack Galbreath <zack.galbreath@kitware.com>
Date: Thu, 7 Sep 2023 12:12:30 -0400
Subject: [PATCH 5/9] ctest: Restore support for http redirects during Submit
step
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
After CDash PR 1519 introduced HTTP status codes greater than 200 for
various error cases, CMake commit b7c871f745 (ctest: Update ctest_submit
for CDash behavior change, 2023-07-24, v3.27.1~3^2) modified CTest's
submit handler to check the status returned by CDash and throw an error
when this status is not equal to 200.
That change had the unintended side effect of causing CTest submissions
to fail when uploading results to a URL that returns a redirect status
code (3xx). Fix this by configuring cURL to follow the redirect. The
status cURL reports to CTest is now 200 instead of 3xx when CDash is
located behind a redirect.
Fixes: #25159
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
---
Source/CTest/cmCTestSubmitHandler.cxx | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index 7d4b0a847c..c04f23a1fe 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -309,6 +309,9 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(
// specify target
::curl_easy_setopt(curl, CURLOPT_URL, upload_as.c_str());
+ // follow redirects
+ ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
+
// CURLAUTH_BASIC is default, and here we allow additional methods,
// including more secure ones
::curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
--
2.41.0

View File

@ -0,0 +1,31 @@
From 84a097f0388f8fbf86aeada640f56132e3776335 Mon Sep 17 00:00:00 2001
From: Ben Boeckel <ben.boeckel@kitware.com>
Date: Sun, 10 Sep 2023 21:10:27 -0400
Subject: [PATCH 6/9] FortranCInterface: forward `CMAKE_OSX_DEPLOYMENT_TARGET`
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
GCC needs to be taught about every macOS release it seems, so older
builds may not support usage on newer releases by default.
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
---
Modules/FortranCInterface.cmake | 1 +
1 file changed, 1 insertion(+)
diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake
index 2c85029ed4..81481a7ba7 100644
--- a/Modules/FortranCInterface.cmake
+++ b/Modules/FortranCInterface.cmake
@@ -374,6 +374,7 @@ function(FortranCInterface_VERIFY)
"-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}"
"-DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE}"
"-DFortranCInterface_BINARY_DIR=${FortranCInterface_BINARY_DIR}"
+ "-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}"
${_FortranCInterface_OSX_ARCH}
${_FortranCInterface_EXE_LINKER_FLAGS}
OUTPUT_VARIABLE _output)
--
2.41.0

View File

@ -0,0 +1,75 @@
From 897a149067b84375d094700632255c0b54f5e44c Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Mon, 11 Sep 2023 09:50:54 -0400
Subject: [PATCH 7/9] FindBoost: Add support for Boost 1.83
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Update the list of known versions.
Run the command
cmake -DBOOST_DIR=/path/to/boost_1_83_0 \
-P Utilities/Scripts/BoostScanDeps.cmake
to extract dependencies from the 1.83.0 source tree.
Dependencies differ from 1.82, as mentioned in the 1.83 release notes:
* Boost.Timer no longer depends on Boost.Chrono
Fixes: #25243
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
---
Modules/FindBoost.cmake | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index f2e4804d04..1f82bb52a1 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -1365,7 +1365,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_TIMER_DEPENDENCIES chrono)
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
- else()
+ elseif(Boost_VERSION_STRING VERSION_LESS 1.83.0)
set(_Boost_CONTRACT_DEPENDENCIES thread chrono)
set(_Boost_COROUTINE_DEPENDENCIES context)
set(_Boost_FIBER_DEPENDENCIES context)
@@ -1380,7 +1380,21 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_TIMER_DEPENDENCIES chrono)
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
- if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.83.0 AND NOT Boost_NO_WARN_NEW_VERSIONS)
+ else()
+ set(_Boost_CONTRACT_DEPENDENCIES thread chrono)
+ set(_Boost_COROUTINE_DEPENDENCIES context)
+ set(_Boost_FIBER_DEPENDENCIES context)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_JSON_DEPENDENCIES container)
+ set(_Boost_LOG_DEPENDENCIES log_setup filesystem thread regex chrono atomic)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
+ set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
+ set(_Boost_THREAD_DEPENDENCIES chrono atomic)
+ set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono atomic)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.84.0 AND NOT Boost_NO_WARN_NEW_VERSIONS)
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
endif()
endif()
@@ -1655,7 +1669,7 @@ else()
# _Boost_COMPONENT_HEADERS. See the instructions at the top of
# _Boost_COMPONENT_DEPENDENCIES.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
- "1.82.0" "1.82" "1.81.0" "1.81" "1.80.0" "1.80" "1.79.0" "1.79"
+ "1.83.0" "1.83" "1.82.0" "1.82" "1.81.0" "1.81" "1.80.0" "1.80" "1.79.0" "1.79"
"1.78.0" "1.78" "1.77.0" "1.77" "1.76.0" "1.76" "1.75.0" "1.75" "1.74.0" "1.74"
"1.73.0" "1.73" "1.72.0" "1.72" "1.71.0" "1.71" "1.70.0" "1.70" "1.69.0" "1.69"
"1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
--
2.41.0

View File

@ -0,0 +1,64 @@
From 6ebff6ebf8850a9372786bf56af8ee79dca6860d Mon Sep 17 00:00:00 2001
From: Robert Maynard <rmaynard@nvidia.com>
Date: Mon, 11 Sep 2023 15:54:53 -0400
Subject: [PATCH 8/9] VS: Avoid unnecessary CUDA device linking for OBJECT
libraries
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Without `CudaLink` fields, MSBuild tries to perform a device link step
for object libraries with CUDA_SEPARABLE_COMPILATION on them even when
not needed. This commonly was encountered when generating PTX or
OPTIX-IR output.
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
---
Source/cmVisualStudio10TargetGenerator.cxx | 5 ++++-
Tests/CudaOnly/Fatbin/CMakeLists.txt | 1 +
Tests/CudaOnly/OptixIR/CMakeLists.txt | 1 +
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index b3699ae739..b011615097 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -3855,7 +3855,10 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions(
void cmVisualStudio10TargetGenerator::WriteCudaLinkOptions(
Elem& e1, std::string const& configName)
{
- if (this->GeneratorTarget->GetType() > cmStateEnums::MODULE_LIBRARY) {
+ // We need to write link options for OBJECT libraries so that
+ // we override the default device link behavior ( enabled ) when
+ // building object libraries with ptx/optix-ir/etc
+ if (this->GeneratorTarget->GetType() > cmStateEnums::OBJECT_LIBRARY) {
return;
}
diff --git a/Tests/CudaOnly/Fatbin/CMakeLists.txt b/Tests/CudaOnly/Fatbin/CMakeLists.txt
index db0dc227e0..99744044c1 100644
--- a/Tests/CudaOnly/Fatbin/CMakeLists.txt
+++ b/Tests/CudaOnly/Fatbin/CMakeLists.txt
@@ -10,6 +10,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../CUBIN/kernelB.cu
${CMAKE_CURRENT_SOURCE_DIR}/../CUBIN/kernelC.cu)
set_property(TARGET CudaFATBIN PROPERTY CUDA_FATBIN_COMPILATION ON)
+set_property(TARGET CudaFATBIN PROPERTY CUDA_SEPARABLE_COMPILATION ON)
# Will use `cuModuleLoadFatBinary` to load the fatbinaries
add_executable(CudaOnlyFatbin main.cu)
diff --git a/Tests/CudaOnly/OptixIR/CMakeLists.txt b/Tests/CudaOnly/OptixIR/CMakeLists.txt
index afeabdade7..f408d40325 100644
--- a/Tests/CudaOnly/OptixIR/CMakeLists.txt
+++ b/Tests/CudaOnly/OptixIR/CMakeLists.txt
@@ -13,6 +13,7 @@ if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.7.0")
set_property(TARGET CudaOptix PROPERTY CUDA_OPTIX_COMPILATION ON)
endif()
+set_property(TARGET CudaOptix PROPERTY CUDA_SEPARABLE_COMPILATION ON)
set_property(TARGET CudaOptix PROPERTY CUDA_ARCHITECTURES native)
add_executable(CudaOnlyOptixIR main.cu)
--
2.41.0

View File

@ -0,0 +1,35 @@
From 42adf3cba82c1f375d7a75a76697e674fd6f1b2f Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Tue, 12 Sep 2023 13:50:16 -0400
Subject: [PATCH 9/9] Autogen: Evaluate INTERFACE_AUTOMOC_MACRO_NAMES
efficiently
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In commit c5c3aff1f5 (Autogen: Add INTERFACE_AUTOMOC_MACRO_NAMES target
property, 2023-04-03, v3.27.0-rc1~197^2) we forgot to mark the property
as a usage requirement. This is needed for efficient evaluation over
the target dependency closure.
Fixes: #25238
Signed-off-by: Björn Esser <besser82@fedoraproject.org>
---
Source/cmGeneratorExpressionDAGChecker.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index 1919b014e5..782d6c8b7d 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -23,6 +23,7 @@ class cmGeneratorTarget;
SELECT(F, EvaluatingSystemIncludeDirectories, SYSTEM_INCLUDE_DIRECTORIES) \
SELECT(F, EvaluatingCompileDefinitions, COMPILE_DEFINITIONS) \
SELECT(F, EvaluatingCompileOptions, COMPILE_OPTIONS) \
+ SELECT(F, EvaluatingAutoMocMacroNames, AUTOMOC_MACRO_NAMES) \
SELECT(F, EvaluatingAutoUicOptions, AUTOUIC_OPTIONS) \
SELECT(F, EvaluatingSources, SOURCES) \
SELECT(F, EvaluatingCompileFeatures, COMPILE_FEATURES) \
--
2.41.0

View File

@ -72,7 +72,7 @@
%global patch_version 4 %global patch_version 4
# For handling bump release by rpmdev-bumpspec and mass rebuild # For handling bump release by rpmdev-bumpspec and mass rebuild
%global baserelease 6 %global baserelease 7
# Set to RC version if building RC, else comment out. # Set to RC version if building RC, else comment out.
#global rcsuf rc1 #global rcsuf rc1
@ -123,8 +123,15 @@ Patch100: %{name}-findruby.patch
Patch1: %{name}-rename.patch Patch1: %{name}-rename.patch
%endif %endif
# https://gitlab.kitware.com/cmake/cmake/-/issues/25204
Patch10001: 0001-Source-Link-libatomic-when-needed-on-any-Linux-archi.patch Patch10001: 0001-Source-Link-libatomic-when-needed-on-any-Linux-archi.patch
Patch10002: 0002-Help-MSVC_DEBUG_INFORMATION_FORMAT-is-initialized-fr.patch
Patch10003: 0003-cmGeneratorTarget-support-config-independent-Fortran.patch
Patch10004: 0004-cmComputeLinkInformation-compute-link-info-for-modul.patch
Patch10005: 0005-ctest-Restore-support-for-http-redirects-during-Subm.patch
Patch10006: 0006-FortranCInterface-forward-CMAKE_OSX_DEPLOYMENT_TARGE.patch
Patch10007: 0007-FindBoost-Add-support-for-Boost-1.83.patch
Patch10008: 0008-VS-Avoid-unnecessary-CUDA-device-linking-for-OBJECT-.patch
Patch10009: 0009-Autogen-Evaluate-INTERFACE_AUTOMOC_MACRO_NAMES-effic.patch
BuildRequires: coreutils BuildRequires: coreutils
BuildRequires: findutils BuildRequires: findutils
@ -552,7 +559,10 @@ popd
%changelog %changelog
* Wed Sep 04 2023 Panu Matilainen <pmatilai@redhat.com> - 3.27.4-6 * Thu Sep 14 2023 Björn Esser <besser82@fedoraproject.org> - 3.27.4-7
- Add upstream patches from milestone to cmake-3.27.5
* Wed Sep 06 2023 Panu Matilainen <pmatilai@redhat.com> - 3.27.4-6
- Only require cmake-rpm-macros when rpm-build is installed part II - Only require cmake-rpm-macros when rpm-build is installed part II
* Sat Sep 02 2023 Tom Stellard <tstellar@redhat.com> - 3.27.4-5 * Sat Sep 02 2023 Tom Stellard <tstellar@redhat.com> - 3.27.4-5