[PATCH] D37484: [libunwind] Always use unwind tables in tests

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 5 09:49:25 PDT 2017


peter.smith created this revision.
Herald added subscribers: kristof.beyls, aemerson.

For many targets setting -fno-exceptions will prevent unwinding tables from being generated for the test programs. As libunwind depends on the tables to unwind the stack several tests will fail.

      

This change always adds -funwind-tables so that even when -fno-exceptions is set unwind tables are generated. On x86_64 clang will add this option implicitly as the ABI requires it, I've tested this with Arm and AArch64.

      

This is an attempt at fixing pr33858 https://bugs.llvm.org/show_bug.cgi?id=33858. I'm not experienced in this area so there may well be better ways of doing this.


https://reviews.llvm.org/D37484

Files:
  test/libunwind/test/config.py


Index: test/libunwind/test/config.py
===================================================================
--- test/libunwind/test/config.py
+++ test/libunwind/test/config.py
@@ -43,10 +43,11 @@
 
     def configure_compile_flags(self):
         self.cxx.compile_flags += ['-DLIBUNWIND_NO_TIMER']
-        if self.get_lit_bool('enable_exceptions', True):
-            self.cxx.compile_flags += ['-funwind-tables']
-        else:
+        if self.get_lit_bool('enable_exceptions', False):
             self.cxx.compile_flags += ['-fno-exceptions', '-DLIBUNWIND_HAS_NO_EXCEPTIONS']
+        # Stack unwinding tests need unwinding tables and these are not
+        # generated by default on all Targets.
+        self.cxx.compile_flags += ['-funwind-tables']
         if not self.get_lit_bool('enable_threads', True):
             self.cxx.compile_flags += ['-D_LIBUNWIND_HAS_NO_THREADS']
             self.config.available_features.add('libunwind-no-threads')


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37484.113872.patch
Type: text/x-patch
Size: 956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170905/55cf76e9/attachment.bin>


More information about the llvm-commits mailing list