Refresh patches

- Drop 0002-Tolerate-empty-proc-cpuinfo.patch (merged upstream)
- Drop 0003-Linux-Provide-multiarch-library-directory-regex-earl.patch
  (merged upstream)
- Drop 0004-HIP-Fix-search-for-hip-lang-CMake-package-on-multiar.patch
  (merged upstream)
- Drop 0005-HIP-Add-support-for-HIP-runtime-in-system-paths.patch
  (merged upstream)

Gbp-Dch: full
ci/unstable
Timo Röhling 1 year ago
parent c0e0ccb431
commit 502a3068af

@ -14,10 +14,10 @@ Forwarded: not-needed
2 files changed, 3 insertions(+), 7 deletions(-) 2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index f842068..6d19a51 100644 index 76d4a9b..6c142ac 100644
--- a/Modules/FindPython/Support.cmake --- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake +++ b/Modules/FindPython/Support.cmake
@@ -1396,12 +1396,7 @@ unset (${_PYTHON_PREFIX}_SOABI) @@ -1420,12 +1420,7 @@ unset (${_PYTHON_PREFIX}_SOABI)
unset (${_PYTHON_PREFIX}_SOSABI) unset (${_PYTHON_PREFIX}_SOSABI)
# Define lookup strategy # Define lookup strategy
@ -31,7 +31,7 @@ index f842068..6d19a51 100644
if (DEFINED ${_PYTHON_PREFIX}_FIND_STRATEGY) if (DEFINED ${_PYTHON_PREFIX}_FIND_STRATEGY)
if (NOT ${_PYTHON_PREFIX}_FIND_STRATEGY MATCHES "^(VERSION|LOCATION)$") if (NOT ${_PYTHON_PREFIX}_FIND_STRATEGY MATCHES "^(VERSION|LOCATION)$")
message (AUTHOR_WARNING "Find${_PYTHON_PREFIX}: ${${_PYTHON_PREFIX}_FIND_STRATEGY}: invalid value for '${_PYTHON_PREFIX}_FIND_STRATEGY'. 'VERSION' or 'LOCATION' expected.") message (AUTHOR_WARNING "Find${_PYTHON_PREFIX}: ${${_PYTHON_PREFIX}_FIND_STRATEGY}: invalid value for '${_PYTHON_PREFIX}_FIND_STRATEGY'. 'VERSION' or 'LOCATION' expected.")
@@ -1583,7 +1578,7 @@ if (DEFINED ${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES) @@ -1625,7 +1620,7 @@ if (DEFINED ${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES)
set (_${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES ${${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES}) set (_${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES ${${_PYTHON_PREFIX}_FIND_UNVERSIONED_NAMES})
endif() endif()
else() else()
@ -41,10 +41,10 @@ index f842068..6d19a51 100644
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 7ad3587..70f4446 100644 index b5e759d..8b02c31 100644
--- a/Modules/FindPythonInterp.cmake --- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake +++ b/Modules/FindPythonInterp.cmake
@@ -94,6 +94,7 @@ if(DEFINED PYTHONLIBS_VERSION_STRING) @@ -107,6 +107,7 @@ if(DEFINED PYTHONLIBS_VERSION_STRING)
endif() endif()
# Search for the current active python version first # Search for the current active python version first
list(APPEND _Python_VERSIONS ";") list(APPEND _Python_VERSIONS ";")

@ -1,25 +0,0 @@
From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
Date: Sun, 28 May 2023 12:02:38 +0200
Subject: Tolerate empty /proc/cpuinfo
Forwarded: https://gitlab.kitware.com/utils/kwsys/-/merge_requests/284
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8504
---
Source/kwsys/SystemInformation.cxx | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index 20e2edb..7f8485e 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -3453,6 +3453,10 @@ bool SystemInformationImplementation::RetrieveInformationFromCpuInfoFile()
fileSize++;
}
fclose(fd);
+ if (fileSize < 2) {
+ std::cout << "No data in /proc/cpuinfo" << std::endl;
+ return false;
+ }
buffer.resize(fileSize - 2);
// Number of logical CPUs (combination of multiple processors, multi-core
// and SMT)

@ -1,38 +0,0 @@
From: Brad King <brad.king@kitware.com>
Date: Wed, 31 May 2023 16:32:45 -0400
Subject: Linux: Provide multiarch library directory regex earlier
Make `CMAKE_LIBRARY_ARCHITECTURE_REGEX` available while determining
compilers before `Platform/Linux` is loaded.
Bug: https://gitlab.kitware.com/cmake/cmake/-/issues/24562
Bug-Debian: https://bugs.debian.org/1031799
Applied-Upstream: https://gitlab.kitware.com/cmake/cmake/-/commit/cc737ae8295156812e697a9d2f3f7b79bf7b72c8
---
Modules/Platform/Linux-Initialize.cmake | 2 ++
Modules/Platform/Linux.cmake | 3 ---
2 files changed, 2 insertions(+), 3 deletions(-)
create mode 100644 Modules/Platform/Linux-Initialize.cmake
diff --git a/Modules/Platform/Linux-Initialize.cmake b/Modules/Platform/Linux-Initialize.cmake
new file mode 100644
index 0000000..6d9cbae
--- /dev/null
+++ b/Modules/Platform/Linux-Initialize.cmake
@@ -0,0 +1,2 @@
+# Match multiarch library directory names.
+set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake
index 3dc3ca3..1f2d8e6 100644
--- a/Modules/Platform/Linux.cmake
+++ b/Modules/Platform/Linux.cmake
@@ -80,9 +80,6 @@ else()
endif()
endif()
-# Match multiarch library directory names.
-set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*")
-
include(Platform/UnixPaths)
# Debian has lib32 and lib64 paths only for compatibility so they should not be

@ -1,112 +0,0 @@
From: Brad King <brad.king@kitware.com>
Date: Wed, 31 May 2023 16:41:49 -0400
Subject: HIP: Fix search for hip-lang CMake package on multiarch distros
We need `CMAKE_LIBRARY_ARCHITECTURE` to find the package before HIP
compiler ABI detection. However, if HIP is the first enabled language,
the value is not known until `CMAKE_HIP_LIBRARY_ARCHITECTURE` is
determined by the ABI detection step. Resolve this by detecting
`CMAKE_HIP_LIBRARY_ARCHITECTURE` from the compiler id output.
Bug: https://gitlab.kitware.com/cmake/cmake/-/issues/24562
Bug-Debian: https://bugs.debian.org/1031799
Applied-Upstream: https://gitlab.kitware.com/cmake/cmake/-/commit/bae57dc28179022ba0b654368efc451e36db6396
---
Modules/CMakeDetermineHIPCompiler.cmake | 50 ++++++++++++++++++++++++++++-----
Modules/CMakeHIPCompiler.cmake.in | 1 +
Modules/CMakeHIPInformation.cmake | 2 +-
3 files changed, 45 insertions(+), 8 deletions(-)
diff --git a/Modules/CMakeDetermineHIPCompiler.cmake b/Modules/CMakeDetermineHIPCompiler.cmake
index 6294d04..5e54502 100644
--- a/Modules/CMakeDetermineHIPCompiler.cmake
+++ b/Modules/CMakeDetermineHIPCompiler.cmake
@@ -3,6 +3,7 @@
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
+include(${CMAKE_ROOT}/Modules/CMakeParseLibraryArchitecture.cmake)
if( NOT ( ("${CMAKE_GENERATOR}" MATCHES "Make") OR
("${CMAKE_GENERATOR}" MATCHES "Ninja") ) )
@@ -102,13 +103,48 @@ endif()
if(NOT CMAKE_HIP_COMPILER_ROCM_ROOT)
message(FATAL_ERROR "Failed to find ROCm root directory.")
endif()
-if(NOT EXISTS "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib/cmake/hip-lang/hip-lang-config.cmake")
- message(FATAL_ERROR
- "The ROCm root directory:\n"
- " ${CMAKE_HIP_COMPILER_ROCM_ROOT}\n"
- "does not contain the HIP runtime CMake package, expected at:\n"
- " ${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib/cmake/hip-lang/hip-lang-config.cmake\n"
- )
+
+# Normally implicit link information is not detected until
+cmake_parse_implicit_link_info("${CMAKE_HIP_COMPILER_PRODUCED_OUTPUT}"
+ _CMAKE_HIP_COMPILER_ID_IMPLICIT_LIBS
+ _CMAKE_HIP_COMPILER_ID_IMPLICIT_DIRS
+ _CMAKE_HIP_COMPILER_ID_IMPLICIT_FWKS
+ _CMAKE_HIP_COMPILER_ID_IMPLICIT_LOG
+ "" LANGUAGE HIP)
+message(CONFIGURE_LOG
+ "Parsed HIP implicit link information from compiler id output:\n${_CMAKE_HIP_COMPILER_ID_IMPLICIT_LOG}\n\n")
+cmake_parse_library_architecture(HIP "${_CMAKE_HIP_COMPILER_ID_IMPLICIT_DIRS}" "" CMAKE_HIP_LIBRARY_ARCHITECTURE)
+if(CMAKE_HIP_LIBRARY_ARCHITECTURE)
+ message(CONFIGURE_LOG
+ "Parsed HIP library architecture from compiler id output: ${CMAKE_HIP_LIBRARY_ARCHITECTURE}\n")
+endif()
+unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_LIBS)
+unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_DIRS)
+unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_FWKS)
+unset(_CMAKE_HIP_COMPILER_ID_IMPLICIT_LOG)
+
+if(NOT CMAKE_HIP_COMPILER_ROCM_LIB)
+ set(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib")
+ if(CMAKE_HIP_LIBRARY_ARCHITECTURE)
+ list(APPEND _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib/${CMAKE_HIP_LIBRARY_ARCHITECTURE}")
+ endif()
+ foreach(dir IN LISTS _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS)
+ if(EXISTS "${dir}/cmake/hip-lang/hip-lang-config.cmake")
+ set(CMAKE_HIP_COMPILER_ROCM_LIB "${dir}")
+ break()
+ endif()
+ endforeach()
+ if(NOT CMAKE_HIP_COMPILER_ROCM_LIB)
+ list(TRANSFORM _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS APPEND "/cmake/hip-lang/hip-lang-config.cmake")
+ string(REPLACE ";" "\n " _CMAKE_HIP_COMPILER_ROCM_LIB_DIRS "${_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS}")
+ message(FATAL_ERROR
+ "The ROCm root directory:\n"
+ " ${CMAKE_HIP_COMPILER_ROCM_ROOT}\n"
+ "does not contain the HIP runtime CMake package, expected at one of:\n"
+ " ${_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS}\n"
+ )
+ endif()
+ unset(_CMAKE_HIP_COMPILER_ROCM_LIB_DIRS)
endif()
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
diff --git a/Modules/CMakeHIPCompiler.cmake.in b/Modules/CMakeHIPCompiler.cmake.in
index ce4e2cf..c106e91 100644
--- a/Modules/CMakeHIPCompiler.cmake.in
+++ b/Modules/CMakeHIPCompiler.cmake.in
@@ -18,6 +18,7 @@ set(CMAKE_HIP_SIMULATE_VERSION "@CMAKE_HIP_SIMULATE_VERSION@")
@SET_MSVC_HIP_ARCHITECTURE_ID@
@_SET_CMAKE_HIP_COMPILER_SYSROOT@
set(CMAKE_HIP_COMPILER_ROCM_ROOT "@CMAKE_HIP_COMPILER_ROCM_ROOT@")
+set(CMAKE_HIP_COMPILER_ROCM_LIB "@CMAKE_HIP_COMPILER_ROCM_LIB@")
set(CMAKE_HIP_COMPILER_ENV_VAR "HIPCXX")
diff --git a/Modules/CMakeHIPInformation.cmake b/Modules/CMakeHIPInformation.cmake
index 33f8697..41a98db 100644
--- a/Modules/CMakeHIPInformation.cmake
+++ b/Modules/CMakeHIPInformation.cmake
@@ -142,7 +142,7 @@ set(CMAKE_HIP_INFORMATION_LOADED 1)
# Load the file and find the relevant HIP runtime.
if(NOT DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET)
- set(hip-lang_DIR "${CMAKE_HIP_COMPILER_ROCM_ROOT}/lib/cmake/hip-lang")
+ set(hip-lang_DIR "${CMAKE_HIP_COMPILER_ROCM_LIB}/cmake/hip-lang")
find_package(hip-lang CONFIG QUIET NO_DEFAULT_PATH REQUIRED)
endif()
if(DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET)

@ -1,43 +0,0 @@
From: Cordell Bloor <Cordell.Bloor@amd.com>
Date: Wed, 22 Mar 2023 16:48:10 -0600
Subject: HIP: Add support for HIP runtime in system paths
Add /usr/include to implicit include dirs for ABI check
The CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES are computed using
try_compile in CMAKE_DETERMINE_COMPILER_ABI, but the implicit include
directories aren't known until after try_compile is complete. This can
be a problem when the HIP runtime include path is /usr/include, because
the runtime include path is always added to the userDirs and the
compiler automatically includes standard library headers via
__clang_hip_runtime_wrapper.h
Bug: https://gitlab.kitware.com/cmake/cmake/-/issues/24562
Bug-Debian: https://bugs.debian.org/1031799
Forwarded: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8534
---
Source/cmLocalGenerator.cxx | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 75ec694..68ff7ea 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1190,6 +1190,17 @@ std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit(
cmSystemTools::ConvertToUnixSlashes(impDirVec[i]);
}
}
+
+ // The CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES are computed using
+ // try_compile in CMAKE_DETERMINE_COMPILER_ABI, but the implicit include
+ // directories are not known during that try_compile. This can be a
+ // problem when the HIP runtime include path is /usr/include because the
+ // runtime include path is always added to the userDirs and the compiler
+ // includes standard library headers via "__clang_hip_runtime_wrapper.h".
+ if (lang == "HIP" && impDirVec.size() == impDirVecOldSize &&
+ !cm::contains(impDirVec, "/usr/include")) {
+ implicitExclude.emplace("/usr/include");
+ }
}
// The Platform/UnixPaths module used to hard-code /usr/include for C, CXX,

@ -1,5 +1 @@
0001-Prefer-default-Python-version.patch 0001-Prefer-default-Python-version.patch
0002-Tolerate-empty-proc-cpuinfo.patch
0003-Linux-Provide-multiarch-library-directory-regex-earl.patch
0004-HIP-Fix-search-for-hip-lang-CMake-package-on-multiar.patch
0005-HIP-Add-support-for-HIP-runtime-in-system-paths.patch

Loading…
Cancel
Save