]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
compiler: Ensure __builtin_*_overflow() support
authorRichard Weinberger <richard@nod.at>
Fri, 9 Aug 2024 09:54:29 +0000 (11:54 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 15 Aug 2024 22:14:36 +0000 (16:14 -0600)
Both gcc and clang support this for a long time.
Make sure the feature is present.

Signed-off-by: Richard Weinberger <richard@nod.at>
include/linux/compiler_types.h

index 1a3060117f140c6b72f2b309e4b6fa1a87c7e508..8b6ce9c11cd8f935d8bdf313d72ac601c5f6289c 100644 (file)
@@ -70,6 +70,13 @@ extern void __chk_io_ptr(const volatile void __iomem *);
 #error "Unknown compiler"
 #endif
 
+/*
+ * At least gcc 5.1 or clang 8 are needed.
+ */
+#ifndef COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW
+#error Unsupported compiler
+#endif
+
 /*
  * Some architectures need to provide custom definitions of macros provided
  * by linux/compiler-*.h, and can do so using asm/compiler.h. We include that