summaryrefslogtreecommitdiff
path: root/sys-devel
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-06-04 09:34:05 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-06-04 09:34:05 +0100
commit13b130894803eda558b74353eda3bf7504615b38 (patch)
treeeb6788b9eeef843120928d0df4cd2b5667aeccb3 /sys-devel
parent5c9bbe083a12cfb9666fed4abe5bce219ff2f019 (diff)
gentoo auto-resync : 04:06:2023 - 09:34:05
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/Manifest.gzbin10635 -> 10628 bytes
-rw-r--r--sys-devel/clang-common/Manifest2
-rw-r--r--sys-devel/clang-common/clang-common-17.0.0_pre20230602.ebuild190
-rw-r--r--sys-devel/clang-runtime/Manifest1
-rw-r--r--sys-devel/clang-runtime/clang-runtime-17.0.0_pre20230602.ebuild41
-rw-r--r--sys-devel/clang/Manifest8
-rw-r--r--sys-devel/clang/clang-16.0.4.ebuild4
-rw-r--r--sys-devel/clang/clang-16.0.5.9999.ebuild4
-rw-r--r--sys-devel/clang/clang-16.0.5.ebuild4
-rw-r--r--sys-devel/clang/clang-17.0.0_pre20230602.ebuild480
-rw-r--r--sys-devel/lld/Manifest2
-rw-r--r--sys-devel/lld/lld-17.0.0_pre20230602.ebuild89
-rw-r--r--sys-devel/llvm-common/Manifest2
-rw-r--r--sys-devel/llvm-common/llvm-common-17.0.0_pre20230602.ebuild28
-rw-r--r--sys-devel/llvm/Manifest8
-rw-r--r--sys-devel/llvm/llvm-16.0.4.ebuild4
-rw-r--r--sys-devel/llvm/llvm-16.0.5.9999.ebuild4
-rw-r--r--sys-devel/llvm/llvm-16.0.5.ebuild4
-rw-r--r--sys-devel/llvm/llvm-17.0.0_pre20230602.ebuild533
19 files changed, 1396 insertions, 12 deletions
diff --git a/sys-devel/Manifest.gz b/sys-devel/Manifest.gz
index 78d72821dec0..4c9dd62f6007 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 0fe611a454a7..ddf605d01db5 100644
--- a/sys-devel/clang-common/Manifest
+++ b/sys-devel/clang-common/Manifest
@@ -9,6 +9,7 @@ DIST llvm-project-16.0.4.src.tar.xz.sig 566 BLAKE2B 43cb2147f12f98f864797158e8ef
DIST llvm-project-16.0.5.src.tar.xz 118000368 BLAKE2B 9f84e6bab450dc8d6379771afbca5cddc6fbad6c9728726f7158f290ab87d464ff657e89e1c8fc3c474362cc865ff13c5d55ef758c848ea3e660d732cb2fdefa SHA512 7008e7e9c8c2246fe98ba3f0c0fa91e41c88c4da427bf1cfdcce7ef57e5ea838efe7c58c523a7d1708e70d64a4338afe16d06fba2fc7ac5a6c19ca3d6ee41e99
DIST llvm-project-16.0.5.src.tar.xz.sig 566 BLAKE2B 4c96f294f350e0086f8504a54c3387308c60efb573c8def40aec45b1918d43e36c44bafb0823625b6cefa5d99b3aacd7823d6c92c7a64a737653d5b51839a924 SHA512 4550c7c6a1b6ea603d1499aba5aca746f3948a00e7567604f5e7dc3b215a34357bad382a7ebea1f6cd7952841cb75a0dfbe2c278a8c6fcb630a5035b3e16e869
DIST llvm-project-a2684acfb61d40f441e240035d7f1ba50da637c8.tar.gz 184900914 BLAKE2B fb1f836738415a640bc84283722f6a7355a06bc8ac05b544dd4ad4ac9552dcf70040b82b0493c5b4485b28610412279ec0adcf467e71915167aa7d010c08216e SHA512 c08ff8abc166399e692d3166ccf65eb4b647893cba8ffc10bcda815bc914a944855bac036d6349f6d820a6ff43d5417170e6ff8620d97a2a144a0898e95d09e3
+DIST llvm-project-f9753ef1893c3d953a0244e7935d3997499b079a.tar.gz 185505236 BLAKE2B 570a8937788027ee2cef0dad6be693c57b4a5634c0c1fc2bc1c2f534fb4ae00203f14b1bcf0a0f241e7e1e8c25120dc6ea7ede2a10bed397e1cc377318ebe7a0 SHA512 c12eade7c9790ec2a790017b1451a15f0ff7d1b60879f08a448edcb4f162703650b244fdc2fc284335dff4b2a37ef5d488e0d771abee79b49cac94b9e478f010
EBUILD clang-common-14.0.6.ebuild 541 BLAKE2B 87b158e874cf600e23591a8095e0edb4d30d4482600ef8fe38984e9ba9559e6e2226107cd482f355d950392a6a452e1a8ae79d297d5afc3951a7f1c8f6227b5f SHA512 1bd0481468c278f131ec9f87243927b60a59752f4229450559bf8016e9599155a52593810fcdc1cf0aecd4aa1529e8df300d95123a53de18eb326152caafbbef
EBUILD clang-common-15.0.7-r5.ebuild 5090 BLAKE2B 39974630209630607d10903585223df68cd809fb390fc9eb2a80c4235ce70ae21120083f8eaf749c769a93f738c4e971e31e978dd637a0b87d07260281db4b83 SHA512 6cb37a7eb373d300d165e851e3643fd35e11d78a6a88617b4a8c0063b83558d10d307c32861e9ba2d0ac902c1cd2069ece6bd1446e309a6753f13adf8cd8fa2c
EBUILD clang-common-15.0.7-r6.ebuild 5449 BLAKE2B 34001daa85a7ed75e5b27b2a93d4b7c12a11fcd575a76198937d4214b350f6ec5674c9e856a5b29a7b946c19a77fc818f33b75b82a94861e1c25a19b2c35bf8d SHA512 189e8fe88850fb2d22b39d6d4ed2df7bad0f321c0293823f0a335f10f0f6d29328e57190997da83699c9f34c1ef82ac6f530fd7ac866db2ffa1afde8d2198bb6
@@ -19,4 +20,5 @@ EBUILD clang-common-16.0.5-r1.ebuild 5517 BLAKE2B b6ab86006359b058f3503e0686a9f9
EBUILD clang-common-16.0.5.9999.ebuild 5426 BLAKE2B dbab7084dcf1ec1c79c8f1c9b52733731917e8a98907891ac3498d9614b5762034f3c45ec40e137e34214c1788b5c0f24dc53d39a3ab764800edfbe61dbb7c70 SHA512 cc1a9faaa11de0b0cb484dccca330cc82ed020c21fb3872db58680411ac3f16171ed8569faf9e59eaf713238728c58f737197ebd337fd1fe797a6455a55d1328
EBUILD clang-common-17.0.0.9999.ebuild 5426 BLAKE2B dbab7084dcf1ec1c79c8f1c9b52733731917e8a98907891ac3498d9614b5762034f3c45ec40e137e34214c1788b5c0f24dc53d39a3ab764800edfbe61dbb7c70 SHA512 cc1a9faaa11de0b0cb484dccca330cc82ed020c21fb3872db58680411ac3f16171ed8569faf9e59eaf713238728c58f737197ebd337fd1fe797a6455a55d1328
EBUILD clang-common-17.0.0_pre20230526.ebuild 5426 BLAKE2B dbab7084dcf1ec1c79c8f1c9b52733731917e8a98907891ac3498d9614b5762034f3c45ec40e137e34214c1788b5c0f24dc53d39a3ab764800edfbe61dbb7c70 SHA512 cc1a9faaa11de0b0cb484dccca330cc82ed020c21fb3872db58680411ac3f16171ed8569faf9e59eaf713238728c58f737197ebd337fd1fe797a6455a55d1328
+EBUILD clang-common-17.0.0_pre20230602.ebuild 5426 BLAKE2B dbab7084dcf1ec1c79c8f1c9b52733731917e8a98907891ac3498d9614b5762034f3c45ec40e137e34214c1788b5c0f24dc53d39a3ab764800edfbe61dbb7c70 SHA512 cc1a9faaa11de0b0cb484dccca330cc82ed020c21fb3872db58680411ac3f16171ed8569faf9e59eaf713238728c58f737197ebd337fd1fe797a6455a55d1328
MISC metadata.xml 735 BLAKE2B 12ea133df3d7eb9367a65e572ef91893e654d5b77caa27c66e4b5b41ba90ebc5e619eb78dfff2a67183d2c1cbfcf35fa903b2bb75604ce153d5cedfce5346e3c SHA512 8ed6b12d4f2aa1985897a8d81ce898dbc0d14ac222f3d0f259cbe80fbb8b2349dff7677627daeaf39a422f290200da4fac6348abc81c9e35da0ca73a11cfdd83
diff --git a/sys-devel/clang-common/clang-common-17.0.0_pre20230602.ebuild b/sys-devel/clang-common/clang-common-17.0.0_pre20230602.ebuild
new file mode 100644
index 000000000000..51e0f70c6470
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-17.0.0_pre20230602.ebuild
@@ -0,0 +1,190 @@
+# 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[static-libs] )
+ !llvm-libunwind? ( sys-libs/libunwind[static-libs] )
+ )
+ !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
+ # bug #870001
+ -include "${EPREFIX}/usr/include/gentoo/maybe-stddefs.h"
+ 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
+
+ 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(__OPTIMIZE__) && __OPTIMIZE__ > 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
+ #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 1021f256051b..6ab4e839732e 100644
--- a/sys-devel/clang-runtime/Manifest
+++ b/sys-devel/clang-runtime/Manifest
@@ -6,4 +6,5 @@ EBUILD clang-runtime-16.0.5.9999.ebuild 1369 BLAKE2B f69af454137c9689bebc710a7a6
EBUILD clang-runtime-16.0.5.ebuild 1442 BLAKE2B ccd97064b84899371758ceab7640d2b9a3104e08dccbefc5523062437cec1358ab68773b96bbc8193d8cd52a2bac65e6687cb150127d953aa49ab7f8cb3dbcea SHA512 9b8639788a2bfab9fea6e717e684c4784ae6719ce8d6bb389d16d836df0b43d108be6c649b9aa17dfa60df7b3f490450d4d51e83dd80707467a844871b97535e
EBUILD clang-runtime-17.0.0.9999.ebuild 1369 BLAKE2B f69af454137c9689bebc710a7a6988338bc715c68238367d55b5f01859244954b7ff8719ba285b64e76a578f063ab3f6325d5e9519ef5ebdb31592af1a276225 SHA512 436ecac7bb5ba46ca72ab48ea2bd8e30e2ee180218c0c3f14f41abd4e3b0445655ad033058bb78661b2095c5786ef644b538574d4ae2a9a8ee12fefc179f79db
EBUILD clang-runtime-17.0.0_pre20230526.ebuild 1369 BLAKE2B f69af454137c9689bebc710a7a6988338bc715c68238367d55b5f01859244954b7ff8719ba285b64e76a578f063ab3f6325d5e9519ef5ebdb31592af1a276225 SHA512 436ecac7bb5ba46ca72ab48ea2bd8e30e2ee180218c0c3f14f41abd4e3b0445655ad033058bb78661b2095c5786ef644b538574d4ae2a9a8ee12fefc179f79db
+EBUILD clang-runtime-17.0.0_pre20230602.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_pre20230602.ebuild b/sys-devel/clang-runtime/clang-runtime-17.0.0_pre20230602.ebuild
new file mode 100644
index 000000000000..67b42357665e
--- /dev/null
+++ b/sys-devel/clang-runtime/clang-runtime-17.0.0_pre20230602.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/Manifest b/sys-devel/clang/Manifest
index eff6c52bf298..ea60086d65d2 100644
--- a/sys-devel/clang/Manifest
+++ b/sys-devel/clang/Manifest
@@ -17,14 +17,16 @@ DIST llvm-project-16.0.4.src.tar.xz.sig 566 BLAKE2B 43cb2147f12f98f864797158e8ef
DIST llvm-project-16.0.5.src.tar.xz 118000368 BLAKE2B 9f84e6bab450dc8d6379771afbca5cddc6fbad6c9728726f7158f290ab87d464ff657e89e1c8fc3c474362cc865ff13c5d55ef758c848ea3e660d732cb2fdefa SHA512 7008e7e9c8c2246fe98ba3f0c0fa91e41c88c4da427bf1cfdcce7ef57e5ea838efe7c58c523a7d1708e70d64a4338afe16d06fba2fc7ac5a6c19ca3d6ee41e99
DIST llvm-project-16.0.5.src.tar.xz.sig 566 BLAKE2B 4c96f294f350e0086f8504a54c3387308c60efb573c8def40aec45b1918d43e36c44bafb0823625b6cefa5d99b3aacd7823d6c92c7a64a737653d5b51839a924 SHA512 4550c7c6a1b6ea603d1499aba5aca746f3948a00e7567604f5e7dc3b215a34357bad382a7ebea1f6cd7952841cb75a0dfbe2c278a8c6fcb630a5035b3e16e869
DIST llvm-project-a2684acfb61d40f441e240035d7f1ba50da637c8.tar.gz 184900914 BLAKE2B fb1f836738415a640bc84283722f6a7355a06bc8ac05b544dd4ad4ac9552dcf70040b82b0493c5b4485b28610412279ec0adcf467e71915167aa7d010c08216e SHA512 c08ff8abc166399e692d3166ccf65eb4b647893cba8ffc10bcda815bc914a944855bac036d6349f6d820a6ff43d5417170e6ff8620d97a2a144a0898e95d09e3
+DIST llvm-project-f9753ef1893c3d953a0244e7935d3997499b079a.tar.gz 185505236 BLAKE2B 570a8937788027ee2cef0dad6be693c57b4a5634c0c1fc2bc1c2f534fb4ae00203f14b1bcf0a0f241e7e1e8c25120dc6ea7ede2a10bed397e1cc377318ebe7a0 SHA512 c12eade7c9790ec2a790017b1451a15f0ff7d1b60879f08a448edcb4f162703650b244fdc2fc284335dff4b2a37ef5d488e0d771abee79b49cac94b9e478f010
EBUILD clang-14.0.6-r1.ebuild 12014 BLAKE2B 0f9eed7779a5b9aa8f92002f6f4d8e22e7baf3d3f6d1930e4716abf3aa00d866f68a682dc2a404655f53800e26c8b388da552184da6943287b2d91c5c1c2672b SHA512 c5e46f1044604f4e41cdb6c42d2079096c0bcdd396d99f8e95a6b5b66918e3519e4226741202f716fa5f53295188ec2bfcec66ae32480a8e10b4ab18bdb880ab
EBUILD clang-14.0.6-r4.ebuild 11945 BLAKE2B 1f14f89997a862e04b0d9042c6d9c698c2cd455ab3a7dc3473af08137566e3c26ac05cf818ba8b12113c38cbd0b3c0d48836ed6b13216821614d7eb7eb1260c6 SHA512 37ee0684d6ae0dfb4e8cb0da683dec4996f8bad1762e3d8ffd1e4bf5a01e2c6cc90dac76a26edfb558e458b50be7ac535f71ea2b3578d6e58e388dab9661b27b
EBUILD clang-15.0.7-r1.ebuild 12617 BLAKE2B 780db8dc3c92efab35280d32f6b7d4ffcea912d7839b995a18aa603d0cf59df1199eabd53eb5a475e67da7a45e10fdd08e9879b871a25672f135dbdb001a5f46 SHA512 f6302415c9a4fb8571613ff5ebea4096f1318333ba4bc0f3c0b63b04eb0d10755c4555f55186875db0d34bb5d2c0b245b758aff387b97033bc643a1a291d1195
EBUILD clang-15.0.7-r3.ebuild 12552 BLAKE2B 1702065ffe0da6dbf809a82f0f0ec9e84daf7b0c3c4e9fb6d3c8eb320cf0034bfa6197f70f3752b3b58b841c27a7d8e00ccdd19b68f17a25fb54e203e9a66769 SHA512 f93df89921be88cd2bee7ba7d3aae0013db0b35f3f5e8cfac188fb5462a963afb9ce50b69b2046dbbe50d9bbf77532effb639e129176d986bb0c98d3106da3fb
EBUILD clang-16.0.3.ebuild 12442 BLAKE2B 768d62dbfa26da9aa52240132b767c00f27e905bddbbd5078b507330d06c7033c7f2db06a199c74e20f8a83fcbacb94ec401ff4a7e81256a6a33f7774eaa8209 SHA512 e413717bd5191a054822daa2b8f3bc363b58de267e66046b3908edd8da6714552e039bb23e9d4c613a8e535c2d70e7add72a923f82763365dab00b5252a04be5
-EBUILD clang-16.0.4.ebuild 12373 BLAKE2B 8b0dc7d45d5204d29c4c57a5196690e06bb106d4ea36368f2d4af9eb7c5cf3cc1ddb9f72af8836ce54e709c708c0228c8c25347dee665887d194f65938fe98f3 SHA512 be98425dfb8d5cf7f1201750c46fd1c3cd870aacddf300529c6270708bc636a99cb986af8267735b8be8088184bd168f211ce6ac86c393fcc4c07880554d477d
-EBUILD clang-16.0.5.9999.ebuild 12293 BLAKE2B b854af4222caecd41ed431d560b9311e3bbc23313323cd7bd3f3fe79935d194657a48e0a64ea3303836d79f4117c28029a6b7b9c8fceaeb2551ea5300871ed23 SHA512 5672ff46c5ed3409e651243b815e5492b9d0f76ef6224860ff60f5b887bf5e1a2c77208c058b94534b1bac614bbe00b858b4d94d017c39ec6554c5e714530077
-EBUILD clang-16.0.5.ebuild 12373 BLAKE2B 8b0dc7d45d5204d29c4c57a5196690e06bb106d4ea36368f2d4af9eb7c5cf3cc1ddb9f72af8836ce54e709c708c0228c8c25347dee665887d194f65938fe98f3 SHA512 be98425dfb8d5cf7f1201750c46fd1c3cd870aacddf300529c6270708bc636a99cb986af8267735b8be8088184bd168f211ce6ac86c393fcc4c07880554d477d
+EBUILD clang-16.0.4.ebuild 12448 BLAKE2B 783048eba466468c3a4ab010b08f58cd0577a198f775cffc4448c90c3cf8ac572362c40b845d929a6ea7931bf7b67a18f7a5634be4342be330e568c5f87bc5ac SHA512 e6191f0e4d007158c258bcd6460a3c59a8f5fce00dc90501a578f0662d0b0d28acebd3749fa47b6ad281a9437f8d0ee264c4c3e55c2aac6d058855dd92409029
+EBUILD clang-16.0.5.9999.ebuild 12368 BLAKE2B a34bca1c8ea4969082a6c7df015f186bfad9f322ea6460f155c2f9ef0cabd1f28a6746216fd8da9ddb75dfc1712aaa07108a9efcb2475aa6c7d6d7199daa4f53 SHA512 1108a2f5573df7b41a304115994a46fc4dd86710d9002478502edf5f2858a3cb2883b99560705047738ab0d82973e7bb06b8420a9d49f9eadd0ed44723ac5d76
+EBUILD clang-16.0.5.ebuild 12448 BLAKE2B 783048eba466468c3a4ab010b08f58cd0577a198f775cffc4448c90c3cf8ac572362c40b845d929a6ea7931bf7b67a18f7a5634be4342be330e568c5f87bc5ac SHA512 e6191f0e4d007158c258bcd6460a3c59a8f5fce00dc90501a578f0662d0b0d28acebd3749fa47b6ad281a9437f8d0ee264c4c3e55c2aac6d058855dd92409029
EBUILD clang-17.0.0.9999.ebuild 12284 BLAKE2B b3ed58b37e00f030d9ab4a8d599cfbcdcb78c17a1542e8942602f360b93077997243f68b4dd441133d9aa79d3e687a3692a8ec31c4937ed4b3f1651b1d1b0d3c SHA512 530d877ab7a240de67056c59c6baad288052133c01171ce9c67d12651300cb3dda3258cd92ab8bd319c89ab9856722c54183bb32ab410201ebe778e5e36e4329
EBUILD clang-17.0.0_pre20230526.ebuild 12284 BLAKE2B b3ed58b37e00f030d9ab4a8d599cfbcdcb78c17a1542e8942602f360b93077997243f68b4dd441133d9aa79d3e687a3692a8ec31c4937ed4b3f1651b1d1b0d3c SHA512 530d877ab7a240de67056c59c6baad288052133c01171ce9c67d12651300cb3dda3258cd92ab8bd319c89ab9856722c54183bb32ab410201ebe778e5e36e4329
+EBUILD clang-17.0.0_pre20230602.ebuild 12284 BLAKE2B b3ed58b37e00f030d9ab4a8d599cfbcdcb78c17a1542e8942602f360b93077997243f68b4dd441133d9aa79d3e687a3692a8ec31c4937ed4b3f1651b1d1b0d3c SHA512 530d877ab7a240de67056c59c6baad288052133c01171ce9c67d12651300cb3dda3258cd92ab8bd319c89ab9856722c54183bb32ab410201ebe778e5e36e4329
MISC metadata.xml 1600 BLAKE2B 8e49e099132445cf695e904acad8a699f3d8c4c1e4cd6ba9d0b97180dfa5b67e9c30b00d1e4cb6cd2f61b27f022accc8d6ee889c6569fc58fbc058186ad216fc SHA512 96b7cf4988ff1fd923ec87311caed458b64888b5acaaf20cc1ad893f2a963158f7f59398f9fd4f9e65cab3df265c0d002048ff874f7a76b94f36377bf9e8f5f6
diff --git a/sys-devel/clang/clang-16.0.4.ebuild b/sys-devel/clang/clang-16.0.4.ebuild
index a6f929936e58..df30d842374c 100644
--- a/sys-devel/clang/clang-16.0.4.ebuild
+++ b/sys-devel/clang/clang-16.0.4.ebuild
@@ -5,7 +5,7 @@ EAPI=8
PYTHON_COMPAT=( python3_{9..11} )
-inherit cmake llvm llvm.org multilib multilib-minimal
+inherit cmake flag-o-matic llvm llvm.org multilib multilib-minimal
inherit prefix python-single-r1 toolchain-funcs
DESCRIPTION="C language family frontend for LLVM"
@@ -255,6 +255,8 @@ get_distribution_components() {
}
multilib_src_configure() {
+ tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670
+
local mycmakeargs=(
-DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
diff --git a/sys-devel/clang/clang-16.0.5.9999.ebuild b/sys-devel/clang/clang-16.0.5.9999.ebuild
index 76f5d288b711..8a26831b2e61 100644
--- a/sys-devel/clang/clang-16.0.5.9999.ebuild
+++ b/sys-devel/clang/clang-16.0.5.9999.ebuild
@@ -5,7 +5,7 @@ EAPI=8
PYTHON_COMPAT=( python3_{9..11} )
-inherit cmake llvm llvm.org multilib multilib-minimal
+inherit cmake flag-o-matic llvm llvm.org multilib multilib-minimal
inherit prefix python-single-r1 toolchain-funcs
DESCRIPTION="C language family frontend for LLVM"
@@ -255,6 +255,8 @@ get_distribution_components() {
}
multilib_src_configure() {
+ tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670
+
local mycmakeargs=(
-DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
diff --git a/sys-devel/clang/clang-16.0.5.ebuild b/sys-devel/clang/clang-16.0.5.ebuild
index a6f929936e58..df30d842374c 100644
--- a/sys-devel/clang/clang-16.0.5.ebuild
+++ b/sys-devel/clang/clang-16.0.5.ebuild
@@ -5,7 +5,7 @@ EAPI=8
PYTHON_COMPAT=( python3_{9..11} )
-inherit cmake llvm llvm.org multilib multilib-minimal
+inherit cmake flag-o-matic llvm llvm.org multilib multilib-minimal
inherit prefix python-single-r1 toolchain-funcs
DESCRIPTION="C language family frontend for LLVM"
@@ -255,6 +255,8 @@ get_distribution_components() {
}
multilib_src_configure() {
+ tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670
+
local mycmakeargs=(
-DDEFAULT_SYSROOT=$(usex prefix-guest "" "${EPREFIX}")
-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/llvm/${LLVM_MAJOR}"
diff --git a/sys-devel/clang/clang-17.0.0_pre20230602.ebuild b/sys-devel/clang/clang-17.0.0_pre20230602.ebuild
new file mode 100644
index 000000000000..e22838875809
--- /dev/null
+++ b/sys-devel/clang/clang-17.0.0_pre20230602.ebuild
@@ -0,0 +1,480 @@
+# 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
+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=""
+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/utils
+)
+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
+
+ 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() {
+ 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
+
+ # 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/Manifest b/sys-devel/lld/Manifest
index 7dc9ca7d72eb..cc74a401b5bb 100644
--- a/sys-devel/lld/Manifest
+++ b/sys-devel/lld/Manifest
@@ -9,6 +9,7 @@ DIST llvm-project-16.0.4.src.tar.xz.sig 566 BLAKE2B 43cb2147f12f98f864797158e8ef
DIST llvm-project-16.0.5.src.tar.xz 118000368 BLAKE2B 9f84e6bab450dc8d6379771afbca5cddc6fbad6c9728726f7158f290ab87d464ff657e89e1c8fc3c474362cc865ff13c5d55ef758c848ea3e660d732cb2fdefa SHA512 7008e7e9c8c2246fe98ba3f0c0fa91e41c88c4da427bf1cfdcce7ef57e5ea838efe7c58c523a7d1708e70d64a4338afe16d06fba2fc7ac5a6c19ca3d6ee41e99
DIST llvm-project-16.0.5.src.tar.xz.sig 566 BLAKE2B 4c96f294f350e0086f8504a54c3387308c60efb573c8def40aec45b1918d43e36c44bafb0823625b6cefa5d99b3aacd7823d6c92c7a64a737653d5b51839a924 SHA512 4550c7c6a1b6ea603d1499aba5aca746f3948a00e7567604f5e7dc3b215a34357bad382a7ebea1f6cd7952841cb75a0dfbe2c278a8c6fcb630a5035b3e16e869
DIST llvm-project-a2684acfb61d40f441e240035d7f1ba50da637c8.tar.gz 184900914 BLAKE2B fb1f836738415a640bc84283722f6a7355a06bc8ac05b544dd4ad4ac9552dcf70040b82b0493c5b4485b28610412279ec0adcf467e71915167aa7d010c08216e SHA512 c08ff8abc166399e692d3166ccf65eb4b647893cba8ffc10bcda815bc914a944855bac036d6349f6d820a6ff43d5417170e6ff8620d97a2a144a0898e95d09e3
+DIST llvm-project-f9753ef1893c3d953a0244e7935d3997499b079a.tar.gz 185505236 BLAKE2B 570a8937788027ee2cef0dad6be693c57b4a5634c0c1fc2bc1c2f534fb4ae00203f14b1bcf0a0f241e7e1e8c25120dc6ea7ede2a10bed397e1cc377318ebe7a0 SHA512 c12eade7c9790ec2a790017b1451a15f0ff7d1b60879f08a448edcb4f162703650b244fdc2fc284335dff4b2a37ef5d488e0d771abee79b49cac94b9e478f010
EBUILD lld-14.0.6-r1.ebuild 2009 BLAKE2B 4db1dfc9b1997d31cc68240ae0b05afeae5a6b1cb24a0eb2012bc28b2ac8c0da4b532d270d070db5fd401717320a74b006628c19a12c787e2f9ba2dc24eb25b1 SHA512 73b2f0e7b27497ce9037cd10503b328378ff9a2e32cd36e6e264f5423cd05732da4ea2ef97b637fc344a4f3d5d3597c60dda29dba7eb509391c176d32d53a427
EBUILD lld-15.0.7.ebuild 2262 BLAKE2B 8882ba45692d54840d8a5933910ade614427733f3da2e344cf4df2806c125a783ff3c6ad4a2f76fd577cb4787fe07495c93e981c03f116fa7f383575d59936f7 SHA512 9b08495f068a01e991d200363549d29e9146e8687b297fa06beda90da1da9a793b1ebf512c3dad9bb985518a8fd9d1d13049a90dd8f06d4bc3de97779ff8e6ed
EBUILD lld-16.0.3.ebuild 2239 BLAKE2B 33f554acd6e1db31f9aec3d75b2c43994a95240ba42bcdf7060090231ff6214e896b5fd051fcb513337161cef408014f64391e9ecfcf5269749fcfdb8a3771da SHA512 a06a9e4ff4f9109dd4eb3f3fdb2308b043beca30c016b184a3f77e7c4728161b3a1b4a662fccf102419c4a3aabab9e30db5a3c87448fb8b2a91237bc08e834ea
@@ -17,4 +18,5 @@ EBUILD lld-16.0.5.9999.ebuild 2197 BLAKE2B 0f6db5db6fff4f572187749ab1704fce82e18
EBUILD lld-16.0.5.ebuild 2239 BLAKE2B 33f554acd6e1db31f9aec3d75b2c43994a95240ba42bcdf7060090231ff6214e896b5fd051fcb513337161cef408014f64391e9ecfcf5269749fcfdb8a3771da SHA512 a06a9e4ff4f9109dd4eb3f3fdb2308b043beca30c016b184a3f77e7c4728161b3a1b4a662fccf102419c4a3aabab9e30db5a3c87448fb8b2a91237bc08e834ea
EBUILD lld-17.0.0.9999.ebuild 2157 BLAKE2B dd17cb187ecc5f448245e19ce67fc9abf26bad3fd62b4f999d01defc43b87e8d47f1613212d56e66061f414de947e0e2a9e24aeffd4b4baf947714b5dadb5ba0 SHA512 fca39302715a0c083b24b94336eeb53a376d69e014f49922ce49987ce2a8c591727cdde49fd70ed5067305c807e4445653753efd5900d8bb61e5b47269fd37d6
EBUILD lld-17.0.0_pre20230526.ebuild 2157 BLAKE2B dd17cb187ecc5f448245e19ce67fc9abf26bad3fd62b4f999d01defc43b87e8d47f1613212d56e66061f414de947e0e2a9e24aeffd4b4baf947714b5dadb5ba0 SHA512 fca39302715a0c083b24b94336eeb53a376d69e014f49922ce49987ce2a8c591727cdde49fd70ed5067305c807e4445653753efd5900d8bb61e5b47269fd37d6
+EBUILD lld-17.0.0_pre20230602.ebuild 2157 BLAKE2B dd17cb187ecc5f448245e19ce67fc9abf26bad3fd62b4f999d01defc43b87e8d47f1613212d56e66061f414de947e0e2a9e24aeffd4b4baf947714b5dadb5ba0 SHA512 fca39302715a0c083b24b94336eeb53a376d69e014f49922ce49987ce2a8c591727cdde49fd70ed5067305c807e4445653753efd5900d8bb61e5b47269fd37d6
MISC metadata.xml 299 BLAKE2B 2feead2cd1b35b3a43335ddd7711f8181b52bc63ee7166608914260c67528add5251349063afbef4f8cf0ec09b2cd4c3ffdd90f2c14ed60bb69ebc03888f6333 SHA512 cd745c54ab18d25bdaff18582105072574103a36cfe7c175ef740f266d00e9fc6f44c332904d23b911c939cf5bdf52973b388923099d8dd5dfef3c283b5cb685
diff --git a/sys-devel/lld/lld-17.0.0_pre20230602.ebuild b/sys-devel/lld/lld-17.0.0_pre20230602.ebuild
new file mode 100644
index 000000000000..5d38213eefc3
--- /dev/null
+++ b/sys-devel/lld/lld-17.0.0_pre20230602.ebuild
@@ -0,0 +1,89 @@
+# 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 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=""
+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? (
+ >=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.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}"
+ )
+
+ 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 10e80b3b37a7..1774abe44bf7 100644
--- a/sys-devel/llvm-common/Manifest
+++ b/sys-devel/llvm-common/Manifest
@@ -9,6 +9,7 @@ DIST llvm-project-16.0.4.src.tar.xz.sig 566 BLAKE2B 43cb2147f12f98f864797158e8ef
DIST llvm-project-16.0.5.src.tar.xz 118000368 BLAKE2B 9f84e6bab450dc8d6379771afbca5cddc6fbad6c9728726f7158f290ab87d464ff657e89e1c8fc3c474362cc865ff13c5d55ef758c848ea3e660d732cb2fdefa SHA512 7008e7e9c8c2246fe98ba3f0c0fa91e41c88c4da427bf1cfdcce7ef57e5ea838efe7c58c523a7d1708e70d64a4338afe16d06fba2fc7ac5a6c19ca3d6ee41e99
DIST llvm-project-16.0.5.src.tar.xz.sig 566 BLAKE2B 4c96f294f350e0086f8504a54c3387308c60efb573c8def40aec45b1918d43e36c44bafb0823625b6cefa5d99b3aacd7823d6c92c7a64a737653d5b51839a924 SHA512 4550c7c6a1b6ea603d1499aba5aca746f3948a00e7567604f5e7dc3b215a34357bad382a7ebea1f6cd7952841cb75a0dfbe2c278a8c6fcb630a5035b3e16e869
DIST llvm-project-a2684acfb61d40f441e240035d7f1ba50da637c8.tar.gz 184900914 BLAKE2B fb1f836738415a640bc84283722f6a7355a06bc8ac05b544dd4ad4ac9552dcf70040b82b0493c5b4485b28610412279ec0adcf467e71915167aa7d010c08216e SHA512 c08ff8abc166399e692d3166ccf65eb4b647893cba8ffc10bcda815bc914a944855bac036d6349f6d820a6ff43d5417170e6ff8620d97a2a144a0898e95d09e3
+DIST llvm-project-f9753ef1893c3d953a0244e7935d3997499b079a.tar.gz 185505236 BLAKE2B 570a8937788027ee2cef0dad6be693c57b4a5634c0c1fc2bc1c2f534fb4ae00203f14b1bcf0a0f241e7e1e8c25120dc6ea7ede2a10bed397e1cc377318ebe7a0 SHA512 c12eade7c9790ec2a790017b1451a15f0ff7d1b60879f08a448edcb4f162703650b244fdc2fc284335dff4b2a37ef5d488e0d771abee79b49cac94b9e478f010
EBUILD llvm-common-14.0.6.ebuild 602 BLAKE2B ef26d6ac2606e9a316ddcce442da1762f578ade0346ba2a947fdace5e2020e8841c63d173e42506d23abf6efc062a2edfac0be98a3eefe1f7a29c88702e9f1d5 SHA512 789dad6fdcf9a930ddc1046e7e98ebc1e05b2dd3713bb1ec5b8a5711690d779691c91d1000d9776720b21ed241d2f12c0ae9a8dba0e6a17d0ddf563cdfbe657f
EBUILD llvm-common-15.0.7.ebuild 601 BLAKE2B 3dd38d17640ed52ff0be26db026475a9d0e7e1acebe95043bc6e0e63e32ff4f03c5637a9dcce25987f673962447feb4aa015f8b5b5cb33553dc1a4f843b75399 SHA512 e8a93a72d06810cface48cce2d8f8a890cdf009939a96350a23fe407b064c05a3016c663d11a3866dc2dd0fd87599b5ac234895c8c42c902e9b0cdb37dba7b62
EBUILD llvm-common-16.0.3.ebuild 615 BLAKE2B dddab327388341f3330d7374a76bc1ea144aa5cad62feea34140b5825daf13118ff7185a6c2cce07479c3ca13c3ba8ad7cac7ba71a8b49fdd25a979d899a5b0a SHA512 57e7d90e7fc4f5dd2daddd1c7e8ed7885112120aca2b13b21e2fc719cfe5a87bb640aa67c605827bcd60aa71300abeba937e158ae1a1a16559236ef9e6d18319
@@ -17,4 +18,5 @@ EBUILD llvm-common-16.0.5.9999.ebuild 524 BLAKE2B 381b028d6ad33fa97d2ff250266bd8
EBUILD llvm-common-16.0.5.ebuild 615 BLAKE2B dddab327388341f3330d7374a76bc1ea144aa5cad62feea34140b5825daf13118ff7185a6c2cce07479c3ca13c3ba8ad7cac7ba71a8b49fdd25a979d899a5b0a SHA512 57e7d90e7fc4f5dd2daddd1c7e8ed7885112120aca2b13b21e2fc719cfe5a87bb640aa67c605827bcd60aa71300abeba937e158ae1a1a16559236ef9e6d18319
EBUILD llvm-common-17.0.0.9999.ebuild 524 BLAKE2B 381b028d6ad33fa97d2ff250266bd896153222cb62647bc6c4a9f7493fc96c23faf788ce8a976d35333e8d40e63cad4c3f44322f6a41f1dbe53f9e772c3a40d9 SHA512 9661a9c544d8bf3edf6c24a307324a58652c8635703dcfa008cad96826e3404cbb05e5c95fe7df85ed6d2642e4f83cfff0c9a381b796cc78f560854aa071acbe
EBUILD llvm-common-17.0.0_pre20230526.ebuild 524 BLAKE2B 381b028d6ad33fa97d2ff250266bd896153222cb62647bc6c4a9f7493fc96c23faf788ce8a976d35333e8d40e63cad4c3f44322f6a41f1dbe53f9e772c3a40d9 SHA512 9661a9c544d8bf3edf6c24a307324a58652c8635703dcfa008cad96826e3404cbb05e5c95fe7df85ed6d2642e4f83cfff0c9a381b796cc78f560854aa071acbe
+EBUILD llvm-common-17.0.0_pre20230602.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_pre20230602.ebuild b/sys-devel/llvm-common/llvm-common-17.0.0_pre20230602.ebuild
new file mode 100644
index 000000000000..ce5f03ca34a5
--- /dev/null
+++ b/sys-devel/llvm-common/llvm-common-17.0.0_pre20230602.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/Manifest b/sys-devel/llvm/Manifest
index 5aa6730b8b83..4d3adb985d08 100644
--- a/sys-devel/llvm/Manifest
+++ b/sys-devel/llvm/Manifest
@@ -17,14 +17,16 @@ DIST llvm-project-16.0.4.src.tar.xz.sig 566 BLAKE2B 43cb2147f12f98f864797158e8ef
DIST llvm-project-16.0.5.src.tar.xz 118000368 BLAKE2B 9f84e6bab450dc8d6379771afbca5cddc6fbad6c9728726f7158f290ab87d464ff657e89e1c8fc3c474362cc865ff13c5d55ef758c848ea3e660d732cb2fdefa SHA512 7008e7e9c8c2246fe98ba3f0c0fa91e41c88c4da427bf1cfdcce7ef57e5ea838efe7c58c523a7d1708e70d64a4338afe16d06fba2fc7ac5a6c19ca3d6ee41e99
DIST llvm-project-16.0.5.src.tar.xz.sig 566 BLAKE2B 4c96f294f350e0086f8504a54c3387308c60efb573c8def40aec45b1918d43e36c44bafb0823625b6cefa5d99b3aacd7823d6c92c7a64a737653d5b51839a924 SHA512 4550c7c6a1b6ea603d1499aba5aca746f3948a00e7567604f5e7dc3b215a34357bad382a7ebea1f6cd7952841cb75a0dfbe2c278a8c6fcb630a5035b3e16e869
DIST llvm-project-a2684acfb61d40f441e240035d7f1ba50da637c8.tar.gz 184900914 BLAKE2B fb1f836738415a640bc84283722f6a7355a06bc8ac05b544dd4ad4ac9552dcf70040b82b0493c5b4485b28610412279ec0adcf467e71915167aa7d010c08216e SHA512 c08ff8abc166399e692d3166ccf65eb4b647893cba8ffc10bcda815bc914a944855bac036d6349f6d820a6ff43d5417170e6ff8620d97a2a144a0898e95d09e3
+DIST llvm-project-f9753ef1893c3d953a0244e7935d3997499b079a.tar.gz 185505236 BLAKE2B 570a8937788027ee2cef0dad6be693c57b4a5634c0c1fc2bc1c2f534fb4ae00203f14b1bcf0a0f241e7e1e8c25120dc6ea7ede2a10bed397e1cc377318ebe7a0 SHA512 c12eade7c9790ec2a790017b1451a15f0ff7d1b60879f08a448edcb4f162703650b244fdc2fc284335dff4b2a37ef5d488e0d771abee79b49cac94b9e478f010
EBUILD llvm-14.0.6-r2.ebuild 12389 BLAKE2B 549b4e1c7feceb40c7e5aaa624925ec08627c84236c460f85a044621dc388cfca248f8a311c657a3b3dadbd367472f3c820a635c14246f74fdac98dd2ddf6fd1 SHA512 8559954b641fc007c92d4b3e2fcc129bdd812f974dccf37d74f61cb9d7414e28cbb41d7088767356035b972c1e417561770a89169676841e762e62644c6d0323
EBUILD llvm-14.0.6-r4.ebuild 12320 BLAKE2B 171c0d33e97ea1298768370982a54cf3ca16a223c3778511eb50fe37e256e34c40a2060e70e11be52bf808dc515b3d01378252cc34e173fa0b7753b17e33af36 SHA512 c18ab71a04325b2670df733699da5f5a4a7b414fcfcec00422337831edaf4600faad2ff059867a945be51183446400c21f153c891a4bdcb6c748e44e6bb6b730
EBUILD llvm-15.0.7-r3.ebuild 12493 BLAKE2B 86343f2e904e6e4bbd653656c359470fb94909d48ca2e4f78e1f48bc183fba98c830569e92ac157d8a98471a5500c0a48c3eda3e13bb69d4abc204702a2b865c SHA512 aa7f3438deac9d07bf78dd44e0bc33a1b39f7a3ae4c930ab9908559604b28b3dbd22efbe43152eeeaf36352afff86e3c03ed10717d5e0aa0e983fbafd8aff971
EBUILD llvm-15.0.7.ebuild 12558 BLAKE2B 1f73f500a38ee4e96438a5e478781a562d48e10d550cd6c5beaf37a754ead1f0bedb121be78c6bee229f694cb085ee665f7b33a44eacba0d6eeaa42b545f6ca7 SHA512 92dd8f7f8554ee24978ef4e1409f5356a95455d2b5006da0a5dbf27cc277962916a0e93d2f7630a0eb3a9f3a1167eb9aeec0a319de3637c5762a7c391d3f5330
EBUILD llvm-16.0.3.ebuild 12490 BLAKE2B 95b6ae05f64728668134ff348e5d084346285425e57c69a7345a44f85c832523b1219a76c3b2c6274e190b869569be3f91d9e5c0298e13167f3e6e0e8d676f66 SHA512 eec238ccb340ad901e130d984349ee4a9788bec4cd7def73a6c946becd1b86b74ee044e39cda48f892017a06e2a381a0424caaf44d073a51c64625c3b45411ba
-EBUILD llvm-16.0.4.ebuild 12421 BLAKE2B 49bea7429ddde3c8ba494952394d7f2b40c244cfa67bae63b3b65a24e13e461f57569d2cbcad7576dfed59c3e377b3a9f0e42c7a19fdf8cd577781636773bc8b SHA512 6e618b38abfa2dec9bc20c56ec5457a37d41063d9f3aff0b5f36d540ce7d07abec5e6223168478ff0f581a04deb4f10a9164fa370b8402b16e9ea43eb2da6dbb
-EBUILD llvm-16.0.5.9999.ebuild 12330 BLAKE2B 0ba8d556723f15cedb1c2296653dd33f6143c9c8d918214dc03645b0726b515cbe8221933ae041bec208bb5a5efc92b7797cbec7b8d5a6a195bc07e5c232cc69 SHA512 50483aafb23649384818a248b5d7a01d2788ec4601cf4926329315727d76a67e2515f76bb29c0665e6a537afc87b08c91aab80e6ad2da5a90906d978019c4646
-EBUILD llvm-16.0.5.ebuild 12421 BLAKE2B 49bea7429ddde3c8ba494952394d7f2b40c244cfa67bae63b3b65a24e13e461f57569d2cbcad7576dfed59c3e377b3a9f0e42c7a19fdf8cd577781636773bc8b SHA512 6e618b38abfa2dec9bc20c56ec5457a37d41063d9f3aff0b5f36d540ce7d07abec5e6223168478ff0f581a04deb4f10a9164fa370b8402b16e9ea43eb2da6dbb
+EBUILD llvm-16.0.4.ebuild 12496 BLAKE2B 3d83aae5848d16c823a7d239052fbc1a725884bcca8b66d70fa4386c33a58e6207e3ec2e023f46e93387a185dd34e9e06097f5b5d5f2f49d8d05fbe285db2880 SHA512 8eabe77506d91c5084f3f1cad9f68c5d68c412500fa5b006c84c8fd4572fb78265539cd02e9ebd607bcf1884c10335c675dc2e82bedc7c42006ce9e0b2c48812
+EBUILD llvm-16.0.5.9999.ebuild 12405 BLAKE2B fb6b33189286b3a61c33a847ce720589b0adc0fcf8160d1a7c4a0e602dd7fc76992ebc3e3163a9843af12d6ca322979cc9e33669d7b54d3381a0742106a7623f SHA512 121e92a2acaeb96d2639914a6f2f17a016b196a320e0b1c45987047bea032826630358005a8a6e8dcb86f95bcf1bc5d4796e1380fb49d226f12e977c2557bddf
+EBUILD llvm-16.0.5.ebuild 12496 BLAKE2B 3d83aae5848d16c823a7d239052fbc1a725884bcca8b66d70fa4386c33a58e6207e3ec2e023f46e93387a185dd34e9e06097f5b5d5f2f49d8d05fbe285db2880 SHA512 8eabe77506d91c5084f3f1cad9f68c5d68c412500fa5b006c84c8fd4572fb78265539cd02e9ebd607bcf1884c10335c675dc2e82bedc7c42006ce9e0b2c48812
EBUILD llvm-17.0.0.9999.ebuild 12689 BLAKE2B 188b2dc059691ac3a1d181e8aeeadbe836507ea419f966b12203eb64de15a5c0bed49074e055f91e0e98a07b80bdff355302e4a4b6f27f09ff23753a513848f6 SHA512 9fcda73df117c7fcab2be62ad8f8ed51794c7e247cfab39f2533948a3c105575f75459b6dccca7cdc425a13e45947b13cf40c0e5cf70b771b7755a2063562192
EBUILD llvm-17.0.0_pre20230526.ebuild 12689 BLAKE2B 188b2dc059691ac3a1d181e8aeeadbe836507ea419f966b12203eb64de15a5c0bed49074e055f91e0e98a07b80bdff355302e4a4b6f27f09ff23753a513848f6 SHA512 9fcda73df117c7fcab2be62ad8f8ed51794c7e247cfab39f2533948a3c105575f75459b6dccca7cdc425a13e45947b13cf40c0e5cf70b771b7755a2063562192
+EBUILD llvm-17.0.0_pre20230602.ebuild 12689 BLAKE2B 188b2dc059691ac3a1d181e8aeeadbe836507ea419f966b12203eb64de15a5c0bed49074e055f91e0e98a07b80bdff355302e4a4b6f27f09ff23753a513848f6 SHA512 9fcda73df117c7fcab2be62ad8f8ed51794c7e247cfab39f2533948a3c105575f75459b6dccca7cdc425a13e45947b13cf40c0e5cf70b771b7755a2063562192
MISC metadata.xml 2782 BLAKE2B 4bd546287f630462c3f5d98cbd15a59a4cdef4023f86a5f4fe64fc5f10256cae7014d18823bd0909f4af4e42f299b6e7983c9c3c569cfab1ad38b0160f1eae40 SHA512 6bf1dc4f71f50e1eecc55cbb8366d8ed82a3dd328871acf1d808fc5e3ee4d203d623f81d9968bda45a87c72a2f20ed69b735b0a289b0052b048175cf6502e124
diff --git a/sys-devel/llvm/llvm-16.0.4.ebuild b/sys-devel/llvm/llvm-16.0.4.ebuild
index 2d844e82840c..c72c4d351e80 100644
--- a/sys-devel/llvm/llvm-16.0.4.ebuild
+++ b/sys-devel/llvm/llvm-16.0.4.ebuild
@@ -5,7 +5,7 @@ EAPI=8
PYTHON_COMPAT=( python3_{9..11} )
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
inherit toolchain-funcs
DESCRIPTION="Low Level Virtual Machine"
@@ -325,6 +325,8 @@ get_distribution_components() {
}
multilib_src_configure() {
+ tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670
+
local ffi_cflags ffi_ldflags
if use libffi; then
ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
diff --git a/sys-devel/llvm/llvm-16.0.5.9999.ebuild b/sys-devel/llvm/llvm-16.0.5.9999.ebuild
index 840748f0601b..7898a8cd400c 100644
--- a/sys-devel/llvm/llvm-16.0.5.9999.ebuild
+++ b/sys-devel/llvm/llvm-16.0.5.9999.ebuild
@@ -5,7 +5,7 @@ EAPI=8
PYTHON_COMPAT=( python3_{9..11} )
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
inherit toolchain-funcs
DESCRIPTION="Low Level Virtual Machine"
@@ -325,6 +325,8 @@ get_distribution_components() {
}
multilib_src_configure() {
+ tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670
+
local ffi_cflags ffi_ldflags
if use libffi; then
ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
diff --git a/sys-devel/llvm/llvm-16.0.5.ebuild b/sys-devel/llvm/llvm-16.0.5.ebuild
index 2d844e82840c..c72c4d351e80 100644
--- a/sys-devel/llvm/llvm-16.0.5.ebuild
+++ b/sys-devel/llvm/llvm-16.0.5.ebuild
@@ -5,7 +5,7 @@ EAPI=8
PYTHON_COMPAT=( python3_{9..11} )
-inherit cmake llvm.org multilib-minimal pax-utils python-any-r1
+inherit cmake flag-o-matic llvm.org multilib-minimal pax-utils python-any-r1
inherit toolchain-funcs
DESCRIPTION="Low Level Virtual Machine"
@@ -325,6 +325,8 @@ get_distribution_components() {
}
multilib_src_configure() {
+ tc-is-gcc && filter-lto # GCC miscompiles LLVM, bug #873670
+
local ffi_cflags ffi_ldflags
if use libffi; then
ffi_cflags=$($(tc-getPKG_CONFIG) --cflags-only-I libffi)
diff --git a/sys-devel/llvm/llvm-17.0.0_pre20230602.ebuild b/sys-devel/llvm/llvm-17.0.0_pre20230602.ebuild
new file mode 100644
index 000000000000..c2c2d7c6b628
--- /dev/null
+++ b/sys-devel/llvm/llvm-17.0.0_pre20230602.ebuild
@@ -0,0 +1,533 @@
+# 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
+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=""
+IUSE="
+ +binutils-plugin +debug debuginfod doc exegesis libedit +libffi
+ ncurses test xar 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}] )
+ 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 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)
+ ;;
+ # 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+=(
+ # 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-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
+ )
+ use debuginfod && out+=(
+ llvm-debuginfod
+ )
+ 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=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_ZSTD=$(usex zstd)
+ -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}"
+ # 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)"
+}