public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Benda XU" <heroxbd@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm-roc/
Date: Sun, 27 Dec 2020 01:55:31 +0000 (UTC)	[thread overview]
Message-ID: <1609034125.a3ecb54a88984f4549cffe7d5ba039ef2eebd928.heroxbd@gentoo> (raw)

commit:     a3ecb54a88984f4549cffe7d5ba039ef2eebd928
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 23 16:49:50 2020 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> 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 <xgreenlandforwyy <AT> gmail.com>
Package-Manager: Portage-3.0.12, Repoman-3.0.1
Signed-off-by: Benda Xu <heroxbd <AT> 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
 }


             reply	other threads:[~2020-12-27  1:55 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-27  1:55 Benda XU [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-03-22  7:45 [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm-roc/ Benda XU
2021-09-20 18:15 Andreas K. Hüttel
2021-09-20 17:51 Andreas K. Hüttel
2021-08-19 19:46 Craig Andrews
2021-08-03  4:35 Benda XU
2021-07-05  1:08 Craig Andrews
2021-07-02 18:03 Craig Andrews
2021-06-29 18:27 Craig Andrews
2021-05-18 15:06 Craig Andrews
2021-04-27 13:16 Craig Andrews
2021-04-08 13:04 Craig Andrews
2021-03-25 17:56 Craig Andrews
2021-02-04 19:19 Craig Andrews
2021-01-15 11:36 Benda XU
2020-12-21 12:55 Craig Andrews
2020-12-06 19:04 Craig Andrews
2020-11-12 15:59 Craig Andrews
2020-09-27 13:35 Craig Andrews
2020-09-18 20:31 Craig Andrews
2020-08-24 19:01 Rick Farina
2020-08-15  0:24 Craig Andrews
2020-07-08 18:34 Craig Andrews
2020-06-16 19:40 Craig Andrews
2020-05-28 14:01 Craig Andrews
2020-04-01 19:33 Craig Andrews
2020-02-26 22:07 Craig Andrews
2020-02-26  2:04 Craig Andrews
2019-11-24 17:10 Craig Andrews
2019-10-04 17:41 Craig Andrews
2019-09-25 18:14 Craig Andrews
2019-08-14 20:54 Craig Andrews
2019-08-14  0:27 Craig Andrews
2019-08-14  0:27 Craig Andrews
2019-08-07 17:38 Craig Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1609034125.a3ecb54a88984f4549cffe7d5ba039ef2eebd928.heroxbd@gentoo \
    --to=heroxbd@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox