Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell if a translation unit is being compiled with segmented stacks

Is there a preprocessor macro, constant or something similar in C++ that can be used to tell if a translation unit is being compiled with segmented stacks (i.e. with -fsplit-stack)?

Answers for any compiler would be good but I am looking for clang and gcc in particular

like image 200
Curious Avatar asked Jul 23 '18 21:07

Curious


1 Answers

According to this gcc wiki page, the preprocessor gets TARGET_SUPPORTS_SPLIT_STACK and the runtime gets bool supports_split_stack().

like image 181
Drew Dormann Avatar answered Nov 08 '22 06:11

Drew Dormann