This is an archive of the discontinued LLVM Phabricator instance.

Add -funwind-tables to CMAKE_C_FLAGS.
ClosedPublic

Authored by logan on Jan 21 2015, 9:54 AM.

Details

Summary

Without -funwind-tables, the compiler won't generate the unwinding
table for these C functions. However, the functions in libunwind,
such as _Unwind_Backtrace(), WILL unwind stack to get the backtrace.

Diff Detail

Event Timeline

logan updated this revision to Diff 18532.Jan 21 2015, 9:54 AM
logan retitled this revision from to Add -funwind-tables to CMAKE_C_FLAGS..
logan updated this object.
logan edited the test plan for this revision. (Show Details)
logan added reviewers: danalbert, rengolin, jroelofs.
logan added a subscriber: Unknown Object (MLST).
rengolin edited edge metadata.Jan 21 2015, 10:46 AM

I'm not a CMake expert, but I think this is ok. I suppose you have tested with Clang and GCC.

danalbert added inline comments.Jan 21 2015, 11:05 AM
cmake/config-ix.cmake
7

Shouldn't this be check_c_compiler_flag?

logan updated this revision to Diff 18573.Jan 21 2015, 4:56 PM
logan edited edge metadata.

Address the review comments from Dan Albert.

cmake/config-ix.cmake
7

Done.

jroelofs accepted this revision.Jan 21 2015, 4:59 PM
jroelofs edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jan 21 2015, 4:59 PM
logan added a comment.Jan 21 2015, 4:59 PM

@rengolin I have tried to compile with arm-linux-gnueabihf-g++-4.7 but it doesn't compile libcxxabi. After applying some hacks, I found that 3 tests failed. However, they seem unrelated to this change (it looks like the code generation issue.)

rengolin accepted this revision.Jan 21 2015, 7:22 PM
rengolin edited edge metadata.

If the same error happens without the patch, than LGTM too. Thanks!

logan added a comment.Jan 22 2015, 5:40 AM

Thanks. Committed as rL226823.

logan closed this revision.Jan 22 2015, 5:40 AM