commit:     5a76747ea313441e2eefffcd1badc7ac59e75ae6
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Mon Aug 26 18:33:53 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep  7 14:26:34 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a76747e

dev-build/cmake: allow override CMAKE_CUDA_HOST_LINK_LAUNCHER

This should fix "undefined reference to `__cxa_call_terminate'" because we can
then use CXX to link cuda binaries.

[sam: No revbump needed as we only just added 3.30.3.]

Bug: https://bugs.gentoo.org/928605
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-build/cmake/cmake-3.30.3.ebuild                |  2 ++
 dev-build/cmake/cmake-9999.ebuild                  |  2 ++
 .../cmake/files/cmake-3.30.3-cudahostld.patch      | 23 ++++++++++++++++++++++
 3 files changed, 27 insertions(+)

diff --git a/dev-build/cmake/cmake-3.30.3.ebuild 
b/dev-build/cmake/cmake-3.30.3.ebuild
index 7957c7bb58b2..1da4eb19984c 100644
--- a/dev-build/cmake/cmake-3.30.3.ebuild
+++ b/dev-build/cmake/cmake-3.30.3.ebuild
@@ -101,6 +101,8 @@ PATCHES=(
        "${FILESDIR}"/${PN}-3.27.0_rc1-0003-Prefer-pkgconfig-in-FindBLAS.patch
        
"${FILESDIR}"/${PN}-3.27.0_rc1-0004-Ensure-that-the-correct-version-of-Qt-is-always-used.patch
        
"${FILESDIR}"/${PN}-3.27.0_rc1-0005-Respect-Gentoo-s-Python-eclasses.patch
+       # Cuda
+       "${FILESDIR}/${PN}-3.30.3-cudahostld.patch"
 
        # Upstream fixes (can usually be removed with a version bump)
 )

diff --git a/dev-build/cmake/cmake-9999.ebuild 
b/dev-build/cmake/cmake-9999.ebuild
index fc1618ceab45..5c33c621e047 100644
--- a/dev-build/cmake/cmake-9999.ebuild
+++ b/dev-build/cmake/cmake-9999.ebuild
@@ -102,6 +102,8 @@ PATCHES=(
        
"${FILESDIR}"/${PN}-3.27.0_rc1-0004-Ensure-that-the-correct-version-of-Qt-is-always-used.patch
        
"${FILESDIR}"/${PN}-3.27.0_rc1-0005-Respect-Gentoo-s-Python-eclasses.patch
        
"${FILESDIR}"/${PN}-3.27.0_rc1-0006-Filter-out-distcc-warnings-to-avoid-confusing-CMake.patch
+       # Cuda
+       "${FILESDIR}/${PN}-3.30.3-cudahostld.patch"
 
        # Upstream fixes (can usually be removed with a version bump)
 )

diff --git a/dev-build/cmake/files/cmake-3.30.3-cudahostld.patch 
b/dev-build/cmake/files/cmake-3.30.3-cudahostld.patch
new file mode 100644
index 000000000000..f8b29730ea9f
--- /dev/null
+++ b/dev-build/cmake/files/cmake-3.30.3-cudahostld.patch
@@ -0,0 +1,23 @@
+From 0648f8f75c5f7044cca0f96d26e3ef6ed9440b3d Mon Sep 17 00:00:00 2001
+From: Paul Zander <[email protected]>
+Date: Mon, 26 Aug 2024 17:04:04 +0200
+Subject: [PATCH] allow custom CMAKE_CUDA_LINK_LAUNCHER
+
+Signed-off-by: Paul Zander <[email protected]>
+
+diff --git a/Modules/Internal/CMakeNVCCParseImplicitInfo.cmake 
b/Modules/Internal/CMakeNVCCParseImplicitInfo.cmake
+index 3aa10a2..a58c3ec 100644
+--- a/Modules/Internal/CMakeNVCCParseImplicitInfo.cmake
++++ b/Modules/Internal/CMakeNVCCParseImplicitInfo.cmake
+@@ -77,6 +77,11 @@ macro(cmake_nvcc_parse_implicit_info lang lang_var_)
+   if(_nvcc_link_line)
+     if("x${CMAKE_${lang}_SIMULATE_ID}" STREQUAL "xMSVC")
+       set(CMAKE_${lang}_HOST_LINK_LAUNCHER "${CMAKE_LINKER}")
++    elseif(DEFINED ENV{CUDAHOSTLD})
++      set(CMAKE_${lang}_HOST_LINK_LAUNCHER "$ENV{CUDAHOSTLD}")
++      string(APPEND _nvcc_log "  env link launcher name: 
[${CMAKE_${lang}_HOST_LINK_LAUNCHER}]\n")
++    elseif(DEFINED CMAKE_CUDA_HOST_LINK_LAUNCHER)
++      string(APPEND _nvcc_log "  set link launcher name: 
[${CMAKE_${lang}_HOST_LINK_LAUNCHER}]\n")
+     else()
+       #extract the compiler that is being used for linking
+       separate_arguments(_nvcc_link_line_args UNIX_COMMAND 
"${_nvcc_link_line}")

Reply via email to