From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1611B13835A for ; Sun, 27 Dec 2020 01:55:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 17402E0995; Sun, 27 Dec 2020 01:55:35 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EFC88E0995 for ; Sun, 27 Dec 2020 01:55:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 57E24340FEF for ; Sun, 27 Dec 2020 01:55:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D360C4E for ; Sun, 27 Dec 2020 01:55:31 +0000 (UTC) From: "Benda XU" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Benda XU" Message-ID: <1609034125.a3ecb54a88984f4549cffe7d5ba039ef2eebd928.heroxbd@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm-roc/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/llvm-roc/llvm-roc-4.0.0.ebuild X-VCS-Directories: sys-devel/llvm-roc/ X-VCS-Committer: heroxbd X-VCS-Committer-Name: Benda XU X-VCS-Revision: a3ecb54a88984f4549cffe7d5ba039ef2eebd928 X-VCS-Branch: master Date: Sun, 27 Dec 2020 01:55:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 500924c7-0007-4259-8c53-2e06584c2537 X-Archives-Hash: ff1d135e7cb9bd56626f20e40c9a7b39 commit: a3ecb54a88984f4549cffe7d5ba039ef2eebd928 Author: Benda Xu gentoo org> AuthorDate: Wed Dec 23 16:49:50 2020 +0000 Commit: Benda XU gentoo org> CommitDate: Sun Dec 27 01:55:25 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a3ecb54a sys-devel/llvm-roc: add support for Prefix. The logic is modeled after profiles/features/prefix/standalone/profile.bashrc. With the location of hip changed to /usr/lib/hip, let clang of llvm-roc look for EPREFIX/usr/lib/hip instead of vendor /opt/rocm. Suggested-by: Yiyang Wu gmail.com> Package-Manager: Portage-3.0.12, Repoman-3.0.1 Signed-off-by: Benda Xu gentoo.org> sys-devel/llvm-roc/llvm-roc-4.0.0.ebuild | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys-devel/llvm-roc/llvm-roc-4.0.0.ebuild b/sys-devel/llvm-roc/llvm-roc-4.0.0.ebuild index 2d3f3939411..64b2abf582b 100644 --- a/sys-devel/llvm-roc/llvm-roc-4.0.0.ebuild +++ b/sys-devel/llvm-roc/llvm-roc-4.0.0.ebuild @@ -33,6 +33,27 @@ CMAKE_BUILD_TYPE=RelWithDebInfo src_prepare() { cd "${WORKDIR}/llvm-project-rocm-${PV}" || die eapply "${FILESDIR}/${PN}-3.0.0-add_libraries.patch" + + if [[ -n ${EPREFIX} ]]; then + pushd "${S}"/../clang >/dev/null || die + sed -i -e "s@DEFAULT_SYSROOT \"\"@DEFAULT_SYSROOT \"${EPREFIX}\"@" CMakeLists.txt + eend $? + + ebegin "Use ${EPREFIX} as default sysroot" + cd lib/Driver/ToolChains >/dev/null || die + ebegin "Use dynamic linker from ${EPREFIX}" + sed -i -e "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX%/}/\"@" Linux.cpp + eend $? + + ebegin "Remove --sysroot call on ld for native toolchain" + sed -i -e "$(grep -n -B1 sysroot= Gnu.cpp | sed -ne '{1s/-.*//;1p}'),+1 d" Gnu.cpp + eend $? + popd >/dev/null || die + fi + + sed -e 's:/opt/rocm:/usr/lib/hip:' \ + -i "${S}"/../clang/lib/Driver/ToolChains/AMDGPU.cpp + eapply_user cmake_src_prepare }