]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
compiler-gcc.h: __nostackprotector needs gcc-4.4 and up
authorGeert Uytterhoeven <geert@linux-m68k.org>
Thu, 1 Feb 2018 10:21:59 +0000 (11:21 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 8 Feb 2018 11:37:10 +0000 (22:37 +1100)
Gcc versions before 4.4 do not recognize the __optimize__ compiler
attribute:

    warning: ‘__optimize__’ attribute directive ignored

Fixes: 7375ae3a0b79ea07 ("compiler-gcc.h: Introduce __nostackprotector function attribute")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
include/linux/compiler-gcc.h

index 7bba8e28c52916fb7f10811ffd9b724a5e0c4a11..bf09213895f7a90559eb53161e99b6c959541401 100644 (file)
 
 #if GCC_VERSION >= 40100
 # define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
-
-#define __nostackprotector     __attribute__((__optimize__("no-stack-protector")))
 #endif
 
 #if GCC_VERSION >= 40300
 
 #if GCC_VERSION >= 40400
 #define __optimize(level)      __attribute__((__optimize__(level)))
+#define __nostackprotector     __optimize("no-stack-protector")
 #endif /* GCC_VERSION >= 40400 */
 
 #if GCC_VERSION >= 40500