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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DDF4115812D for ; Mon, 30 Dec 2024 11:35:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1AC5FE083E; Mon, 30 Dec 2024 11:35:23 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 818B7E07D0 for ; Mon, 30 Dec 2024 11:35:22 +0000 (UTC) Message-ID: <4b8574eceed10b524dfadeea485819a7fcbd5ab5.camel@gentoo.org> Subject: Re: [gentoo-dev] [PATCH 00/11] llvm-r2.eclass, to unmess pkg_setup and fix cross From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Date: Mon, 30 Dec 2024 12:35:17 +0100 In-Reply-To: <20241221160053.780079-1-mgorny@gentoo.org> References: <20241221160053.780079-1-mgorny@gentoo.org> Organization: Gentoo Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-LJM7wWys1kfLbtaJZnvV" User-Agent: Evolution 3.52.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 X-Archives-Salt: 750ab015-ed8b-4da0-a952-c4676260bdd4 X-Archives-Hash: f7fcf7a9d3b187a28e80c7881f034b20 --=-LJM7wWys1kfLbtaJZnvV Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 2024-12-21 at 16:48 +0100, Micha=C5=82 G=C3=B3rny wrote: > Hello, >=20 > 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. >=20 > 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. >=20 > PR for those who prefer quality Microsoft software: > https://github.com/gentoo/gentoo/pull/39696 >=20 > Now, on to some details. >=20 >=20 > 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. >=20 > In the greatest simplification: >=20 > 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. >=20 > 2. If you only call LLVM tools and don't link to it, you need to add > a BDEPEND and call llvm_cbuild_setup. >=20 > 3. If you need both, then you add both DEPEND and BDEPEND, and call both > (i.e. llvm-r2_pkg_setup). >=20 > 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. >=20 > 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). >=20 > 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. >=20 > 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. >=20 >=20 > Micha=C5=82 G=C3=B3rny (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 >=20 > 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 >=20 Merged now. --=20 Best regards, Micha=C5=82 G=C3=B3rny --=-LJM7wWys1kfLbtaJZnvV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmdyhXUSHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQOVsMH/ilb8xXagYAi3w1BwBrkHzszsA/OQy4b moxSgNMc9wBO0tCyc0nN3cqq815yvk1NwUva+dN+Kosq5WwPD6bwVyrB3EcV6C4I Dj/TMflLqzfVzSoKSW7lub60wg6ds7CedIlivEr7OksEMMe5CiJkL6bcNLi1O058 fHvKl7jaaoXeR9K6i2iRrVeQffZ1OePwyy6xg5jIwzSmK6Y22Pntsltj1cbCbgfu j23RicxHV1OsTaWXoSOf7MnZKm0RVfMGidT2vLVBPAlqvAswh8PZThgwqgI5GYtN E3aFBF9a2QAm1Z1tKeRWTFS7UwQCjh22ju5Gs29YWwmtaDTz1L9NFbU= =wWC5 -----END PGP SIGNATURE----- --=-LJM7wWys1kfLbtaJZnvV--