summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys-devel/clang-common/clang-common-15.0.2-r1.ebuild25
-rw-r--r--sys-devel/clang-common/clang-common-15.0.2.9999.ebuild25
-rw-r--r--sys-devel/clang-common/clang-common-16.0.0.9999.ebuild25
-rw-r--r--sys-devel/clang-common/clang-common-16.0.0_pre20221006-r1.ebuild25
-rw-r--r--sys-devel/clang-common/metadata.xml1
5 files changed, 97 insertions, 4 deletions
diff --git a/sys-devel/clang-common/clang-common-15.0.2-r1.ebuild b/sys-devel/clang-common/clang-common-15.0.2-r1.ebuild
index 9962f257ccc0..a29bbbc806c9 100644
--- a/sys-devel/clang-common/clang-common-15.0.2-r1.ebuild
+++ b/sys-devel/clang-common/clang-common-15.0.2-r1.ebuild
@@ -11,7 +11,10 @@ HOMEPAGE="https://llvm.org/"
LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~ppc-macos ~x64-macos"
-IUSE="default-compiler-rt default-libcxx default-lld llvm-libunwind"
+IUSE="
+ default-compiler-rt default-libcxx default-lld llvm-libunwind
+ stricter
+"
PDEPEND="
sys-devel/clang:*
@@ -82,6 +85,26 @@ src_install() {
@gentoo-gcc-install.cfg
EOF
+ 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=strict-prototypes
+ -Werror=deprecated-non-prototype
+ 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
diff --git a/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild b/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild
index 0ff52691cc71..993dddec4bf9 100644
--- a/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild
+++ b/sys-devel/clang-common/clang-common-15.0.2.9999.ebuild
@@ -11,7 +11,10 @@ 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"
+IUSE="
+ default-compiler-rt default-libcxx default-lld llvm-libunwind
+ stricter
+"
PDEPEND="
sys-devel/clang:*
@@ -81,6 +84,26 @@ src_install() {
@gentoo-gcc-install.cfg
EOF
+ 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=strict-prototypes
+ -Werror=deprecated-non-prototype
+ 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
diff --git a/sys-devel/clang-common/clang-common-16.0.0.9999.ebuild b/sys-devel/clang-common/clang-common-16.0.0.9999.ebuild
index 0ff52691cc71..993dddec4bf9 100644
--- a/sys-devel/clang-common/clang-common-16.0.0.9999.ebuild
+++ b/sys-devel/clang-common/clang-common-16.0.0.9999.ebuild
@@ -11,7 +11,10 @@ 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"
+IUSE="
+ default-compiler-rt default-libcxx default-lld llvm-libunwind
+ stricter
+"
PDEPEND="
sys-devel/clang:*
@@ -81,6 +84,26 @@ src_install() {
@gentoo-gcc-install.cfg
EOF
+ 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=strict-prototypes
+ -Werror=deprecated-non-prototype
+ 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
diff --git a/sys-devel/clang-common/clang-common-16.0.0_pre20221006-r1.ebuild b/sys-devel/clang-common/clang-common-16.0.0_pre20221006-r1.ebuild
index 0ff52691cc71..993dddec4bf9 100644
--- a/sys-devel/clang-common/clang-common-16.0.0_pre20221006-r1.ebuild
+++ b/sys-devel/clang-common/clang-common-16.0.0_pre20221006-r1.ebuild
@@ -11,7 +11,10 @@ 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"
+IUSE="
+ default-compiler-rt default-libcxx default-lld llvm-libunwind
+ stricter
+"
PDEPEND="
sys-devel/clang:*
@@ -81,6 +84,26 @@ src_install() {
@gentoo-gcc-install.cfg
EOF
+ 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=strict-prototypes
+ -Werror=deprecated-non-prototype
+ 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
diff --git a/sys-devel/clang-common/metadata.xml b/sys-devel/clang-common/metadata.xml
index 31c80b4fb555..7ea033c083c9 100644
--- a/sys-devel/clang-common/metadata.xml
+++ b/sys-devel/clang-common/metadata.xml
@@ -11,5 +11,6 @@
<flag name="default-compiler-rt">Use compiler-rt + libunwind instead of libgcc as the default rtlib for clang</flag>
<flag name="default-libcxx">Use libc++ instead of libstdc++ as the default stdlib for clang</flag>
<flag name="default-lld">Use lld as the default linker for clang</flag>
+ <flag name="stricter">Default to stricter behavior known from newer clang versions, turning more warnings into errors</flag>
</use>
</pkgmetadata>