|
@@ -207,6 +207,15 @@
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * calling noreturn functions, __builtin_unreachable() and __builtin_trap()
|
|
|
|
+ * confuse the stack allocation in gcc, leading to overly large stack
|
|
|
|
+ * frames, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365
|
|
|
|
+ *
|
|
|
|
+ * Adding an empty inline assembly before it works around the problem
|
|
|
|
+ */
|
|
|
|
+#define barrier_before_unreachable() asm volatile("")
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Mark a position in code as unreachable. This can be used to
|
|
* Mark a position in code as unreachable. This can be used to
|
|
* suppress control flow warnings after asm blocks that transfer
|
|
* suppress control flow warnings after asm blocks that transfer
|
|
@@ -217,7 +226,11 @@
|
|
* unreleased. Really, we need to have autoconf for the kernel.
|
|
* unreleased. Really, we need to have autoconf for the kernel.
|
|
*/
|
|
*/
|
|
#define unreachable() \
|
|
#define unreachable() \
|
|
- do { annotate_unreachable(); __builtin_unreachable(); } while (0)
|
|
|
|
|
|
+ do { \
|
|
|
|
+ annotate_unreachable(); \
|
|
|
|
+ barrier_before_unreachable(); \
|
|
|
|
+ __builtin_unreachable(); \
|
|
|
|
+ } while (0)
|
|
|
|
|
|
/* Mark a function definition as prohibited from being cloned. */
|
|
/* Mark a function definition as prohibited from being cloned. */
|
|
#define __noclone __attribute__((__noclone__, __optimize__("no-tracer")))
|
|
#define __noclone __attribute__((__noclone__, __optimize__("no-tracer")))
|