File tree Expand file tree Collapse file tree 4 files changed +27
-5
lines changed
Expand file tree Collapse file tree 4 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -502,9 +502,14 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
502502 set (LIBCXXABI_LIBUNWIND_SOURCES "" )
503503 endif ()
504504
505- if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND" )
505+ if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND" )
506+ set (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "" )
507+ endif ()
508+
509+ if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "" )
506510 include_directories ("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL} " )
507511 endif ()
512+
508513 if (NOT LIBCXXABI_LIBUNWIND_SOURCES STREQUAL "" )
509514 include_directories ("${LIBCXXABI_LIBUNWIND_SOURCES} " )
510515 endif ()
Original file line number Diff line number Diff line change @@ -84,6 +84,13 @@ def configure_compile_flags_header_includes(self):
8484 % libcxxabi_headers )
8585 self .cxx .compile_flags += ['-I' + libcxxabi_headers ]
8686
87+ libunwind_headers = self .get_lit_conf ('libunwind_headers' , None )
88+ if self .get_lit_bool ('llvm_unwinder' , False ) and libunwind_headers :
89+ if not os .path .isdir (libunwind_headers ):
90+ self .lit_config .fatal ("libunwind_headers='%s' is not a directory."
91+ % libunwind_headers )
92+ self .cxx .compile_flags += ['-I' + libunwind_headers ]
93+
8794 def configure_compile_flags_exceptions (self ):
8895 pass
8996
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ config.libcxxabi_obj_root = "@LIBCXXABI_BINARY_DIR@"
66config.abi_library_path = "@LIBCXXABI_LIBRARY_DIR@"
77config.libcxx_src_root = "@LIBCXXABI_LIBCXX_PATH@"
88config.cxx_headers = "@LIBCXXABI_LIBCXX_INCLUDES@"
9+ config.libunwind_headers = "@LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL@"
910config.cxx_library_root = "@LIBCXXABI_LIBCXX_LIBRARY_PATH@"
1011config.llvm_unwinder = "@LIBCXXABI_USE_LLVM_UNWINDER@"
1112config.enable_threads = "@LIBCXXABI_ENABLE_THREADS@"
Original file line number Diff line number Diff line change 1515// working around this failure.
1616// XFAIL: darwin && libcxxabi-has-system-unwinder
1717
18- // Test that the address of the exception object is properly aligned to the
19- // largest supported alignment for the system.
18+ // Test that the address of the exception object is properly aligned as required
19+ // by the relevant ABI
2020
2121#include < cstdint>
2222#include < cassert>
2323
2424#include < unwind.h>
2525
2626struct __attribute__ ((aligned)) AlignedType {};
27- static_assert (alignof (AlignedType) == alignof (_Unwind_Exception),
27+
28+ // EHABI : 8-byte aligned
29+ // Itanium: Largest supported alignment for the system
30+ #if defined(_LIBUNWIND_ARM_EHABI)
31+ # define EXPECTED_ALIGNMENT 8
32+ #else
33+ # define EXPECTED_ALIGNMENT alignof (AlignedType)
34+ #endif
35+
36+ static_assert (alignof (_Unwind_Exception) == EXPECTED_ALIGNMENT,
2837 " _Unwind_Exception is incorrectly aligned. This test is expected to fail" );
2938
3039struct MinAligned { };
@@ -35,7 +44,7 @@ int main() {
3544 try {
3645 throw MinAligned{};
3746 } catch (MinAligned const & ref) {
38- assert (reinterpret_cast <uintptr_t >(&ref) % alignof (AlignedType) == 0 );
47+ assert (reinterpret_cast <uintptr_t >(&ref) % EXPECTED_ALIGNMENT == 0 );
3948 }
4049 }
4150}
You can’t perform that action at this time.
0 commit comments