Skip to content

Commit

Permalink
dev-libs/rocm-comgr: fix hip compiler on musl profile
Browse files Browse the repository at this point in the history
Signed-off-by: Sv. Lockal <[email protected]>
  • Loading branch information
AngryLoki committed May 22, 2024
1 parent 0becd1d commit 084b146
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Remove HIP/ROCM includes ("-isystem /usr/include"), as they break inclusion of <math.h>.
Add inclusion of Clang resource dir (e.g. /usr/lib/clang/17), as it is used in hip runtime like that.
Issue: https://github.com/ROCm/clr/issues/82
Remove hardcoded target to fix HIP on musl.

Issues:
* https://github.com/ROCm/clr/issues/82
* https://github.com/ROCm/llvm-project/issues/92
--- a/src/comgr-compiler.cpp
+++ b/src/comgr-compiler.cpp
@@ -1028,9 +1028,8 @@ AMDGPUCompiler::addTargetIdentifierFlags(llvm::StringRef IdentStr,
Expand All @@ -15,8 +19,12 @@ Issue: https://github.com/ROCm/clr/issues/82

Args.push_back("-x");

@@ -1055,9 +1054,7 @@ amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() {
Args.push_back("x86_64-unknown-linux-gnu");
@@ -1051,13 +1050,9 @@ amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() {
case AMD_COMGR_LANGUAGE_HIP:
Args.push_back("hip");
Args.push_back("-std=c++11");
- Args.push_back("-target");
- Args.push_back("x86_64-unknown-linux-gnu");
Args.push_back("--cuda-device-only");
Args.push_back("-isystem");
- Args.push_back(ROCMIncludePath.c_str());
Expand Down
10 changes: 5 additions & 5 deletions dev-libs/rocm-comgr/rocm-comgr-6.1.1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ else
KEYWORDS="~amd64"
fi

DESCRIPTION="Radeon Open Compute Code Object Manager"
HOMEPAGE="https://github.com/ROCm/ROCm-CompilerSupport"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"

IUSE="test"
RESTRICT="!test? ( test )"

Expand All @@ -37,11 +42,6 @@ PATCHES=(
"${FILESDIR}/${PN}-6.1.0-dont-add-nogpulib.patch"
)

DESCRIPTION="Radeon Open Compute Code Object Manager"
HOMEPAGE="https://github.com/ROCm/ROCm-CompilerSupport"
LICENSE="MIT"
SLOT="0/$(ver_cut 1-2)"

RDEPEND=">=dev-libs/rocm-device-libs-${PV}
sys-devel/clang-runtime:=
$(llvm_gen_dep '
Expand Down

0 comments on commit 084b146

Please sign in to comment.