Skip to content

Commit

Permalink
compiler-gcc.h: __nostackprotector needs gcc-4.4 and up
Browse files Browse the repository at this point in the history
Gcc versions before 4.4 do not recognize the __optimize__ compiler
attribute:

    warning: ‘__optimize__’ attribute directive ignored

Fixes: 7375ae3 ("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>
  • Loading branch information
Geert Uytterhoeven authored and Herbert Xu committed Feb 8, 2018
1 parent df5d45a commit d9afaaa
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/linux/compiler-gcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@

#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
Expand Down Expand Up @@ -198,6 +196,7 @@

#if GCC_VERSION >= 40400
#define __optimize(level) __attribute__((__optimize__(level)))
#define __nostackprotector __optimize("no-stack-protector")
#endif /* GCC_VERSION >= 40400 */

#if GCC_VERSION >= 40500
Expand Down

0 comments on commit d9afaaa

Please sign in to comment.