Bugzilla – Bug 2008
-fstack-check is not supported
Last modified: 2008-02-10 12:17:46
You need to log in before you can comment on or make changes to this bug.
Compiling a program with -fstack-check is supposed to add code to check for stack overflow. This does not happen with llvm-gcc. I've filed this option under tools/gnat because in mainline this option only works with the Ada front-end. However patches to mainline have been proposed that generalize this functionality to all languages. It seems like a useful feature for LLVM to support.
Is this related to the -fstack-protector option? I thought 4.2 had some support for stack canaries.
It's not related to -fstack-protector: that's trying to prevent people from overwriting your stack. -fstack-check is about checking that (via recursion or whatever) you do not make the stack so big that it runs into the heap or some other bad place. Ada doesn't really have a buffer overflow problem since the compiler is required to insert code to check that there are no out of range accesses, so -fstack-protector isn't really useful for it. However stack overflow is a potential problem.
ah, ok!