public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Piotr Karbowski <slashbeast@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: [gentoo-dev] Multiple LLVM versions with single sys-devel/lld. How to match runtime?
Date: Sat, 29 Oct 2022 18:00:52 +0200	[thread overview]
Message-ID: <4611bfea-b23b-126f-3c84-2b6973115ebd@gentoo.org> (raw)

Hi,

The state for this very moment is that we can have many versions of llvm 
around, however we can at most have only one ld.lld installed. Usually 
matching the lowest version of clang installed.

THis leads to build failures if one attempts to build some (but not all) 
software, Linux kernel being one of them.

Currently if one have installed clang in 15 and 14 version, and ld.lld 
in 14, and attempt to build Linux kernel with simple 'make LLVM=1' it 
will fail on the mismatch between clang and ld.lld with "Opaque pointers 
are only supported in -opaque-pointers mode".

This can be easily handled by doing 'make LLVM=1 CC=clang-14'.

Now, the problem is with kernel modules that are in ::gentoo. One of the 
examples is ryzen_smu that has github's PR to support kernels built with 
clang and lto enabled.

I might be not really up to the speed with llvm in gentoo, but it 
appears to me we have no interface to get matching clang+lld paths that 
could be callable like ts-getCC is. Setting CC=${CHOST}-clang when 
kernel's config has LLVM toggled will result in crash due to ld.lld 
mismatch, easy workaround would be to set $PATH before calling emerge so 
it would first find the matching 14 version, however emerge will build 
its own $PATH, ignoring whatever we provided there.

Which means one would either need to write a code in ebuild to get lld 
version and then set CC to ${CHOST}-clang-${LLD_MAJOR_VERSION} or have 
similar code in /etc/portage/bashrc, neither of which are particularly 
appealing to me even though it's rather simple to get the version out of 
ld.lld.

Before I invent such a atrocious code in ebuild, do you perhaps have any 
solution that is somewhat more reasonable than ebuild doing backflips to 
figure out working toolchain combination?

-- Piotr.


             reply	other threads:[~2022-10-29 16:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-29 16:00 Piotr Karbowski [this message]
2022-10-29 16:22 ` [gentoo-dev] Multiple LLVM versions with single sys-devel/lld. How to match runtime? Matt Turner
2022-10-29 16:52   ` Piotr Karbowski
2022-10-29 19:01     ` Matt Turner
2022-10-29 20:35       ` Piotr Karbowski
2022-10-29 20:38         ` Piotr Karbowski

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=4611bfea-b23b-126f-3c84-2b6973115ebd@gentoo.org \
    --to=slashbeast@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