diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2018-02-01 05:21:59 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-02-08 06:37:10 -0500 |
commit | d9afaaa4ff7af8b87d4a205e48cb8a6f666d7f01 (patch) | |
tree | ed55f554712402edab6a4cf0bd52ec2ce0b0a46e /include/linux/compiler-gcc.h | |
parent | df5d45aa08f848b79caf395211b222790534ccc7 (diff) |
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>
Diffstat (limited to 'include/linux/compiler-gcc.h')
-rw-r--r-- | include/linux/compiler-gcc.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 7bba8e28c529..bf09213895f7 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -167,8 +167,6 @@ | |||
167 | 167 | ||
168 | #if GCC_VERSION >= 40100 | 168 | #if GCC_VERSION >= 40100 |
169 | # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | 169 | # define __compiletime_object_size(obj) __builtin_object_size(obj, 0) |
170 | |||
171 | #define __nostackprotector __attribute__((__optimize__("no-stack-protector"))) | ||
172 | #endif | 170 | #endif |
173 | 171 | ||
174 | #if GCC_VERSION >= 40300 | 172 | #if GCC_VERSION >= 40300 |
@@ -198,6 +196,7 @@ | |||
198 | 196 | ||
199 | #if GCC_VERSION >= 40400 | 197 | #if GCC_VERSION >= 40400 |
200 | #define __optimize(level) __attribute__((__optimize__(level))) | 198 | #define __optimize(level) __attribute__((__optimize__(level))) |
199 | #define __nostackprotector __optimize("no-stack-protector") | ||
201 | #endif /* GCC_VERSION >= 40400 */ | 200 | #endif /* GCC_VERSION >= 40400 */ |
202 | 201 | ||
203 | #if GCC_VERSION >= 40500 | 202 | #if GCC_VERSION >= 40500 |