Commit Graph

16 Commits

Author SHA1 Message Date
Saleem Abdulrasool 14798b4465 unwind: rename `__personality_routine` to `_Unwind_Personality_Fn`
This patch renames `__personality_routine` to `_Unwind_Personality_Fn`
in `unwind.h`. Both `unwind.h` from clang and GCC headers use this name
instead of `__personality_routine`. With this patch one is also able to
build libc++abi with libunwind support on Windows.

Patch by Markus Böck!
2020-02-10 08:52:31 -08:00
Louis Dionne 2b0da3d63e [NFC] Correct outdated links to the Itanium C++ ABI documentation
Those are now hosted on GitHub.

rdar://problem/36557462

llvm-svn: 358191
2019-04-11 16:37:07 +00:00
Chandler Carruth 57b08b0944 Update more file headers across all of the LLVM projects in the monorepo
to reflect the new license. These used slightly different spellings that
defeated my regular expressions.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351648
2019-01-19 10:56:40 +00:00
Charles Davis a7e3a6d802 Add support for SEH unwinding on Windows.
Summary:
I've tested this implementation on x86-64 to ensure that it works. All
`libc++abi` tests pass, as do all `libc++` exception-related tests. ARM
still remains to be implemented (@compnerd?).

Special thanks to KJK::Hyperion for his excellent series of articles on
how EH works on x86-64 Windows. (Seriously, check it out. It's awesome.)

I'm actually not sure if this should go in as is. I particularly don't
like that I duplicated the UnwindCursor class for this special case.

Reviewers: mstorsjo, rnk, compnerd, smeenai, javed.absar

Subscribers: mgorny, kristof.beyls, christof, chrib, cfe-commits, compnerd, llvm-commits

Differential Revision: https://reviews.llvm.org/D50564

llvm-svn: 341125
2018-08-30 21:29:00 +00:00
Charles Davis b006dafbef Remove unneeded preprocessor condition.
llvm-svn: 339259
2018-08-08 15:18:22 +00:00
Charles Davis 06acf1f638 [libunwind][include] Add SEH declarations to <unwind.h>.
Summary:
Make the `_Unwind_Exception` struct correct under SEH. Add a
declaration of `_GCC_specific_handler()`, which is used by SEH versions
of Itanium personality handlers to do common setup. Roughly corresponds
to Clang's D50380.

Reviewers: mstorsjo, rnk, compnerd, smeenai

Subscribers: christof, chrib, cfe-commits, llvm-commits

Differential Revision: https://reviews.llvm.org/D50414

llvm-svn: 339258
2018-08-08 15:18:20 +00:00
Martin Storsjo 66bb841f64 Add support for dwarf unwinding on windows on x86_64
Clang doesn't currently support building for windows/x86_64 with
dwarf by setting command line parameters, but if manually modified
to use dwarf, we can make libunwind work in this configuration
as well.

Also include i386 in the docs when adding this as a supported
configuration; libunwind already works for i386 windows, but
can fail due to an issue unrelated to windows itself.

Differential Revision: https://reviews.llvm.org/D38819

llvm-svn: 316747
2017-10-27 08:11:36 +00:00
Saleem Abdulrasool f8774f1d73 ARM: explicitly specify the 8-byte alignment
It seems that GCC interprets `__attribute__((__aligned__))` as 8-byte
alignment on ARM, but clang does not.  Explicitly specify the
double-word alignment value to ensure that the structure is properly
aligned.

llvm-svn: 311574
2017-08-23 16:50:27 +00:00
Saleem Abdulrasool 5b389f1cf7 unwind: explicitly align `_Unwind_Control_Block`
The C++ ABI requires that the exception object is double-word aligned.
The alignment attribute was applied to the `_Unwind_Exception` type
which is used on non-EHABI targets.  On EHABI, the exception object type
is `_Unwind_Control_Block`.  Apply the explicit maximal alignment on the
type to ensure that the allocation has the correct alignment.

Resolves PR33858!

llvm-svn: 311562
2017-08-23 15:33:45 +00:00
Ranjeet Singh 5808011bd9 [libunwind] Clean up macro usage.
Convention in libunwind is to use !defined(FOOT) not !FOO.

Differential Revision: https://reviews.llvm.org/D31078

llvm-svn: 299225
2017-03-31 15:28:06 +00:00
Dimitry Andric 84af6d10a2 Add missing _US_ACTION_MASK constant to unwind.h
Summary:
During building of recent compiler-rt sources on FreeBSD for arm, I
noticed that our unwind.h (which originates in libunwind) was missing
the `_US_ACTION_MASK` constant:

    compiler-rt/lib/builtins/gcc_personality_v0.c:187:18: error: use of undeclared identifier '_US_ACTION_MASK'
        if ((state & _US_ACTION_MASK) != _US_UNWIND_FRAME_STARTING)
                     ^

It appears that both clang's internal unwind.h, and libgcc's unwind.h
define this constant as 3, so let's add this to libunwind's version too.

Reviewers: logan, kledzik, davide, emaste

Subscribers: joerg, davide, aemerson, emaste, llvm-commits

Differential Revision: https://reviews.llvm.org/D24222

llvm-svn: 280669
2016-09-05 18:01:13 +00:00
Eric Fiselier 19f802ff68 [libunwind] Properly align _Unwind_Exception.
Summary: _Unwind_Exception is required to be double word aligned. Currently the struct is under aligned.

Reviewers: mclow.lists, compnerd, kledzik, emaste

Subscribers: emaste, cfe-commits

Differential Revision: https://reviews.llvm.org/D22543

llvm-svn: 276215
2016-07-20 23:56:42 +00:00
Ed Maste c073b1bac9 libunwind: Use conventional DWARF capitalization in comments and errors
llvm-svn: 275996
2016-07-19 17:15:50 +00:00
Logan Chien ff8fbf9f90 unwind: Fix libc++abi and libgcc build.
To build libc++abi without libunwind, we should make sure that all
function calls to _Unwind_{Get,Set}{GR,IP}() are inlined as function
calls to _Unwind_VRS_{Get,Set}().  Otherwise, libc++abi.so will fail to
link since libgcc does not provide these symbol at all.

This commit fixes the problem by providing both the inlined version and
exported version.

llvm-svn: 243073
2015-07-24 00:16:48 +00:00
Logan Chien 5191fe9509 libunwind: Introduce __libunwind_config.h.
Introduce __libunwind_config.h to avoid cross repository circular
dependency with libcxxabi.

llvm-svn: 242642
2015-07-19 15:23:10 +00:00
Saleem Abdulrasool b1b1911777 unwind: move src/Unwind, include/, and test/ unwind content
This moves the majority of the unwind sources into the new project layout for
libunwind.  This was previously discussed on llvmdev at [1].  This is a
purely movement related change, with the build infrastructure currently still
residing in the libc++abi repository.

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-January/081507.html

llvm-svn: 235758
2015-04-24 19:39:17 +00:00