summaryrefslogtreecommitdiff
path: root/sys-devel/clang-common
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-01-27 20:49:18 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-01-27 20:49:18 +0000
commitc5ee568457ac776b65b71fa444e0dd47535bc44a (patch)
tree1aa40f593e598d7c8352c1d99a30ff9315e690af /sys-devel/clang-common
parent8eccda982236f2cfe9188bdcaffd9168134f39a9 (diff)
gentoo auto-resync : 27:01:2023 - 20:49:18
Diffstat (limited to 'sys-devel/clang-common')
-rw-r--r--sys-devel/clang-common/Manifest2
-rw-r--r--sys-devel/clang-common/clang-common-16.0.0_pre20230127.ebuild168
2 files changed, 170 insertions, 0 deletions
diff --git a/sys-devel/clang-common/Manifest b/sys-devel/clang-common/Manifest
index 25317b11565c..6848011dc4da 100644
--- a/sys-devel/clang-common/Manifest
+++ b/sys-devel/clang-common/Manifest
@@ -2,6 +2,7 @@ DIST llvm-project-14.0.6.src.tar.xz 105618228 BLAKE2B ee67c5407df8cef493b9c0004f
DIST llvm-project-14.0.6.src.tar.xz.sig 566 BLAKE2B cb658ad43d8ab6c43a5773aedadf0569c97b5ee4b1bd58eceb10e1879a30880c741c3d66bedd462c892309b688fb7b2673115a62d1f74d71ee375a578de9547f SHA512 b4a7b368532a7a4a24376cfa7db8f6d3478f6d4446474342fc00b474ecf466330cd0f16783209263c4c72d5fc7ddedfb11b95578842e700cfb7ee0bb34cc95d6
DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78af36b0826a1dfd9a337992499bf701e33149665bfc47d5e14978e38f342559629a559f8b2ce328705ba34fdf6830f5ae9721a5 SHA512 4836d3603f32e8e54434cbfa8ef33d9d473ac5dc20ebf9c67132653c73f4524931abd1084655eaee5f20bcfcb91bcc4bbc5c4a0b603ad0c9029c556e14dc4c52
DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2
+DIST llvm-project-46d5a57801bc37e5ebb1a4d6b2acc0fa99c01e8d.tar.gz 180436731 BLAKE2B 51c30c3f11dd55a225b8ebe4ded752ce9e8eb58751e7458c29901dbdd3673f94892d337d111d696e779e3f7ef0bca6c7d79709e2072a4bf3a001d8813125d571 SHA512 ebbe0f8becac39d63433dcc3de474c40f1215fc8faab94fa2ba869d28e66b27e4fe088377bd7ae64575a6d7b07017b88bf92e5488a3185a753e647d8da352bbf
DIST llvm-project-6dc85bd3fde7df2999fda07e9e9f2e83d52c6125.tar.gz 175208511 BLAKE2B cf87cf7e9bf7c74aab8ccda0f153369cb81798047fdd48025c3c7030857b128babbaafb667385a5c8e9916e16038b14fee39f1623d329471e73c39c2f2d7bbfa SHA512 e6dc0cacd6c079be8a00364e4c244782d764d9a8d514d65f9078427cb4a0c1663ff88761bfbc1e955a1a990451439110497c2cb7af7f56b2c91f2e9db4389894
DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f
EBUILD clang-common-13.0.1.ebuild 593 BLAKE2B f7d78facc226d949240f31d10bb01f6a2bbe3c806d7f7c22a78d715d29de74723bedccdeefd029d309b090afe63821e10a1bd27662ff156640820fbca1896bab SHA512 48e5c5f3d4716c15018aa246cf61fbf898c4c459b1f04710da155084a8cf5b8a6df7697c300d297ac48ee1a8a8cff9bc9b4fca712455032f78cb26e9f77ef955
@@ -9,5 +10,6 @@ EBUILD clang-common-14.0.6.ebuild 541 BLAKE2B 87b158e874cf600e23591a8095e0edb4d3
EBUILD clang-common-15.0.7-r1.ebuild 4626 BLAKE2B edaacc5b0fed376e342377e2e433838ddf150dc77aea27f32a172e2b23219d9fc3e01ec3cf8e0efb3991987a34b79ab857b9687856bc97119f97eb7e6d8adeb6 SHA512 8ff4b1129e45271e4281813e0bb970e19d74bbe560eb63238eaabeec11a1907cbe24a7252cfcad5fa566c49d95c85212507c1eb0b7be093d6ad2995d966025d4
EBUILD clang-common-16.0.0.9999.ebuild 4686 BLAKE2B c2bf510db70a7708d56746c035eebe20b332ace167138ae5260375dc5bfe15e2b8478692636cca60cebd9ebc2e418324377e3d17ebb49db7e30ecd6ad11e6db3 SHA512 abb81468747c4f83554c35792f6fd1e282b0edfa02a34157c0594cefef42b91c95092b35a88b7b4b7abfb17bff95029065b86f2c2724df5badb5924f915fd63e
EBUILD clang-common-16.0.0_pre20230107-r1.ebuild 4692 BLAKE2B 0628160af123d42ea6cc9a2d39d0115ccc3d0f4461f2bc3b13946d3fb587a100092df73ba512aa016bf359283cf8790cf465cdbf7a230f1cd02e536d570424cd SHA512 08f8ef115f59f74a3b845af7563dbd43819c4fb37ed27a2fc0c65ce3c0f7c7e61eb3617b1e8c54c598d5cff0a1b8988d0ed32f8fa40c6b4428545a5f8f1bf05a
+EBUILD clang-common-16.0.0_pre20230127.ebuild 4686 BLAKE2B c2bf510db70a7708d56746c035eebe20b332ace167138ae5260375dc5bfe15e2b8478692636cca60cebd9ebc2e418324377e3d17ebb49db7e30ecd6ad11e6db3 SHA512 abb81468747c4f83554c35792f6fd1e282b0edfa02a34157c0594cefef42b91c95092b35a88b7b4b7abfb17bff95029065b86f2c2724df5badb5924f915fd63e
EBUILD clang-common-17.0.0.9999.ebuild 4686 BLAKE2B c2bf510db70a7708d56746c035eebe20b332ace167138ae5260375dc5bfe15e2b8478692636cca60cebd9ebc2e418324377e3d17ebb49db7e30ecd6ad11e6db3 SHA512 abb81468747c4f83554c35792f6fd1e282b0edfa02a34157c0594cefef42b91c95092b35a88b7b4b7abfb17bff95029065b86f2c2724df5badb5924f915fd63e
MISC metadata.xml 735 BLAKE2B 12ea133df3d7eb9367a65e572ef91893e654d5b77caa27c66e4b5b41ba90ebc5e619eb78dfff2a67183d2c1cbfcf35fa903b2bb75604ce153d5cedfce5346e3c SHA512 8ed6b12d4f2aa1985897a8d81ce898dbc0d14ac222f3d0f259cbe80fbb8b2349dff7677627daeaf39a422f290200da4fac6348abc81c9e35da0ca73a11cfdd83
diff --git a/sys-devel/clang-common/clang-common-16.0.0_pre20230127.ebuild b/sys-devel/clang-common/clang-common-16.0.0_pre20230127.ebuild
new file mode 100644
index 000000000000..be17e87b775a
--- /dev/null
+++ b/sys-devel/clang-common/clang-common-16.0.0_pre20230127.ebuild
@@ -0,0 +1,168 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit bash-completion-r1 llvm.org
+
+DESCRIPTION="Common files shared between multiple slots of clang"
+HOMEPAGE="https://llvm.org/"
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0"
+KEYWORDS=""
+IUSE="
+ default-compiler-rt default-libcxx default-lld llvm-libunwind
+ hardened stricter
+"
+
+PDEPEND="
+ sys-devel/clang:*
+ default-compiler-rt? (
+ sys-devel/clang-runtime[compiler-rt]
+ llvm-libunwind? ( sys-libs/llvm-libunwind )
+ !llvm-libunwind? ( sys-libs/libunwind )
+ )
+ !default-compiler-rt? ( sys-devel/gcc )
+ default-libcxx? ( >=sys-libs/libcxx-${PV} )
+ !default-libcxx? ( sys-devel/gcc )
+ default-lld? ( sys-devel/lld )
+ !default-lld? ( sys-devel/binutils )
+"
+IDEPEND="
+ !default-compiler-rt? ( sys-devel/gcc-config )
+ !default-libcxx? ( sys-devel/gcc-config )
+"
+
+LLVM_COMPONENTS=( clang/utils )
+llvm.org_set_globals
+
+pkg_pretend() {
+ [[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return
+
+ local flag missing_flags=()
+ for flag in default-{compiler-rt,libcxx,lld}; do
+ if ! use "${flag}" && has_version "sys-devel/clang[${flag}]"; then
+ missing_flags+=( "${flag}" )
+ fi
+ done
+
+ if [[ ${missing_flags[@]} ]]; then
+ eerror "It seems that you have the following flags set on sys-devel/clang:"
+ eerror
+ eerror " ${missing_flags[*]}"
+ eerror
+ eerror "The default runtimes are now set via flags on sys-devel/clang-common."
+ eerror "The build is being aborted to prevent breakage. Please either set"
+ eerror "the respective flags on this ebuild, e.g.:"
+ eerror
+ eerror " sys-devel/clang-common ${missing_flags[*]}"
+ eerror
+ eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1."
+ die "Mismatched defaults detected between sys-devel/clang and sys-devel/clang-common"
+ fi
+}
+
+src_install() {
+ newbashcomp bash-autocomplete.sh clang
+
+ insinto /etc/clang
+ newins - gentoo-runtimes.cfg <<-EOF
+ # This file is initially generated by sys-devel/clang-runtime.
+ # It is used to control the default runtimes using by clang.
+
+ --rtlib=$(usex default-compiler-rt compiler-rt libgcc)
+ --unwindlib=$(usex default-compiler-rt libunwind libgcc)
+ --stdlib=$(usex default-libcxx libc++ libstdc++)
+ -fuse-ld=$(usex default-lld lld bfd)
+ EOF
+
+ newins - gentoo-gcc-install.cfg <<-EOF
+ # This file is maintained by gcc-config.
+ # It is used to specify the selected GCC installation.
+ EOF
+
+ newins - gentoo-common.cfg <<-EOF
+ # This file contains flags common to clang, clang++ and clang-cpp.
+ @gentoo-runtimes.cfg
+ @gentoo-gcc-install.cfg
+ @gentoo-hardened.cfg
+ EOF
+
+ # Baseline hardening (bug #851111)
+ newins - gentoo-hardened.cfg <<-EOF
+ # Some of these options are added unconditionally, regardless of
+ # USE=hardened, for parity with sys-devel/gcc.
+ -fstack-clash-protection
+ -fstack-protector-strong
+ -fPIE
+ -include "${EPREFIX}/usr/include/gentoo/fortify.h"
+ EOF
+
+ dodir /usr/include/gentoo
+
+ local fortify_level=$(usex hardened 3 2)
+ # We have to do this because glibc's headers warn if F_S is set
+ # without optimization and that would at the very least be very noisy
+ # during builds and at worst trigger many -Werror builds.
+ cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die
+ #ifndef _FORTIFY_SOURCE
+ #if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
+ #define _FORTIFY_SOURCE ${fortify_level}
+ #endif
+ #endif
+ EOF
+
+ if use hardened ; then
+ cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
+ # Options below are conditional on USE=hardened.
+ -D_GLIBCXX_ASSERTIONS
+
+ # Analogue to GLIBCXX_ASSERTIONS
+ # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode
+ -D_LIBCPP_ENABLE_ASSERTIONS=1
+ EOF
+ fi
+
+ if use stricter; then
+ newins - gentoo-stricter.cfg <<-EOF
+ # This file increases the strictness of older clang versions
+ # to match the newest upstream version.
+
+ # clang-16 defaults
+ -Werror=implicit-function-declaration
+ -Werror=implicit-int
+ -Werror=incompatible-function-pointer-types
+
+ # constructs banned by C2x
+ -Werror=deprecated-non-prototype
+
+ # deprecated but large blast radius
+ #-Werror=strict-prototypes
+ EOF
+
+ cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die
+ @gentoo-stricter.cfg
+ EOF
+ fi
+
+ local tool
+ for tool in clang{,++,-cpp}; do
+ newins - "${tool}.cfg" <<-EOF
+ # This configuration file is used by ${tool} driver.
+ @gentoo-common.cfg
+ EOF
+ done
+}
+
+pkg_preinst() {
+ if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc
+ then
+ local gcc_path=$(gcc-config --get-lib-path 2>/dev/null)
+ if [[ -n ${gcc_path} ]]; then
+ cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF
+ --gcc-install-dir="${gcc_path%%:*}"
+ EOF
+ fi
+ fi
+}