summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vpp/api/api_main.c4
-rw-r--r--src/vppinfra/clib.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/vpp/api/api_main.c b/src/vpp/api/api_main.c
index 9b915eeffcf..63bb5f21c06 100644
--- a/src/vpp/api/api_main.c
+++ b/src/vpp/api/api_main.c
@@ -4,8 +4,8 @@
vat_main_t vat_main;
-void
-vat_suspend (vlib_main_t * vm, f64 interval)
+void __clib_no_tail_calls
+vat_suspend (vlib_main_t *vm, f64 interval)
{
vlib_process_suspend (vm, interval);
}
diff --git a/src/vppinfra/clib.h b/src/vppinfra/clib.h
index b3a2580e73a..76dd0ebf2ad 100644
--- a/src/vppinfra/clib.h
+++ b/src/vppinfra/clib.h
@@ -109,6 +109,12 @@
#define __clib_section(s) __attribute__ ((section(s)))
#define __clib_warn_unused_result __attribute__ ((warn_unused_result))
#define __clib_export __attribute__ ((visibility("default")))
+#ifdef __clang__
+#define __clib_no_tail_calls __attribute__ ((disable_tail_calls))
+#else
+#define __clib_no_tail_calls \
+ __attribute__ ((optimize ("no-optimize-sibling-calls")))
+#endif
#define never_inline __attribute__ ((__noinline__))