summaryrefslogtreecommitdiff
path: root/sys-devel
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-04-19 12:05:02 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-04-19 12:05:02 +0100
commitb6cfc0c19effe2d9f7b8ab303cd00636f16da253 (patch)
treea0158050dac0a7ebfb9df4f667ec6ad2dd185538 /sys-devel
parent2d01b3d133c0fbf17de8d7b47905585af88bd6e4 (diff)
gentoo auto-resync : 19:04:2024 - 12:05:02
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/Manifest.gzbin7697 -> 7708 bytes
-rw-r--r--sys-devel/clang-common/Manifest3
-rw-r--r--sys-devel/clang-common/clang-common-18.1.4-r3.ebuild297
-rw-r--r--sys-devel/clang-runtime/Manifest1
-rw-r--r--sys-devel/clang-runtime/clang-runtime-18.1.4.ebuild40
-rw-r--r--sys-devel/clang/Manifest3
-rw-r--r--sys-devel/clang/clang-18.1.4.ebuild476
-rw-r--r--sys-devel/gcc/Manifest1
-rw-r--r--sys-devel/gcc/files/gcc-14.0.1_pre20240303-uninit.patch48
-rw-r--r--sys-devel/lld/Manifest3
-rw-r--r--sys-devel/lld/lld-18.1.4.ebuild94
-rw-r--r--sys-devel/llvm-common/Manifest3
-rw-r--r--sys-devel/llvm-common/llvm-common-18.1.4.ebuild54
-rw-r--r--sys-devel/llvm/Manifest3
-rw-r--r--sys-devel/llvm/llvm-18.1.4.ebuild548
15 files changed, 1525 insertions, 49 deletions
diff --git a/sys-devel/Manifest.gz b/sys-devel/Manifest.gz
index 900970775b16..286119f65b02 100644
--- a/sys-devel/Manifest.gz
+++ b/sys-devel/Manifest.gz
Binary files differ
diff --git a/sys-devel/clang-common/Manifest b/sys-devel/clang-common/Manifest
index 9365a5fa1510..3ece75fa0304 100644
--- a/sys-devel/clang-common/Manifest
+++ b/sys-devel/clang-common/Manifest
@@ -7,12 +7,15 @@ DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e06541
DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783
DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c
+DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29
+DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386
DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07
DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1
EBUILD clang-common-15.0.7-r8.ebuild 5482 BLAKE2B 20e8744166a852b4dbc233f128807e60bb204f14558d2cc1691b1a87777be2775d1a6c82a108945f795b02919bc47bf213b1a85e45f423c49a6009aed0fbbc3b SHA512 bf1f5cdf47c6772266117e9545994dcfb27cfd263a5e7749604106686d8e56b8b45ddab7073d6baf73e966304162f3aad755075c11dbb16bb42b88fa78e6face
EBUILD clang-common-16.0.6-r4.ebuild 5726 BLAKE2B de26b88570bf487a2be2a59f4551c8e61b940fb84b0dc3cb5be1884252672782700b657fb63c0b7ac247ec2092b236a550b51273f73ec19fab7db6eeda0ff94e SHA512 9f2778fbb89d578e162b36c7a692219533437d9fbec407422e7aff1b11d942f09c8cf0edb5c5bd37bbf34523b1f947b418f954b632d769f836baa7d2493bc527
EBUILD clang-common-17.0.6-r5.ebuild 9010 BLAKE2B cbb5c5094ca6e99fc9ce1734acf02e2e35b792173f84b71e19b25e687f7a93a6fca31e4461fc580d92c0eadabe1400359bec3938fc0cba2cac9bc28a4b8d66be SHA512 ea66877912d34f11a0b788a0d188caf03a5c06098507e7bbb3fa609f594d7b9397ac8fa21c7b502238e36b1ede7bf32dc173b9a6d74a3be1e5d3f25babac9165
EBUILD clang-common-18.1.3-r3.ebuild 8934 BLAKE2B a77b12fbdaf06369d9d59dd00470053d500572bccb209a59b634ea4685e28ece1b0ac50e7bed0f025ab08697ea91efac191823ad3419888628430332c8175d5c SHA512 4b4e1f0f1a947c127f2ad3e84df09c9309e3df9b5733f0a3f9b25473314823af9f976803830d4b2d1aa7611712fb77a0cf5536a10bd5aab2965705ff201e0d09
+EBUILD clang-common-18.1.4-r3.ebuild 8934 BLAKE2B a77b12fbdaf06369d9d59dd00470053d500572bccb209a59b634ea4685e28ece1b0ac50e7bed0f025ab08697ea91efac191823ad3419888628430332c8175d5c SHA512 4b4e1f0f1a947c127f2ad3e84df09c9309e3df9b5733f0a3f9b25473314823af9f976803830d4b2d1aa7611712fb77a0cf5536a10bd5aab2965705ff201e0d09
EBUILD clang-common-19.0.0.9999.ebuild 9018 BLAKE2B 5f055aeaec9b6ebdfbfe9b84aa65dc6de8ffac3003235d3aef66e48b2f0f4daff56f38a574de61f9abb0a12e4728b27f99f726f840528ba279e7334b85d5bee4 SHA512 5463729ed67144428d5a154a91083efa2006e0d449b31f8870650097dd0b1322f4bd5ec7a7b2884ffd906a976ffa310e36dacd3c9dba519c1d5c26b3879cbd85
EBUILD clang-common-19.0.0_pre20240330-r1.ebuild 9018 BLAKE2B 5f055aeaec9b6ebdfbfe9b84aa65dc6de8ffac3003235d3aef66e48b2f0f4daff56f38a574de61f9abb0a12e4728b27f99f726f840528ba279e7334b85d5bee4 SHA512 5463729ed67144428d5a154a91083efa2006e0d449b31f8870650097dd0b1322f4bd5ec7a7b2884ffd906a976ffa310e36dacd3c9dba519c1d5c26b3879cbd85
EBUILD clang-common-19.0.0_pre20240404.ebuild 9018 BLAKE2B 5f055aeaec9b6ebdfbfe9b84aa65dc6de8ffac3003235d3aef66e48b2f0f4daff56f38a574de61f9abb0a12e4728b27f99f726f840528ba279e7334b85d5bee4 SHA512 5463729ed67144428d5a154a91083efa2006e0d449b31f8870650097dd0b1322f4bd5ec7a7b2884ffd906a976ffa310e36dacd3c9dba519c1d5c26b3879cbd85
diff --git a/sys-devel/clang-common/clang-common-18.1.4-r3.ebuild b/sys-devel/clang-common/clang-common-18.1.4-r3.ebuild
new file mode 100644
index 000000000000..fff63838526d
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-18.1.4-r3.ebuild
@@ -0,0 +1,297 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org multilib
+
+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="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+ default-compiler-rt default-libcxx default-lld
+ bootstrap-prefix cet hardened llvm-libunwind
+"
+
+PDEPEND="
+ sys-devel/clang:*
+ default-compiler-rt? (
+ sys-devel/clang-runtime[compiler-rt]
+ llvm-libunwind? ( sys-libs/llvm-libunwind[static-libs] )
+ !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
+ )
+ !default-compiler-rt? ( sys-devel/gcc )
+ default-libcxx? ( >=sys-libs/libcxx-${PV}[static-libs] )
+ !default-libcxx? ( sys-devel/gcc )
+ default-lld? ( >=sys-devel/lld-${PV} )
+ !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
+}
+
+_doclang_cfg() {
+ local triple="${1}"
+
+ local tool
+ for tool in ${triple}-clang{,++}; do
+ newins - "${tool}.cfg" <<-EOF
+ # This configuration file is used by ${tool} driver.
+ @gentoo-common.cfg
+ @gentoo-common-ld.cfg
+ EOF
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/${triple}-clang++.cfg" <<-EOF || die
+ -lc++abi
+ EOF
+ fi
+
+ newins - "${triple}-clang-cpp.cfg" <<-EOF
+ # This configuration file is used by the ${triple}-clang-cpp driver.
+ @gentoo-common.cfg
+ EOF
+
+ # Install symlinks for triples with other vendor strings since some
+ # programs insist on mangling the triple.
+ local vendor
+ for vendor in gentoo pc unknown; do
+ local vendor_triple="${triple%%-*}-${vendor}-${triple#*-*-}"
+ for tool in clang{,++,-cpp}; do
+ if [[ ! -f "${ED}/etc/clang/${vendor_triple}-${tool}.cfg" ]]; then
+ dosym "${triple}-${tool}.cfg" "/etc/clang/${vendor_triple}-${tool}.cfg"
+ fi
+ done
+ done
+}
+
+doclang_cfg() {
+ local triple="${1}"
+
+ _doclang_cfg ${triple}
+
+ # LLVM may have different arch names in some cases. For example in x86
+ # profiles the triple uses i686, but llvm will prefer i386 if invoked
+ # with "clang" on x86 or "clang -m32" on x86_64. The gentoo triple will
+ # be used if invoked through ${CHOST}-clang{,++,-cpp} though.
+ #
+ # To make sure the correct triples are installed,
+ # see Triple::getArchTypeName() in llvm/lib/TargetParser/Triple.cpp
+ # and compare with CHOST values in profiles.
+
+ local abi=${triple%%-*}
+ case ${abi} in
+ armv4l|armv4t|armv5tel|armv6j|armv7a)
+ _doclang_cfg ${triple/${abi}/arm}
+ ;;
+ i686)
+ _doclang_cfg ${triple/${abi}/i386}
+ ;;
+ sparc)
+ _doclang_cfg ${triple/${abi}/sparcel}
+ ;;
+ sparc64)
+ _doclang_cfg ${triple/${abi}/sparcv9}
+ ;;
+ esac
+}
+
+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
+ # bug #870001
+ -include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+ EOF
+
+ # clang-cpp does not like link args being passed to it when directly
+ # invoked, so use a separate configuration file.
+ newins - gentoo-common-ld.cfg <<-EOF
+ # This file contains flags common to clang and clang++
+ @gentoo-hardened-ld.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.
+ -Xarch_host -fstack-clash-protection
+ -Xarch_host -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ if use amd64; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ -Xarch_host -fcf-protection=$(usex cet full none)
+ EOF
+ fi
+
+ if use kernel_Darwin; then
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # There was -Wl,-z,relro here, but it's not supported on Mac
+ # TODO: investigate whether -bind_at_load or -read_only_stubs will do the job
+ EOF
+ else
+ newins - gentoo-hardened-ld.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -Wl,-z,relro
+ -Wl,-z,now
+ EOF
+ fi
+
+ dodir /usr/include/gentoo
+
+ cat >> "${ED}/usr/include/gentoo/maybe-stddefs.h" <<-EOF || die
+ /* __has_include is an extension, but it's fine, because this is only
+ for Clang anyway. */
+ #if defined __has_include && __has_include (<stdc-predef.h>) && !defined(__GLIBC__)
+ # include <stdc-predef.h>
+ #endif
+ EOF
+
+ 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
+ #ifdef __clang__
+ # pragma clang system_header
+ #endif
+ #ifndef _FORTIFY_SOURCE
+ # if defined(__has_feature)
+ # define __GENTOO_HAS_FEATURE(x) __has_feature(x)
+ # else
+ # define __GENTOO_HAS_FEATURE(x) 0
+ # endif
+ #
+ # if defined(__STDC_HOSTED__) && __STDC_HOSTED__ == 1
+ # define __GENTOO_NOT_FREESTANDING 1
+ # else
+ # define __GENTOO_NOT_FREESTANDING 0
+ # endif
+ #
+ # if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 && __GENTOO_NOT_FREESTANDING > 0
+ # if !defined(__SANITIZE_ADDRESS__) && !__GENTOO_HAS_FEATURE(address_sanitizer) && !__GENTOO_HAS_FEATURE(memory_sanitizer)
+ # define _FORTIFY_SOURCE ${fortify_level}
+ # endif
+ # endif
+ # undef __GENTOO_HAS_FEATURE
+ # undef __GENTOO_NOT_FREESTANDING
+ #endif
+ EOF
+
+ # TODO: Maybe -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST for
+ # non-hardened?
+ 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
+ # https://libcxx.llvm.org/Hardening.html#using-hardened-mode
+ -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ EOF
+ fi
+
+ # We only install config files for supported ABIs because unprefixed tools
+ # might be used for crosscompilation where e.g. PIE may not be supported.
+ # See bug #912237 and bug #901247. Just ${CHOST} won't do due to bug #912685.
+ local abi
+ for abi in $(get_all_abis); do
+ local abi_chost=$(get_abi_CHOST "${abi}")
+ doclang_cfg "${abi_chost}"
+ done
+
+ if use kernel_Darwin; then
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ # Gentoo Prefix on Darwin
+ -Wl,-search_paths_first
+ -Wl,-rpath,${EPREFIX}/usr/lib
+ -L ${EPREFIX}/usr/lib
+ -isystem ${EPREFIX}/usr/include
+ -isysroot ${EPREFIX}/MacOSX.sdk
+ EOF
+ if use bootstrap-prefix ; then
+ # bootstrap-prefix is only set during stage2 of bootstrapping
+ # Prefix, where EPREFIX is set to EPREFIX/tmp.
+ # Here we need to point it at the future lib dir of the stage3's
+ # EPREFIX.
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ -Wl,-rpath,${EPREFIX}/../usr/lib
+ EOF
+ fi
+ fi
+}
+
+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 e9ffc98226cb..2639a4b13bc3 100644
--- a/sys-devel/clang-runtime/Manifest
+++ b/sys-devel/clang-runtime/Manifest
@@ -2,6 +2,7 @@ EBUILD clang-runtime-15.0.7.ebuild 759 BLAKE2B d7b481faffc4da0a6dc1b4e708322cd17
EBUILD clang-runtime-16.0.6.ebuild 1448 BLAKE2B be376aab09a0268444784d1a0bcb590222c9c8a118e260b15939e574687334eb476d6f66ab0f1f4fb0841a226c7b7f690666c33bec2d9c14f27a4f30f986b859 SHA512 b0b7a2f5c69890cb2fc0a9c2c8a1910669a4eae16826c0702a2ef508f91b6ec3b5607beab5b24f02951cf9b377f1d09395bd97c27f476137ef6cdf2571330578
EBUILD clang-runtime-17.0.6.ebuild 1448 BLAKE2B be376aab09a0268444784d1a0bcb590222c9c8a118e260b15939e574687334eb476d6f66ab0f1f4fb0841a226c7b7f690666c33bec2d9c14f27a4f30f986b859 SHA512 b0b7a2f5c69890cb2fc0a9c2c8a1910669a4eae16826c0702a2ef508f91b6ec3b5607beab5b24f02951cf9b377f1d09395bd97c27f476137ef6cdf2571330578
EBUILD clang-runtime-18.1.3.ebuild 1455 BLAKE2B 09d026673062eaf3251bc0ac3665217f834c0bb8b57945a138839d86bec58ef7c979a627fb2054a5166c35894e4063bd1972402516d7304c6423639f556ff29a SHA512 aefd613ab3ec054a6829b0f3471384726a05ce410a1f98ab53cca1857bbb19f3b76526ed867a93092fe29acf95078823b2ff8e6b9941705c791c9a42b6eff68c
+EBUILD clang-runtime-18.1.4.ebuild 1455 BLAKE2B 09d026673062eaf3251bc0ac3665217f834c0bb8b57945a138839d86bec58ef7c979a627fb2054a5166c35894e4063bd1972402516d7304c6423639f556ff29a SHA512 aefd613ab3ec054a6829b0f3471384726a05ce410a1f98ab53cca1857bbb19f3b76526ed867a93092fe29acf95078823b2ff8e6b9941705c791c9a42b6eff68c
EBUILD clang-runtime-19.0.0.9999.ebuild 1339 BLAKE2B 4a5ee8a332faf2da21256df048867b1458a5ccb2d733d00ee3788bfbc28b3daf4ce2ae2455ab03c9ebb192d964feae2cd5806b5fef23eaa9401d57b35386aa57 SHA512 fac3e259b5a7b5e105b3d5fd2f8e9a9b6236642867e4c4a67106ec999dfaf0a30a97a3905685043a0ab9f38b15b7b8a5a814a97921e37029b9d0beac7ba7085a
EBUILD clang-runtime-19.0.0_pre20240330.ebuild 1339 BLAKE2B 4a5ee8a332faf2da21256df048867b1458a5ccb2d733d00ee3788bfbc28b3daf4ce2ae2455ab03c9ebb192d964feae2cd5806b5fef23eaa9401d57b35386aa57 SHA512 fac3e259b5a7b5e105b3d5fd2f8e9a9b6236642867e4c4a67106ec999dfaf0a30a97a3905685043a0ab9f38b15b7b8a5a814a97921e37029b9d0beac7ba7085a
EBUILD clang-runtime-19.0.0_pre20240404.ebuild 1339 BLAKE2B 4a5ee8a332faf2da21256df048867b1458a5ccb2d733d00ee3788bfbc28b3daf4ce2ae2455ab03c9ebb192d964feae2cd5806b5fef23eaa9401d57b35386aa57 SHA512 fac3e259b5a7b5e105b3d5fd2f8e9a9b6236642867e4c4a67106ec999dfaf0a30a97a3905685043a0ab9f38b15b7b8a5a814a97921e37029b9d0beac7ba7085a
diff --git a/sys-devel/clang-runtime/clang-runtime-18.1.4.ebuild b/sys-devel/clang-runtime/clang-runtime-18.1.4.ebuild
new file mode 100644
index 000000000000..38042f073a24
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-18.1.4.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2024 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="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="+compiler-rt libcxx openmp +sanitize"
+REQUIRED_USE="sanitize? ( compiler-rt )"
+
+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/Manifest b/sys-devel/clang/Manifest
index fc2a5257308e..12380ec66ece 100644
--- a/sys-devel/clang/Manifest
+++ b/sys-devel/clang/Manifest
@@ -14,12 +14,15 @@ DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e06541
DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783
DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c
+DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29
+DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386
DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07
DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1
EBUILD clang-15.0.7-r3.ebuild 12523 BLAKE2B d2f9e112d8c8d782b9d19913332445b234870dbff770bfd520b646347d8d804258e5043a155bb5e15f40ecdb41b2c0d70ee72dbe908b5621c2349d37f181d236 SHA512 c4abe3701012b4f9da97ac182680dbaceed802e95be06ae065debea943fa4635e60f4a0f31b6f23e3f7818f2d30dfb1e2c28f1a85dc0175c158b4e5c68b5a23e
EBUILD clang-16.0.6.ebuild 12452 BLAKE2B 446a354b58fc0535b81596a9a3785a4cd5d7b7ad52a461baa3b6b7beacdc12161f62da588cd837b8b9c8f35307b1a2c885b9d01bf8edc4af1b551efaab09ebe8 SHA512 58b5694a7d28a03edd4a71e3a99b0b2678285e616cdaab82bb196f092a8726e9cd3787ab07d724680113b4f6683e89103cab2478e49a85e7b5c75a633fb1ca51
EBUILD clang-17.0.6.ebuild 12151 BLAKE2B 665280844db218824bec2add033e13e14b958ac510fb1b0b7193130a55041a5c802c57aa022a35d65a689c611ca9ed119eaf39c47f581d24f38d9c8655c5f062 SHA512 482ae07e36fb3c593d2051b2034f501fc0c94bdcaeb2a6a0701473d00f16f691c8a1584d4b1773dfd236297a12a42cb4f9443eb5c381dcb10d36f749a432ff1d
EBUILD clang-18.1.3.ebuild 12225 BLAKE2B d52fd24ce24fb92e1546160ac8aecbb2baef2c0cf40f89ae8acc0d79f381fa657ee11cfd1977d3225b00d0ca865603725f2d598fa513dc3a41baa48061814368 SHA512 9b7ea92fbf5bd44f98bb200069488319038419f468d7b45774840c6fec18de9069d67cedb064f0f395523d369776b723779e7b8e7bf03b2b3a87e606d43bfd9e
+EBUILD clang-18.1.4.ebuild 12225 BLAKE2B d52fd24ce24fb92e1546160ac8aecbb2baef2c0cf40f89ae8acc0d79f381fa657ee11cfd1977d3225b00d0ca865603725f2d598fa513dc3a41baa48061814368 SHA512 9b7ea92fbf5bd44f98bb200069488319038419f468d7b45774840c6fec18de9069d67cedb064f0f395523d369776b723779e7b8e7bf03b2b3a87e606d43bfd9e
EBUILD clang-19.0.0.9999.ebuild 12121 BLAKE2B e9e8731b4b44f4d0fa46280abea5d33792816ab54c7f40dbff794e7fcdd1fdc1f37b47fdb79efe16f3ee5c5b86a4a6d62da4765da4283467457bf3329e01cb7b SHA512 95974fe447ad803577d6bcbada6dc33b32b7ae1a6626e754529b334c2565b3d5a26dd51c6391edbc6c7defe4450f103dbdbbdcfd4b241c882d922197ef0895ab
EBUILD clang-19.0.0_pre20240330.ebuild 12121 BLAKE2B e9e8731b4b44f4d0fa46280abea5d33792816ab54c7f40dbff794e7fcdd1fdc1f37b47fdb79efe16f3ee5c5b86a4a6d62da4765da4283467457bf3329e01cb7b SHA512 95974fe447ad803577d6bcbada6dc33b32b7ae1a6626e754529b334c2565b3d5a26dd51c6391edbc6c7defe4450f103dbdbbdcfd4b241c882d922197ef0895ab
EBUILD clang-19.0.0_pre20240404.ebuild 12121 BLAKE2B e9e8731b4b44f4d0fa46280abea5d33792816ab54c7f40dbff794e7fcdd1fdc1f37b47fdb79efe16f3ee5c5b86a4a6d62da4765da4283467457bf3329e01cb7b SHA512 95974fe447ad803577d6bcbada6dc33b32b7ae1a6626e754529b334c2565b3d5a26dd51c6391edbc6c7defe4450f103dbdbbdcfd4b241c882d922197ef0895ab
diff --git a/sys-devel/clang/clang-18.1.4.ebuild b/sys-devel/clang/clang-18.1.4.ebuild
new file mode 100644
index 000000000000..142fc3861de3
--- /dev/null
+++ b/sys-devel/clang/clang-18.1.4.ebuild
@@ -0,0 +1,476 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake llvm.org llvm-utils multilib multilib-minimal
+inherit 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="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~x64-macos"
+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}
+ test? ( ~sys-devel/lld-${PV} )
+ 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/utils
+)
+LLVM_USE_TARGETS=llvm
+llvm.org_set_globals
+
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_cond_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
+# 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).
+
+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
+
+ if ! use prefix-guest && [[ -n ${EPREFIX} ]]; then
+ sed -i "/LibDir.*Loader/s@return \"\/\"@return \"${EPREFIX}/\"@" lib/Driver/ToolChains/Linux.cpp || die
+ 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
+ # 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-linker-wrapper
+ 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() {
+ llvm_prepend_path "${LLVM_MAJOR}"
+
+ local mycmakeargs=(
+ -DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
+ -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// /;}"
+
+ # these are not propagated reliably, so redefine them
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ # 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_CUDAToolkit=ON
+ # disable linking to HSA to avoid automagic dep,
+ # load it dynamically instead
+ -DCMAKE_DISABLE_FIND_PACKAGE_hsa-runtime64=ON
+
+ -DCLANG_DEFAULT_PIE_ON_LINUX=$(usex pie)
+
+ -DCLANG_ENABLE_LIBXML2=$(usex xml)
+ -DCLANG_ENABLE_ARCMT=$(usex static-analyzer)
+ -DCLANG_ENABLE_STATIC_ANALYZER=$(usex static-analyzer)
+ # TODO: CLANG_ENABLE_HLSL?
+
+ -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
+}
+
+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/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/gcc/Manifest b/sys-devel/gcc/Manifest
index 6a53567ca5b9..667f7428846b 100644
--- a/sys-devel/gcc/Manifest
+++ b/sys-devel/gcc/Manifest
@@ -1,5 +1,4 @@
AUX gcc-13-fix-cross-fixincludes.patch 854 BLAKE2B 3dc52dc6b1ed7e86ae5a0a48b79dc5020f2abcbb4db6735479595ce88e259eb8fe933a5619408a29997c00966481f5b3cd3a412eb63517aa26b6babb3afac612 SHA512 666f9343594c5ffa4ea01e7cbfb8c79d95ffc3a5215dbc16a3f964cb73de552863aa578758d2ffcb0dfd36764ec65389b5abacf6dd12c941c129f39c8117fff2
-AUX gcc-14.0.1_pre20240303-uninit.patch 2047 BLAKE2B edad64293826366fc668da1926dd7a860ee4acb77771cacba043a1ccea3fe1886b4cbc586012026f57e610a0bbebc08120d693786e0cd49c50c80693ced75447 SHA512 9de6b5182086a0abebd8e171ab3b3a9775dac2408684acf27e2d92dce0c44e1622197a00ca72319a0ad4f173279313d6a560f0dbcce8368bc57bb8735bff792f
AUX gcc-14.0.1_pre20240324-PR114439.patch 2806 BLAKE2B a8232abbca4da3a280085d11319f31ba4829439b6121c8a22b91e57487275560f9d4399fb079e53b08155b94392f57434480a508f2ed629ed1a132d9b2251972 SHA512 7e8ad80cc927d15837f6b5ea1c14f1441fecb2ebaeb51c9f84f49a01673b89b6ab8852a4e251d154235f0724267156dfbddb9707d1d15ac5f9de41107d930f45
AUX gcc-configure-texinfo.patch 341 BLAKE2B d2ea3b2ea08f5d3a498ba27d0fb95e325097e2104e55caa28b66515cb48662649140d90b639369aedc54b2b1178fa4b49cda442f5f504e09d88a2efa45a5057c SHA512 e8d34c5077409df5495cf0c5fbf5e77f841c5698108fa6a5fde33eb28202c685603bdefd8368918e55f30c4b995e895d71d64c715c1ec2b017e09eb2c54c09ff
DIST gcc-10.5.0-musl-patches-2.tar.xz 3452 BLAKE2B 5387e516d07d81477b3f39b8b3bd986bf861d32cd25dc5481c97bd3620d00c918c5661e86857f66dbf28a655401a53e43417f638c443e44cbfdbf5e950caac4d SHA512 86f2ce31cc4fc4fb5a6043fb527bf822d895e1a6220652024f78a1cbd5a962edb6be8dc5f43c32053e075f39bb2350ea8f14e7d57e0473dd2933a7b44676bde5
diff --git a/sys-devel/gcc/files/gcc-14.0.1_pre20240303-uninit.patch b/sys-devel/gcc/files/gcc-14.0.1_pre20240303-uninit.patch
deleted file mode 100644
index 5ad41c4581a9..000000000000
--- a/sys-devel/gcc/files/gcc-14.0.1_pre20240303-uninit.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=901e7bdab70e2275723ac31dacbbce0b6f68f4f4
-
-From 901e7bdab70e2275723ac31dacbbce0b6f68f4f4 Mon Sep 17 00:00:00 2001
-From: Jakub Jelinek <jakub@redhat.com>
-Date: Mon, 4 Mar 2024 19:23:02 +0100
-Subject: [PATCH] combine: Fix recent WORD_REGISTER_OPERATIONS check [PR113010]
-
-On Mon, Mar 04, 2024 at 05:18:39PM +0100, Rainer Orth wrote:
-> unfortunately, the patch broke Solaris/SPARC bootstrap
-> (sparc-sun-solaris2.11):
->
-> .../gcc/combine.cc: In function 'rtx_code simplify_comparison(rtx_code, rtx_def**, rtx_def**)':
-> .../gcc/combine.cc:12101:25: error: '*(unsigned int*)((char*)&inner_mode + offsetof(scalar_int_mode, scalar_int_mode::m_mode))' may be used uninitialized [-Werror=maybe-uninitialized]
-> 12101 | scalar_int_mode mode, inner_mode, tmode;
-> | ^~~~~~~~~~
-
-I don't see how it could ever work properly, inner_mode in that spot is
-just uninitialized.
-
-I think we shouldn't worry about paradoxical subregs of non-scalar_int_mode
-REGs/MEMs and for the scalar_int_mode ones should initialize inner_mode
-before we use it.
-Another option would be to use
-maybe_lt (GET_MODE_PRECISION (GET_MODE (SUBREG_REG (op0))), BITS_PER_WORD)
-and
-load_extend_op (GET_MODE (SUBREG_REG (op0))) == ZERO_EXTEND,
-or set machine_mode smode = GET_MODE (SUBREG_REG (op0)); and use it in
-those two spots.
-
-2024-03-04 Jakub Jelinek <jakub@redhat.com>
-
- PR rtl-optimization/113010
- * combine.cc (simplify_comparison): Guard the
- WORD_REGISTER_OPERATIONS check on scalar_int_mode of SUBREG_REG
- and initialize inner_mode.
---- a/gcc/combine.cc
-+++ b/gcc/combine.cc
-@@ -12554,6 +12554,8 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1)
- if (paradoxical_subreg_p (op0))
- {
- if (WORD_REGISTER_OPERATIONS
-+ && is_a <scalar_int_mode> (GET_MODE (SUBREG_REG (op0)),
-+ &inner_mode)
- && GET_MODE_PRECISION (inner_mode) < BITS_PER_WORD
- /* On WORD_REGISTER_OPERATIONS targets the bits
- beyond sub_mode aren't considered undefined,
---
-2.39.3
diff --git a/sys-devel/lld/Manifest b/sys-devel/lld/Manifest
index 657b9ebf8960..0be728c90c6a 100644
--- a/sys-devel/lld/Manifest
+++ b/sys-devel/lld/Manifest
@@ -8,12 +8,15 @@ DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e06541
DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783
DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c
+DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29
+DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386
DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07
DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1
EBUILD lld-15.0.7.ebuild 2269 BLAKE2B 322d5608e3acfb87bfb720646404ed405a3113c4faf1059428663a50d5566d7842fcff57ccf3aeb5e97b1a9acd4efd862db2368f130e088944ef4f0faf3c90f8 SHA512 e50d1d99fe18b6aba57c06eb6853f3212be1f7b7f2f3c70dcd226a69a4defc753eafcce77eb74f30eaa31b010fa094738718c1cdb23e584ef6e33eb72e536719
EBUILD lld-16.0.6.ebuild 2324 BLAKE2B 9b849aea16a8188e4da4cfcf0c85fb3e997007e1287ec062aee182c7955c7bc78132e761c2611198c7207283fbe930fbee6bdc9a39b922d6d5387bedadaf1b76 SHA512 a7c3d4c1508e5435ba9f6250c6b2fd3157fb4f2c205a6888736f79fa739c59eec3e901927b53af81de3a3c6d4fa5d576be3eaa6ad45c60e5d952ed4ad9706c2f
EBUILD lld-17.0.6.ebuild 2363 BLAKE2B 8ebe513b67f3fb8efd981b97c1f77fe5de2065c363c2b9e99b8836983539fe5637b231e8be2a87713d47b48a49bfde77471ad65fa5166b606df476eca6f94fc1 SHA512 fd63e8600e393ecd95a05a28c8ac0d71b12f5aedcf273f432bea1904165b874ee913afff4aab91c2049aa1eb95c239bca217b84150133b2060f95ea66ce1944e
EBUILD lld-18.1.3.ebuild 2373 BLAKE2B 3c077afb30cf364f50baa371a6df7bfc20ca719ea8fa450d4276cb375b4503a70a4d87488f23e17b304e45daa61ae44a7c8f33da98cbfdedd07a95221ff15719 SHA512 94aa33e741b4a79c864ff0e49ed09fd115cab80612e96712fbb8344d49134d7d7ec2acc4e3526ab3d184f4c703e9290d8124fb15b8dc248f4df23252947f2cc6
+EBUILD lld-18.1.4.ebuild 2373 BLAKE2B 3c077afb30cf364f50baa371a6df7bfc20ca719ea8fa450d4276cb375b4503a70a4d87488f23e17b304e45daa61ae44a7c8f33da98cbfdedd07a95221ff15719 SHA512 94aa33e741b4a79c864ff0e49ed09fd115cab80612e96712fbb8344d49134d7d7ec2acc4e3526ab3d184f4c703e9290d8124fb15b8dc248f4df23252947f2cc6
EBUILD lld-19.0.0.9999.ebuild 2293 BLAKE2B 18ee4d77344d5fd4ad0cab1d0a7d54d02edda3b3969dc9b5fbbb16af1296e4a65be293a0472911598c1cab3e23e45a115495fb1368b3a4db48dc4fdc0c7061e7 SHA512 3ad276dc89c7be26ed0e6c90eb1e8f951b0f6ecf163a6534071f63add887619444fdd8f05135a4e23c195773758320a4aede1683a7d0c4779696b60deef19e40
EBUILD lld-19.0.0_pre20240330.ebuild 2293 BLAKE2B 18ee4d77344d5fd4ad0cab1d0a7d54d02edda3b3969dc9b5fbbb16af1296e4a65be293a0472911598c1cab3e23e45a115495fb1368b3a4db48dc4fdc0c7061e7 SHA512 3ad276dc89c7be26ed0e6c90eb1e8f951b0f6ecf163a6534071f63add887619444fdd8f05135a4e23c195773758320a4aede1683a7d0c4779696b60deef19e40
EBUILD lld-19.0.0_pre20240404.ebuild 2293 BLAKE2B 18ee4d77344d5fd4ad0cab1d0a7d54d02edda3b3969dc9b5fbbb16af1296e4a65be293a0472911598c1cab3e23e45a115495fb1368b3a4db48dc4fdc0c7061e7 SHA512 3ad276dc89c7be26ed0e6c90eb1e8f951b0f6ecf163a6534071f63add887619444fdd8f05135a4e23c195773758320a4aede1683a7d0c4779696b60deef19e40
diff --git a/sys-devel/lld/lld-18.1.4.ebuild b/sys-devel/lld/lld-18.1.4.ebuild
new file mode 100644
index 000000000000..0d20224dc323
--- /dev/null
+++ b/sys-devel/lld/lld-18.1.4.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake flag-o-matic llvm.org llvm-utils python-any-r1 toolchain-funcs
+
+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="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~arm64-macos"
+IUSE="debug test zstd"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ ~sys-devel/llvm-${PV}[debug=,zstd=]
+ sys-libs/zlib:=
+ zstd? ( app-arch/zstd:= )
+"
+RDEPEND="
+ ${DEPEND}
+ !sys-devel/lld:0
+"
+BDEPEND="
+ sys-devel/llvm:${LLVM_MAJOR}
+ test? (
+ $(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.org_set_globals
+
+python_check_deps() {
+ python_has_version ">=dev-python/lit-${PV}[${PYTHON_USEDEP}]"
+}
+
+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_prepend_path "${LLVM_MAJOR}"
+
+ # ODR violations (https://github.com/llvm/llvm-project/issues/83529, bug #922353)
+ filter-lto
+
+ # 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)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ -DPython3_EXECUTABLE="${PYTHON}"
+ )
+
+ tc-is-cross-compiler && mycmakeargs+=(
+ -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen"
+ )
+
+ 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 f6c9239d30c0..def6e1625739 100644
--- a/sys-devel/llvm-common/Manifest
+++ b/sys-devel/llvm-common/Manifest
@@ -7,12 +7,15 @@ DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e06541
DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783
DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c
+DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29
+DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386
DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07
DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1
EBUILD llvm-common-15.0.7.ebuild 1014 BLAKE2B da3b7ec6cd3c1e57758312fb9ea25e693305e1ef72b350eea85fbde5a1e636269d84bd491b6f528aee8a9cb8229f6304b371f99e6ac416c661c6519706b83b61 SHA512 68b9d672372fe71e39f2b8f9d80eb1dcb5138b8b9b961f56a4eeb81b3fc4054448a51a46b3a62547ebb6262425512f39bc146e5f2c3703de10ab520f1594e7a4
EBUILD llvm-common-16.0.6.ebuild 1034 BLAKE2B 1e0a0b6cbb746a7eb45e3f553bc949b69314afc3d913cda004d395e7b322c17f976496eed074cf08718dc2d9efa7f3db81dec4f38394fe6ea2b77793b74f4371 SHA512 8fbb211a6b05d24409642fcb00a4fb798499721cc30c4c5fa2df120ed74d9da7286916cf3788ea26f2cb21e334876417b05a4336fedff99e95d1ebe358f8b311
EBUILD llvm-common-17.0.6.ebuild 1034 BLAKE2B 1e0a0b6cbb746a7eb45e3f553bc949b69314afc3d913cda004d395e7b322c17f976496eed074cf08718dc2d9efa7f3db81dec4f38394fe6ea2b77793b74f4371 SHA512 8fbb211a6b05d24409642fcb00a4fb798499721cc30c4c5fa2df120ed74d9da7286916cf3788ea26f2cb21e334876417b05a4336fedff99e95d1ebe358f8b311
EBUILD llvm-common-18.1.3.ebuild 1041 BLAKE2B 6fd0cd984783dffba5a2d72e77983646fbdcf8f87cb053a5fbf593c8d53faab420d63f820d5e9a08763f33a5514c2bcf3e10387a5d27fff8e6602a97259ecfb3 SHA512 67162ca5f0ff161b155d8eaa8550091debee142e2bb6498440438b3ea96803e5ac79f6aac00da1396ed0cc644a601ef5473cc688cdd43b12ccdb2ffaf1a50369
+EBUILD llvm-common-18.1.4.ebuild 1041 BLAKE2B 6fd0cd984783dffba5a2d72e77983646fbdcf8f87cb053a5fbf593c8d53faab420d63f820d5e9a08763f33a5514c2bcf3e10387a5d27fff8e6602a97259ecfb3 SHA512 67162ca5f0ff161b155d8eaa8550091debee142e2bb6498440438b3ea96803e5ac79f6aac00da1396ed0cc644a601ef5473cc688cdd43b12ccdb2ffaf1a50369
EBUILD llvm-common-19.0.0.9999.ebuild 925 BLAKE2B 18510f8adb0e892eb63bdbf8a6154f56e23ed026ee6f0bf05bbccbafea843beb228bf57e14b01525fb0b067fdfa897faadbfd61179844a7c397c7f1d3b6fca64 SHA512 0cff75fcbabf14ba1526201d65b79486aefaf559accf5bd479a3643c4351ac997f6d55b2323328fabc4009e887e1cfe70681df5593c62a5b5bbfffb8312ea22d
EBUILD llvm-common-19.0.0_pre20240330.ebuild 925 BLAKE2B 18510f8adb0e892eb63bdbf8a6154f56e23ed026ee6f0bf05bbccbafea843beb228bf57e14b01525fb0b067fdfa897faadbfd61179844a7c397c7f1d3b6fca64 SHA512 0cff75fcbabf14ba1526201d65b79486aefaf559accf5bd479a3643c4351ac997f6d55b2323328fabc4009e887e1cfe70681df5593c62a5b5bbfffb8312ea22d
EBUILD llvm-common-19.0.0_pre20240404.ebuild 925 BLAKE2B 18510f8adb0e892eb63bdbf8a6154f56e23ed026ee6f0bf05bbccbafea843beb228bf57e14b01525fb0b067fdfa897faadbfd61179844a7c397c7f1d3b6fca64 SHA512 0cff75fcbabf14ba1526201d65b79486aefaf559accf5bd479a3643c4351ac997f6d55b2323328fabc4009e887e1cfe70681df5593c62a5b5bbfffb8312ea22d
diff --git a/sys-devel/llvm-common/llvm-common-18.1.4.ebuild b/sys-devel/llvm-common/llvm-common-18.1.4.ebuild
new file mode 100644
index 000000000000..32e5c3f51d9b
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-18.1.4.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit elisp-common 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="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="emacs"
+
+RDEPEND="
+ !sys-devel/llvm:0
+"
+BDEPEND="
+ emacs? ( >=app-editors/emacs-23.1:* )
+"
+
+LLVM_COMPONENTS=( llvm/utils )
+llvm.org_set_globals
+
+SITEFILE="50llvm-gentoo.el"
+BYTECOMPFLAGS="-L emacs"
+
+src_compile() {
+ default
+
+ use emacs && elisp-compile emacs/*.el
+}
+
+src_install() {
+ insinto /usr/share/vim/vimfiles
+ doins -r vim/*/
+ # some users may find it useful
+ newdoc vim/README README.vim
+ dodoc vim/vimrc
+
+ if use emacs ; then
+ elisp-install llvm emacs/*.{el,elc}
+ elisp-make-site-file "${SITEFILE}" llvm
+ fi
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/sys-devel/llvm/Manifest b/sys-devel/llvm/Manifest
index cb4250031053..7cceb9b690d9 100644
--- a/sys-devel/llvm/Manifest
+++ b/sys-devel/llvm/Manifest
@@ -14,12 +14,15 @@ DIST llvm-project-17.0.6.src.tar.xz 127838860 BLAKE2B d6ede1a9fda8756995c3e06541
DIST llvm-project-17.0.6.src.tar.xz.sig 438 BLAKE2B 186e75b6a0fbfe1e85408589c149e1800fcc47d685b74e4260018e05cd08bc793d1d1197c9c50e177eea941a3d0c65cb0c583ce6dae449099b920adf8a508ef7 SHA512 f78c55053a6450625f3e95f52c305110b4468a9854fec75831b65b8d6ceee3c9206ab9e63c4b5fda8be9bd344f72cfbdaae0520ed240abd505e08ebeaa25d340
DIST llvm-project-18.1.3.src.tar.xz 132049300 BLAKE2B 0681177cfe6a65f5cf11942381078388e8f5d9d5a4bb50b040e4c10a3898e7311ff379fcca008e82e4bef225792a38eb77f722c972725b9251a0fda29d8d7ecc SHA512 b8b8a00c560bc7d4c4b5d533b92dbd52f2c0254f0acf687e787e8b7fa780cd5d96f6e9709356d2c406c0b36b186dee4de6b1bc1928a97de0bda863fa873e0783
DIST llvm-project-18.1.3.src.tar.xz.sig 566 BLAKE2B dcecf41346cc864c6e5bedd3a7db3db4f32a68534364d2537a15ca7e4e2f2d35a22722385ac556d2a4ac48ab37567566094f223534e696299f98040e702146d0 SHA512 b7e50779841891e9ed9de5ed917c5be3209a52a5d98c67a032509ae8fad8a2a882bf619c66d2ee45bb53dfb03d750cb94dc4b2750ec2a8edb0465700d5bc657c
+DIST llvm-project-18.1.4.src.tar.xz 132054668 BLAKE2B 94bbad3b185fd07cbace4eff79aba80fbdd5e072739250e3927fe1848bcf3f8d355eb1f384e57306707eb702acc7ab01b732590735be7950221607664d04b0a6 SHA512 b1b214ae91f3705d8ea345547ad53f1e5d7d884c1eb6958bc41c14ac4b3e407771ccc2b693686ff103c8232c2c3942731d6db9a9cb4f735e6c6a0674739d0b29
+DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B b74fd219d7bcdf197b4e711cfbb25c40e9d8d2c7341de0215d8c31f330f396e9c166ff63513829cdc9cef349f08238f66a4dc949fa97958a7af496abae369eaa SHA512 4f456edf4fb454815acaef6855b1a0991f229810a32e9369af83388e37f0ef8964308e1e93bd6216024cdd67e86caaadc8d5794467857cc6fe561c9fa6ca7386
DIST llvm-project-a8b0ecd2605ff23f495a8af64e06c35f86834e54.tar.gz 208451583 BLAKE2B 3f8557637b9d10ed924cfec0b3e83d85996417df24b317cac55740aa199ef97cf7560fe634debd1dbfc7c9fc25aa2b2643fccaecc4c866481dc57b11eba1d02f SHA512 1f4bf5a8a59582af426ad13cc828e1e482c5c831ed5a4bb0da419ed3cf67e5e485fd36074603ad22328e35be44b8ccd2d92d1382bc7a228fdf38d458a2321e07
DIST llvm-project-ee284d2da0720dc21191d6f545504cbfcf5dcbcf.tar.gz 208883034 BLAKE2B e37c9f1a6a4d0caa9a3091f979dd09f509d458f8b7b30286c77dd2385aea748b7aac6dd488c79573f82feb655aa321717bd2fb46bba4a12b388b52064f6e13bf SHA512 1335ade87cd2accc47ac47ed2ab302999e375808b158b6c9d31fac9059cbb992d2bdaaadf1fd9a1b37268c1123d43346ea4d150894d6d2e6f80ba790b65b93b1
EBUILD llvm-15.0.7-r3.ebuild 12592 BLAKE2B 81cd473990810203c4e8a47ceb0189ed399c869b85fab3181724dbd1429063cdaad1f6b6cb1ab5b392f531b0b4907cc61f266558b873b236f9a3ff439045aa37 SHA512 2321f9e6da93af22d5f074175a6a92b7dcd271e2b9b92128d268dd777a9c3bdd876010740153734e2593b90d26a58d4f784b2256a6b1e18160d13b3c10441fb3
EBUILD llvm-16.0.6.ebuild 12822 BLAKE2B fe0a8bca0506827f09ea9edc18e8574443af644540cec84126fa3668ca8fa538a103c76315ee7c61b0af67a1391168ae7b04201e7825958a46fe8642a327e93b SHA512 a1a861d11791cb583dc33b9c71a86bd50690ffb8b743a6bccf8b4600976f48e96a2b4171cc9b449c17c8b0516ef440cee89df8cff97a3c691968b3431a149612
EBUILD llvm-17.0.6.ebuild 13293 BLAKE2B 50e4212c63f1561f4fc8397a831f83bd3ea370349fa3b6239dfe2f9212757f6e8d5bb1921b8714680fe94d0f02ca523d289447b1396124aa94f91b539aabb17a SHA512 5b2b1d2293cf00d0c547a06111a0af706b2cad1f7cb5f2cc421f54a129c165560adbba4342d9bea486d5b2474a1eed066f1ae955a89133cd94b61a62313980bb
EBUILD llvm-18.1.3.ebuild 13353 BLAKE2B 876a80da23376e127e1196a427a50771f5410e697a724dd8f704b018aa6677cb08c6a1819f56918e1bcc7a293701afb01afe86aa3baf363b7383247939863d9f SHA512 f8831179105275eff18ef19f777c6286efc64249376a274a3a5521d310610d99af5fb7e6741d3321ccf1d3c27e89a7caa2520c6c56c24f534e7f04db5f777f1f
+EBUILD llvm-18.1.4.ebuild 13353 BLAKE2B 876a80da23376e127e1196a427a50771f5410e697a724dd8f704b018aa6677cb08c6a1819f56918e1bcc7a293701afb01afe86aa3baf363b7383247939863d9f SHA512 f8831179105275eff18ef19f777c6286efc64249376a274a3a5521d310610d99af5fb7e6741d3321ccf1d3c27e89a7caa2520c6c56c24f534e7f04db5f777f1f
EBUILD llvm-19.0.0.9999.ebuild 13238 BLAKE2B cd2c461147c5f02904c3fb693d4a47367dc986bb9a6f127761f7dc4cc1a32b2a95da8fedea345dec7ab8afabe5dac94dd0eecd84a963dbbdf3ef12fc4eaa8e8c SHA512 a800a86ea3636eb3dd971d4782e93a0d98c6928a5bb9603d7b9ad95ce675cd1fbe0e5b4f9aa2a6c961b8d172003320f38fd980ca032219e9e6a0cf142c459ec4
EBUILD llvm-19.0.0_pre20240330.ebuild 13238 BLAKE2B cd2c461147c5f02904c3fb693d4a47367dc986bb9a6f127761f7dc4cc1a32b2a95da8fedea345dec7ab8afabe5dac94dd0eecd84a963dbbdf3ef12fc4eaa8e8c SHA512 a800a86ea3636eb3dd971d4782e93a0d98c6928a5bb9603d7b9ad95ce675cd1fbe0e5b4f9aa2a6c961b8d172003320f38fd980ca032219e9e6a0cf142c459ec4
EBUILD llvm-19.0.0_pre20240404.ebuild 13238 BLAKE2B cd2c461147c5f02904c3fb693d4a47367dc986bb9a6f127761f7dc4cc1a32b2a95da8fedea345dec7ab8afabe5dac94dd0eecd84a963dbbdf3ef12fc4eaa8e8c SHA512 a800a86ea3636eb3dd971d4782e93a0d98c6928a5bb9603d7b9ad95ce675cd1fbe0e5b4f9aa2a6c961b8d172003320f38fd980ca032219e9e6a0cf142c459ec4
diff --git a/sys-devel/llvm/llvm-18.1.4.ebuild b/sys-devel/llvm/llvm-18.1.4.ebuild
new file mode 100644
index 000000000000..8c3d70f01423
--- /dev/null
+++ b/sys-devel/llvm/llvm-18.1.4.ebuild
@@ -0,0 +1,548 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
+inherit 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="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos"
+IUSE="
+ +binutils-plugin debug debuginfod doc exegesis libedit +libffi
+ ncurses test xml z3 zstd
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ sys-libs/zlib:0=[${MULTILIB_USEDEP}]
+ debuginfod? (
+ net-misc/curl:=
+ dev-cpp/cpp-httplib:=
+ )
+ 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}] )
+ 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
+ sys-devel/gnuconfig
+ kernel_Darwin? (
+ <sys-libs/libcxx-${LLVM_VERSION}.9999
+ )
+ 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 third-party )
+LLVM_MANPAGES=1
+LLVM_USE_TARGETS=provide
+llvm.org_set_globals
+
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" doc? ( "
+BDEPEND+="
+ $(python_gen_any_dep '
+ dev-python/myst-parser[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ ')
+"
+[[ -n ${LLVM_MANPAGE_DIST} ]] && BDEPEND+=" ) "
+
+python_check_deps() {
+ llvm_are_manpages_built || return 0
+
+ python_has_version -b "dev-python/myst-parser[${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)
+ ;;
+ # used by lldb
+ LLVMDebuginfod)
+ ;;
+ # testing libraries
+ LLVMTestingAnnotations|LLVMTestingSupport)
+ ;;
+ # 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
+
+ # testing libraries
+ llvm_gtest
+ llvm_gtest_main
+ LLVMTestingAnnotations
+ LLVMTestingSupport
+ )
+
+ if multilib_is_native_abi; then
+ out+=(
+ # library used by lldb
+ LLVMDebuginfod
+
+ # 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-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-readtapi
+ llvm-reduce
+ llvm-remarkutil
+ llvm-rtdyld
+ llvm-sim
+ llvm-size
+ llvm-split
+ llvm-stress
+ llvm-strings
+ llvm-strip
+ llvm-symbolizer
+ 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
+ )
+ use debuginfod && out+=(
+ llvm-debuginfod
+ )
+ fi
+
+ printf "%s${sep}" "${out[@]}"
+}
+
+multilib_src_configure() {
+ if use ppc && tc-is-gcc && [[ $(gcc-major-version) -lt 14 ]]; then
+ # Workaround for bug #880677
+ append-flags $(test-flags-CXX -fno-ipa-sra -fno-ipa-modref -fno-ipa-icf)
+ fi
+
+ # ODR violations (bug #917536, bug #926529). Just do it for GCC for now
+ # to avoid people grumbling. GCC is, anecdotally, more likely to miscompile
+ # LLVM with LTO anyway (which is not necessarily its fault).
+ tc-is-gcc && filter-lto
+
+ 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=ON
+ -DLLVM_BUILD_TESTS=$(usex test)
+ -DLLVM_INSTALL_GTEST=ON
+
+ -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_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+ -DLLVM_ENABLE_Z3_SOLVER=$(usex z3)
+ -DLLVM_ENABLE_ZLIB=FORCE_ON
+ -DLLVM_ENABLE_ZSTD=$(usex zstd FORCE_ON OFF)
+ -DLLVM_ENABLE_CURL=$(usex debuginfod)
+ -DLLVM_ENABLE_HTTPLIB=$(usex debuginfod)
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DFFI_INCLUDE_DIR="${ffi_cflags#-I}"
+ -DFFI_LIBRARY_DIR="${ffi_ldflags#-L}"
+
+ -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
+
+ use kernel_Darwin && mycmakeargs+=(
+ # On Macos prefix, Gentoo doesn't split sys-libs/ncurses to libtinfo and
+ # libncurses, but llvm tries to use libtinfo before libncurses, and ends up
+ # using libtinfo (actually, libncurses.dylib) from system instead of prefix
+ -DTerminfo_LIBRARIES=-lncurses
+ # Use our libtool instead of looking it up with xcrun
+ -DCMAKE_LIBTOOL="${EPREFIX}/usr/bin/${CHOST}-libtool"
+ )
+
+ # 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_MAIN_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)"
+}