summaryrefslogtreecommitdiff
path: root/sys-devel/clang-common
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-10-13 18:18:15 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-10-13 18:18:15 +0100
commitb8330d80ce605a72596ccfa1bfc087b9ded559b8 (patch)
tree209587b26d39505ff0a0c21c2f20ef51652688e9 /sys-devel/clang-common
parent41c2683a5cfac2bd3280dc5d5aaed73b6c377bcf (diff)
gentoo auto-resync : 13:10:2023 - 18:18:15
Diffstat (limited to 'sys-devel/clang-common')
-rw-r--r--sys-devel/clang-common/Manifest4
-rw-r--r--sys-devel/clang-common/clang-common-17.0.3.9999.ebuild (renamed from sys-devel/clang-common/clang-common-17.0.2.9999.ebuild)0
-rw-r--r--sys-devel/clang-common/clang-common-18.0.0_pre20231013.ebuild250
3 files changed, 253 insertions, 1 deletions
diff --git a/sys-devel/clang-common/Manifest b/sys-devel/clang-common/Manifest
index 231134e48e24..8b421d7d86db 100644
--- a/sys-devel/clang-common/Manifest
+++ b/sys-devel/clang-common/Manifest
@@ -9,15 +9,17 @@ DIST llvm-project-17.0.1.src.tar.xz.sig 438 BLAKE2B 3182e3c3a48635fdec39b945ee3b
DIST llvm-project-17.0.2.src.tar.xz 127833708 BLAKE2B fa9e2e48ce1117063f5cef0aeef85ce84b99bd8fae23022572a6f016eff2ffbf8aab6250b0bdb6e0bbea1c4daf10cecceb18e80496260b5aa81086075d503e12 SHA512 4586224c3f547e8065fa4f0ca3629a1dfed868dfc372ab192d8b9384f0f74dc8cb27dcb6269dc4230202e6a524aae852d98b40fa02ed0393086a162387ea7659
DIST llvm-project-17.0.2.src.tar.xz.sig 438 BLAKE2B 3ba5d7a09e9de3f38a6f7b5b771b08b1c4e96ea7eda948cfa679598d240fa5211fd37220fbe09e37682212b17fb71b8b5539475edb8ff46d9767054983f670cb SHA512 234276813e3f4b5ee9b1dc640a613fd2e60f1d659f4e089733278d08dd0e208ad37d4d64c9e1edd420b6b87e112458ecec5f76ed9a243c3023b0adbab19ab909
DIST llvm-project-39fec5457c0925bd39f67f63fe17391584e08258.tar.gz 198361956 BLAKE2B 001b9d9b7997762dcce4f0b1deb94d41c3d840c178ba1e92208782e7e21fdc0041cde359051b2b1b1fc75526ff6504d3b9375ff873831350de359530c944a961 SHA512 b560e71c9855aff9fb5385f9fb30f63fbef074fd695e7cb31847192837a161bfe4808ceb09c514a676ae817616f15fb5a57d325aa9744eaac46b8f4b20b77a13
+DIST llvm-project-5d35273a32d239b7407338e13ed71b59174d6536.tar.gz 198787569 BLAKE2B 7f4f1eb490028e18826a6ebade649a682e433252ceab1f3dcd9e50c34f24e7ef108c3325ec209a4d4fa1ded8e09ebda4980cb9d8ddce8a0d517923d6c38b8f4a SHA512 4d263561fb12cc07a5e8f7ed2f8f22a3645aa959cf963a6a735a9bb93cfc2a51bf7e4d36b54e8425725029cfcfd868dfcc53af95d26d84be72be124d8c564271
DIST llvm-project-f5cb9cb59d7c9c6ac3d5c41c677f68c9b75d34a3.tar.gz 198113948 BLAKE2B 1688920eb790421f4143e92bd7bd26794a2497e7b445dde6d55b59c9df4b1aebb848833c7cb1b7c273c5e002763f2531a341313500ce207242f992dfe343b988 SHA512 9817e8b7adf7c69d673124e8334c3e511dfd1cc386832c52b2fb0f2517475d29cd98513ad87188a962f9697dfac39ea03f5b2db6c549c307cf3d27b1370ffdf3
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-r7.ebuild 5462 BLAKE2B 098697c65115e672a1e878167997d820c93cad6a71c5a1dc17c731a031d37f20e50ef41e2f1d3238bc91065ba23bab5db4ab48e8274be9db3cb086ec6cdf7868 SHA512 7500bf0c4fde82b90aac68d09b95a49c241fae8b0d2340f7780e9baed1c85d855e45c4296a7daaa0b831a07f442e0be4faf6510a335fa5c979b3061e28fdb99d
EBUILD clang-common-16.0.6-r2.ebuild 5523 BLAKE2B d1679b6e4b3f8430b9840c0e43e16d7deaf26990822c4754e906ece5451f142a201d70d8f9207ec461c9be4c28960811bb4c4f3f253c23d2c9abe5e3e66278e3 SHA512 8b9f63bbd13006f1c2e207ba889c3e4a03e8edd63b7c51d4bfa78bb10ccbb6f64636a0ccf2fde91abc43fed16b5c5993375a8bc6226315c80fb9fd3f2d0ebf14
EBUILD clang-common-17.0.1.ebuild 7403 BLAKE2B 35f5e2902195de83791905633e996ae12bbe2b4611ddd300b4674e369cdeb823fbcf9258d765685fc9820999ba720b5c045b05c8f60c478873c5e4bada8ead29 SHA512 ae7f947ac7f8042ce120443c7ffbda45dabee3d089ba534243d3dd333e4f2c22fb720a8f12ff1cee5815fbcf4734ab68b50b82fa38e3edc5c0f8f080d9d4c87b
-EBUILD clang-common-17.0.2.9999.ebuild 7312 BLAKE2B f4b71b9e945ab3077cc6a878db875b42fe5af5eea1a60e440d32084ec50de0d86bcb68f4abda1316cf662a077e2f21330a88a7bc82e629c68062c7ebf6fa3ef6 SHA512 3072535b554289d422363d67c91416b54d007c0ff6f67b7311c558d14ab9201f02b71ad629c872db6fe44b648b44736c412bb6c63f495d4d4ab682f71ca919ea
EBUILD clang-common-17.0.2.ebuild 7403 BLAKE2B 35f5e2902195de83791905633e996ae12bbe2b4611ddd300b4674e369cdeb823fbcf9258d765685fc9820999ba720b5c045b05c8f60c478873c5e4bada8ead29 SHA512 ae7f947ac7f8042ce120443c7ffbda45dabee3d089ba534243d3dd333e4f2c22fb720a8f12ff1cee5815fbcf4734ab68b50b82fa38e3edc5c0f8f080d9d4c87b
+EBUILD clang-common-17.0.3.9999.ebuild 7312 BLAKE2B f4b71b9e945ab3077cc6a878db875b42fe5af5eea1a60e440d32084ec50de0d86bcb68f4abda1316cf662a077e2f21330a88a7bc82e629c68062c7ebf6fa3ef6 SHA512 3072535b554289d422363d67c91416b54d007c0ff6f67b7311c558d14ab9201f02b71ad629c872db6fe44b648b44736c412bb6c63f495d4d4ab682f71ca919ea
EBUILD clang-common-18.0.0.9999.ebuild 7315 BLAKE2B 00a7319ea073ee22b56e5299c97c083444fffaa8739fa420c79368fd5c6217c3333b616a7c347276797baef3a586069c879f08061cd01c2b73e222b779d74928 SHA512 6948e83aab799aec9835d11cbef96809cc0d4e9205a8b49770dab92ca0f9430989130e553ef56263dd5362e9419e7f2c1945987f538ebe212112b504fe04ff35
EBUILD clang-common-18.0.0_pre20230925.ebuild 7315 BLAKE2B 00a7319ea073ee22b56e5299c97c083444fffaa8739fa420c79368fd5c6217c3333b616a7c347276797baef3a586069c879f08061cd01c2b73e222b779d74928 SHA512 6948e83aab799aec9835d11cbef96809cc0d4e9205a8b49770dab92ca0f9430989130e553ef56263dd5362e9419e7f2c1945987f538ebe212112b504fe04ff35
EBUILD clang-common-18.0.0_pre20231002.ebuild 7315 BLAKE2B 00a7319ea073ee22b56e5299c97c083444fffaa8739fa420c79368fd5c6217c3333b616a7c347276797baef3a586069c879f08061cd01c2b73e222b779d74928 SHA512 6948e83aab799aec9835d11cbef96809cc0d4e9205a8b49770dab92ca0f9430989130e553ef56263dd5362e9419e7f2c1945987f538ebe212112b504fe04ff35
+EBUILD clang-common-18.0.0_pre20231013.ebuild 7315 BLAKE2B 00a7319ea073ee22b56e5299c97c083444fffaa8739fa420c79368fd5c6217c3333b616a7c347276797baef3a586069c879f08061cd01c2b73e222b779d74928 SHA512 6948e83aab799aec9835d11cbef96809cc0d4e9205a8b49770dab92ca0f9430989130e553ef56263dd5362e9419e7f2c1945987f538ebe212112b504fe04ff35
MISC metadata.xml 735 BLAKE2B 12ea133df3d7eb9367a65e572ef91893e654d5b77caa27c66e4b5b41ba90ebc5e619eb78dfff2a67183d2c1cbfcf35fa903b2bb75604ce153d5cedfce5346e3c SHA512 8ed6b12d4f2aa1985897a8d81ce898dbc0d14ac222f3d0f259cbe80fbb8b2349dff7677627daeaf39a422f290200da4fac6348abc81c9e35da0ca73a11cfdd83
diff --git a/sys-devel/clang-common/clang-common-17.0.2.9999.ebuild b/sys-devel/clang-common/clang-common-17.0.3.9999.ebuild
index e3a7af989d05..e3a7af989d05 100644
--- a/sys-devel/clang-common/clang-common-17.0.2.9999.ebuild
+++ b/sys-devel/clang-common/clang-common-17.0.3.9999.ebuild
diff --git a/sys-devel/clang-common/clang-common-18.0.0_pre20231013.ebuild b/sys-devel/clang-common/clang-common-18.0.0_pre20231013.ebuild
new file mode 100644
index 000000000000..baa1dffade6a
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-18.0.0_pre20231013.ebuild
@@ -0,0 +1,250 @@
+# Copyright 1999-2023 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=""
+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}[static-libs] )
+ !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
+}
+
+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
+
+ 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
+}
+
+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.
+ -fstack-clash-protection
+ -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ 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
+ 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(__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
+
+ 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_ENABLE_HARDENED_MODE=1
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-hardened-ld.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ -Wl,-z,now
+ 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
+
+ # 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.
+ doclang_cfg "${CHOST}"
+
+ # 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
+}
+
+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
+}