From: Violet Purcell <vimproved@inventati.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: LLVM build strategy (was: Re: [gentoo-dev] [RFC] New categories for LLVM)
Date: Sun, 8 Dec 2024 00:06:22 -0500 [thread overview]
Message-ID: <kisr5auva3wefhfmchpt3na2377bgn7dfhge2elhieuovfhq6h@oaeg2pf5o6q6> (raw)
In-Reply-To: <87a5d6wza1.fsf@gentoo.org>
On Sun, Dec 08, 2024 at 04:53:58AM +0000, Sam James wrote:
> I fear this sort of assumes we won't switch to monobuild any time soon.
>
> I keep thinking [0] about how sustainable our current setup is:
> * Fedora moved away from it for >=18 [1].
> * As we saw with offload, it broke a few times in just a week. So it's
> only Gentoo who cares about this configuration AFAIK.
> * It's not working great if we're already not able to easily package
> mlir, flang, or polly.
>
> Violet attempted working on a merge before [2].
Hey! Thanks for bringing up my work on this. I've also been continuing
this work in an overlay which I use myself on some of my machines:
https://codeberg.org/vimproved/llvm-overlay.
> IIRC, Violet ended up running into issues with getting the CMake to
> properly handle both shared and static libraries to install with the
> monobuild, so maybe LLVM's CMake is just broken in both directions and
> we just have to pick whichever one is least-worst for us (which might be
> the standalone builds as we do now)?
LLVM's CMake is definitely just rather broken in many ways, yeah. The
biggest issue I experienced when working on this was with LLD libraries.
Currently, sys-devel/lld is built with -DBUILD_SHARED_LIBS=ON, which
builds some LLD libraries used by e.g. zig as shared libraries. However,
there's no way to do this in monobuild since passing
-DBUILD_SHARED_LIBS=ON is not desirable. The solution I settled on was
splitting a sys-libs/lld-libs package which builds LLD with
-DBUILD_SHARED_LIBS=ON and then only installs the shared libraries.
As for sys-libs/llvm-libs, this package is a result of me trying to
figure out a way to have a statically linked system clang (for
performance purposes) while still having LLVM functional as a library.
After a lot of sifting through CMake spaghetti I settled on splitting
the LLVM monobuild into two packages: sys-devel/llvm and
sys-libs/llvm-libs. sys-devel/llvm installs the toolchain parts of LLVM
(statically linked), and sys-libs/llvm-libs installs the library and
CMake parts of LLVM.
This overlay is just for my personal use, and I don't think the above
package split would be viable for ::gentoo however.
One more thing that wasn't mentioned here, LLVM monobuild would also
potentially unblock PGO/BOLT optimizations for clang, so overall it
could have some pretty good speed improvements for system LLVM toolchain
users.
- Violet
next prev parent reply other threads:[~2024-12-08 5:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-07 16:07 [gentoo-dev] [RFC] New categories for LLVM Michał Górny
2024-12-08 4:11 ` Sam James
2024-12-08 13:02 ` Michał Górny
2024-12-08 4:53 ` LLVM build strategy (was: Re: [gentoo-dev] [RFC] New categories for LLVM) Sam James
2024-12-08 5:05 ` [gentoo-dev] Re: LLVM build strategy Sam James
2024-12-08 5:06 ` Violet Purcell [this message]
2024-12-08 13:20 ` LLVM build strategy (was: Re: [gentoo-dev] [RFC] New categories for LLVM) Michał Górny
2024-12-08 21:45 ` [gentoo-dev] Re: LLVM build strategy Sam James
2024-12-08 22:23 ` Eli Schwartz
2024-12-09 4:35 ` Michał Górny
2024-12-08 15:44 ` [gentoo-dev] [PATCH] Introduce llvm-core and llvm-runtimes categories Michał Górny
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=kisr5auva3wefhfmchpt3na2377bgn7dfhge2elhieuovfhq6h@oaeg2pf5o6q6 \
--to=vimproved@inventati.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