Skip to content
Snippets Groups Projects
Commit d2da512f authored by Matt Turner's avatar Matt Turner Committed by Eric Engestrom
Browse files

util: Force emission of stack frame in stack unit test

The `capture_not_overwritten` unit test captures and compares two
backtraces -- one from inside a call to `func_c` and one outside -- and
confirms that they are not identical. That is, that `func_c` is in the
backtrace.

On 32-bit x86, without `-fno-omit-frame-pointer`, the function will not
emit a stack frame. As a result, the unit test fails.

The fix is to compile `func_c` with the flag `-fno-omit-frame-pointer`
to prevent the compiler from optimizing out the stack frame which is
otherwise unneeded.

Bug: https://bugs.gentoo.org/823774
Closes: mesa/mesa#4091
Fixes: d0d14f3f ("util: Add unit test for stack backtrace caputure")
Part-of: <mesa/mesa!30622>
(cherry picked from commit 05dc4eb5)
parent 5f2c486c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment