From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH 00/11] llvm-r2.eclass, to unmess pkg_setup and fix cross
Date: Sat, 21 Dec 2024 16:48:33 +0100 [thread overview]
Message-ID: <20241221160053.780079-1-mgorny@gentoo.org> (raw)
Hello,
Here's the newest eclass I've been working on. While llvm-r1 addressed
the problems of generating dependencies and matching LLVM package
versions, it retained a hacky awful pkg_setup(). This one aims to fix
that.
Note that the patchset contains a quick hack enabling testing the new
eclass on packages using llvm-r1 -- it's obviously not intended to be
merged.
PR for those who prefer quality Microsoft software:
https://github.com/gentoo/gentoo/pull/39696
Now, on to some details.
The eclass aims to support two main uses of LLVM: as libraries to link
to, and as a tools to call at build time. The default setup tries to
handle both, and it will probably succeed for the general case, though
to get cross right, it may require some manual manipulation.
In the greatest simplification:
1. If you only link to LLVM and don't need to call anything, you need
to add a DEPEND and call llvm_chost_setup.
2. If you only call LLVM tools and don't link to it, you need to add
a BDEPEND and call llvm_cbuild_setup.
3. If you need both, then you add both DEPEND and BDEPEND, and call both
(i.e. llvm-r2_pkg_setup).
llvm_cbuild_setup is pretty similar to what the previous eclasses did.
It sets PATH, but unlike the old eclasses, it uses the correct BROOT
path.
llvm_chost_setup combines a few methods to make it most likely for
the build systems to find the correct LLVM installation. We set a bunch
of variables that are used by CMake's `find_package()` function, and we
generate a custom llvm-config that uses the ESYSROOT install of LLVM
(except for --bindir, that refers to BROOT tools, if available).
Of course, individual packages may need different scenarios.
For example, sequoia-sq uses llvm-config to find libclang.so that's
loaded at build-time -- it won't work correctly with llvm_chost_setup
(though this will only affect cross-compilation), and needs plain
llvm_cbuild_setup instead. Other packages may prefer no special setup
at all and instead will want some custom configure option pointing
at the LLVM installation.
Overall, I think it's the best "one size fits all" tool I could come up
with, and one that can be customized to fit other use cases. Please
test and lemme know what you make of it.
Michał Górny (11):
llvm-r1.eclass: Fix list in eclassdoc
llvm-r2.eclass: Copy from llvm-r1.eclass
HACK! llvm-r1 -> llvm-r2 (to ease testing)
llvm-utils.eclass: Support -b/-d to llvm_prepend_path
llvm-r2.eclass: Readjust for BROOT, split to llvm_cbuild_setup
llvm-r2.eclass: Add llvm_chost_setup, set CMake path variables
llvm-r2.eclass: Generate a llvm-config script for CHOST
llvm-r2.eclass: Update top-level docs for CBUILD/CHOST support
llvm-r2.eclass: Remove obsolete Meson LLVM_CONFIG hack
eclass/tests: Copy llvm-r1 tests to llvm-r2.sh
eclass/tests/llvm-r2.sh: Add tests for llvm-config
eclass/llvm-r1.eclass | 203 +----------------
eclass/llvm-r2.eclass | 474 +++++++++++++++++++++++++++++++++++++++
eclass/llvm-utils.eclass | 27 ++-
eclass/tests/llvm-r2.sh | 188 ++++++++++++++++
4 files changed, 690 insertions(+), 202 deletions(-)
create mode 100644 eclass/llvm-r2.eclass
create mode 100755 eclass/tests/llvm-r2.sh
--
2.47.1
next reply other threads:[~2024-12-21 16:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-21 15:48 Michał Górny [this message]
2024-12-21 15:48 ` [gentoo-dev] [PATCH 01/11] llvm-r1.eclass: Fix list in eclassdoc Michał Górny
2024-12-21 15:48 ` [gentoo-dev] [PATCH 02/11] llvm-r2.eclass: Copy from llvm-r1.eclass Michał Górny
2024-12-21 15:48 ` [gentoo-dev] [PATCH 03/11] HACK! llvm-r1 -> llvm-r2 (to ease testing) Michał Górny
2024-12-21 15:48 ` [gentoo-dev] [PATCH 04/11] llvm-utils.eclass: Support -b/-d to llvm_prepend_path Michał Górny
2024-12-21 15:48 ` [gentoo-dev] [PATCH 05/11] llvm-r2.eclass: Readjust for BROOT, split to llvm_cbuild_setup Michał Górny
2024-12-21 15:48 ` [gentoo-dev] [PATCH 06/11] llvm-r2.eclass: Add llvm_chost_setup, set CMake path variables Michał Górny
2024-12-21 15:48 ` [gentoo-dev] [PATCH 07/11] llvm-r2.eclass: Generate a llvm-config script for CHOST Michał Górny
2024-12-21 15:48 ` [gentoo-dev] [PATCH 08/11] llvm-r2.eclass: Update top-level docs for CBUILD/CHOST support Michał Górny
2024-12-21 15:48 ` [gentoo-dev] [PATCH 09/11] llvm-r2.eclass: Remove obsolete Meson LLVM_CONFIG hack Michał Górny
2024-12-21 15:48 ` [gentoo-dev] [PATCH 10/11] eclass/tests: Copy llvm-r1 tests to llvm-r2.sh Michał Górny
2024-12-21 15:48 ` [gentoo-dev] [PATCH 11/11] eclass/tests/llvm-r2.sh: Add tests for llvm-config Michał Górny
2024-12-30 11:35 ` [gentoo-dev] [PATCH 00/11] llvm-r2.eclass, to unmess pkg_setup and fix cross 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=20241221160053.780079-1-mgorny@gentoo.org \
--to=mgorny@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