[PATCH] D15781: [compiler-rt] Add support for ARM EHABI to gcc_personality_v0.

Timon Van Overveldt via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 30 14:10:20 PST 2015


timonvo added a comment.

Please take a look at https://github.com/timonvo/compiler-rt/tree/arm-personality-routine-llvm-w-test. It contains both this patch as well as a `test_pr.sh` script for running the already existing personality routine tests on ARM (the one under test/builtins/Unit). You can compare the branch against the master compiler-rt branch here: https://github.com/llvm-mirror/compiler-rt/compare/master...timonvo:arm-personality-routine-llvm-w-test.

Note that this test relies on qemu-arm, as well as a functional arm-linux-gnueabi-{gcc,g++} toolchain. That means it uses GCC, not Clang, but that shouldn't matter. It uses LLVM's libunwind library, and obviously it tests compiler-rt's personality routine implementatin, not GCC's, and that's what matters.

When you revert the ARM EHABI patch, the test fails with a SIGSEGV (due to the mismatching function signatures). The stack trace for the segfault is;

  (gdb) bt
  #0  0x00015a64 in unw_get_proc_info (cursor=0x1, info=0xf6ffeac4) at libunwind/src/libunwind.cpp:242
  #1  0x00012d2c in _Unwind_GetLanguageSpecificData (context=0x1) at libunwind/src/Unwind-EHABI.cpp:762
  #2  0x0001120c in __gcc_personality_v0 (version=0, actions=196408, exceptionClass=300943912463320, exceptionObject=0xbc, context=0x1) at gcc_personality_v0.c:163
  #3  0x00012434 in unwind_phase1 (uc=0xf6fff270, exception_object=0x2ff38) at libunwind/src/Unwind-EHABI.cpp:514
  #4  0x00012b88 in _Unwind_RaiseException (exception_object=0x2ff38) at libunwind/src/Unwind-EHABI.cpp:715

But that really doesn't matter much. The segfault is caused by the incompatible function signature causing corrupt memory accesses further down the stack.

However, when you do apply the patch, the test does succeed. Does that make it clear why this patch is needed?


http://reviews.llvm.org/D15781





More information about the llvm-commits mailing list