summaryrefslogtreecommitdiff
path: root/sys-devel
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/Manifest.gzbin10633 -> 10614 bytes
-rw-r--r--sys-devel/bmake/Manifest3
-rw-r--r--sys-devel/bmake/bmake-20230120.ebuild57
-rw-r--r--sys-devel/bmake/files/bmake-20220418-warnings.patch38
-rw-r--r--sys-devel/clang-common/Manifest1
-rw-r--r--sys-devel/clang-common/clang-common-17.0.0.9999.ebuild168
-rw-r--r--sys-devel/clang-runtime/Manifest1
-rw-r--r--sys-devel/clang-runtime/clang-runtime-17.0.0.9999.ebuild41
-rw-r--r--sys-devel/clang-toolchain-symlinks/Manifest1
-rw-r--r--sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-17.ebuild61
-rw-r--r--sys-devel/clang/Manifest1
-rw-r--r--sys-devel/clang/clang-17.0.0.9999.ebuild467
-rw-r--r--sys-devel/lld-toolchain-symlinks/Manifest1
-rw-r--r--sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-17.ebuild40
-rw-r--r--sys-devel/lld/Manifest1
-rw-r--r--sys-devel/lld/lld-17.0.0.9999.ebuild83
-rw-r--r--sys-devel/llvm-common/Manifest1
-rw-r--r--sys-devel/llvm-common/llvm-common-17.0.0.9999.ebuild28
-rw-r--r--sys-devel/llvm-toolchain-symlinks/Manifest1
-rw-r--r--sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-17.ebuild49
-rw-r--r--sys-devel/llvm/Manifest1
-rw-r--r--sys-devel/llvm/llvm-17.0.0.9999.ebuild514
-rw-r--r--sys-devel/llvmgold/Manifest1
-rw-r--r--sys-devel/llvmgold/llvmgold-17.ebuild24
24 files changed, 1544 insertions, 39 deletions
diff --git a/sys-devel/Manifest.gz b/sys-devel/Manifest.gz
index 419d865831ee..c0f009a58456 100644
--- a/sys-devel/Manifest.gz
+++ b/sys-devel/Manifest.gz
Binary files differ
diff --git a/sys-devel/bmake/Manifest b/sys-devel/bmake/Manifest
index 417afff139fa..ceb90d25fa62 100644
--- a/sys-devel/bmake/Manifest
+++ b/sys-devel/bmake/Manifest
@@ -1,7 +1,8 @@
AUX bmake-20210206-tests.patch 467 BLAKE2B 7c66cfbb610f2ea9615a737dd2d97fbea359ecb0e5b5c746447b9a0e9d2dff188f6f0d45225dd07d1226a86297f0c9ba8b8be7587039f2cc7ceaab4bde61f570 SHA512 3d855d54b64e2871ad8ccd494939c92a6bca2bec61f186e907a9b6b8b4f51b4ff63fcacbb8b6d44cef33a39c6ba2bed6c1fdd30d7ad65ad03d1d659781c420fe
AUX bmake-20210314-mk-fixes.patch 2054 BLAKE2B 404e99593f04408e3f62d8c6118fc1676ef414b4cc18f5ec8b089182fad8865ad79e40c236e58b084f3194bdcc94c92e1e10e40efbddc142b84053117065e202 SHA512 8c9e823dd158e352021f0905e2a15cb8d7da3020c49a8f824cc5dbd8f33910fc64629d5f400fd8651a16b07e0685a1247a661fd9230a62b7330bd5fc71427dd4
-AUX bmake-20220418-warnings.patch 1304 BLAKE2B 364c458c39541f5901a7e46c2275625972d1879d42fd9c5f347e2f27f3b6f837dc3c1f676b3da1615eab6f91f38766bfc758d58959313e5598c4c9a7445fb93e SHA512 3925f5feea2222bd0b136f41dc633e03254946a88ef6029e4363f2bbcf97214f25479d27489a8f1697ddca5bab4157fb7675aba81534bcfa35eaa16750ce098b
DIST bmake-20220928.tar.gz 821224 BLAKE2B 9b377a9a8d329d229aae37fd852a68629edb78f7f0f16bf8aeb59df4da886fe89d8b7defd8294fa49fca397d4726e704eb9c95936561fe8a3a0a1fdfe4e5b861 SHA512 13fde6517d79080c5a548b1e47e4fbf00d54752f48b40d10542926b26a3be22da70877ca2b977b43366ec1b632a76a6974c78155c39895910e01e4142e7675a0
+DIST bmake-20230120.tar.gz 823514 BLAKE2B 45e96f4911b8965b44ebe30c636819b36cb33a9733304f3bb8a99a806356ef1f01925c48a0fd25cf57b65524ae6ef544b6a79974bf1f92b749a242323a068fdd SHA512 b3c54f723adaf3329af14247d9891b1732d2b6dc9856e30be6fd65f3cd7aab85c4fcef1ef9799eaca5203357e2be5a6564d7e9108844b459654b1fa3767f721a
DIST mk-20210330.tar.gz 107380 BLAKE2B 9ac30a117d9ba31635cf8d8d29fdba76f148611f47628403ca8f807081c32509f10498d3c30fd24985e5420af4710fe59fc6315d71f2d0c1cfed93263a06553a SHA512 6acd3ee911442934082f4f877d795b07c5e23022eaa9c0874799d97e92a2f5a663cb45f94b7f9745c49cbbce6b7e755a29e381ccfb9e68a0be1eedbd22fd5d3b
EBUILD bmake-20220928.ebuild 1280 BLAKE2B 8b0a901f552c84562690e3543e66cb388b9a3415ecc83028748711982651b91e75fca5f6e4fbff17b5db3ec52447e9f03b56589ff991e41be979a1026f221389 SHA512 99320a95fc86b80d9449be59e98acaab416c69209528ed0110b00e1fe18b8739a5e8100c8f4a8bb302c6e1ea4f7930253ea5cf69861f5172b02fa987d3bd2f97
+EBUILD bmake-20230120.ebuild 1281 BLAKE2B 3710d6487c66efa8b203bdcbf49f0cc11fd213083159b91802e57e7ccc5a86bbf4de3df08a60ba18f2c807ab4e25e80116fb4ece95563b5f5cc67be79dc41082 SHA512 8507fcce4e0e397abe856786d8f4693d5b55f8262bfc0015e3978570b22442789ebe1a42fe7f666df05d0c4a3d299901fb29926b0ed7866537568b19879f3176
MISC metadata.xml 353 BLAKE2B 70bd5eb274c4693a005986471e5a5c29a162bd0a080a7ba590c64171f2aa171bf9670093419f0b3e9ef304e5478f71df4899082e3dc76b4b0cedfe782a6625df SHA512 ade70c57a7ae5165c432d2024ec685609971347a94ecd69ab73142ff602f4cafb49df880d4dd1cee5695f1ea11c2c0ccc837d9a1ad38e50c61d0d27049279bc5
diff --git a/sys-devel/bmake/bmake-20230120.ebuild b/sys-devel/bmake/bmake-20230120.ebuild
new file mode 100644
index 000000000000..7c7d277872cc
--- /dev/null
+++ b/sys-devel/bmake/bmake-20230120.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MK_VER=20210330
+
+DESCRIPTION="NetBSD's portable make"
+HOMEPAGE="http://www.crufty.net/help/sjg/bmake.html"
+SRC_URI="
+ http://void.crufty.net/ftp/pub/sjg/${P}.tar.gz
+ http://void.crufty.net/ftp/pub/sjg/mk-${MK_VER}.tar.gz"
+S="${WORKDIR}/${PN}"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~loong ~ppc ~ppc64 ~x86"
+
+# Skip failing test (sandbox and csh)
+PATCHES=(
+ "${FILESDIR}"/${PN}-20210206-tests.patch
+)
+
+src_prepare() {
+ default
+ cd "${WORKDIR}" || die
+ eapply "${FILESDIR}"/${PN}-20210314-mk-fixes.patch
+}
+
+src_configure() {
+ econf \
+ --with-mksrc=../mk \
+ --with-default-sys-path="${EPREFIX}"/usr/share/mk/${PN} \
+ --with-machine_arch=${ARCH}
+}
+
+src_compile() {
+ sh make-bootstrap.sh || die "bootstrap failed"
+}
+
+src_test() {
+ cd unit-tests || die
+
+ # the 'ternary' test uses ${A} internally, which
+ # conflicts with Gentoo's ${A}, hence unset it for
+ # the tests temporarily.
+ env -u A MAKEFLAGS= \
+ "${S}"/bmake -r -m / TEST_MAKE="${S}"/bmake test || die "tests compilation failed"
+}
+
+src_install() {
+ dobin ${PN}
+ doman ${PN}.1
+ FORCE_BSD_MK=1 SYS_MK_DIR=. \
+ sh ../mk/install-mk -v -m 644 "${ED}"/usr/share/mk/${PN} \
+ || die "failed to install mk files"
+}
diff --git a/sys-devel/bmake/files/bmake-20220418-warnings.patch b/sys-devel/bmake/files/bmake-20220418-warnings.patch
deleted file mode 100644
index 1fccb91e95a3..000000000000
--- a/sys-devel/bmake/files/bmake-20220418-warnings.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-# https://bugs.gentoo.org/841362
-#
-# Fix -Wimplicit-function-declaration and -Wunused-result warnings
-#
-# meta.c: In function ‘meta_name’:
-# meta.c:262:21: warning: implicit declaration of function ‘strlcpy’; did you mean ‘strncpy’? [-Wimplicit-function-declaration]
-# 262 | strlcpy(rp, tname_base, sizeof buf - (size_t)(rp - buf));
-# | ^~~~~~~
-# | strncpy
-#
-# meta.c: In function ‘meta_job_error’:
-# meta.c:774:5: warning: ignoring return value of ‘getcwd’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
-# 774 | getcwd(cwd, sizeof cwd);
-# | ^~~~~~~~~~~~~~~~~~~~~~~
-
---- a/meta.c
-+++ b/meta.c
-@@ -106,6 +106,10 @@
- char * stresep(char **, const char *, int);
- #endif
-
-+#if !defined(HAVE_STRLCPY)
-+size_t strlcpy(char *, const char *, size_t);
-+#endif
-+
- /*
- * Filemon is a kernel module which snoops certain syscalls.
- *
-@@ -769,7 +773,8 @@
- }
- if (gn != NULL)
- Global_Set(".ERROR_TARGET", GNode_Path(gn));
-- getcwd(cwd, sizeof cwd);
-+ if (getcwd(cwd, sizeof cwd) == NULL)
-+ err(1, "Could not get current working directory");
- Global_Set(".ERROR_CWD", cwd);
- if (pbm->meta_fname[0] != '\0') {
- Global_Set(".ERROR_META_FILE", pbm->meta_fname);
diff --git a/sys-devel/clang-common/Manifest b/sys-devel/clang-common/Manifest
index e1d22404d0b4..83a5e918cdd2 100644
--- a/sys-devel/clang-common/Manifest
+++ b/sys-devel/clang-common/Manifest
@@ -13,4 +13,5 @@ EBUILD clang-common-15.0.6.ebuild 3509 BLAKE2B 70910eaf42d62c4e570f87d5eeef778c1
EBUILD clang-common-15.0.7-r1.ebuild 4632 BLAKE2B 09180c6eb6fa4b387efd07b0403065bee4184e896aa71820209f3770cf7f0150a1c1d5506f90eaccb93047e3bc6d413758593acb9430b6b932321543f9cb183d SHA512 e087c381776916bb05ad084579d3f560a4384f48afaf3abbb68d7316e51daa6a8a1a8fb04fd1da0633e7f8248e0165cdee593767a61e6c2d1a8a4aa36a96fd30
EBUILD clang-common-16.0.0.9999.ebuild 4686 BLAKE2B c2bf510db70a7708d56746c035eebe20b332ace167138ae5260375dc5bfe15e2b8478692636cca60cebd9ebc2e418324377e3d17ebb49db7e30ecd6ad11e6db3 SHA512 abb81468747c4f83554c35792f6fd1e282b0edfa02a34157c0594cefef42b91c95092b35a88b7b4b7abfb17bff95029065b86f2c2724df5badb5924f915fd63e
EBUILD clang-common-16.0.0_pre20230107-r1.ebuild 4692 BLAKE2B 0628160af123d42ea6cc9a2d39d0115ccc3d0f4461f2bc3b13946d3fb587a100092df73ba512aa016bf359283cf8790cf465cdbf7a230f1cd02e536d570424cd SHA512 08f8ef115f59f74a3b845af7563dbd43819c4fb37ed27a2fc0c65ce3c0f7c7e61eb3617b1e8c54c598d5cff0a1b8988d0ed32f8fa40c6b4428545a5f8f1bf05a
+EBUILD clang-common-17.0.0.9999.ebuild 4686 BLAKE2B c2bf510db70a7708d56746c035eebe20b332ace167138ae5260375dc5bfe15e2b8478692636cca60cebd9ebc2e418324377e3d17ebb49db7e30ecd6ad11e6db3 SHA512 abb81468747c4f83554c35792f6fd1e282b0edfa02a34157c0594cefef42b91c95092b35a88b7b4b7abfb17bff95029065b86f2c2724df5badb5924f915fd63e
MISC metadata.xml 735 BLAKE2B 12ea133df3d7eb9367a65e572ef91893e654d5b77caa27c66e4b5b41ba90ebc5e619eb78dfff2a67183d2c1cbfcf35fa903b2bb75604ce153d5cedfce5346e3c SHA512 8ed6b12d4f2aa1985897a8d81ce898dbc0d14ac222f3d0f259cbe80fbb8b2349dff7677627daeaf39a422f290200da4fac6348abc81c9e35da0ca73a11cfdd83
diff --git a/sys-devel/clang-common/clang-common-17.0.0.9999.ebuild b/sys-devel/clang-common/clang-common-17.0.0.9999.ebuild
new file mode 100644
index 000000000000..be17e87b775a
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-17.0.0.9999.ebuild
@@ -0,0 +1,168 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS=""
+IUSE="
+ default-compiler-rt default-libcxx default-lld llvm-libunwind
+ hardened stricter
+"
+
+PDEPEND="
+ sys-devel/clang:*
+ default-compiler-rt? (
+ sys-devel/clang-runtime[compiler-rt]
+ llvm-libunwind? ( sys-libs/llvm-libunwind )
+ !llvm-libunwind? ( sys-libs/libunwind )
+ )
+ !default-compiler-rt? ( sys-devel/gcc )
+ default-libcxx? ( >=sys-libs/libcxx-${PV} )
+ !default-libcxx? ( sys-devel/gcc )
+ default-lld? ( sys-devel/lld )
+ !default-lld? ( sys-devel/binutils )
+"
+IDEPEND="
+ !default-compiler-rt? ( sys-devel/gcc-config )
+ !default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+ [[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+ local flag missing_flags=()
+ for flag in default-{compiler-rt,libcxx,lld}; do
+ if ! use "${flag}" && has_version "sys-devel/clang[${flag}]"; then
+ missing_flags+=( "${flag}" )
+ fi
+ done
+
+ if [[ ${missing_flags[@]} ]]; then
+ eerror "It seems that you have the following flags set on sys-devel/clang:"
+ eerror
+ eerror " ${missing_flags[*]}"
+ eerror
+ eerror "The default runtimes are now set via flags on sys-devel/clang-common."
+ eerror "The build is being aborted to prevent breakage. Please either set"
+ eerror "the respective flags on this ebuild, e.g.:"
+ eerror
+ eerror " sys-devel/clang-common ${missing_flags[*]}"
+ eerror
+ eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+ die "Mismatched defaults detected between sys-devel/clang and sys-devel/clang-common"
+ fi
+}
+
+src_install() {
+ newbashcomp bash-autocomplete.sh clang
+
+ insinto /etc/clang
+ newins - gentoo-runtimes.cfg <<-EOF
+ # This file is initially generated by sys-devel/clang-runtime.
+ # It is used to control the default runtimes using by clang.
+
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
+ EOF
+
+ newins - gentoo-gcc-install.cfg <<-EOF
+ # This file is maintained by gcc-config.
+ # It is used to specify the selected GCC installation.
+ EOF
+
+ newins - gentoo-common.cfg <<-EOF
+ # This file contains flags common to clang, clang++ and clang-cpp.
+ @gentoo-runtimes.cfg
+ @gentoo-gcc-install.cfg
+ @gentoo-hardened.cfg
+ EOF
+
+ # Baseline hardening (bug #851111)
+ newins - gentoo-hardened.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -fstack-clash-protection
+ -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ dodir /usr/include/gentoo
+
+ local fortify_level=$(usex hardened 3 2)
+ # We have to do this because glibc's headers warn if F_S is set
+ # without optimization and that would at the very least be very noisy
+ # during builds and at worst trigger many -Werror builds.
+ cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+ #ifndef _FORTIFY_SOURCE
+ #if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
+ #define _FORTIFY_SOURCE ${fortify_level}
+ #endif
+ #endif
+ EOF
+
+ if use hardened ; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ -D_GLIBCXX_ASSERTIONS
+
+ # Analogue to GLIBCXX_ASSERTIONS
+ # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+ -D_LIBCPP_ENABLE_ASSERTIONS=1
+ EOF
+ fi
+
+ if use stricter; then
+ newins - gentoo-stricter.cfg <<-EOF
+ # This file increases the strictness of older clang versions
+ # to match the newest upstream version.
+
+ # clang-16 defaults
+ -Werror=implicit-function-declaration
+ -Werror=implicit-int
+ -Werror=incompatible-function-pointer-types
+
+ # constructs banned by C2x
+ -Werror=deprecated-non-prototype
+
+ # deprecated but large blast radius
+ #-Werror=strict-prototypes
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ @gentoo-stricter.cfg
+ EOF
+ fi
+
+ local tool
+ for tool in clang{,++,-cpp}; do
+ newins - "${tool}.cfg" <<-EOF
+ # This configuration file is used by ${tool} driver.
+ @gentoo-common.cfg
+ EOF
+ done
+}
+
+pkg_preinst() {
+ if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+ then
+ local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+ if [[ -n ${gcc_path} ]]; then
+ cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+ --gcc-install-dir="${gcc_path%%:*}"
+ EOF
+ fi
+ fi
+}
diff --git a/sys-devel/clang-runtime/Manifest b/sys-devel/clang-runtime/Manifest
index 602f303abb29..9820d1d34f29 100644
--- a/sys-devel/clang-runtime/Manifest
+++ b/sys-devel/clang-runtime/Manifest
@@ -4,4 +4,5 @@ EBUILD clang-runtime-15.0.6.ebuild 759 BLAKE2B d7b481faffc4da0a6dc1b4e708322cd17
EBUILD clang-runtime-15.0.7.ebuild 765 BLAKE2B 5cbdadca3bd8cd2739642a15ef905e50e09a0694845a6ba959f3568c140d04d24a1884de282736573e620ebd657bd4266182b0439ab352a5707a8f3f312b3f20 SHA512 7eabc8703f65cd65ac08394f20f4825163aa3f859a4fd827b80426c5187ace13dfa261e2ef11c532ac09e6fb717c58a7a75110468f8c33dc78b9f92fc5ed34dc
EBUILD clang-runtime-16.0.0.9999.ebuild 1369 BLAKE2B a25d32189f78e993706138f339ad0645e3042bd283ddc26b4189c117ea2368d0a1c2b09c2f5f538112bcad65fc14dc0d29f16e4d6ff98e3401c3bdb74d59d750 SHA512 c37860675576d51047f5347400753a19469ea0e2e6ff49a3a5ba6e35f5b33372c06ee2ac1e82aa4a681f35e8c186a1ff8eb25a9eccd0ee35e5ab3d57873f40e0
EBUILD clang-runtime-16.0.0_pre20230107.ebuild 1357 BLAKE2B 8bffc2e195aea4f0c5c13d8f730dbf7cf5afade08d6ca9915addb9a148d4fa28d01331461adc16221840095a8b94d997795e25fb01c68ca6260b24471abd2747 SHA512 cd391453ef4a5ef739d9897b25fc1899062c20e23dbb1bfa4ef33ada3a697ffaedaf6956ba82fd114b8f24a5c8de3d255b5d114c545968f0689bd6cb38b64ba6
+EBUILD clang-runtime-17.0.0.9999.ebuild 1369 BLAKE2B f69af454137c9689bebc710a7a6988338bc715c68238367d55b5f01859244954b7ff8719ba285b64e76a578f063ab3f6325d5e9519ef5ebdb31592af1a276225 SHA512 436ecac7bb5ba46ca72ab48ea2bd8e30e2ee180218c0c3f14f41abd4e3b0445655ad033058bb78661b2095c5786ef644b538574d4ae2a9a8ee12fefc179f79db
MISC metadata.xml 661 BLAKE2B 24688c511713ea102b83c71d226d519981b3aee0e05ef7a56d6a80be829efd843194e45cb4fd801f0bb976b6f1976386d6a2b05d2bc907fe2aa42b22b85b7d1f SHA512 2b5ab8783c90795f2e7d1673d876048ed9745f4911fb7a860df56deac13a6dfeba4581a84562eae54eff757c45042ca3fab75c7800313ae61df9ce69780a9294
diff --git a/sys-devel/clang-runtime/clang-runtime-17.0.0.9999.ebuild b/sys-devel/clang-runtime/clang-runtime-17.0.0.9999.ebuild
new file mode 100644
index 000000000000..67b42357665e
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-17.0.0.9999.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib-build toolchain-funcs
+
+DESCRIPTION="Meta-ebuild for clang runtime libraries"
+HOMEPAGE="https://clang.llvm.org/"
+
+LICENSE="metapackage"
+SLOT="${PV%%.*}"
+KEYWORDS=""
+IUSE="+compiler-rt libcxx openmp +sanitize"
+REQUIRED_USE="sanitize? ( compiler-rt )"
+PROPERTIES="live"
+
+RDEPEND="
+ compiler-rt? (
+ ~sys-libs/compiler-rt-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ sanitize? (
+ ~sys-libs/compiler-rt-sanitizers-${PV}:${SLOT}[abi_x86_32(+)?,abi_x86_64(+)?]
+ )
+ )
+ libcxx? ( >=sys-libs/libcxx-${PV}[${MULTILIB_USEDEP}] )
+ openmp? ( >=sys-libs/libomp-${PV}[${MULTILIB_USEDEP}] )
+"
+
+pkg_pretend() {
+ if tc-is-clang; then
+ ewarn "You seem to be using clang as a system compiler. As of clang-16,"
+ ewarn "upstream has turned a few warnings that commonly occur during"
+ ewarn "configure script runs into errors by default. This causes some"
+ ewarn "configure tests to start failing, sometimes resulting in silent"
+ ewarn "breakage, missing functionality or runtime misbehavior. It is"
+ ewarn "not yet clear whether the change will remain or be reverted."
+ ewarn
+ ewarn "For more information, please see:"
+ ewarn "https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213"
+ fi
+}
diff --git a/sys-devel/clang-toolchain-symlinks/Manifest b/sys-devel/clang-toolchain-symlinks/Manifest
index e79faff005e1..e3aeb6f63d39 100644
--- a/sys-devel/clang-toolchain-symlinks/Manifest
+++ b/sys-devel/clang-toolchain-symlinks/Manifest
@@ -1,4 +1,5 @@
EBUILD clang-toolchain-symlinks-14-r2.ebuild 1154 BLAKE2B 1da81bdc43afd21ad3f45e3ede1decf1f2eb0aa0dd5a451b28b06a74837cb1354e785784d723a770b7fd3e4dfaeb3b7d095d8579ea07cc798c33d65f9fd6fb9f SHA512 f02f2c7c21def93692503fceae45f8aa6abd608ad99b3be0a63a85f80b54899b201457ee56666161c87d0039bc512eef2bbf6f819807f236e52ac2d88f4bbe54
EBUILD clang-toolchain-symlinks-15-r2.ebuild 1147 BLAKE2B a3676de65810503e7009f0ae8df1c8233f02518decf27d602096c946081f459d4350541b807bb07e83a740080ac89c94482b6c48c7cd570fce4af4c083edb60b SHA512 cdd69cc55c5ed323852a031cda463504bf1de0676a3fbda80853d63c6b7fce28531940c4a47bc34a6c99f289038d65ba510dc314026a16795a060a0794b522aa
EBUILD clang-toolchain-symlinks-16-r2.ebuild 1087 BLAKE2B 620d0d863160f7adf06dd72b299e04913a3802e0fc226eaa9adc2d4a0ec7440f2897e5c0ccd16719648a2cb2790e4fd1367fcddcbaa90888ac0413aabe87ff77 SHA512 54d0e0d1b4ea1d6e2f0c8b448f7bc39b250b3cd97ee4b3c6a834d68be7b7e45954289065aef06300836d2f1231719bd783ae193f66ed584f7b1f656632f430ea
+EBUILD clang-toolchain-symlinks-17.ebuild 1104 BLAKE2B a22bdfe7dad1c912b254f692ba44da6931a52602d4ba448b015d9655103d5ec6faab4a5941bd8e8689f9528fc5adb16beaffd7123dfa451eebce5f8cca4adfd4 SHA512 a6e2494676fc92a1f0b5db87845a5db1904d50111d99340dbc000fe630e40da888d50287fbec79ba35b8815fcdf00b151eedb1aa806b6ea1b5a0d5e041f0e400
MISC metadata.xml 904 BLAKE2B d2c8a31355b0f3bea6c5b4c72d198f40bf14b6908f5a3f765b48fffb2ba3e4f09a8bb37c87ea4e7d9b4e1de0a3ad2c80bdca6feb45538c973119f27ba6329ad8 SHA512 846548593c071d6905b56984c6924086d5f03929c813be986c89c57a6924d1976975b29769ee60a2796287753aa3453608794af8d36cf48b76c55920778c27d4
diff --git a/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-17.ebuild b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-17.ebuild
new file mode 100644
index 000000000000..7924646e117e
--- /dev/null
+++ b/sys-devel/clang-toolchain-symlinks/clang-toolchain-symlinks-17.ebuild
@@ -0,0 +1,61 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use Clang on GCC-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+SRC_URI=""
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS=""
+PROPERTIES="live"
+IUSE="gcc-symlinks multilib-symlinks +native-symlinks"
+
+# Blocker for bug #872416
+RDEPEND="
+ !<sys-devel/gcc-config-2.6
+ sys-devel/clang:${SLOT}
+"
+
+src_install() {
+ local tools=()
+
+ if use native-symlinks; then
+ tools+=(
+ cc:clang
+ cpp:clang-cpp
+ c++:clang++
+ )
+ fi
+ if use gcc-symlinks; then
+ tools+=(
+ gcc:clang
+ g++:clang++
+ )
+ fi
+
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local chost t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${t%:*}"
+ done
+ for chost in "${chosts[@]}"; do
+ for t in "${tools[@]}"; do
+ dosym "${t#*:}" "${dest}/${chost}-${t%:*}"
+ done
+ done
+}
diff --git a/sys-devel/clang/Manifest b/sys-devel/clang/Manifest
index d4e81269343d..7e85b85c1d4a 100644
--- a/sys-devel/clang/Manifest
+++ b/sys-devel/clang/Manifest
@@ -20,4 +20,5 @@ EBUILD clang-15.0.6-r1.ebuild 11954 BLAKE2B 1f83a038f9632948caf8cd8fc598337a0996
EBUILD clang-15.0.7-r1.ebuild 12120 BLAKE2B 2efcc56b3bd74d0b281072a1f0cd8d2fb19bf92127a68c1dbc5feb242b13800034e8de85bc472c966f3080b6466bd315ddfaf5f72af2be448fb5dc09d6c2a777 SHA512 f8928f3abad4b36deec09f6de340ca780dbf0433db9aa2016d5d4d2f5129c2f3d0852f0d4ff9c962a49b40a421a794ad86e63ede5bc463ac6a2ca42e0d140a76
EBUILD clang-16.0.0.9999.ebuild 11809 BLAKE2B fea22fa24054a45527d9bdd7b1fefda36eb7ad345cce748ca6ee3e7e200b63331d39dfc7149051a91e9874e42aadfb0019b56418a2201f8f494bf0903f47e526 SHA512 e4e3d20b3ca0a9692d132999b84879921837f084875eb07ca88423afb11684d6702f094be6833270650c00372e320c0986db2faf28c76ccccd1095614728d52f
EBUILD clang-16.0.0_pre20230107.ebuild 11888 BLAKE2B 46d7463ac2022887874a597d172497b1e04b715c326eb629c5fde978bf36ca0229be7d06f333647a7d392c7bcfead3a8ecefedb2848689b5f0713e50193aace4 SHA512 de47068ccb31519b4eb8f782d5a81379d667913b39c59128eb4c0c22a4d82cf3818547bf393d18d392aa7f2309c0aabc4434986328cf55272bac86037f657c5f
+EBUILD clang-17.0.0.9999.ebuild 11809 BLAKE2B fea22fa24054a45527d9bdd7b1fefda36eb7ad345cce748ca6ee3e7e200b63331d39dfc7149051a91e9874e42aadfb0019b56418a2201f8f494bf0903f47e526 SHA512 e4e3d20b3ca0a9692d132999b84879921837f084875eb07ca88423afb11684d6702f094be6833270650c00372e320c0986db2faf28c76ccccd1095614728d52f
MISC metadata.xml 1600 BLAKE2B 8e49e099132445cf695e904acad8a699f3d8c4c1e4cd6ba9d0b97180dfa5b67e9c30b00d1e4cb6cd2f61b27f022accc8d6ee889c6569fc58fbc058186ad216fc SHA512 96b7cf4988ff1fd923ec87311caed458b64888b5acaaf20cc1ad893f2a963158f7f59398f9fd4f9e65cab3df265c0d002048ff874f7a76b94f36377bf9e8f5f6
diff --git a/sys-devel/clang/clang-17.0.0.9999.ebuild b/sys-devel/clang/clang-17.0.0.9999.ebuild
new file mode 100644
index 000000000000..4979e95cd523
--- /dev/null
+++ b/sys-devel/clang/clang-17.0.0.9999.ebuild
@@ -0,0 +1,467 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+inherit cmake llvm llvm.org multilib multilib-minimal \
+ prefix python-single-r1 toolchain-funcs
+
+DESCRIPTION="C language family frontend for LLVM"
+HOMEPAGE="https://llvm.org/"
+
+# MSVCSetupApi.h: MIT
+# sorttable.js: MIT
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA MIT"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS=""
+IUSE="debug doc +extra ieee-long-double +pie +static-analyzer test xml"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}:${LLVM_MAJOR}=[debug=,${MULTILIB_USEDEP}]
+ static-analyzer? ( dev-lang/perl:* )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ ${DEPEND}
+ >=sys-devel/clang-common-${PV}
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ >=dev-util/cmake-3.16
+ doc? ( $(python_gen_cond_dep '
+ dev-python/recommonmark[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ') )
+ xml? ( virtual/pkgconfig )
+"
+PDEPEND="
+ ~sys-devel/clang-runtime-${PV}
+ sys-devel/clang-toolchain-symlinks:${LLVM_MAJOR}
+"
+
+LLVM_COMPONENTS=(
+ clang clang-tools-extra cmake
+ llvm/lib/Transforms/Hello
+)
+LLVM_MANPAGES=1
+LLVM_TEST_COMPONENTS=(
+ llvm/lib/Testing
+ llvm/utils
+ third-party
+)
+LLVM_USE_TARGETS=llvm
+llvm.org_set_globals
+
+# Multilib notes:
+# 1. ABI_* flags control ABIs libclang* is built for only.
+# 2. clang is always capable of compiling code for all ABIs for enabled
+# target. However, you will need appropriate crt* files (installed
+# e.g. by sys-devel/gcc and sys-libs/glibc).
+# 3. ${CHOST}-clang wrappers are always installed for all ABIs included
+# in the current profile (i.e. alike supported by sys-devel/gcc).
+#
+# Therefore: use sys-devel/clang[${MULTILIB_USEDEP}] only if you need
+# multilib clang* libraries (not runtime, not wrappers).
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # create extra parent dir for relative CLANG_RESOURCE_DIR access
+ mkdir -p x/y || die
+ BUILD_DIR=${WORKDIR}/x/y/clang
+
+ llvm.org_src_prepare
+
+ # add Gentoo Portage Prefix for Darwin (see prefix-dirs.patch)
+ eprefixify \
+ lib/Lex/InitHeaderSearch.cpp \
+ lib/Driver/ToolChains/Darwin.cpp || die
+}
+
+check_distribution_components() {
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
+ local all_targets=() my_targets=() l
+ cd "${BUILD_DIR}" || die
+
+ while read -r l; do
+ if [[ ${l} == install-*-stripped:* ]]; then
+ l=${l#install-}
+ l=${l%%-stripped*}
+
+ case ${l} in
+ # meta-targets
+ clang-libraries|distribution)
+ continue
+ ;;
+ # tools
+ clang|clangd|clang-*)
+ ;;
+ # static libraries
+ clang*|findAllSymbols)
+ continue
+ ;;
+ # conditional to USE=doc
+ docs-clang-html|docs-clang-tools-html)
+ use doc || continue
+ ;;
+ esac
+
+ all_targets+=( "${l}" )
+ fi
+ done < <(${NINJA} -t targets all)
+
+ while read -r l; do
+ my_targets+=( "${l}" )
+ done < <(get_distribution_components $"\n")
+
+ local add=() remove=()
+ for l in "${all_targets[@]}"; do
+ if ! has "${l}" "${my_targets[@]}"; then
+ add+=( "${l}" )
+ fi
+ done
+ for l in "${my_targets[@]}"; do
+ if ! has "${l}" "${all_targets[@]}"; then
+ remove+=( "${l}" )
+ fi
+ done
+
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
+ eqawarn "get_distribution_components() is outdated!"
+ eqawarn " Add: ${add[*]}"
+ eqawarn "Remove: ${remove[*]}"
+ fi
+ cd - >/dev/null || die
+ fi
+}
+
+get_distribution_components() {
+ local sep=${1-;}
+
+ local out=(
+ # common stuff
+ clang-cmake-exports
+ clang-headers
+ clang-resource-headers
+ libclang-headers
+
+ aarch64-resource-headers
+ arm-common-resource-headers
+ arm-resource-headers
+ core-resource-headers
+ cuda-resource-headers
+ hexagon-resource-headers
+ hip-resource-headers
+ hlsl-resource-headers
+ mips-resource-headers
+ opencl-resource-headers
+ openmp-resource-headers
+ ppc-htm-resource-headers
+ ppc-resource-headers
+ riscv-resource-headers
+ systemz-resource-headers
+ utility-resource-headers
+ ve-resource-headers
+ webassembly-resource-headers
+ windows-resource-headers
+ x86-resource-headers
+
+ # libs
+ clang-cpp
+ libclang
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # common stuff
+ bash-autocomplete
+ libclang-python-bindings
+
+ # tools
+ amdgpu-arch
+ c-index-test
+ clang
+ clang-format
+ clang-offload-bundler
+ clang-offload-packager
+ clang-refactor
+ clang-repl
+ clang-rename
+ clang-scan-deps
+ diagtool
+ hmaptool
+ nvptx-arch
+
+ # needed for cross-compiling Clang
+ clang-tblgen
+ )
+
+ if use extra; then
+ out+=(
+ # extra tools
+ clang-apply-replacements
+ clang-change-namespace
+ clang-doc
+ clang-include-cleaner
+ clang-include-fixer
+ clang-move
+ clang-pseudo
+ clang-query
+ clang-reorder-fields
+ clang-tidy
+ clang-tidy-headers
+ clangd
+ find-all-symbols
+ modularize
+ pp-trace
+ )
+ fi
+
+ if llvm_are_manpages_built; then
+ out+=( docs-clang-man )
+ use extra && out+=( docs-clang-tools-man )
+ fi
+
+ if use doc; then
+ out+=( docs-clang-html )
+ use extra && out+=( docs-clang-tools-html )
+ fi
+
+ use static-analyzer && out+=(
+ clang-check
+ clang-extdef-mapping
+ scan-build
+ scan-build-py
+ scan-view
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DCLANG_CONFIG_FILE_SYSTEM_DIR="${EPREFIX}/etc/clang"
+ # relative to bindir
+ -DCLANG_RESOURCE_DIR="../../../../lib/clang/${LLVM_MAJOR}"
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DCLANG_LINK_CLANG_DYLIB=ON
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+ -DCLANG_INCLUDE_TESTS=$(usex test)
+
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+
+ -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=$(usex !xml)
+ # libgomp support fails to find headers without explicit -I
+ # furthermore, it provides only syntax checking
+ -DCLANG_DEFAULT_OPENMP_RUNTIME=libomp
+
+ # disable using CUDA to autodetect GPU, just build for all
+ -DCMAKE_DISABLE_FIND_PACKAGE_CUDA=ON
+
+ -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie)
+
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ if ! use elibc_musl; then
+ mycmakeargs+=(
+ -DPPC_LINUX_DEFAULT_IEEELONGDOUBLE=$(usex ieee-long-double)
+ )
+ fi
+
+ use test && mycmakeargs+=(
+ -DLLVM_BUILD_TESTS=ON
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ if multilib_is_native_abi; then
+ local build_docs=OFF
+ if llvm_are_manpages_built; then
+ build_docs=ON
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=ON
+ -DLLVM_ENABLE_SPHINX=ON
+ -DCLANG_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ if use extra; then
+ mycmakeargs+=(
+ -DCLANG-TOOLS_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/tools-extra"
+ )
+ fi
+ fi
+ mycmakeargs+=(
+ -DCLANG_INCLUDE_DOCS=${build_docs}
+ )
+ fi
+ if multilib_native_use extra; then
+ mycmakeargs+=(
+ -DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR="${WORKDIR}"/clang-tools-extra
+ -DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=${build_docs}
+ )
+ else
+ mycmakeargs+=(
+ -DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD=OFF
+ )
+ fi
+
+ if [[ -n ${EPREFIX} ]]; then
+ mycmakeargs+=(
+ -DGCC_INSTALL_PREFIX="${EPREFIX}/usr"
+ )
+ fi
+
+ if tc-is-cross-compiler; then
+ has_version -b sys-devel/clang:${LLVM_MAJOR} ||
+ die "sys-devel/clang:${LLVM_MAJOR} is required on the build host."
+ local tools_bin=${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin
+ mycmakeargs+=(
+ -DLLVM_TOOLS_BINARY_DIR="${tools_bin}"
+ -DCLANG_TABLEGEN="${tools_bin}"/clang-tblgen
+ )
+ fi
+
+ # LLVM can have very high memory consumption while linking,
+ # exhausting the limit on 32-bit linker executable
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ multilib_is_native_abi && check_distribution_components
+}
+
+multilib_src_compile() {
+ cmake_build distribution
+
+ # provide a symlink for tests
+ if [[ ! -L ${WORKDIR}/lib/clang ]]; then
+ mkdir -p "${WORKDIR}"/lib || die
+ ln -s "${BUILD_DIR}/$(get_libdir)/clang" "${WORKDIR}"/lib/clang || die
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ local test_targets=( check-clang )
+ if multilib_native_use extra; then
+ test_targets+=(
+ check-clang-tools
+ check-clangd
+ )
+ fi
+ cmake_build "${test_targets[@]}"
+}
+
+src_install() {
+ MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/clang/Config/config.h
+ )
+
+ multilib-minimal_src_install
+
+ # Move runtime headers to /usr/lib/clang, where they belong
+ mv "${ED}"/usr/include/clangrt "${ED}"/usr/lib/clang || die
+ # move (remaining) wrapped headers back
+ if use extra; then
+ mv "${T}"/clang-tidy "${ED}"/usr/include/ || die
+ fi
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
+
+ # Apply CHOST and version suffix to clang tools
+ local clang_tools=( clang clang++ clang-cl clang-cpp )
+ local abi i
+
+ # cmake gives us:
+ # - clang-X
+ # - clang -> clang-X
+ # - clang++, clang-cl, clang-cpp -> clang
+ # we want to have:
+ # - clang-X
+ # - clang++-X, clang-cl-X, clang-cpp-X -> clang-X
+ # - clang, clang++, clang-cl, clang-cpp -> clang*-X
+ # also in CHOST variant
+ for i in "${clang_tools[@]:1}"; do
+ rm "${ED}/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}" || die
+ dosym "clang-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}-${LLVM_MAJOR}"
+ dosym "${i}-${LLVM_MAJOR}" "/usr/lib/llvm/${LLVM_MAJOR}/bin/${i}"
+ done
+
+ # now create target symlinks for all supported ABIs
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ for i in "${clang_tools[@]}"; do
+ dosym "${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}-${LLVM_MAJOR}"
+ dosym "${abi_chost}-${i}-${LLVM_MAJOR}" \
+ "/usr/lib/llvm/${LLVM_MAJOR}/bin/${abi_chost}-${i}"
+ done
+ done
+}
+
+multilib_src_install() {
+ DESTDIR=${D} cmake_build install-distribution
+
+ # move headers to /usr/include for wrapping & ABI mismatch checks
+ # (also drop the version suffix from runtime headers)
+ rm -rf "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)/clang "${ED}"/usr/include/clangrt || die
+ if multilib_native_use extra; then
+ # don't wrap clang-tidy headers, the list is too long
+ # (they're fine for non-native ABI but enabling the targets is problematic)
+ mv "${ED}"/usr/include/clang-tidy "${T}/" || die
+ fi
+}
+
+multilib_src_install_all() {
+ python_fix_shebang "${ED}"
+ if use static-analyzer; then
+ python_optimize "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/share/scan-view
+ fi
+
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ llvm_install_manpages
+ # match 'html' non-compression
+ use doc && docompress -x "/usr/share/doc/${PF}/tools-extra"
+ # +x for some reason; TODO: investigate
+ use static-analyzer && fperms a-x "/usr/lib/llvm/${LLVM_MAJOR}/share/man/man1/scan-build.1"
+}
+
+pkg_postinst() {
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow update all
+ fi
+
+ elog "You can find additional utility scripts in:"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/clang"
+ if use extra; then
+ elog "Some of them are vim integration scripts (with instructions inside)."
+ elog "The run-clang-tidy.py script requires the following additional package:"
+ elog " dev-python/pyyaml"
+ fi
+}
+
+pkg_postrm() {
+ if [[ -z ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
+ eselect compiler-shadow clean all
+ fi
+}
diff --git a/sys-devel/lld-toolchain-symlinks/Manifest b/sys-devel/lld-toolchain-symlinks/Manifest
index a6f8c69c90bc..cbb9ed303744 100644
--- a/sys-devel/lld-toolchain-symlinks/Manifest
+++ b/sys-devel/lld-toolchain-symlinks/Manifest
@@ -1,4 +1,5 @@
EBUILD lld-toolchain-symlinks-14-r2.ebuild 801 BLAKE2B 9d503356ed85fd996a922f531782550dc9d9fb8f8f70b6298083abb4bda017b4015932add186a9e55c54e55135913b2cb83f571b115de09e704c936435f53f02 SHA512 7280dff33d642c0b1d4a6f23fbca4d412fc90693b7a9b825d0044f41694d2d4438b0c270277851999688dd7f04c4e67393c435b087d837abdd1f59011f3eb7ae
EBUILD lld-toolchain-symlinks-15-r2.ebuild 796 BLAKE2B 830b933f8535eef6b128c929b80bb90d80541bd3a5ed7b5b66f453ee3e09af3e70d3df9fe5994aaca0b25160042c6cd2e8ff0fcf618da8acb2215a32cc28a8a4 SHA512 b44ce89bf627b927d79a9b182e6675024f88a26e4f76709b8490c4c67fe294efad06f2e82f72006fc638d4f0fcb87a3b54d4ffd12c039160283838405bb02aa2
EBUILD lld-toolchain-symlinks-16-r2.ebuild 777 BLAKE2B 7717e8a4bcedfacfb4c8e857345a8d57b7dedaa7986ce6e3f835e72089bf45d4904fe2f6aa50ed407d1b3b75e7fa293e3071cdef70c4b63a0002cf7a34c1e6ed SHA512 1163038de439599cc078642a4650f2b318d41ce92c25401e1c7a811e1eb15ea69f0877110d2a02c23700ac559255dfa55e02f0c079d9c1ba4679c3cd296be211
+EBUILD lld-toolchain-symlinks-17.ebuild 782 BLAKE2B 8df819209ba58e4f772b2c192cc951433a673fe6c4e7367fd9de93acdae63b787c1563adbceea49451c78a4e0fb7e5c4b109dd7dd636b39f2b78fa708e1faf1f SHA512 c889bec3ac8aa431bb13f5cf6e0900f6114ae30299ba752ddd648494309a7cfb1e930d2a4fb4d933666ae1630e3158e4633c082271651791c084a333e08b91d2
MISC metadata.xml 784 BLAKE2B 044eebb87ddac511186e137d9e255cb3ead2d53aeffafc641cc9a53556b833f06cae439907de8e8ead1090d54f7cc4bcacdbfff52449b6fab5908aa6d354a110 SHA512 50a9ac94efe64f8f6533049f496a19c37e375803ea3920a3729c93f346117ea5b662978570db27e8fffcfaf78f990691c4ab5aaf7dd48a7e2931f713eddedb4b
diff --git a/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-17.ebuild b/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-17.ebuild
new file mode 100644
index 000000000000..a882c715a3a7
--- /dev/null
+++ b/sys-devel/lld-toolchain-symlinks/lld-toolchain-symlinks-17.ebuild
@@ -0,0 +1,40 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use LLD on binutils-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+SRC_URI=""
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS=""
+PROPERTIES="live"
+IUSE="multilib-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/lld:${SLOT}
+"
+
+src_install() {
+ use native-symlinks || return
+
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ dosym ld.lld "${dest}/ld"
+ for chost in "${chosts[@]}"; do
+ dosym ld.lld "${dest}/${chost}-ld"
+ done
+}
diff --git a/sys-devel/lld/Manifest b/sys-devel/lld/Manifest
index 0a701a2ff2c5..1288b0c76d27 100644
--- a/sys-devel/lld/Manifest
+++ b/sys-devel/lld/Manifest
@@ -12,4 +12,5 @@ EBUILD lld-15.0.6.ebuild 2094 BLAKE2B 1994e3430ea215e4c8aa54f84e1c845c3bf1dfa164
EBUILD lld-15.0.7.ebuild 2098 BLAKE2B 8e663356c8c37602578ba3b80f3d94561b932d07c6a2f6275d5101a0bac9c787c6067b9515002146e8d9ef37f36289c51573d1af518b81286c3d40fc6c26f415 SHA512 3d45615613dfcb62fc4f75d7aa3c414ef5db07cbfdee25018a8732bb04cb609df4125a9a01cd4851a9b9289b096c2148357fb9076d9c4663697dab95ddf1a19a
EBUILD lld-16.0.0.9999.ebuild 2029 BLAKE2B 65cf3f20ddf1a4e3c9019df2fb9afc6bca038d88dbd29bbd7ea6c767e68ec2b824f4be6b04139bf98211177c30db0fd9ed5f351e0207d1530382c6fb618a3d19 SHA512 69eb8e93fd5f28789dca326dbbb658c4060b57ccdeae7e12aec5d842aeb944748a167983b67c00a98972cfff7350ac54ffe381db54c3d7a18e7970ca0190bf34
EBUILD lld-16.0.0_pre20230107.ebuild 2029 BLAKE2B 65cf3f20ddf1a4e3c9019df2fb9afc6bca038d88dbd29bbd7ea6c767e68ec2b824f4be6b04139bf98211177c30db0fd9ed5f351e0207d1530382c6fb618a3d19 SHA512 69eb8e93fd5f28789dca326dbbb658c4060b57ccdeae7e12aec5d842aeb944748a167983b67c00a98972cfff7350ac54ffe381db54c3d7a18e7970ca0190bf34
+EBUILD lld-17.0.0.9999.ebuild 2029 BLAKE2B 65cf3f20ddf1a4e3c9019df2fb9afc6bca038d88dbd29bbd7ea6c767e68ec2b824f4be6b04139bf98211177c30db0fd9ed5f351e0207d1530382c6fb618a3d19 SHA512 69eb8e93fd5f28789dca326dbbb658c4060b57ccdeae7e12aec5d842aeb944748a167983b67c00a98972cfff7350ac54ffe381db54c3d7a18e7970ca0190bf34
MISC metadata.xml 299 BLAKE2B 2feead2cd1b35b3a43335ddd7711f8181b52bc63ee7166608914260c67528add5251349063afbef4f8cf0ec09b2cd4c3ffdd90f2c14ed60bb69ebc03888f6333 SHA512 cd745c54ab18d25bdaff18582105072574103a36cfe7c175ef740f266d00e9fc6f44c332904d23b911c939cf5bdf52973b388923099d8dd5dfef3c283b5cb685
diff --git a/sys-devel/lld/lld-17.0.0.9999.ebuild b/sys-devel/lld/lld-17.0.0.9999.ebuild
new file mode 100644
index 000000000000..a540e3ab0cb3
--- /dev/null
+++ b/sys-devel/lld/lld-17.0.0.9999.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+inherit cmake flag-o-matic llvm llvm.org python-any-r1
+
+DESCRIPTION="The LLVM linker (link editor)"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS=""
+IUSE="debug test zstd"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}[zstd=]
+ sys-libs/zlib:=
+ zstd? ( app-arch/zstd:= )
+"
+RDEPEND="
+ ${DEPEND}
+ !sys-devel/lld:0
+"
+BDEPEND="
+ test? (
+ >=dev-util/cmake-3.16
+ $(python_gen_any_dep ">=dev-python/lit-${PV}[\${PYTHON_USEDEP}]")
+ )
+"
+PDEPEND="
+ >=sys-devel/lld-toolchain-symlinks-16-r2:${LLVM_MAJOR}
+"
+
+LLVM_COMPONENTS=( lld cmake libunwind/include/mach-o )
+LLVM_TEST_COMPONENTS=( llvm/utils third-party )
+llvm.org_set_globals
+
+python_check_deps() {
+ python_has_version ">=dev-python/lit-${PV}[${PYTHON_USEDEP}]"
+}
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${LLVM_MAJOR} llvm_pkg_setup
+ use test && python-any-r1_pkg_setup
+}
+
+src_unpack() {
+ llvm.org_src_unpack
+
+ # Directory ${WORKDIR}/llvm does not exist with USE="-test",
+ # but LLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" is set below,
+ # and ${LLVM_MAIN_SRC_DIR}/../libunwind/include is used by build system
+ # (lld/MachO/CMakeLists.txt) and is expected to be resolvable
+ # to existent directory ${WORKDIR}/libunwind/include.
+ mkdir -p "${WORKDIR}/llvm" || die
+}
+
+src_configure() {
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+
+ use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
+
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DBUILD_SHARED_LIBS=ON
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+ )
+ use test && mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+ cmake_src_configure
+}
+
+src_test() {
+ local -x LIT_PRESERVES_TMP=1
+ cmake_build check-lld
+}
diff --git a/sys-devel/llvm-common/Manifest b/sys-devel/llvm-common/Manifest
index b9f87c894b9c..cb483edcfa3d 100644
--- a/sys-devel/llvm-common/Manifest
+++ b/sys-devel/llvm-common/Manifest
@@ -12,4 +12,5 @@ EBUILD llvm-common-15.0.6.ebuild 601 BLAKE2B 3dd38d17640ed52ff0be26db026475a9d0e
EBUILD llvm-common-15.0.7.ebuild 607 BLAKE2B bfb68fc3a0a245ca32bb286fa43fe418235e456bb96438c4aab505d619438aff9e173168b2d34a3b7942446ac8d31c64cbb64f16f2c48ab2fa2c5be1a416be01 SHA512 c5e52a332f1fa9fcfcc1313a8a1eb780d36e79af30a828d658c8e645b2f533138de9cb017c73b3d361bf05589b2c4edeff162c637ce578769aa07ed16915ddea
EBUILD llvm-common-16.0.0.9999.ebuild 524 BLAKE2B 1864e7c6a8578fe3ad74718368deca408757c501726fd3a2941087756f50bbf9ed83a6a635ef264150c86b577f373b5d391df4cbc6ff3e3e6a561bcc41b2c5f1 SHA512 feab4cb373d2384ce018d26b480024060b89c6a5475e7e7d475124b9a20a2c55470d98799067c437540b6ec6e7471f712534005ec426f76a247b8767edff6164
EBUILD llvm-common-16.0.0_pre20230107.ebuild 530 BLAKE2B 8475e3b53197e4d4632f635af86038889c0e93161819f3b655a570f8b3b774f392a786c67320845ca7be620bcd22acfd0349ec9376435deff1f4333c993abeb3 SHA512 2f899fd29442895532c45eb8c97e1bdf19aaef19406382b81ebad16cb9eb6d4181a637a10d090060557f1d0b33dc579828c2c5c5d5ad02d0c5a4a3cca256caef
+EBUILD llvm-common-17.0.0.9999.ebuild 524 BLAKE2B 381b028d6ad33fa97d2ff250266bd896153222cb62647bc6c4a9f7493fc96c23faf788ce8a976d35333e8d40e63cad4c3f44322f6a41f1dbe53f9e772c3a40d9 SHA512 9661a9c544d8bf3edf6c24a307324a58652c8635703dcfa008cad96826e3404cbb05e5c95fe7df85ed6d2642e4f83cfff0c9a381b796cc78f560854aa071acbe
MISC metadata.xml 299 BLAKE2B 2feead2cd1b35b3a43335ddd7711f8181b52bc63ee7166608914260c67528add5251349063afbef4f8cf0ec09b2cd4c3ffdd90f2c14ed60bb69ebc03888f6333 SHA512 cd745c54ab18d25bdaff18582105072574103a36cfe7c175ef740f266d00e9fc6f44c332904d23b911c939cf5bdf52973b388923099d8dd5dfef3c283b5cb685
diff --git a/sys-devel/llvm-common/llvm-common-17.0.0.9999.ebuild b/sys-devel/llvm-common/llvm-common-17.0.0.9999.ebuild
new file mode 100644
index 000000000000..ce5f03ca34a5
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-17.0.0.9999.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of LLVM"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS=""
+
+RDEPEND="
+ !sys-devel/llvm:0
+"
+
+LLVM_COMPONENTS=( llvm/utils/vim )
+llvm.org_set_globals
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r */
+ # some users may find it useful
+ newdoc README README.vim
+ dodoc vimrc
+}
diff --git a/sys-devel/llvm-toolchain-symlinks/Manifest b/sys-devel/llvm-toolchain-symlinks/Manifest
index 9c8c8dc76c17..54d0aec9f4e0 100644
--- a/sys-devel/llvm-toolchain-symlinks/Manifest
+++ b/sys-devel/llvm-toolchain-symlinks/Manifest
@@ -1,4 +1,5 @@
EBUILD llvm-toolchain-symlinks-14-r1.ebuild 1050 BLAKE2B 2e1e3a23812823c1a747a2b09d006f874b3a192c92b1ed275988bd84740df5ed68283f638fa36232d780eec817c26163d4d76335ad1dc2e0c5780b96dddd88bd SHA512 f54178846a398792a753174cd6b067f63b22bef13dba49485b14cc7f909a1da2a8d9bb2657a0b485ccfb5a3830388a855d52e8dea7a62e766a3bd65bb6602923
EBUILD llvm-toolchain-symlinks-15-r1.ebuild 1043 BLAKE2B 2c2ea96910bf11e2263bb157b9ef071998b61a2ab06ef848d68d1622249f74b4d1752351a5f2569c5668093c8f0b4b494eded9a920601e8226d4f519f0642754 SHA512 ee650715492c5d08a51760d6c14396d6a9c5fcbe8af069370d8cd628fda1c10f79250e553fd67a5d56ba370e446affbb1b2d48f8557f2dd58bad3947863f6814
EBUILD llvm-toolchain-symlinks-16-r1.ebuild 972 BLAKE2B c836eade62ca7a97c447e82aba05be5ec3504d35675d6a2ca6aa34ee72f28cafe2b0aa8020725cbea4e15c6924a578f7927ef38df0a63e741b8795154cd22795 SHA512 2edb9947c31ebd561645361cfbe4515751c5e6816c567ea77ace3564277322e4b84df4592c952f7673668599d05c1651fbf36f04f5a153e6bb59863c70f14fb4
+EBUILD llvm-toolchain-symlinks-17.ebuild 989 BLAKE2B 63e5d2f1312362e4570ecdb3bc190ab4d30245f0149871eaba00ad257e05c31d0ea3664c3e4abae366fa47cd5c5eef581334bd7dfa71dc4250042342ad114a2d SHA512 bbfc302b6b49b0d8398b3f6115e32da3a9a9f2c2069225598191cc1fda90a551d459fb92ff309270bcb9a792791fd0b302cabb81456f61f35adfdfdc812c2fbe
MISC metadata.xml 815 BLAKE2B 963f1b8425495144d04659d2d8cdabab910f15f9861634bf436a82ccb70b27682b44c47415ca6884956097e92294457d09b5c44e7a2f108c93abb79df8884aa7 SHA512 940a6c63c4c13a1c78c041c02df9bd3d2ac0f19eb552fcfb8134784386a2197956b1dd4950c760ca6ac9e8fb154eb550d59fc6ab1aea9c9236e7e005882d556a
diff --git a/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-17.ebuild b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-17.ebuild
new file mode 100644
index 000000000000..588158b795e1
--- /dev/null
+++ b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-17.ebuild
@@ -0,0 +1,49 @@
+# Copyright 2022-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit multilib
+
+DESCRIPTION="Symlinks to use LLVM on binutils-free system"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:LLVM"
+SRC_URI=""
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="${PV}"
+KEYWORDS=""
+PROPERTIES="live"
+IUSE="multilib-symlinks +native-symlinks"
+
+RDEPEND="
+ sys-devel/llvm:${SLOT}
+"
+
+src_install() {
+ use native-symlinks || return
+
+ local tools=(
+ addr2line ar dlltool nm objcopy objdump ranlib readelf size
+ strings strip windres
+ )
+ local chosts=( "${CHOST}" )
+ if use multilib-symlinks; then
+ local abi
+ for abi in $(get_all_abis); do
+ chosts+=( "$(get_abi_CHOST "${abi}")" )
+ done
+ fi
+
+ local chost t
+ local dest=/usr/lib/llvm/${SLOT}/bin
+ dodir "${dest}"
+ for t in "${tools[@]}"; do
+ dosym "llvm-${t}" "${dest}/${t}"
+ done
+ for chost in "${chosts[@]}"; do
+ for t in "${tools[@]}"; do
+ dosym "llvm-${t}" "${dest}/${chost}-${t}"
+ done
+ done
+}
diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
index 592ccba63b34..0da8ce3ab085 100644
--- a/sys-devel/llvm/Manifest
+++ b/sys-devel/llvm/Manifest
@@ -20,4 +20,5 @@ EBUILD llvm-15.0.6-r1.ebuild 12550 BLAKE2B f89218a5d755507c1595f94b718cb8386ff52
EBUILD llvm-15.0.7.ebuild 12553 BLAKE2B c01b0128bb17f4cfe58f844ba2671541e38fc247b7bb5b7f62bba15d216c2725808a51ac1e3a3f69e187509cbef2f02943d8671acca0b60828c05c968476ece3 SHA512 5a9be8b085aa3190c6f74678d1b69a48ee098d5c23461ce290a441607823c4e51bd9e024c9f889bdbcc0b5f0ac873eb501686f65db1416377c9dd949134d1686
EBUILD llvm-16.0.0.9999.ebuild 12342 BLAKE2B 2ee8d346c927e1e32242b2ae5146cbcc0280030197d24e72908064403646975497bd469f14d1a46d5c93823e22b757b074f3215593fef68429060e733a2006ba SHA512 09b426cce2ffd6e56b354b7ec0d5ed4ef69fb16b7bd20f1afb1c05239cc106daae1c9246e5b24b29f88654a2a4bc7f4a907d55cead98aafed34465af84b6007d
EBUILD llvm-16.0.0_pre20230107.ebuild 12348 BLAKE2B cab528b783d40bcfa24127b9d777374b163844a37b706162933f3020c36cec79263b29e3cb356d1f702467705322c8daff1d01f6c32018524bbc5e1e8f9d4459 SHA512 5ca3ef40d6ef141c733a09b8492e1cf5724ee826ab4e63d8055289a7955a88270b863dc2782cf313e4ea852129bfe95d0aa8b9a755df61303963ce8277f28655
+EBUILD llvm-17.0.0.9999.ebuild 12342 BLAKE2B 2ee8d346c927e1e32242b2ae5146cbcc0280030197d24e72908064403646975497bd469f14d1a46d5c93823e22b757b074f3215593fef68429060e733a2006ba SHA512 09b426cce2ffd6e56b354b7ec0d5ed4ef69fb16b7bd20f1afb1c05239cc106daae1c9246e5b24b29f88654a2a4bc7f4a907d55cead98aafed34465af84b6007d
MISC metadata.xml 2654 BLAKE2B c27983265b6c9b33200ee42565648f30a6cc9c51be53a1cb82a3353d7c1f7aa9c9501c58254280c2880ff2d4992b4834e4b5e2f1c9b1c60e9b21945f234b9973 SHA512 b331d9186908762907f5713b00e357785b62afbee83afefac8701beb1a20f7ebd68df4a030bb82c6f9164719d4ccfcaf16c189833ad40e9f5900c36247d9cff2
diff --git a/sys-devel/llvm/llvm-17.0.0.9999.ebuild b/sys-devel/llvm/llvm-17.0.0.9999.ebuild
new file mode 100644
index 000000000000..d4655d4dc33f
--- /dev/null
+++ b/sys-devel/llvm/llvm-17.0.0.9999.ebuild
@@ -0,0 +1,514 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+inherit cmake llvm.org multilib-minimal pax-utils python-any-r1 \
+ toolchain-funcs
+
+DESCRIPTION="Low Level Virtual Machine"
+HOMEPAGE="https://llvm.org/"
+
+# Additional licenses:
+# 1. OpenBSD regex: Henry Spencer's license ('rc' in Gentoo) + BSD.
+# 2. xxhash: BSD.
+# 3. MD5 code: public-domain.
+# 4. ConvertUTF.h: TODO.
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA BSD public-domain rc"
+SLOT="${LLVM_MAJOR}/${LLVM_SOABI}"
+KEYWORDS=""
+IUSE="
+ +binutils-plugin debug doc exegesis libedit +libffi ncurses test xar
+ xml z3 zstd
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ sys-libs/zlib:0=[${MULTILIB_USEDEP}]
+ binutils-plugin? ( >=sys-devel/binutils-2.31.1-r4:*[plugins] )
+ exegesis? ( dev-libs/libpfm:= )
+ libedit? ( dev-libs/libedit:0=[${MULTILIB_USEDEP}] )
+ libffi? ( >=dev-libs/libffi-3.0.13-r1:0=[${MULTILIB_USEDEP}] )
+ ncurses? ( >=sys-libs/ncurses-5.9-r3:0=[${MULTILIB_USEDEP}] )
+ xar? ( app-arch/xar )
+ xml? ( dev-libs/libxml2:2=[${MULTILIB_USEDEP}] )
+ z3? ( >=sci-mathematics/z3-4.7.1:0=[${MULTILIB_USEDEP}] )
+ zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+ ${RDEPEND}
+ binutils-plugin? ( sys-libs/binutils-libs )
+"
+BDEPEND="
+ ${PYTHON_DEPS}
+ dev-lang/perl
+ >=dev-util/cmake-3.16
+ sys-devel/gnuconfig
+ kernel_Darwin? (
+ <sys-libs/libcxx-${LLVM_VERSION}.9999
+ >=sys-devel/binutils-apple-5.1
+ )
+ doc? ( $(python_gen_any_dep '
+ dev-python/recommonmark[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ') )
+ libffi? ( virtual/pkgconfig )
+"
+# There are no file collisions between these versions but having :0
+# installed means llvm-config there will take precedence.
+RDEPEND="
+ ${RDEPEND}
+ !sys-devel/llvm:0
+"
+PDEPEND="
+ sys-devel/llvm-common
+ sys-devel/llvm-toolchain-symlinks:${LLVM_MAJOR}
+ binutils-plugin? ( >=sys-devel/llvmgold-${LLVM_MAJOR} )
+"
+
+LLVM_COMPONENTS=( llvm cmake )
+LLVM_TEST_COMPONENTS=( third-party )
+LLVM_MANPAGES=1
+LLVM_USE_TARGETS=provide
+llvm.org_set_globals
+
+python_check_deps() {
+ use doc || return 0
+
+ python_has_version -b "dev-python/recommonmark[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]"
+}
+
+check_uptodate() {
+ local prod_targets=(
+ $(sed -n -e '/set(LLVM_ALL_TARGETS/,/)/p' CMakeLists.txt \
+ | tail -n +2 | head -n -1)
+ )
+ local all_targets=(
+ lib/Target/*/
+ )
+ all_targets=( "${all_targets[@]#lib/Target/}" )
+ all_targets=( "${all_targets[@]%/}" )
+
+ local exp_targets=() i
+ for i in "${all_targets[@]}"; do
+ has "${i}" "${prod_targets[@]}" || exp_targets+=( "${i}" )
+ done
+
+ if [[ ${exp_targets[*]} != ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]} ]]; then
+ eqawarn "ALL_LLVM_EXPERIMENTAL_TARGETS is outdated!"
+ eqawarn " Have: ${ALL_LLVM_EXPERIMENTAL_TARGETS[*]}"
+ eqawarn "Expected: ${exp_targets[*]}"
+ eqawarn
+ fi
+
+ if [[ ${prod_targets[*]} != ${ALL_LLVM_PRODUCTION_TARGETS[*]} ]]; then
+ eqawarn "ALL_LLVM_PRODUCTION_TARGETS is outdated!"
+ eqawarn " Have: ${ALL_LLVM_PRODUCTION_TARGETS[*]}"
+ eqawarn "Expected: ${prod_targets[*]}"
+ fi
+}
+
+check_distribution_components() {
+ if [[ ${CMAKE_MAKEFILE_GENERATOR} == ninja ]]; then
+ local all_targets=() my_targets=() l
+ cd "${BUILD_DIR}" || die
+
+ while read -r l; do
+ if [[ ${l} == install-*-stripped:* ]]; then
+ l=${l#install-}
+ l=${l%%-stripped*}
+
+ case ${l} in
+ # shared libs
+ LLVM|LLVMgold)
+ ;;
+ # TableGen lib + deps
+ LLVMDemangle|LLVMSupport|LLVMTableGen)
+ ;;
+ # static libs
+ LLVM*)
+ continue
+ ;;
+ # meta-targets
+ distribution|llvm-libraries)
+ continue
+ ;;
+ # used only w/ USE=doc
+ docs-llvm-html)
+ use doc || continue
+ ;;
+ esac
+
+ all_targets+=( "${l}" )
+ fi
+ done < <(${NINJA} -t targets all)
+
+ while read -r l; do
+ my_targets+=( "${l}" )
+ done < <(get_distribution_components $"\n")
+
+ local add=() remove=()
+ for l in "${all_targets[@]}"; do
+ if ! has "${l}" "${my_targets[@]}"; then
+ add+=( "${l}" )
+ fi
+ done
+ for l in "${my_targets[@]}"; do
+ if ! has "${l}" "${all_targets[@]}"; then
+ remove+=( "${l}" )
+ fi
+ done
+
+ if [[ ${#add[@]} -gt 0 || ${#remove[@]} -gt 0 ]]; then
+ eqawarn "get_distribution_components() is outdated!"
+ eqawarn " Add: ${add[*]}"
+ eqawarn "Remove: ${remove[*]}"
+ fi
+ cd - >/dev/null || die
+ fi
+}
+
+src_prepare() {
+ # disable use of SDK on OSX, bug #568758
+ sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die
+
+ # Update config.guess to support more systems
+ cp "${BROOT}/usr/share/gnuconfig/config.guess" cmake/ || die
+
+ # Verify that the ebuild is up-to-date
+ check_uptodate
+
+ llvm.org_src_prepare
+}
+
+get_distribution_components() {
+ local sep=${1-;}
+
+ local out=(
+ # shared libs
+ LLVM
+ LTO
+ Remarks
+
+ # tools
+ llvm-config
+
+ # common stuff
+ cmake-exports
+ llvm-headers
+
+ # libraries needed for clang-tblgen
+ LLVMDemangle
+ LLVMSupport
+ LLVMTableGen
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # utilities
+ llvm-tblgen
+ FileCheck
+ llvm-PerfectShuffle
+ count
+ not
+ yaml-bench
+ UnicodeNameMappingGenerator
+
+ # tools
+ bugpoint
+ dsymutil
+ llc
+ lli
+ lli-child-target
+ llvm-addr2line
+ llvm-ar
+ llvm-as
+ llvm-bcanalyzer
+ llvm-bitcode-strip
+ llvm-c-test
+ llvm-cat
+ llvm-cfi-verify
+ llvm-config
+ llvm-cov
+ llvm-cvtres
+ llvm-cxxdump
+ llvm-cxxfilt
+ llvm-cxxmap
+ llvm-debuginfo-analyzer
+ llvm-debuginfod
+ llvm-debuginfod-find
+ llvm-diff
+ llvm-dis
+ llvm-dlltool
+ llvm-dwarfdump
+ llvm-dwarfutil
+ llvm-dwp
+ llvm-exegesis
+ llvm-extract
+ llvm-gsymutil
+ llvm-ifs
+ llvm-install-name-tool
+ llvm-jitlink
+ llvm-jitlink-executor
+ llvm-lib
+ llvm-libtool-darwin
+ llvm-link
+ llvm-lipo
+ llvm-lto
+ llvm-lto2
+ llvm-mc
+ llvm-mca
+ llvm-ml
+ llvm-modextract
+ llvm-mt
+ llvm-nm
+ llvm-objcopy
+ llvm-objdump
+ llvm-opt-report
+ llvm-otool
+ llvm-pdbutil
+ llvm-profdata
+ llvm-profgen
+ llvm-ranlib
+ llvm-rc
+ llvm-readelf
+ llvm-readobj
+ llvm-reduce
+ llvm-remark-size-diff
+ llvm-remarkutil
+ llvm-rtdyld
+ llvm-sim
+ llvm-size
+ llvm-split
+ llvm-stress
+ llvm-strings
+ llvm-strip
+ llvm-symbolizer
+ llvm-tapi-diff
+ llvm-tli-checker
+ llvm-undname
+ llvm-windres
+ llvm-xray
+ obj2yaml
+ opt
+ sancov
+ sanstats
+ split-file
+ verify-uselistorder
+ yaml2obj
+
+ # python modules
+ opt-viewer
+ )
+
+ if llvm_are_manpages_built; then
+ out+=(
+ # manpages
+ docs-dsymutil-man
+ docs-llvm-dwarfdump-man
+ docs-llvm-man
+ )
+ fi
+ use doc && out+=(
+ docs-llvm-html
+ )
+
+ use binutils-plugin && out+=(
+ LLVMgold
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ local ffi_cflags ffi_ldflags
+ if use libffi; then
+ ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
+ ffi_ldflags=$($(tc-getPKG_CONFIG) --libs-only-L libffi)
+ fi
+
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ # disable appending VCS revision to the version to improve
+ # direct cache hit ratio
+ -DLLVM_APPEND_VC_REV=OFF
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DLLVM_BUILD_LLVM_DYLIB=ON
+ -DLLVM_LINK_LLVM_DYLIB=ON
+ -DLLVM_DISTRIBUTION_COMPONENTS=$(get_distribution_components)
+
+ # cheap hack: LLVM combines both anyway, and the only difference
+ # is that the former list is explicitly verified at cmake time
+ -DLLVM_TARGETS_TO_BUILD=""
+ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_INCLUDE_BENCHMARKS=OFF
+ -DLLVM_INCLUDE_TESTS=$(usex test)
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ -DLLVM_ENABLE_FFI=$(usex libffi)
+ -DLLVM_ENABLE_LIBEDIT=$(usex libedit)
+ -DLLVM_ENABLE_TERMINFO=$(usex ncurses)
+ -DLLVM_ENABLE_LIBXML2=$(usex xml)
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_LIBPFM=$(usex exegesis)
+ -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
+ -DLLVM_ENABLE_ZSTD=$(usex zstd)
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+ # used only for llvm-objdump tool
+ -DLLVM_HAVE_LIBXAR=$(multilib_native_usex xar 1 0)
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+
+ # disable OCaml bindings (now in dev-ml/llvm-ocaml)
+ -DOCAMLFIND=NO
+ )
+
+ local suffix=
+ if [[ -n ${EGIT_VERSION} && ${EGIT_BRANCH} != release/* ]]; then
+ # the ABI of the main branch is not stable, so let's include
+ # the commit id in the SOVERSION to contain the breakage
+ suffix+="git${EGIT_VERSION::8}"
+ fi
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
+ # Smart hack: alter version suffix -> SOVERSION when linking
+ # against libc++. This way we won't end up mixing LLVM libc++
+ # libraries with libstdc++ clang, and the other way around.
+ suffix+="+libcxx"
+ mycmakeargs+=(
+ -DLLVM_ENABLE_LIBCXX=ON
+ )
+ fi
+ mycmakeargs+=(
+ -DLLVM_VERSION_SUFFIX="${suffix}"
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ if multilib_is_native_abi; then
+ local build_docs=OFF
+ if llvm_are_manpages_built; then
+ build_docs=ON
+ mycmakeargs+=(
+ -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ -DLLVM_INSTALL_SPHINX_HTML_DIR="${EPREFIX}/usr/share/doc/${PF}/html"
+ -DSPHINX_WARNINGS_AS_ERRORS=OFF
+ )
+ fi
+
+ mycmakeargs+=(
+ -DLLVM_BUILD_DOCS=${build_docs}
+ -DLLVM_ENABLE_OCAMLDOC=OFF
+ -DLLVM_ENABLE_SPHINX=${build_docs}
+ -DLLVM_ENABLE_DOXYGEN=OFF
+ -DLLVM_INSTALL_UTILS=ON
+ )
+ use binutils-plugin && mycmakeargs+=(
+ -DLLVM_BINUTILS_INCDIR="${EPREFIX}"/usr/include
+ )
+ fi
+
+ # workaround BMI bug in gcc-7 (fixed in 7.4)
+ # https://bugs.gentoo.org/649880
+ # apply only to x86, https://bugs.gentoo.org/650506
+ if tc-is-gcc && [[ ${MULTILIB_ABI_FLAG} == abi_x86* ]] &&
+ [[ $(gcc-major-version) -eq 7 && $(gcc-minor-version) -lt 4 ]]
+ then
+ local CFLAGS="${CFLAGS} -mno-bmi"
+ local CXXFLAGS="${CXXFLAGS} -mno-bmi"
+ fi
+
+ # LLVM can have very high memory consumption while linking,
+ # exhausting the limit on 32-bit linker executable
+ use x86 && local -x LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory"
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ use debug || local -x CPPFLAGS="${CPPFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ grep -q -E "^CMAKE_PROJECT_VERSION_MAJOR(:.*)?=${LLVM_MAJOR}$" \
+ CMakeCache.txt ||
+ die "Incorrect version, did you update _LLVM_MASTER_MAJOR?"
+ multilib_is_native_abi && check_distribution_components
+}
+
+multilib_src_compile() {
+ tc-env_build cmake_build distribution
+
+ pax-mark m "${BUILD_DIR}"/bin/llvm-rtdyld
+ pax-mark m "${BUILD_DIR}"/bin/lli
+ pax-mark m "${BUILD_DIR}"/bin/lli-child-target
+
+ if use test; then
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/Orc/OrcJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/ExecutionEngine/MCJIT/MCJITTests
+ pax-mark m "${BUILD_DIR}"/unittests/Support/SupportTests
+ fi
+}
+
+multilib_src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ cmake_build check
+}
+
+src_install() {
+ local MULTILIB_CHOST_TOOLS=(
+ /usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-config
+ )
+
+ local MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/llvm/Config/llvm-config.h
+ )
+
+ local LLVM_LDPATHS=()
+ multilib-minimal_src_install
+
+ # move wrapped headers back
+ mv "${ED}"/usr/include "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include || die
+}
+
+multilib_src_install() {
+ DESTDIR=${D} cmake_build install-distribution
+
+ # move headers to /usr/include for wrapping
+ rm -rf "${ED}"/usr/include || die
+ mv "${ED}"/usr/lib/llvm/${LLVM_MAJOR}/include "${ED}"/usr/include || die
+
+ LLVM_LDPATHS+=( "${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/$(get_libdir)" )
+}
+
+multilib_src_install_all() {
+ local revord=$(( 9999 - ${LLVM_MAJOR} ))
+ newenvd - "60llvm-${revord}" <<-_EOF_
+ PATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ # we need to duplicate it in ROOTPATH for Portage to respect...
+ ROOTPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/bin"
+ MANPATH="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ LDPATH="$( IFS=:; echo "${LLVM_LDPATHS[*]}" )"
+ _EOF_
+
+ docompress "/usr/lib/llvm/${LLVM_MAJOR}/share/man"
+ llvm_install_manpages
+}
+
+pkg_postinst() {
+ elog "You can find additional opt-viewer utility scripts in:"
+ elog " ${EROOT}/usr/lib/llvm/${LLVM_MAJOR}/share/opt-viewer"
+ elog "To use these scripts, you will need Python along with the following"
+ elog "packages:"
+ elog " dev-python/pygments (for opt-viewer)"
+ elog " dev-python/pyyaml (for all of them)"
+}
diff --git a/sys-devel/llvmgold/Manifest b/sys-devel/llvmgold/Manifest
index a440b66eacf5..ee59c31af64a 100644
--- a/sys-devel/llvmgold/Manifest
+++ b/sys-devel/llvmgold/Manifest
@@ -2,4 +2,5 @@ EBUILD llvmgold-13-r2.ebuild 591 BLAKE2B 28b122d41982961594bd1f70e9a666ace7e51e7
EBUILD llvmgold-14.ebuild 576 BLAKE2B c9493f322fa0e387411df160c28078a514510e684f01c415a035c93868dd5a16ae718f10af0debe2e1a4112ea0864890a81a89ebf3fefc55ffdc89adc743524f SHA512 7cdb73379b9f6db22abde1f01043e28b8bfd797f3123f77d31ab3166e2c8d72747aad0963e8f6a41a0a01a19ea29eb468d869b5dbc7a35eb016a4a89c57715c3
EBUILD llvmgold-15.ebuild 576 BLAKE2B c9493f322fa0e387411df160c28078a514510e684f01c415a035c93868dd5a16ae718f10af0debe2e1a4112ea0864890a81a89ebf3fefc55ffdc89adc743524f SHA512 7cdb73379b9f6db22abde1f01043e28b8bfd797f3123f77d31ab3166e2c8d72747aad0963e8f6a41a0a01a19ea29eb468d869b5dbc7a35eb016a4a89c57715c3
EBUILD llvmgold-16.ebuild 526 BLAKE2B df3fe5c0b3f73b4751561b1637211a1606682610e273612e6caa5e55ffbca48aacaef6a56518e36e5e9969c23987ae2202a0e4c362c23ad69c1b5d422147eada SHA512 57f2057dfd7ce6d129df46715d732c260aa5e5de505b26e713b72ab5471d9e1632fe1762ebdeda6afda03ae983559d69a4d0a3aca51aa24a1e087917c4b1deb3
+EBUILD llvmgold-17.ebuild 538 BLAKE2B a3424159e17fb2fb91ee0ebc7b84bee83b48c0bc672bad2d55fde1be98066b718352cab72f422b4a7a6e33e7ac98463ef433fb6f7c37e27570359d2fdcd7bd75 SHA512 906506a5430e1c3f39b49f8e3b5bb6981f1781a14d3dff59f57d872f3790fe146e5e4e757f1e6486558c77d0ee6bff7bf1bc784d4d1b5e2ecc81e6bfbb335c13
MISC metadata.xml 299 BLAKE2B 2feead2cd1b35b3a43335ddd7711f8181b52bc63ee7166608914260c67528add5251349063afbef4f8cf0ec09b2cd4c3ffdd90f2c14ed60bb69ebc03888f6333 SHA512 cd745c54ab18d25bdaff18582105072574103a36cfe7c175ef740f266d00e9fc6f44c332904d23b911c939cf5bdf52973b388923099d8dd5dfef3c283b5cb685
diff --git a/sys-devel/llvmgold/llvmgold-17.ebuild b/sys-devel/llvmgold/llvmgold-17.ebuild
new file mode 100644
index 000000000000..0f6fedb082d3
--- /dev/null
+++ b/sys-devel/llvmgold/llvmgold-17.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="LLVMgold plugin symlink for autoloading"
+HOMEPAGE="https://llvm.org/"
+S=${WORKDIR}
+
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS=""
+PROPERTIES="live"
+
+RDEPEND="
+ sys-devel/llvm:${PV}[binutils-plugin]
+ !sys-devel/llvm:0
+"
+
+src_install() {
+ dodir "/usr/${CHOST}/binutils-bin/lib/bfd-plugins"
+ dosym "../../../../lib/llvm/${PV}/$(get_libdir)/LLVMgold.so" \
+ "/usr/${CHOST}/binutils-bin/lib/bfd-plugins/LLVMgold.so"
+}