From 6cce4caa3ea04c74e4a9430e04b2db7e5e40b01d Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Thu, 12 Dec 2013 18:21:58 +0100 Subject: [PATCH] Allow building for x86 Linux on GCC < 4.5 Signed-off-by: Giel van Schijndel --- platform/switch_x86_unix.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/switch_x86_unix.h b/platform/switch_x86_unix.h index e66633ec..b59793b0 100644 --- a/platform/switch_x86_unix.h +++ b/platform/switch_x86_unix.h @@ -36,9 +36,15 @@ /* the above works fine with gcc 2.96, but 2.95.3 wants this */ #define STACK_MAGIC 0 +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) +# define ATTR_NOCLONE __attribute__((noclone)) +#else +# define ATTR_NOCLONE +#endif + /* See below for the purpose of this function. */ -__attribute__((noinline, noclone)) int fancy_return_zero(void); -__attribute__((noinline, noclone)) int +__attribute__((noinline)) ATTR_NOCLONE int fancy_return_zero(void); +__attribute__((noinline)) ATTR_NOCLONE int fancy_return_zero(void) { return 0;