aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/compiler-clang.h
diff options
context:
space:
mode:
authorNick Desaulniers <ndesaulniers@google.com>2021-09-10 16:40:39 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-09-13 10:18:28 -0700
commit4eb6bd55cfb22ffc20652732340c4962f3ac9a91 (patch)
tree6549bca068e68ab17685fc640aa249af76d48f0e /include/linux/compiler-clang.h
parentDocumentation: raise minimum supported version of GCC to 5.1 (diff)
downloadwireguard-linux-4eb6bd55cfb22ffc20652732340c4962f3ac9a91.tar.xz
wireguard-linux-4eb6bd55cfb22ffc20652732340c4962f3ac9a91.zip
compiler.h: drop fallback overflow checkers
Once upgrading the minimum supported version of GCC to 5.1, we can drop the fallback code for !COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW. This is effectively a revert of commit f0907827a8a9 ("compiler.h: enable builtin overflow checkers and add fallback code") Link: https://github.com/ClangBuiltLinux/linux/issues/1438#issuecomment-916745801 Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Acked-by: Kees Cook <keescook@chromium.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/compiler-clang.h')
-rw-r--r--include/linux/compiler-clang.h13
1 files changed, 0 insertions, 13 deletions
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index 49b0ac8b6fd3..3c4de9b6c6e3 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -62,19 +62,6 @@
#define __no_sanitize_coverage
#endif
-/*
- * Not all versions of clang implement the type-generic versions
- * of the builtin overflow checkers. Fortunately, clang implements
- * __has_builtin allowing us to avoid awkward version
- * checks. Unfortunately, we don't know which version of gcc clang
- * pretends to be, so the macro may or may not be defined.
- */
-#if __has_builtin(__builtin_mul_overflow) && \
- __has_builtin(__builtin_add_overflow) && \
- __has_builtin(__builtin_sub_overflow)
-#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
-#endif
-
#if __has_feature(shadow_call_stack)
# define __noscs __attribute__((__no_sanitize__("shadow-call-stack")))
#endif