diff options
author | 2023-03-13 21:46:59 +0000 | |
---|---|---|
committer | 2023-03-13 21:47:53 +0000 | |
commit | 162b52d8795d5eead77376c37c23d91001373258 (patch) | |
tree | c26df78a9c7626ea9535329514ef65a1c90bb6b6 /sys-devel/clang-common | |
parent | www-client/tangram: new package; add 2.0 (diff) | |
download | gentoo-162b52d8795d5eead77376c37c23d91001373258.tar.gz gentoo-162b52d8795d5eead77376c37c23d91001373258.tar.bz2 gentoo-162b52d8795d5eead77376c37c23d91001373258.zip |
sys-devel/clang-common: don't default-enable _FORTIFY_SOURCE w/ ASAN and MSAN
This can cause either false positives in warnings from the compiler or false
negatives where the sanitizer misses something.
Bug: https://github.com/google/sanitizers/issues/247
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-devel/clang-common')
-rw-r--r-- | sys-devel/clang-common/clang-common-15.0.7-r4.ebuild (renamed from sys-devel/clang-common/clang-common-15.0.7-r3.ebuild) | 19 | ||||
-rw-r--r-- | sys-devel/clang-common/clang-common-16.0.0.9999.ebuild | 19 | ||||
-rw-r--r-- | sys-devel/clang-common/clang-common-16.0.0_rc3-r2.ebuild (renamed from sys-devel/clang-common/clang-common-16.0.0_rc3-r1.ebuild) | 19 | ||||
-rw-r--r-- | sys-devel/clang-common/clang-common-16.0.0_rc4-r1.ebuild (renamed from sys-devel/clang-common/clang-common-16.0.0_rc4.ebuild) | 19 | ||||
-rw-r--r-- | sys-devel/clang-common/clang-common-17.0.0.9999.ebuild | 19 | ||||
-rw-r--r-- | sys-devel/clang-common/clang-common-17.0.0_pre20230304-r1.ebuild (renamed from sys-devel/clang-common/clang-common-17.0.0_pre20230304.ebuild) | 19 |
6 files changed, 84 insertions, 30 deletions
diff --git a/sys-devel/clang-common/clang-common-15.0.7-r3.ebuild b/sys-devel/clang-common/clang-common-15.0.7-r4.ebuild index ae60c641f5f9..c7af956a5dd7 100644 --- a/sys-devel/clang-common/clang-common-15.0.7-r3.ebuild +++ b/sys-devel/clang-common/clang-common-15.0.7-r4.ebuild @@ -107,11 +107,20 @@ src_install() { # 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 + #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 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 3165f42a329f..808c1e1a0ae1 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 @@ -106,11 +106,20 @@ src_install() { # 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 + #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 diff --git a/sys-devel/clang-common/clang-common-16.0.0_rc3-r1.ebuild b/sys-devel/clang-common/clang-common-16.0.0_rc3-r2.ebuild index d8624a7c3152..1f768ea302a9 100644 --- a/sys-devel/clang-common/clang-common-16.0.0_rc3-r1.ebuild +++ b/sys-devel/clang-common/clang-common-16.0.0_rc3-r2.ebuild @@ -106,11 +106,20 @@ src_install() { # 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 + #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 diff --git a/sys-devel/clang-common/clang-common-16.0.0_rc4.ebuild b/sys-devel/clang-common/clang-common-16.0.0_rc4-r1.ebuild index d8624a7c3152..1f768ea302a9 100644 --- a/sys-devel/clang-common/clang-common-16.0.0_rc4.ebuild +++ b/sys-devel/clang-common/clang-common-16.0.0_rc4-r1.ebuild @@ -106,11 +106,20 @@ src_install() { # 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 + #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 diff --git a/sys-devel/clang-common/clang-common-17.0.0.9999.ebuild b/sys-devel/clang-common/clang-common-17.0.0.9999.ebuild index 3165f42a329f..808c1e1a0ae1 100644 --- a/sys-devel/clang-common/clang-common-17.0.0.9999.ebuild +++ b/sys-devel/clang-common/clang-common-17.0.0.9999.ebuild @@ -106,11 +106,20 @@ src_install() { # 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 + #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 diff --git a/sys-devel/clang-common/clang-common-17.0.0_pre20230304.ebuild b/sys-devel/clang-common/clang-common-17.0.0_pre20230304-r1.ebuild index 3165f42a329f..808c1e1a0ae1 100644 --- a/sys-devel/clang-common/clang-common-17.0.0_pre20230304.ebuild +++ b/sys-devel/clang-common/clang-common-17.0.0_pre20230304-r1.ebuild @@ -106,11 +106,20 @@ src_install() { # 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 + #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 |