tests: Add required flags to the stack tests
Tests that use the stack need special build flags, as some common
optimizations can cause them to fail.
-rdynamic: Adds all symbols to the dynamic symbol table. This option is needed
for backtrace() to work properly.
-fno-optimize-sibling-calls: This optimization can turn some calls into direct
jumps, which leaves caller information out of the stack frame and makes
functions not appear in the backtrace.
We disable it inconditionally. It's only enabled at -O2 and above, which
some users may pass.
This patch adds those flags only to the stack tests.
It also avoids generating the intermediate .o because they're not particularly
useful.