瀏覽代碼

compiler-gcc.h: __nostackprotector needs gcc-4.4 and up

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>
Geert Uytterhoeven 7 年之前
父節點
當前提交
d9afaaa4ff
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      include/linux/compiler-gcc.h

+ 1 - 2
include/linux/compiler-gcc.h

@@ -167,8 +167,6 @@
 
 
 #if GCC_VERSION >= 40100
 #if GCC_VERSION >= 40100
 # define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
 # define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
-
-#define __nostackprotector	__attribute__((__optimize__("no-stack-protector")))
 #endif
 #endif
 
 
 #if GCC_VERSION >= 40300
 #if GCC_VERSION >= 40300
@@ -198,6 +196,7 @@
 
 
 #if GCC_VERSION >= 40400
 #if GCC_VERSION >= 40400
 #define __optimize(level)	__attribute__((__optimize__(level)))
 #define __optimize(level)	__attribute__((__optimize__(level)))
+#define __nostackprotector	__optimize("no-stack-protector")
 #endif /* GCC_VERSION >= 40400 */
 #endif /* GCC_VERSION >= 40400 */
 
 
 #if GCC_VERSION >= 40500
 #if GCC_VERSION >= 40500