commit:     31a45f02c1df2f828972c42210b298786bf122e6
Author:     Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Sat Jul 20 16:23:32 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep  9 18:15:11 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31a45f02

dev-libs/rocm-device-libs: strip unsupported flags for potentially switched 
compiler

Closes: https://bugs.gentoo.org/936099
Closes: https://bugs.gentoo.org/937276
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/rocm-device-libs/rocm-device-libs-6.1.1.ebuild | 13 +++++++++----
 dev-libs/rocm-device-libs/rocm-device-libs-6.1.2.ebuild | 13 +++++++++----
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/dev-libs/rocm-device-libs/rocm-device-libs-6.1.1.ebuild 
b/dev-libs/rocm-device-libs/rocm-device-libs-6.1.1.ebuild
index 04fd989b95cb..bd28fb96d253 100644
--- a/dev-libs/rocm-device-libs/rocm-device-libs-6.1.1.ebuild
+++ b/dev-libs/rocm-device-libs/rocm-device-libs-6.1.1.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 LLVM_COMPAT=( 18 )
-inherit cmake llvm-r1
+inherit cmake flag-o-matic llvm-r1
 
 MY_P=llvm-project-rocm-${PV}
 components=( "amd/device-libs" )
@@ -66,12 +66,17 @@ src_prepare() {
 }
 
 src_configure() {
+       # Do not trust CMake with autoselecting Clang, as it autoselects the 
latest one
+       # producing too modern LLVM bitcode and causing linker errors in other 
packages.
+       # Clean up unsupported flags for the switched compiler, see #936099
+       local -x CC="$(get_llvm_prefix)/bin/clang"
+       local -x CXX="$(get_llvm_prefix)/bin/clang++"
+       strip-unsupported-flags
+
        local mycmakeargs=(
                -DLLVM_DIR="$(get_llvm_prefix)"
        )
-       # do not trust CMake with autoselecting Clang, as it autoselects the 
latest one
-       # producing too modern LLVM bitcode and causing linker errors in other 
packages
-       CC="$(get_llvm_prefix)/bin/clang" CXX="$(get_llvm_prefix)/bin/clang++" 
cmake_src_configure
+       cmake_src_configure
 }
 
 src_install() {

diff --git a/dev-libs/rocm-device-libs/rocm-device-libs-6.1.2.ebuild 
b/dev-libs/rocm-device-libs/rocm-device-libs-6.1.2.ebuild
index a6d5dd67438b..a19a93f076ef 100644
--- a/dev-libs/rocm-device-libs/rocm-device-libs-6.1.2.ebuild
+++ b/dev-libs/rocm-device-libs/rocm-device-libs-6.1.2.ebuild
@@ -4,7 +4,7 @@
 EAPI=8
 
 LLVM_COMPAT=( 18 )
-inherit cmake llvm-r1
+inherit cmake flag-o-matic llvm-r1
 
 MY_P=llvm-project-rocm-${PV}
 components=( "amd/device-libs" )
@@ -67,12 +67,17 @@ src_prepare() {
 }
 
 src_configure() {
+       # Do not trust CMake with autoselecting Clang, as it autoselects the 
latest one
+       # producing too modern LLVM bitcode and causing linker errors in other 
packages.
+       # Clean up unsupported flags for the switched compiler, see #936099
+       local -x CC="$(get_llvm_prefix)/bin/clang"
+       local -x CXX="$(get_llvm_prefix)/bin/clang++"
+       strip-unsupported-flags
+
        local mycmakeargs=(
                -DLLVM_DIR="$(get_llvm_prefix)"
        )
-       # do not trust CMake with autoselecting Clang, as it autoselects the 
latest one
-       # producing too modern LLVM bitcode and causing linker errors in other 
packages
-       CC="$(get_llvm_prefix)/bin/clang" CXX="$(get_llvm_prefix)/bin/clang++" 
cmake_src_configure
+       cmake_src_configure
 }
 
 src_install() {

Reply via email to