mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-21 10:37:22 -08:00
This adds a patch that removes gfx1250-strict target used by the new Instinct MI450 series accelerators. More info on this target: https://www.phoronix.com/news/AMD-gfx1250-strict gfx1250-strict requires LLVM 24; it looks like enablement of some future hardware feature, but practically not used yet. Bug: https://bugs.gentoo.org/984016 Signed-off-by: Sv. Lockal <lockalsash@gmail.com> Part-of: https://github.com/gentoo/gentoo/pull/46894 Signed-off-by: Sam James <sam@gentoo.org>
87 lines
2.1 KiB
Bash
87 lines
2.1 KiB
Bash
# Copyright 1999-2026 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
LLVM_COMPAT=( 23 )
|
|
|
|
inherit cmake llvm-r2
|
|
|
|
MY_P=llvm-project-therock-${PV%.0}
|
|
components=( "amd/comgr" )
|
|
|
|
DESCRIPTION="Radeon Open Compute Code Object Manager"
|
|
HOMEPAGE="https://github.com/ROCm/llvm-project/tree/amd-staging/amd/comgr"
|
|
SRC_URI="https://github.com/ROCm/llvm-project/archive/therock-${PV%.0}.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 )"
|
|
|
|
PATCHES=(
|
|
"${FILESDIR}/${PN}-6.4.1-extend-isa-compatibility-check.patch"
|
|
"${FILESDIR}/${PN}-6.1.0-dont-add-nogpulib.patch"
|
|
"${FILESDIR}/${PN}-10.1.0-llvm-23-compat.patch"
|
|
"${FILESDIR}/${PN}-10.1.0-llvm-23-gpu-rdc.patch"
|
|
"${FILESDIR}/${PN}-10.1.0-test-llvm-dylib.patch"
|
|
)
|
|
|
|
RDEPEND="
|
|
dev-libs/rocm-device-libs:${SLOT}
|
|
llvm-runtimes/clang-runtime:=
|
|
$(llvm_gen_dep "
|
|
llvm-core/clang:\${LLVM_SLOT}=
|
|
llvm-core/lld:\${LLVM_SLOT}=
|
|
llvm-core/llvm:\${LLVM_SLOT}=
|
|
")
|
|
dev-util/hipcc:${SLOT}
|
|
"
|
|
DEPEND="${RDEPEND}"
|
|
|
|
# Circular dependency: to build tests, hip compiler must be functional
|
|
BDEPEND="test? ( dev-util/hip:${SLOT} )"
|
|
|
|
CMAKE_BUILD_TYPE=Release
|
|
|
|
src_unpack() {
|
|
if [[ ${PV} == *9999 ]] ; then
|
|
git-r3_fetch
|
|
git-r3_checkout '' . '' "${components[@]}"
|
|
else
|
|
archive="${MY_P}.tar.gz"
|
|
ebegin "Unpacking from ${archive}"
|
|
tar -x -z -o \
|
|
-f "${DISTDIR}/${archive}" \
|
|
"${components[@]/#/${MY_P}/}" || die
|
|
eend ${?}
|
|
fi
|
|
}
|
|
|
|
src_prepare() {
|
|
sed -e "s:\${CLANG_CMAKE_DIR}/../../../\*:${EPREFIX}/usr/lib/clang/${LLVM_SLOT}/include:" \
|
|
-i cmake/opencl_header.cmake || die
|
|
|
|
cmake_src_prepare
|
|
}
|
|
|
|
src_configure() {
|
|
llvm_prepend_path "${LLVM_SLOT}"
|
|
|
|
local mycmakeargs=(
|
|
-DCMAKE_STRIP="" # disable stripping defined at lib/comgr/CMakeLists.txt:58
|
|
-DBUILD_TESTING=$(usex test ON OFF)
|
|
-DCOMGR_DISABLE_SPIRV=ON # requires ROCm/SPIRV-LLVM-Translator (fork of dev-util/spirv-llvm-translator)
|
|
)
|
|
# Prevent CMake from finding systemwide hip, which breaks tests
|
|
use test && mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_hip=ON )
|
|
cmake_src_configure
|
|
}
|
|
|
|
src_test() {
|
|
cmake_src_test
|
|
}
|