diff options
author | Sv. Lockal <lockalsash@gmail.com> | 2024-05-22 07:36:17 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-06-26 10:19:07 +0100 |
commit | fc6671b5a08547e584370b41d02d5535e3198040 (patch) | |
tree | 348dca45da256094384a5549a2a96dde5ef6cd45 | |
parent | sci-libs/caffe2: limit rocm libs to 5.7*. 6.x only works with >=caffe2-2.3.0 (diff) | |
download | gentoo-fc6671b5a08547e584370b41d02d5535e3198040.tar.gz gentoo-fc6671b5a08547e584370b41d02d5535e3198040.tar.bz2 gentoo-fc6671b5a08547e584370b41d02d5535e3198040.zip |
dev-libs/rocm-comgr: drop 6.0.0, cleanup in 6.1.1 patches
* fix hip compiler on musl profile
* fix tests
* make 6.1.1 compatible with LLVM 18
Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
9 files changed, 100 insertions, 189 deletions
diff --git a/dev-libs/rocm-comgr/Manifest b/dev-libs/rocm-comgr/Manifest index 232172423583..0b5b9a36741f 100644 --- a/dev-libs/rocm-comgr/Manifest +++ b/dev-libs/rocm-comgr/Manifest @@ -4,4 +4,3 @@ DIST rocm-comgr-5.3.3.tar.gz 120414 BLAKE2B 29b9d466d74ef94165a2b9bea35eac4616f6 DIST rocm-comgr-5.4.3.tar.gz 120461 BLAKE2B c4eb79dd5a72a2b18e16841fc8cb9a3a33efb0c7b04a7585df9672d682bba6fa826ab8b37dba5febca3b8c5ee5aca30d8546e1fa69e77671e5c750e2a8c1f12f SHA512 1a25af99a0166d70ca6dc5df5a667068eaf583dccd74bbb18a2a5de3c1b769e0c1eb9a0c539e0cd88bc50bbbe53214a1d1b23fbdfd6fc5b6507c44da259815c4 DIST rocm-comgr-5.5.1.tar.gz 127475 BLAKE2B dbcb6729b27c0b4a4be37f5e462d96b10c15a6a3b540a81a74a648fc45dc727ea5706db1a0f4583a31ac4cb5c9f0d9f4e258fa5ac792b327f4cb1dfe6d585937 SHA512 09174ef2ad21f62b197e439bb5b04a365233c360c57cc2ccf0ea3d53edfa8880dff4f127c6d6c1d430b63b6f7ea666705b14cadc2bccb89c0fefed943b0cf1c7 DIST rocm-comgr-5.7.1.tar.gz 137923 BLAKE2B e215f51137fd0c4b67e85496bf289dc0afde6ebc9efb9416f5fc4cf312b2be9be26da35cb70965bf4857a0f1434d750bcc03ce83095173098487ef7805948735 SHA512 cdd2609b858d9503c30122a2d328d36baa8a930a05bcb6c38e30723909c492b4d47eaaf4884dbb7aa82053e7cda6c22ee1aa16fc5ba266e272d98ff772c5079d -DIST rocm-comgr-6.0.0.tar.gz 142129 BLAKE2B 65d00a79ead48872e3b94e5239a07c476288c611aa3ce2311a345bec5f7d277dc67910fa5f4ef000a5e94e6bed148baa4b1c7fe2b1cfaae2cc39555d716668d5 SHA512 877d2042bdafa6b503ee8f24d3a9c4ac9e001a7884211df47b2237d8a5ead66ced0f352c7b76d96190cd407461f5434fb1a5a4508067e432eb93c0f2fd066053 diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-llvm-18-compat.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-llvm-18-compat.patch deleted file mode 100644 index a5a0edb92f6b..000000000000 --- a/dev-libs/rocm-comgr/files/rocm-comgr-6.0.0-llvm-18-compat.patch +++ /dev/null @@ -1,22 +0,0 @@ -ROCm 6.0.0 and 6.0.2 releases use mix between LLVM 17 and 18 -forked as https://github.com/RadeonOpenCompute/llvm-project -which makes some libraries compatible with only one version, -while other require another... - -Backports https://github.com/ROCm/llvm-project/commit/6cbc4dc91dfeb1cf2295cb350866e0b3a07dfee4 ---- a/src/comgr-metadata.cpp -+++ b/src/comgr-metadata.cpp -@@ -1087,7 +1087,12 @@ amd_comgr_status_t lookUpCodeObject(DataObject *DataP, - } - - BinaryStreamReader Reader(StringRef(DataP->Data, DataP->Size), -- support::little); -+#if LLVM_VERSION_MAJOR > 17 -+ llvm::endianness::little -+#else -+ support::little -+#endif -+ ); - - StringRef Magic; - if (auto EC = Reader.readFixedString(Magic, OffloadBundleMagicLen)) { diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-clang18-code-object-v5.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-clang18-code-object-v5.patch deleted file mode 100644 index 7590dfd2ff59..000000000000 --- a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-clang18-code-object-v5.patch +++ /dev/null @@ -1,23 +0,0 @@ -Merged from https://github.com/ROCm/llvm-project/commit/52161580a9c343813a5f46567864f8a98b655444 -and https://github.com/ROCm/llvm-project/commit/27b8c1c1d04276e6911eadb97b4fbb8b23662e81 -diff --git a/test/mangled_names_test.c b/test/mangled_names_test.c -index 2374686b6ef1..e5840d221bc0 100644 ---- a/test/mangled_names_test.c -+++ b/test/mangled_names_test.c -@@ -173,14 +173,14 @@ int main(int argc, char *argv[]) { - Status = amd_comgr_populate_mangled_names(DataBc, &numNames); - checkError(Status, "amd_comgr_populate_mangled_names"); - -- if (numNames != 2) { -+ if (numNames != 3) { - printf("amd_populate_mangled_names Failed: " - "produced %zu bitcode names (expected 2)\n", - numNames); - exit(1); - } - -- const char *bcNames[] = {"source1", "source2"}; -+ const char *bcNames[] = {"__oclc_ABI_version", "source1", "source2"}; - - for (size_t I = 0; I < numNames; ++I) { - size_t Size; diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-clang18-log_remarks_test.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-clang18-log_remarks_test.patch deleted file mode 100644 index 82c986c2f1ac..000000000000 --- a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-clang18-log_remarks_test.patch +++ /dev/null @@ -1,14 +0,0 @@ -From https://github.com/ROCm/llvm-project/commit/61986583f3d0825686ba2e0fd8bf899b9d395980 -Clang-18 have updates the warning message. -=================================================================== ---- comgr.orig/test/compile_log_remarks_test.c -+++ comgr/test/compile_log_remarks_test.c -@@ -107,7 +107,7 @@ int main(int argc, char *argv[]) { - AMD_COMGR_DATA_KIND_SOURCE, 1); - - checkLogs("AMD_COMGR_ACTION_CODEGEN_BC_TO_ASSEMBLY", DataSetAsm, -- "remark: <unknown>:0:0: 8 stack bytes in function " -+ "remark: <unknown>:0:0: 8 stack bytes in function 'f' " - "[-Rpass-analysis=prologepilog]"); - - Status = amd_comgr_destroy_data_set(DataSetCl); diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-clang18-option-use-visibility.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-clang18-option-use-visibility.patch deleted file mode 100644 index ea7d97ce7996..000000000000 --- a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-clang18-option-use-visibility.patch +++ /dev/null @@ -1,39 +0,0 @@ -From ee123c3d1706bc4346511b1a9032020782576350 Mon Sep 17 00:00:00 2001 -From: Ron Lieberman <ron.lieberman@amd.com> -Date: Thu, 17 Aug 2023 11:02:47 -0500 -Subject: [PATCH] [Options] use Visibilty - -Change-Id: I2b0fae82e917b4902609a1fba70032939a165299 ---- - amd/comgr/src/comgr-compiler.cpp | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/comgr-compiler.cpp b/src/comgr-compiler.cpp -index d421ea0c094b..aaf902b143d9 100644 ---- a/src/comgr-compiler.cpp -+++ b/src/comgr-compiler.cpp -@@ -205,10 +205,10 @@ bool AssemblerInvocation::createFromArgs(AssemblerInvocation &Opts, - // Parse the arguments. - const OptTable &OptTbl = getDriverOptTable(); - -- const unsigned IncludedFlagsBitmask = options::CC1AsOption; -+ llvm::opt::Visibility VisibilityMask(options::CC1AsOption); - unsigned MissingArgIndex, MissingArgCount; - InputArgList Args = OptTbl.ParseArgs(Argv, MissingArgIndex, MissingArgCount, -- IncludedFlagsBitmask); -+ VisibilityMask); - - // Check for missing argument error. - if (MissingArgCount) { -@@ -221,7 +221,7 @@ bool AssemblerInvocation::createFromArgs(AssemblerInvocation &Opts, - for (const Arg *A : Args.filtered(OPT_UNKNOWN)) { - auto ArgString = A->getAsString(Args); - std::string Nearest; -- if (OptTbl.findNearest(ArgString, Nearest, IncludedFlagsBitmask) > 1) { -+ if (OptTbl.findNearest(ArgString, Nearest, VisibilityMask) > 1) { - Diags.Report(diag::err_drv_unknown_argument) << ArgString; - } else { - Diags.Report(diag::err_drv_unknown_argument_with_suggestion) --- -2.44.0 - diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-fix-comgr-default-flags.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-fix-comgr-default-flags.patch index 9bad87a68c3d..d885da08ddae 100644 --- a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-fix-comgr-default-flags.patch +++ b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-fix-comgr-default-flags.patch @@ -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, @@ -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()); diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-llvm-18-compat.patch b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-llvm-18-compat.patch new file mode 100644 index 000000000000..df008e4230d7 --- /dev/null +++ b/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-llvm-18-compat.patch @@ -0,0 +1,79 @@ +ROCm 6.0.0 and 6.0.2 releases use mix between LLVM 17 and 18 +forked as https://github.com/RadeonOpenCompute/llvm-project +which makes some libraries compatible with LLVM 17, +while other require LLVM 18. + +Backports: +* https://github.com/ROCm/llvm-project/commit/6cbc4dc91dfeb1cf2295cb350866e0b3a07dfee4 +* https://github.com/ROCm/llvm-project/commit/179ec2e67bf882c6bccb27f81db3d80f7eb9946e +* https://github.com/ROCm/llvm-project/commit/ee123c3d1706bc4346511b1a9032020782576350 +--- a/src/comgr-compiler.cpp ++++ b/src/comgr-compiler.cpp +@@ -205,7 +205,11 @@ bool AssemblerInvocation::createFromArgs(AssemblerInvocation &Opts, + // Parse the arguments. + const OptTable &OptTbl = getDriverOptTable(); + ++#if LLVM_VERSION_MAJOR == 17 + const unsigned IncludedFlagsBitmask = options::CC1AsOption; ++#else ++ llvm::opt::Visibility IncludedFlagsBitmask(options::CC1AsOption); ++#endif + unsigned MissingArgIndex, MissingArgCount; + InputArgList Args = OptTbl.ParseArgs(Argv, MissingArgIndex, MissingArgCount, + IncludedFlagsBitmask); +@@ -1041,11 +1045,15 @@ amd_comgr_status_t AMDGPUCompiler::addCompilationFlags() { + Args.push_back("cl"); + Args.push_back("-std=cl1.2"); + Args.push_back("-cl-no-stdinc"); ++ Args.push_back("-mllvm"); ++ Args.push_back("-amdgpu-internalize-symbols"); + break; + case AMD_COMGR_LANGUAGE_OPENCL_2_0: + Args.push_back("cl"); + Args.push_back("-std=cl2.0"); + Args.push_back("-cl-no-stdinc"); ++ Args.push_back("-mllvm"); ++ Args.push_back("-amdgpu-internalize-symbols"); + break; + case AMD_COMGR_LANGUAGE_HIP: + Args.push_back("hip"); +@@ -1605,6 +1613,9 @@ amd_comgr_status_t AMDGPUCompiler::assembleToRelocatable() { + Args.push_back("-x"); + Args.push_back("assembler"); + ++ // -nogpulib option not needed for assembling to relocatable ++ NoGpuLib = false; ++ + return processFiles(AMD_COMGR_DATA_KIND_RELOCATABLE, ".o"); + } + +--- a/src/comgr-metadata.cpp ++++ b/src/comgr-metadata.cpp +@@ -1087,7 +1087,12 @@ amd_comgr_status_t lookUpCodeObject(DataObject *DataP, + } + + BinaryStreamReader Reader(StringRef(DataP->Data, DataP->Size), +- support::little); ++#if LLVM_VERSION_MAJOR == 17 ++ support::little ++#else ++ llvm::endianness::little ++#endif ++ ); + + StringRef Magic; + if (auto EC = Reader.readFixedString(Magic, OffloadBundleMagicLen)) { +--- a/test/compile_log_remarks_test.c ++++ b/test/compile_log_remarks_test.c +@@ -107,7 +107,11 @@ int main(int argc, char *argv[]) { + AMD_COMGR_DATA_KIND_SOURCE, 1); + + checkLogs("AMD_COMGR_ACTION_CODEGEN_BC_TO_ASSEMBLY", DataSetAsm, ++#if LLVM_VERSION_MAJOR == 17 + "remark: <unknown>:0:0: 8 stack bytes in function " ++#else ++ "remark: <unknown>:0:0: 8 stack bytes in function 'f' " ++#endif + "[-Rpass-analysis=prologepilog]"); + + Status = amd_comgr_destroy_data_set(DataSetCl); diff --git a/dev-libs/rocm-comgr/rocm-comgr-6.0.0-r1.ebuild b/dev-libs/rocm-comgr/rocm-comgr-6.0.0-r1.ebuild deleted file mode 100644 index 14bc03e325f6..000000000000 --- a/dev-libs/rocm-comgr/rocm-comgr-6.0.0-r1.ebuild +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -LLVM_COMPAT=( 17 ) - -inherit cmake llvm-r1 prefix - -if [[ ${PV} == *9999 ]] ; then - EGIT_REPO_URI="https://github.com/ROCm/ROCm-CompilerSupport.git" - inherit git-r3 - S="${WORKDIR}/${P}/lib/comgr" -else - SRC_URI="https://github.com/ROCm/ROCm-CompilerSupport/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" - S="${WORKDIR}/ROCm-CompilerSupport-rocm-${PV}/lib/comgr" - KEYWORDS="~amd64" -fi - -IUSE="test" -RESTRICT="!test? ( test )" - -PATCHES=( - "${FILESDIR}/${PN}-5.1.3-rocm-path.patch" - "${FILESDIR}/0001-Specify-clang-exe-path-in-Driver-Creation.patch" - "${FILESDIR}/0001-Find-CLANG_RESOURCE_DIR-using-clang-print-resource-d.patch" - "${FILESDIR}/${PN}-5.7.0-optional.patch" - "${FILESDIR}/${PN}-5.7.0-lld.patch" - "${FILESDIR}/${PN}-5.7.0-disassembly.patch" - "${FILESDIR}/${PN}-5.7.0-metadata.patch" - "${FILESDIR}/${PN}-5.7.0-symbolizer.patch" - "${FILESDIR}/${PN}-5.7.1-fix-tests.patch" - "${FILESDIR}/${PN}-5.7.1-correct-license-install-dir.patch" - "${FILESDIR}/${PN}-6.0.0-extend-isa-compatibility-check.patch" - "${FILESDIR}/${PN}-6.0.0-llvm-18-compat.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 ' - sys-devel/clang:${LLVM_SLOT}= - sys-devel/lld:${LLVM_SLOT}= - ') -" -DEPEND="${RDEPEND}" - -CMAKE_BUILD_TYPE=Release - -src_prepare() { - sed '/sys::path::append(HIPPath/s,"hip","",' -i src/comgr-env.cpp || die - sed "/return LLVMPath;/s,LLVMPath,llvm::SmallString<128>(\"$(get_llvm_prefix)\")," -i src/comgr-env.cpp || die - eapply $(prefixify_ro "${FILESDIR}"/${PN}-5.0-rocm_path.patch) - cmake_src_prepare -} - -src_configure() { - local mycmakeargs=( - -DLLVM_DIR="$(get_llvm_prefix)" - -DCMAKE_STRIP="" # disable stripping defined at lib/comgr/CMakeLists.txt:58 - -DBUILD_TESTING=$(usex test ON OFF) - ) - cmake_src_configure -} diff --git a/dev-libs/rocm-comgr/rocm-comgr-6.1.1.ebuild b/dev-libs/rocm-comgr/rocm-comgr-6.1.1.ebuild index b52f76a962ea..a2492992ceed 100644 --- a/dev-libs/rocm-comgr/rocm-comgr-6.1.1.ebuild +++ b/dev-libs/rocm-comgr/rocm-comgr-6.1.1.ebuild @@ -10,15 +10,14 @@ inherit cmake llvm-r1 prefix MY_P=llvm-project-rocm-${PV} components=( "amd/comgr" ) -if [[ ${PV} == *9999 ]] ; then - EGIT_REPO_URI="https://github.com/ROCm/llvm-project" - inherit git-r3 - S="${WORKDIR}/${P}/${components[0]}" -else - SRC_URI="https://github.com/ROCm/llvm-project/archive/rocm-${PV}.tar.gz -> ${MY_P}.tar.gz" - S="${WORKDIR}/${MY_P}/${components[0]}" - KEYWORDS="~amd64" -fi +DESCRIPTION="Radeon Open Compute Code Object Manager" +HOMEPAGE="https://github.com/ROCm/ROCm-CompilerSupport" +SRC_URI="https://github.com/ROCm/llvm-project/archive/rocm-${PV}.tar.gz -> ${MY_P}.tar.gz" +S="${WORKDIR}/${MY_P}/${components[0]}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" IUSE="test" RESTRICT="!test? ( test )" @@ -28,27 +27,19 @@ PATCHES=( "${FILESDIR}/0001-Find-CLANG_RESOURCE_DIR-using-clang-print-resource-d.patch" "${FILESDIR}/${PN}-5.7.1-correct-license-install-dir.patch" "${FILESDIR}/${PN}-6.0.0-extend-isa-compatibility-check.patch" - "${FILESDIR}/${PN}-6.0.0-llvm-18-compat.patch" + "${FILESDIR}/${PN}-6.1.0-llvm-18-compat.patch" "${FILESDIR}/${PN}-6.1.0-enforce-oop-compiler.patch" "${FILESDIR}/${PN}-6.1.0-fix-comgr-default-flags.patch" - "${FILESDIR}/${PN}-6.1.0-clang18-option-use-visibility.patch" - "${FILESDIR}/${PN}-6.1.0-clang18-code-object-v5.patch" - "${FILESDIR}/${PN}-6.1.0-clang18-log_remarks_test.patch" "${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 ' sys-devel/clang:${LLVM_SLOT}= sys-devel/lld:${LLVM_SLOT}= ') - dev-util/hipcc + dev-util/hipcc:${SLOT} " DEPEND="${RDEPEND}" |