Commit Graph

18 Commits

Author SHA1 Message Date
Ed Maste
2be6126d2a libunwind: use upstream patch to disable executable stacks
arm uses '@' as a comment character, and cannot use @progbits in the
.section directive. Apply the upstream noexec stach change which avoids
this issue.

Obtained from:	LLVM r277868
2017-10-11 19:26:39 +00:00
Ruslan Bukin
ca20f8ec29 o Replace __riscv__ with __riscv
o Replace __riscv64 with (__riscv && __riscv_xlen == 64)

This is required to support new GCC 7.1 compiler.
This is compatible with current GCC 6.1 compiler.

RISC-V is extensible ISA and the idea here is to have built-in define
per each extension, so together with __riscv we will have some subset
of these as well (depending on -march string passed to compiler):

__riscv_compressed
__riscv_atomic
__riscv_mul
__riscv_div
__riscv_muldiv
__riscv_fdiv
__riscv_fsqrt
__riscv_float_abi_soft
__riscv_float_abi_single
__riscv_float_abi_double
__riscv_cmodel_medlow
__riscv_cmodel_medany
__riscv_cmodel_pic
__riscv_xlen

Reviewed by:	ngie
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D11901
2017-08-07 14:09:57 +00:00
Ed Maste
d4cd50b494 libunwind: add noexec stack annotation
Reported by:	vangyzen
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9075
2017-01-07 14:40:58 +00:00
Ed Maste
77ac8927fd libunwind: make __{de,}register_frame compatible with libgcc API
The libgcc __register_frame and __deregister_frame functions take a
pointer to a set of FDE/CIEs, terminated by an entry where length is 0.

In Apple's libunwind implementation the pointer is taken to be to a
single FDE. I suspect this was just an Apple bug, compensated by Apple-
specific code in LLVM.

See lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp and
http://lists.llvm.org/pipermail/llvm-dev/2013-April/061737.html
for more detail.

This change is based on the LLVM RTDyldMemoryManager.cpp. It should
later be changed to be alignment-safe.

Reported by:	dim
Reviewed by:	dim
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D8869
2016-12-21 14:06:44 +00:00
Ruslan Bukin
ef37962496 Implement riscv jumpto() so world can be compiled.
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-11-10 12:54:33 +00:00
Ed Maste
0656bb22c0 libunwind: consistently add \n to log and trace messages
Previously most messages included a newline in the string, but a few of
them were missing. Fix these and simplify by just adding the newline in
the _LIBUNWIND_LOG macro itself.

While here correct 'libuwind' typo (missing 'n').

Upstream LLVM libunwind commits r280086 and r280103.
2016-10-28 00:04:04 +00:00
Ed Maste
03f124f737 libunwind: correct return code in unwinding trace log message
Obtained from:	LLVM r277215
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2016-07-29 21:37:00 +00:00
Ruslan Bukin
0efcacc58b Set real values for context/cursor sizes for RISC-V to prevent static
assertions.

Reviewed by:	emaste
Sponsored by:	DARPA, AFRL
2016-07-22 14:57:26 +00:00
Ed Maste
49b33d144b libunwind: Properly align _Unwind_Exception.
_Unwind_Exception is required to be double word aligned.  GCC has
interpreted this to mean "use the maximum useful alignment for the
target" so follow that lead.

Obtained from:	LLVM review D22543
2016-07-20 03:13:02 +00:00
Ed Maste
b1b8369114 llvm-libunwind: use conventional (non-Darwin) X86 register numbers
For historical reasons Darwin/i386 has ebp and esp swapped in the
eh_frame register numbering.  That is:

             Darwin      Other
    Reg #    eh_frame    eh_frame    DWARF
    =====    ========    ========    =====
      4        ebp         esp        esp
      5        esp         ebp        ebp

Although the UNW_X86_* constants are not supposed to be coupled to
DWARF / eh_frame numbering they are currently conflated in LLVM
libunwind, and thus we require the non-Darwin numbering.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2016-07-19 00:47:00 +00:00
Ed Maste
c44b4795a9 libunwind: limit stack usage in unwind cursor
This may be reworked upstream but in the interim should address the
stack usage issue reported in the PR.

PR:		206384
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2016-07-09 00:35:20 +00:00
Ed Maste
1de4a1a95b libunwind: update to upstream snapshot r272680
The key improvement is that it may be built without cross-unwinding
support, which significantly reduces the stack space requirement.

MFC after:	1 week
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D7123
2016-07-08 20:20:46 +00:00
Ruslan Bukin
bdffadedf5 Add stubs for RISC-V ISA so libunwind can be compiled.
Reviewed by:	emaste
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D5035
2016-01-22 16:42:06 +00:00
Ed Maste
0d7911c03b libunwind: Include header for dl_unwind_find_exidx for ARM EHABI 2016-01-06 19:41:06 +00:00
Ed Maste
b8c23099c6 Merge LLVM libunwind revision 256779 2016-01-04 21:41:02 +00:00
Ed Maste
8c034f6af7 Bring LLVM libunwind snapshot into contrib/llvm/projects 2015-09-23 19:30:46 +00:00
Roman Divacky
1fbefe1829 Remove Xcode cmake win32 projects unittests from LLVM and
clang.xcodeproj INPUTS win32 from clang.

Requested by:	jkim
Approved by:	ed (mentor)
2010-06-10 19:59:23 +00:00
Roman Divacky
f22ef01c33 Import LLVM/clang from vendor stripped of docs/ test/ website/ www/ examples/
in llvm/ and/or llvm/contrib/clang/ respectively.

Approved by:	ed (mentor)
Approved by:	core
2010-06-09 17:59:52 +00:00