From ae32bce0b823140512aaf748572216e4e91e98b1 Mon Sep 17 00:00:00 2001 From: Yiyang Wu Date: Sat, 28 Jan 2023 17:31:48 +0800 Subject: dev-libs/rocm-comgr: append -fno-stack-protector at runtime Closes: https://bugs.gentoo.org/892371 Signed-off-by: Yiyang Wu Closes: https://github.com/gentoo/gentoo/pull/29291 Signed-off-by: Sam James --- .../rocm-comgr-5.3.3-fno-stack-protecter.patch | 14 +++++ dev-libs/rocm-comgr/rocm-comgr-5.1.3-r2.ebuild | 59 --------------------- dev-libs/rocm-comgr/rocm-comgr-5.1.3-r3.ebuild | 60 ++++++++++++++++++++++ dev-libs/rocm-comgr/rocm-comgr-5.3.3-r1.ebuild | 1 + 4 files changed, 75 insertions(+), 59 deletions(-) create mode 100644 dev-libs/rocm-comgr/files/rocm-comgr-5.3.3-fno-stack-protecter.patch delete mode 100644 dev-libs/rocm-comgr/rocm-comgr-5.1.3-r2.ebuild create mode 100644 dev-libs/rocm-comgr/rocm-comgr-5.1.3-r3.ebuild (limited to 'dev-libs/rocm-comgr') diff --git a/dev-libs/rocm-comgr/files/rocm-comgr-5.3.3-fno-stack-protecter.patch b/dev-libs/rocm-comgr/files/rocm-comgr-5.3.3-fno-stack-protecter.patch new file mode 100644 index 000000000000..c8d078ee8946 --- /dev/null +++ b/dev-libs/rocm-comgr/files/rocm-comgr-5.3.3-fno-stack-protecter.patch @@ -0,0 +1,14 @@ +This add -fno-stack-protector to all compilation, since -f-stack-protector is currently unsupported by ROCm +Reference: https://bugs.gentoo.org/890377 +index 465187e..0baf925 100644 +--- a/src/comgr-compiler.cpp ++++ b/src/comgr-compiler.cpp +@@ -850,6 +850,8 @@ amd_comgr_status_t AMDGPUCompiler::processFile(const char *InputFilePath, + Argv.push_back(Arg); + } + ++ Argv.push_back("-fno-stack-protector"); ++ + for (auto &Option : ActionInfo->getOptions()) { + Argv.push_back(Option.c_str()); + if (Option.rfind("--rocm-path", 0) == 0) { diff --git a/dev-libs/rocm-comgr/rocm-comgr-5.1.3-r2.ebuild b/dev-libs/rocm-comgr/rocm-comgr-5.1.3-r2.ebuild deleted file mode 100644 index b080235a4798..000000000000 --- a/dev-libs/rocm-comgr/rocm-comgr-5.1.3-r2.ebuild +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit cmake llvm prefix - -LLVM_MAX_SLOT=15 - -if [[ ${PV} == *9999 ]] ; then - EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/" - inherit git-r3 - S="${WORKDIR}/${P}/lib/comgr" -else - SRC_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" - S="${WORKDIR}/ROCm-CompilerSupport-rocm-${PV}/lib/comgr" - KEYWORDS="~amd64" -fi - -PATCHES=( - "${FILESDIR}/${PN}-4.5.2-dependencies.patch" - "${FILESDIR}/${PN}-5.1.3-Find-CLANG_RESOURCE_DIR.patch" - "${FILESDIR}/${PN}-5.1.3-clang-link.patch" - "${FILESDIR}/${PN}-5.1.3-clang-fix-include.patch" - "${FILESDIR}/${PN}-5.1.3-rocm-path.patch" - "${FILESDIR}/0001-COMGR-changes-needed-for-upstream-llvm.patch" - "${FILESDIR}/${PN}-5.1.3-llvm-15-remove-zlib-gnu" - "${FILESDIR}/${PN}-5.1.3-llvm-15-args-changed" -) - -DESCRIPTION="Radeon Open Compute Code Object Manager" -HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport" -LICENSE="MIT" -SLOT="0/$(ver_cut 1-2)" - -RDEPEND=">=dev-libs/rocm-device-libs-${PV} - sys-devel/clang:${LLVM_MAX_SLOT}= - sys-devel/clang-runtime:= - sys-devel/lld:${LLVM_MAX_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 ${LLVM_MAX_SLOT})\")," -i src/comgr-env.cpp || die - sed '/Args.push_back(HIPIncludePath/,+1d' -i src/comgr-compiler.cpp || die - sed '/Args.push_back(ROCMIncludePath/,+1d' -i src/comgr-compiler.cpp || die # ROCM and HIPIncludePath is now /usr, which disturb the include order - eapply $(prefixify_ro "${FILESDIR}"/${PN}-5.0-rocm_path.patch) - cmake_src_prepare -} - -src_configure() { - local mycmakeargs=( - -DLLVM_DIR="$(get_llvm_prefix ${LLVM_MAX_SLOT})" - -DCMAKE_STRIP="" # disable stripping defined at lib/comgr/CMakeLists.txt:58 - ) - cmake_src_configure -} diff --git a/dev-libs/rocm-comgr/rocm-comgr-5.1.3-r3.ebuild b/dev-libs/rocm-comgr/rocm-comgr-5.1.3-r3.ebuild new file mode 100644 index 000000000000..5165add2a564 --- /dev/null +++ b/dev-libs/rocm-comgr/rocm-comgr-5.1.3-r3.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake llvm prefix + +LLVM_MAX_SLOT=15 + +if [[ ${PV} == *9999 ]] ; then + EGIT_REPO_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/" + inherit git-r3 + S="${WORKDIR}/${P}/lib/comgr" +else + SRC_URI="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/ROCm-CompilerSupport-rocm-${PV}/lib/comgr" + KEYWORDS="~amd64" +fi + +PATCHES=( + "${FILESDIR}/${PN}-4.5.2-dependencies.patch" + "${FILESDIR}/${PN}-5.1.3-Find-CLANG_RESOURCE_DIR.patch" + "${FILESDIR}/${PN}-5.1.3-clang-link.patch" + "${FILESDIR}/${PN}-5.1.3-clang-fix-include.patch" + "${FILESDIR}/${PN}-5.1.3-rocm-path.patch" + "${FILESDIR}/0001-COMGR-changes-needed-for-upstream-llvm.patch" + "${FILESDIR}/${PN}-5.1.3-llvm-15-remove-zlib-gnu" + "${FILESDIR}/${PN}-5.1.3-llvm-15-args-changed" + "${FILESDIR}/${PN}-5.3.3-fno-stack-protecter.patch" +) + +DESCRIPTION="Radeon Open Compute Code Object Manager" +HOMEPAGE="https://github.com/RadeonOpenCompute/ROCm-CompilerSupport" +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" + +RDEPEND=">=dev-libs/rocm-device-libs-${PV} + sys-devel/clang:${LLVM_MAX_SLOT}= + sys-devel/clang-runtime:= + sys-devel/lld:${LLVM_MAX_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 ${LLVM_MAX_SLOT})\")," -i src/comgr-env.cpp || die + sed '/Args.push_back(HIPIncludePath/,+1d' -i src/comgr-compiler.cpp || die + sed '/Args.push_back(ROCMIncludePath/,+1d' -i src/comgr-compiler.cpp || die # ROCM and HIPIncludePath is now /usr, which disturb the include order + eapply $(prefixify_ro "${FILESDIR}"/${PN}-5.0-rocm_path.patch) + cmake_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DLLVM_DIR="$(get_llvm_prefix ${LLVM_MAX_SLOT})" + -DCMAKE_STRIP="" # disable stripping defined at lib/comgr/CMakeLists.txt:58 + ) + cmake_src_configure +} diff --git a/dev-libs/rocm-comgr/rocm-comgr-5.3.3-r1.ebuild b/dev-libs/rocm-comgr/rocm-comgr-5.3.3-r1.ebuild index c00adc6c1727..1c491f3f83b8 100644 --- a/dev-libs/rocm-comgr/rocm-comgr-5.3.3-r1.ebuild +++ b/dev-libs/rocm-comgr/rocm-comgr-5.3.3-r1.ebuild @@ -28,6 +28,7 @@ PATCHES=( "${FILESDIR}/0001-Find-CLANG_RESOURCE_DIR-using-clang-print-resource-d.patch" "${FILESDIR}/${PN}-5.3.3-HIPIncludePath-not-needed.patch" "${FILESDIR}/${PN}-5.3.3-fix-tests.patch" + "${FILESDIR}/${PN}-5.3.3-fno-stack-protecter.patch" ) DESCRIPTION="Radeon Open Compute Code Object Manager" -- cgit v1.2.3-65-gdbad