From ebc282ef4dfa408accac685565b8ee5f6faec119 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 12 Feb 2023 09:56:54 +0000 Subject: gentoo auto-resync : 12:02:2023 - 09:56:54 --- sys-devel/clang-common/Manifest | 9 +- .../clang-common-16.0.0_pre20230107-r2.ebuild | 169 --------------------- .../clang-common-16.0.0_pre20230127-r1.ebuild | 169 --------------------- .../clang-common/clang-common-16.0.0_rc2.ebuild | 168 ++++++++++++++++++++ .../clang-common-17.0.0_pre20230211.ebuild | 168 ++++++++++++++++++++ 5 files changed, 341 insertions(+), 342 deletions(-) delete mode 100644 sys-devel/clang-common/clang-common-16.0.0_pre20230107-r2.ebuild delete mode 100644 sys-devel/clang-common/clang-common-16.0.0_pre20230127-r1.ebuild create mode 100644 sys-devel/clang-common/clang-common-16.0.0_rc2.ebuild create mode 100644 sys-devel/clang-common/clang-common-17.0.0_pre20230211.ebuild (limited to 'sys-devel/clang-common') diff --git a/sys-devel/clang-common/Manifest b/sys-devel/clang-common/Manifest index 42ce40fe164c..3b399f52f0b0 100644 --- a/sys-devel/clang-common/Manifest +++ b/sys-devel/clang-common/Manifest @@ -5,14 +5,15 @@ DIST llvm-project-15.0.7.src.tar.xz 110936452 BLAKE2B f3d277e2029157329e5be78b78 DIST llvm-project-15.0.7.src.tar.xz.sig 566 BLAKE2B 47dc8c82d86237b80c6d85f83a6c9a6e9e174cf8e7f367b071e0cd9481d7cd408e991337c5624e07f3f370f26387c814f212808575ed1c1b58404d3e3836b7df SHA512 fc6891b440dd1175eb8df3790590af8d36bc92301660f84744ae15123475aeb900a151e6a8e7998ded27ec4d86871903ad0b89cd61164943054c2e3bc8d8beb2 DIST llvm-project-16.0.0rc1.src.tar.xz 118364920 BLAKE2B 449fa321722e77d1a595d0f1f52a4e9492954d928355402f6e07e6c8a20e4ebfc03690ef8272b92eb5cdd58c97ca37fa6baf847d399e36a84e3ea7d94d1ea6ca SHA512 a24074ea8e21af49b0545f02bdec4727e8df841e59340dc189cc5a144a70fc6880e82381fba622ac62c7504f7bf394c916c773ee25904e8faf41eaedce6ae9e0 DIST llvm-project-16.0.0rc1.src.tar.xz.sig 566 BLAKE2B 29a593f74b05ef6268f0b2ee5ebd810a244e7c6b27dd94f709b22bca8e6c8367f8321a6ec61f85476cd399f31519ac2a3c978014afae29490c1e70d26eb6c35f SHA512 dcca03d41ee3cc7d5b150184b03eb9f2e579603ce9cd5289360d1ca47169174afc26a85079cf096ec91e23f487f0b38bb6cd5fb7e5197530582155b16a5ce748 -DIST llvm-project-46d5a57801bc37e5ebb1a4d6b2acc0fa99c01e8d.tar.gz 180436731 BLAKE2B 51c30c3f11dd55a225b8ebe4ded752ce9e8eb58751e7458c29901dbdd3673f94892d337d111d696e779e3f7ef0bca6c7d79709e2072a4bf3a001d8813125d571 SHA512 ebbe0f8becac39d63433dcc3de474c40f1215fc8faab94fa2ba869d28e66b27e4fe088377bd7ae64575a6d7b07017b88bf92e5488a3185a753e647d8da352bbf -DIST llvm-project-6dc85bd3fde7df2999fda07e9e9f2e83d52c6125.tar.gz 175208511 BLAKE2B cf87cf7e9bf7c74aab8ccda0f153369cb81798047fdd48025c3c7030857b128babbaafb667385a5c8e9916e16038b14fee39f1623d329471e73c39c2f2d7bbfa SHA512 e6dc0cacd6c079be8a00364e4c244782d764d9a8d514d65f9078427cb4a0c1663ff88761bfbc1e955a1a990451439110497c2cb7af7f56b2c91f2e9db4389894 +DIST llvm-project-16.0.0rc2.src.tar.xz 117917640 BLAKE2B 92c6b1daaa500339403dcf530efb23e1d869c7b9cd8677a6680e57d5d087fb54182f009d58bdda714b62a5866d7fe3b10deedc1e251fffdaae513706d95325af SHA512 c68bb7f2a8004666ecc5c55e89e2ca1252b384e6240a2b7c5588b74794ffc6ce93bb4b0db394abba6436cce04a6de301e80821aeda04d7aab49efb96b6f8cf40 +DIST llvm-project-16.0.0rc2.src.tar.xz.sig 566 BLAKE2B 35b2a8edf3392e1c0e9bf7f1a5e6e18fdda3d98a2164947cebf0c19d7d7c7a459901060345745dff794cf99bea243fec5cb625ca68d7c73d31ac01f18cbaa58c SHA512 4f6d43f00c3bce36c3a005441473fe37fe2ca97df4b8dd306045bd0d8bd14406ae7068a3dea54d4535eaa37b7ccca54b3f5b6f5aef70a7dfc23ed336d4ad408c +DIST llvm-project-22fb66eb94b643c858c2beecbcfac438a7fa29ed.tar.gz 179795537 BLAKE2B aef57ef739c52a8f8b2b327a8f6d8cce4734d9704018fb43a21468e56748e5d5b3d2d47fb4e95fd72b2af9f2e4be88839553e26fd7da08df60c5cc0f51c001d4 SHA512 9ed093ef7dac4891660aafbc5cad66bddefa796bff4dd70c792cc636268742142d82b84520ac2f5a5963521d7b9e4325440763ce0c88937f89722f07d3acd4b8 EBUILD clang-common-14.0.6.ebuild 541 BLAKE2B 87b158e874cf600e23591a8095e0edb4d30d4482600ef8fe38984e9ba9559e6e2226107cd482f355d950392a6a452e1a8ae79d297d5afc3951a7f1c8f6227b5f SHA512 1bd0481468c278f131ec9f87243927b60a59752f4229450559bf8016e9599155a52593810fcdc1cf0aecd4aa1529e8df300d95123a53de18eb326152caafbbef EBUILD clang-common-15.0.7-r2.ebuild 4709 BLAKE2B 45c3f8fc620d93c68140ec3f86744524b706555213599fdfaf8ee6d1109cf71ca15d09400e3d080d7099355b4ac3c83a645c7d17f5ff9967cd77147f2b4fb890 SHA512 130d2f15aef579a2942bf61d6b8062dfba930c3413910b4634bc8032c452ef4627fadbb930b3a4c76fe57d870fe21b1c812f58945b9eea4c63bd6a821e2377dc EBUILD clang-common-16.0.0.9999.ebuild 4686 BLAKE2B c2bf510db70a7708d56746c035eebe20b332ace167138ae5260375dc5bfe15e2b8478692636cca60cebd9ebc2e418324377e3d17ebb49db7e30ecd6ad11e6db3 SHA512 abb81468747c4f83554c35792f6fd1e282b0edfa02a34157c0594cefef42b91c95092b35a88b7b4b7abfb17bff95029065b86f2c2724df5badb5924f915fd63e -EBUILD clang-common-16.0.0_pre20230107-r2.ebuild 4775 BLAKE2B a447dc18e3e97c9cac00ba882fc3c37aa6fefd58592c9b0b389ebf67a9faf64f1872cb868f8c0154d644eb2c7df32860b3c032d464ee2414d186a35cf8135151 SHA512 e763587e1bd2954c0c813295b1e08ca944041346b99904bc05857dbc086832606b62738d122f1328804c9616cfd90827397c82b510c9291c78b797071e525932 -EBUILD clang-common-16.0.0_pre20230127-r1.ebuild 4769 BLAKE2B 3896d2e63855bc296138b7a9eff2cd7ff21ecb184e1ae9f152def1c5eb9158becd3d1d8c557cf6b9db42aa53273df81c402f31a78c9f8502caec9938b493040d SHA512 65f2b422c0953218b85fe3dbf316692929edfe62a345e75888fe81d82506b9e1c3ce18948401efefb97ef335a40e527a0887eb58531bf9e4c9c350d816740db3 EBUILD clang-common-16.0.0_rc1-r1.ebuild 4775 BLAKE2B a447dc18e3e97c9cac00ba882fc3c37aa6fefd58592c9b0b389ebf67a9faf64f1872cb868f8c0154d644eb2c7df32860b3c032d464ee2414d186a35cf8135151 SHA512 e763587e1bd2954c0c813295b1e08ca944041346b99904bc05857dbc086832606b62738d122f1328804c9616cfd90827397c82b510c9291c78b797071e525932 +EBUILD clang-common-16.0.0_rc2.ebuild 4692 BLAKE2B 0628160af123d42ea6cc9a2d39d0115ccc3d0f4461f2bc3b13946d3fb587a100092df73ba512aa016bf359283cf8790cf465cdbf7a230f1cd02e536d570424cd SHA512 08f8ef115f59f74a3b845af7563dbd43819c4fb37ed27a2fc0c65ce3c0f7c7e61eb3617b1e8c54c598d5cff0a1b8988d0ed32f8fa40c6b4428545a5f8f1bf05a EBUILD clang-common-17.0.0.9999.ebuild 4686 BLAKE2B c2bf510db70a7708d56746c035eebe20b332ace167138ae5260375dc5bfe15e2b8478692636cca60cebd9ebc2e418324377e3d17ebb49db7e30ecd6ad11e6db3 SHA512 abb81468747c4f83554c35792f6fd1e282b0edfa02a34157c0594cefef42b91c95092b35a88b7b4b7abfb17bff95029065b86f2c2724df5badb5924f915fd63e EBUILD clang-common-17.0.0_pre20230203.ebuild 4686 BLAKE2B c2bf510db70a7708d56746c035eebe20b332ace167138ae5260375dc5bfe15e2b8478692636cca60cebd9ebc2e418324377e3d17ebb49db7e30ecd6ad11e6db3 SHA512 abb81468747c4f83554c35792f6fd1e282b0edfa02a34157c0594cefef42b91c95092b35a88b7b4b7abfb17bff95029065b86f2c2724df5badb5924f915fd63e +EBUILD clang-common-17.0.0_pre20230211.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_pre20230107-r2.ebuild b/sys-devel/clang-common/clang-common-16.0.0_pre20230107-r2.ebuild deleted file mode 100644 index d5df949d5d96..000000000000 --- a/sys-devel/clang-common/clang-common-16.0.0_pre20230107-r2.ebuild +++ /dev/null @@ -1,169 +0,0 @@ -# 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="~loong" -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) - # (-fstack-clash-protection is omitted because of a possible Clang bug, - # see bug #892537 and bug #865339.) - newins - gentoo-hardened.cfg <<-EOF - # Some of these options are added unconditionally, regardless of - # USE=hardened, for parity with sys-devel/gcc. - -fstack-protector-strong - -fPIE - -include "${EPREFIX}/usr/include/gentoo/fortify.h" - EOF - - dodir /usr/include/gentoo - - local fortify_level=$(usex hardened 3 2) - # We have to do this because glibc's headers warn if F_S is set - # without optimization and that would at the very least be very noisy - # during builds and at worst trigger many -Werror builds. - cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die - #ifndef _FORTIFY_SOURCE - #if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 - #define _FORTIFY_SOURCE ${fortify_level} - #endif - #endif - EOF - - if use hardened ; then - cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die - # Options below are conditional on USE=hardened. - -D_GLIBCXX_ASSERTIONS - - # Analogue to GLIBCXX_ASSERTIONS - # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode - -D_LIBCPP_ENABLE_ASSERTIONS=1 - EOF - fi - - if use stricter; then - newins - gentoo-stricter.cfg <<-EOF - # This file increases the strictness of older clang versions - # to match the newest upstream version. - - # clang-16 defaults - -Werror=implicit-function-declaration - -Werror=implicit-int - -Werror=incompatible-function-pointer-types - - # constructs banned by C2x - -Werror=deprecated-non-prototype - - # deprecated but large blast radius - #-Werror=strict-prototypes - EOF - - cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die - @gentoo-stricter.cfg - EOF - fi - - local tool - for tool in clang{,++,-cpp}; do - newins - "${tool}.cfg" <<-EOF - # This configuration file is used by ${tool} driver. - @gentoo-common.cfg - EOF - done -} - -pkg_preinst() { - if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc - then - local gcc_path=$(gcc-config --get-lib-path 2>/dev/null) - if [[ -n ${gcc_path} ]]; then - cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF - --gcc-install-dir="${gcc_path%%:*}" - EOF - fi - fi -} diff --git a/sys-devel/clang-common/clang-common-16.0.0_pre20230127-r1.ebuild b/sys-devel/clang-common/clang-common-16.0.0_pre20230127-r1.ebuild deleted file mode 100644 index c04c266d94c8..000000000000 --- a/sys-devel/clang-common/clang-common-16.0.0_pre20230127-r1.ebuild +++ /dev/null @@ -1,169 +0,0 @@ -# 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) - # (-fstack-clash-protection is omitted because of a possible Clang bug, - # see bug #892537 and bug #865339.) - newins - gentoo-hardened.cfg <<-EOF - # Some of these options are added unconditionally, regardless of - # USE=hardened, for parity with sys-devel/gcc. - -fstack-protector-strong - -fPIE - -include "${EPREFIX}/usr/include/gentoo/fortify.h" - EOF - - dodir /usr/include/gentoo - - local fortify_level=$(usex hardened 3 2) - # We have to do this because glibc's headers warn if F_S is set - # without optimization and that would at the very least be very noisy - # during builds and at worst trigger many -Werror builds. - cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die - #ifndef _FORTIFY_SOURCE - #if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 - #define _FORTIFY_SOURCE ${fortify_level} - #endif - #endif - EOF - - if use hardened ; then - cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die - # Options below are conditional on USE=hardened. - -D_GLIBCXX_ASSERTIONS - - # Analogue to GLIBCXX_ASSERTIONS - # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode - -D_LIBCPP_ENABLE_ASSERTIONS=1 - EOF - fi - - if use stricter; then - newins - gentoo-stricter.cfg <<-EOF - # This file increases the strictness of older clang versions - # to match the newest upstream version. - - # clang-16 defaults - -Werror=implicit-function-declaration - -Werror=implicit-int - -Werror=incompatible-function-pointer-types - - # constructs banned by C2x - -Werror=deprecated-non-prototype - - # deprecated but large blast radius - #-Werror=strict-prototypes - EOF - - cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die - @gentoo-stricter.cfg - EOF - fi - - local tool - for tool in clang{,++,-cpp}; do - newins - "${tool}.cfg" <<-EOF - # This configuration file is used by ${tool} driver. - @gentoo-common.cfg - EOF - done -} - -pkg_preinst() { - if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc - then - local gcc_path=$(gcc-config --get-lib-path 2>/dev/null) - if [[ -n ${gcc_path} ]]; then - cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF - --gcc-install-dir="${gcc_path%%:*}" - EOF - fi - fi -} diff --git a/sys-devel/clang-common/clang-common-16.0.0_rc2.ebuild b/sys-devel/clang-common/clang-common-16.0.0_rc2.ebuild new file mode 100644 index 000000000000..3c407f5a1af6 --- /dev/null +++ b/sys-devel/clang-common/clang-common-16.0.0_rc2.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="~loong" +IUSE=" + default-compiler-rt default-libcxx default-lld llvm-libunwind + hardened stricter +" + +PDEPEND=" + sys-devel/clang:* + default-compiler-rt? ( + sys-devel/clang-runtime[compiler-rt] + llvm-libunwind? ( sys-libs/llvm-libunwind ) + !llvm-libunwind? ( sys-libs/libunwind ) + ) + !default-compiler-rt? ( sys-devel/gcc ) + default-libcxx? ( >=sys-libs/libcxx-${PV} ) + !default-libcxx? ( sys-devel/gcc ) + default-lld? ( sys-devel/lld ) + !default-lld? ( sys-devel/binutils ) +" +IDEPEND=" + !default-compiler-rt? ( sys-devel/gcc-config ) + !default-libcxx? ( sys-devel/gcc-config ) +" + +LLVM_COMPONENTS=( clang/utils ) +llvm.org_set_globals + +pkg_pretend() { + [[ ${CLANG_IGNORE_DEFAULT_RUNTIMES} ]] && return + + local flag missing_flags=() + for flag in default-{compiler-rt,libcxx,lld}; do + if ! use "${flag}" && has_version "sys-devel/clang[${flag}]"; then + missing_flags+=( "${flag}" ) + fi + done + + if [[ ${missing_flags[@]} ]]; then + eerror "It seems that you have the following flags set on sys-devel/clang:" + eerror + eerror " ${missing_flags[*]}" + eerror + eerror "The default runtimes are now set via flags on sys-devel/clang-common." + eerror "The build is being aborted to prevent breakage. Please either set" + eerror "the respective flags on this ebuild, e.g.:" + eerror + eerror " sys-devel/clang-common ${missing_flags[*]}" + eerror + eerror "or build with CLANG_IGNORE_DEFAULT_RUNTIMES=1." + die "Mismatched defaults detected between sys-devel/clang and sys-devel/clang-common" + fi +} + +src_install() { + newbashcomp bash-autocomplete.sh clang + + insinto /etc/clang + newins - gentoo-runtimes.cfg <<-EOF + # This file is initially generated by sys-devel/clang-runtime. + # It is used to control the default runtimes using by clang. + + --rtlib=$(usex default-compiler-rt compiler-rt libgcc) + --unwindlib=$(usex default-compiler-rt libunwind libgcc) + --stdlib=$(usex default-libcxx libc++ libstdc++) + -fuse-ld=$(usex default-lld lld bfd) + EOF + + newins - gentoo-gcc-install.cfg <<-EOF + # This file is maintained by gcc-config. + # It is used to specify the selected GCC installation. + EOF + + newins - gentoo-common.cfg <<-EOF + # This file contains flags common to clang, clang++ and clang-cpp. + @gentoo-runtimes.cfg + @gentoo-gcc-install.cfg + @gentoo-hardened.cfg + EOF + + # Baseline hardening (bug #851111) + newins - gentoo-hardened.cfg <<-EOF + # Some of these options are added unconditionally, regardless of + # USE=hardened, for parity with sys-devel/gcc. + -fstack-clash-protection + -fstack-protector-strong + -fPIE + -include "${EPREFIX}/usr/include/gentoo/fortify.h" + EOF + + dodir /usr/include/gentoo + + local fortify_level=$(usex hardened 3 2) + # We have to do this because glibc's headers warn if F_S is set + # without optimization and that would at the very least be very noisy + # during builds and at worst trigger many -Werror builds. + cat >> "${ED}/usr/include/gentoo/fortify.h" <<- EOF || die + #ifndef _FORTIFY_SOURCE + #if defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 + #define _FORTIFY_SOURCE ${fortify_level} + #endif + #endif + EOF + + if use hardened ; then + cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die + # Options below are conditional on USE=hardened. + -D_GLIBCXX_ASSERTIONS + + # Analogue to GLIBCXX_ASSERTIONS + # https://libcxx.llvm.org/UsingLibcxx.html#assertions-mode + -D_LIBCPP_ENABLE_ASSERTIONS=1 + EOF + fi + + if use stricter; then + newins - gentoo-stricter.cfg <<-EOF + # This file increases the strictness of older clang versions + # to match the newest upstream version. + + # clang-16 defaults + -Werror=implicit-function-declaration + -Werror=implicit-int + -Werror=incompatible-function-pointer-types + + # constructs banned by C2x + -Werror=deprecated-non-prototype + + # deprecated but large blast radius + #-Werror=strict-prototypes + EOF + + cat >> "${ED}/etc/clang/gentoo-common.cfg" <<-EOF || die + @gentoo-stricter.cfg + EOF + fi + + local tool + for tool in clang{,++,-cpp}; do + newins - "${tool}.cfg" <<-EOF + # This configuration file is used by ${tool} driver. + @gentoo-common.cfg + EOF + done +} + +pkg_preinst() { + if has_version -b sys-devel/gcc-config && has_version sys-devel/gcc + then + local gcc_path=$(gcc-config --get-lib-path 2>/dev/null) + if [[ -n ${gcc_path} ]]; then + cat >> "${ED}/etc/clang/gentoo-gcc-install.cfg" <<-EOF + --gcc-install-dir="${gcc_path%%:*}" + EOF + fi + fi +} diff --git a/sys-devel/clang-common/clang-common-17.0.0_pre20230211.ebuild b/sys-devel/clang-common/clang-common-17.0.0_pre20230211.ebuild new file mode 100644 index 000000000000..be17e87b775a --- /dev/null +++ b/sys-devel/clang-common/clang-common-17.0.0_pre20230211.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 +} -- cgit v1.2.3