The __attribute__((no_stack_protector)) was introduced in GCC 11. Building a TA with an older version of GCC would trigger a -Wattributes warning on the ta/user_ta_header.c file.
Use __has_attribute() to check for the support of the no_stack_protector attribute before using it. If not supported, define the __no_stack_protector alias as a NOP.
Note: This no_stack_protector is the only troublesome attribute in my set up (GCC 9.4.0). Let me know if you want to also add a __has_attribute() guard to the other attributes and I will do so.
The
__attribute__((no_stack_protector))
was introduced in GCC 11. Building a TA with an older version of GCC would trigger a-Wattributes
warning on theta/user_ta_header.c
file.Use
__has_attribute()
to check for the support of theno_stack_protector
attribute before using it. If not supported, define the__no_stack_protector
alias as a NOP.Fixes: e3fb2bd005f ("compiler.h: add __no_stack_protector")
Note: This
no_stack_protector
is the only troublesome attribute in my set up (GCC 9.4.0). Let me know if you want to also add a__has_attribute()
guard to the other attributes and I will do so.