summaryrefslogtreecommitdiff
path: root/libunwind
AgeCommit message (Collapse)Author
2018-09-24Reverting r342895Luke Cheeseman
- The used builtins do not compile for pre arm v8.3a targets with gcc
2018-09-24[AArch64] Unwinding support for return address signingLuke Cheeseman
- When return address signing is enabled, the LR may be signed on function entry - When an exception is thrown the return address is inspected used to unwind the call stack - Before this happens, the return address must be correctly authenticated to avoid causing an abort by dereferencing the signed pointer Differential Revision: https://reviews.llvm.org/D51432
2018-09-22[libunwind][NFC] Suppress unused parameter warningsLouis Dionne
Reviewers: EricWF Subscribers: christof, chrib, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D52393
2018-09-04[CMake] Don't use -rtlib=compiler-rt with -nodefaultlibs.Charles Davis
Summary: This switch only has an effect at link time. It changes the default compiler support library to `compiler-rt`. With `-nodefaultlibs`, this library won't get linked anyway; Clang actually warns about that. Reviewers: mstorsjo, rnk Subscribers: dberris, mgorny, christof, cfe-commits Differential Revision: https://reviews.llvm.org/D51645
2018-09-04[CMake] Remove variable reference that isn't used.Charles Davis
Summary: This variable is never defined, so its value is always empty. Since `libunwind` is needed to build the C++ ABI library in the first place, it should never be linked to the C++ ABI library anyway. Reviewers: mstorsjo, rnk Subscribers: mgorny, christof, cfe-commits Differential Revision: https://reviews.llvm.org/D51644
2018-08-31Export public functions implemented in assembly on Windows.Charles Davis
Summary: By default, symbols aren't visible outside of the module that defines them. To make them visible, they must be exported. The easiest way to do that is to embed an `-export:symname` directive into the object file. Reviewers: mstorsjo, rnk Subscribers: christof, cfe-commits Differential Revision: https://reviews.llvm.org/D51508
2018-08-31Fix existing code for SEH on ARM to compile correctlyMartin Storsjo
Even though SEH for ARM is incomplete, make what code already exists at least compile correctly. The _LIBUNWIND_CURSOR_SIZE wasn't correct. ARM (and AArch64) have a DISPATCHER_CONTEXT field named TargetPc instead of TargetIp. For the libunwind.h UNW_* constants, there is no UNW_ARM_PC, only UNW_ARM_IP. Don't use 'r' as loop variable when 'r' already is a Registers_arm member. Differential Revision: https://reviews.llvm.org/D51530
2018-08-31[AddressSpace] Use the macro to set hidden visibility on LocalAddressSpace.Charles Davis
Summary: That attribute has no effect on Windows anyway--classes are hidden by default. Reviewers: mstorsjo, rnk Subscribers: christof, cfe-commits Differential Revision: https://reviews.llvm.org/D51509
2018-08-30Add support for SEH unwinding on Windows.Charles Davis
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
2018-08-16NFC: Test commit accessJordan Rupprecht
Testing commit access from a new machine, so using this as an opportunity to revert my old test access commit (r336006) that I never cleaned up.
2018-08-16[libunwind][mips] Include gcc_s for linkageStefan Maksimovic
When compiling with optimizations, mips requires various helper routines(__ashldi3 and the like) contained in libgcc_s. Conditionally include libgcc_s in the set of libraries to be linked to. Differential Revision: https://reviews.llvm.org/D50243
2018-08-16[libunwind][mips] Guard accumulator registersStefan Maksimovic
Mipsr6 does not possess HI and LO accumulator registers, adjust validRegister functions to respect that. Differential Revision: https://reviews.llvm.org/D50244
2018-08-16[libunwind][mips] Modify the __mips_fpr macro checkStefan Maksimovic
The __mips_fpr macro can take the value of 0 as well, change to account for that case. Differential Revision: https://reviews.llvm.org/D50245
2018-08-14[cmake] Add MINGW_LIBRARIES to the linker flagsMartin Storsjo
This is essential when building with -nodefaultlibs. In some CMake versions (noticed in 3.5.1), the same libraries are picked up from CMAKE_REQUIRED_LIBRARIES in some exceptional situations (if CXX probing failed, due to libc++ not being built yet, the libraries from CMAKE_REQUIRED_LIBRARIES are used for linking the target library), but not at all in other newer CMake versions (3.10). This is similar to what already is done in libcxxabi in SVN r302760 and libcxx in SVN r312498. Differential Revision: https://reviews.llvm.org/D50663
2018-08-08Remove unneeded preprocessor condition.Charles Davis
2018-08-08[libunwind][include] Add SEH declarations to <unwind.h>.Charles Davis
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
2018-08-08[libunwind] Fix pointer-to-integer cast warnings on LLP64.Charles Davis
Summary: `long` is too short on LLP64. We have to use `intptr_t` to avoid truncating pointers. Reviewers: mstorsjo, rnk, compnerd, smeenai Subscribers: christof, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D50412
2018-08-03[CMake] Allow building standalone without any llvm-config availableMartin Storsjo
This is the same as libcxxabi/libcxx do. Differential Revision: https://reviews.llvm.org/D50135
2018-08-01Bump version number to 8.0.0svnHans Wennborg
2018-08-01Update docs version and clear release notes after 8.0.0 version bumpHans Wennborg
2018-07-24[CMake] Include CMakeDependentOption in libunwindPetr Hosek
This should resolve the breakage introduced in r337867 which introduced the use of cmake_dependent_option without include the necessary file.
2018-07-24[CMake] Option to control whether shared/static library is installedPetr Hosek
Currently it's only possible to control whether shared or static library build of libc++, libc++abi and libunwind is enabled or disabled and whether to install everything we've built or not. However, it'd be useful to have more fine grained control, e.g. when static libraries are merged together into libc++.a we don't need to install libc++abi.a and libunwind.a. This change adds this option. Differential Revision: https://reviews.llvm.org/D49573
2018-07-17The semantics of DW_CFA_GNU_args_size have changed subtile over theJoerg Sonnenberger
years. Adopt the new convention that it is call-site specific and that it should be applied before moving the IP by personality routines, but not during normal unwinding. Differential Revision: https://reviews.llvm.org/D38680
2018-07-10[CMake] Set per-runtime library directory suffix in runtimes buildPetr Hosek
Do not use LLVM_RUNTIMES_LIBDIR_SUFFIX variable which is an internal variable used by the runtimes build from individual runtimes, instead set per-runtime librarhy directory suffix variable which is necessary for the sanitized runtimes build to install libraries into correct location. Differential Revision: https://reviews.llvm.org/D49121
2018-06-29Introduce a separate preprocessor macro, _LIBUNWIND_USE_DLADDR, for directly ↵Jordan Rupprecht
controlling a dependency on dladdr(). This will allow us to use libunwind without adding a libdl dependency. Reviewers: saugustine Subscribers: christof, chrib, cfe-commits, echristo Differential Revision: https://reviews.llvm.org/D48733
2018-06-29Revert "Revert "Support for multiarch runtimes layout""Eric Christopher
This reverts commit r336005 that was accidentally committed.
2018-06-29Add a blank line to docs/README.txt test commit accessJordan Rupprecht
Subscribers: christof, cfe-commits Differential Revision: https://reviews.llvm.org/D48785
2018-06-29Revert "Support for multiarch runtimes layout"Jordan Rupprecht
This reverts commit 0c7cea3c0c6338b99e30c13201365a3dd4edc6f4.
2018-06-28Support for multiarch runtimes layoutPetr Hosek
This change adds a support for multiarch style runtimes layout, so in addition to the existing layout where runtimes get installed to: lib/clang/$version/lib/$os Clang now allows runtimes to be installed to: lib/clang/$version/$target/lib This also includes libc++, libc++abi and libunwind; today those are assumed to be in Clang library directory built for host, with the new layout it is possible to install libc++, libc++abi and libunwind into the runtime directory built for different targets. The use of new layout is enabled by setting the LLVM_ENABLE_RUNTIME_TARGET_DIR CMake variable and is supported by both projects and runtimes layouts. The runtimes CMake build has been further modified to use the new layout when building runtimes for multiple targets. Differential Revision: https://reviews.llvm.org/D45604
2018-06-20[CMake] Convert paths to the right form in standalone builds on WindowsMartin Storsjo
The paths output from llvm-config --cmakedir and from clang --print-libgcc-file-name can contain backslashes, while CMake can't handle the paths in this form. This matches what compiler-rt already does (since SVN r203789 and r293195). Differential Revision: https://reviews.llvm.org/D48353
2018-06-18Update copyright year to 2018.Paul Robinson
2018-05-16[OR1K] Add the EPCR special-purpose register to register state.whitequark
This makes it possible to unwind hardware exception stack frames, which necessarily save every register and so need an extra column for storing the return address. CFI for the exception handler could then look as follows: .globl exception_vector exception_vector: .cfi_startproc .cfi_signal_frame .cfi_return_column 32 l.addi r1, r1, -0x100 .cfi_def_cfa_offset 0x100 l.sw 0x00(r1), r2 .cfi_offset 2, 0x00-0x100 l.sw 0x04(r1), r3 .cfi_offset 3, 0x04-0x100 l.sw 0x08(r1), r4 .cfi_offset 4, 0x08-0x100 l.mfspr r3, r0, SPR_EPCR_BASE l.sw 0x78(r1), r3 .cfi_offset 32, 0x78-0x100 l.jal exception_handler l.nop l.lwz r2, 0x00(r1) l.lwz r3, 0x04(r1) l.lwz r4, 0x08(r1) l.jr r9 l.nop .cfi_endproc This register could, of course, also be accessed by the trace callback or personality function, if so desired.
2018-05-16[OR1K] Add a dedicated PC register to register state.whitequark
Before this commit, R9, the link register, was used as PC register. However, a stack frame may have R9 not set to PC on entry, either because it uses a custom calling convention, or, more likely, because this is a signal or exception stack frame. Using R9 as PC register made it impossible to unwind such frames. All other architectures similarly use a dedicated PC register.
2018-05-15[libunwind][MIPS] Support MIPS floating-point registers for hard-float ABIs.John Baldwin
Summary: For MIPS ABIs with 64-bit floating point registers including newabi and O32 with 64-bit floating point registers, just save and restore the 32 floating-point registers as doubles. For O32 MIPS with 32-bit floating-point registers, save and restore the individual floating-point registers as "plain" registers. These registers are encoded as floats rather than doubles, but the DWARF unwinder assumes that floating-point registers are stored as doubles when reading them from memory (via AddressSpace::getDouble()). Treating the registers as "normal" registers instead causes the DWARF unwinder to fetch them from memory as a 32-bit register. This does mean that for O32 with 32-bit floating-point registers unw_get_fpreg() and unw_set_fpreg() do not work. One would have to use unw_get_reg() and unw_set_reg() instead. However, DWARF unwinding works correctly as the DWARF CFI emits records for individual 32-bit floating-point registers even when they are treated as doubles stored in paired registers. If the lack of unw_get/set_fpreg() becomes a pressing need in the future for O32 MIPS we could add in special handling to make it work. Reviewers: sdardis, compnerd Reviewed By: sdardis Differential Revision: https://reviews.llvm.org/D41968
2018-04-05[cmake] Remove duplicate command line options from buildAaron Smith
CMAKE_CXX_FLAGS and CMAKE_C_FLAGS are added twice to the command line. This causes the command line options to be doubled which works until it doesn't as not all options can be specified twice. For example, clang-cl foo.c /GS- /GS- -mllvm -small-loop-cost=1 -mllvm -small-loop-cost=1 clang (LLVM option parsing): for the -small-loop-cost option: may only occur zero or one times!
2018-04-04[CMake] Support for monorepo layoutPetr Hosek
Support finding libcxx sources in monorepo style layout. Differential Revision: https://reviews.llvm.org/D45270
2018-02-27[libunwind][MIPS]: Add support for unwinding in N32 processes.John Baldwin
Summary: N32 uses the same register context as N64. However, N32 requires one change to properly fetch addresses from registers stored in memory. Since N32 is an ILP32 platform, getP() only fetches the first 32-bits of a stored register. For a big-endian platform this fetches the upper 32-bits which will be zero. To fix this, add a new getRegister() method to AddressSpace which is responsible for extracting the address stored in a register in memory. This matches getP() for all current ABIs except for N32 where it reads the 64-bit register and returns the low 32-bits as an address. The DwarfInstructions::getSavedRegister() method uses AddressSpace::getRegister() instead of AddressSpace::getP(). Reviewers: sdardis, compnerd Reviewed By: sdardis Differential Revision: https://reviews.llvm.org/D39074
2018-02-27[libunwind] Permit additional compiler and linker flags to be passed to tests.John Baldwin
Summary: This is done via new LIBUNWIND_TEST_COMPILER_FLAGS and LIBUNWIND_TEST_LINKER_FLAGS variables. Reviewed By: sdardis Differential Revision: https://reviews.llvm.org/D43585
2018-01-27[cmake] [libunwind] LLVM_FOUND isn't always set, so just test ifDon Hinton
llvm_setup_rpath() is available instead.
2018-01-26Don't enable _LIBUNWIND_BUILD_ZERO_COST_APIS if building the SJLJ APIsMartin Storsjo
Otherwise, a shared library build with SJLJ APIs enabled would end up with duplicate symbols. This didn't occur for the apple && arm case due to specifically checking for that in the surrounding ifdef. Differential Revision: https://reviews.llvm.org/D42555
2018-01-26[cmake] [libunwind] Call llvm_setup_rpath() when adding shared libraries.Don Hinton
Clang and llvm already use llvm_setup_rpath(), so this change will help standarize rpath usage across all projects. Differential Revision: https://reviews.llvm.org/D42461
2018-01-22[cmake] [libunwind] Fix find_path() problems when cross compilingDon Hinton
When CMAKE_SYSROOT or CMAKE_FIND_ROOT_PATH is set, cmake recommends setting CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY globally which means find_path() always prepends CMAKE_SYSROOT or CMAKE_FIND_ROOT_PATH to all paths used in the search. However, this find_path() invocation is looking for a path in the libcxx project on the host system, not the target system, which can be done by passing NO_CMAKE_FIND_ROOT_PATH. Differential Revision: https://reviews.llvm.org/D41621
2018-01-16[PPC64] Added vector registers.Martin Storsjo
The Registers_ppc64 class needed a couple of changes, both to accommodate the new registers as well as to handle the overlaps of VS register set without wasting space. The save/restore code of V and VS registers was added. As VS registers depend on the VMX extension, they are processed only if VMX support is detected (_ARCH_PWR8 for now). Patch by Leandro Lupori! Differential Revision: https://reviews.llvm.org/D41906
2018-01-10[libunwind] Set up .arcconfig to point to new Diffusion UNW repositoryPetr Hosek
See http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html for related discussion and context. Differential Revision: https://reviews.llvm.org/D41918
2018-01-09[libunwind][MIPS]: Rename Registers_mips_n64 to Registers_mips_newabi.John Baldwin
This is in preparation for adding support for N32 unwinding which reuses the newabi register class. Reviewed By: compnerd Differential Revision: https://reviews.llvm.org/D41842
2018-01-03Update PACKAGE_VERSION to 7.0.0svnHans Wennborg
2018-01-03Update docs version to 7.0Hans Wennborg
2018-01-02Reland [PPC64] Port to ppc64le - initial versionMartin Storsjo
Initial working version of libunwind for PowerPC 64. Tested on little-endian ppc64 host only. Based on the existing PowerPC 32 code. It supports: - context save/restore (unw_getcontext, unw_init_local, unw_resume) - read/write from/to saved registers - backtrace (unw_step) Patch by Leandro Lupori! Differential Revision: https://reviews.llvm.org/D41386 Now builds with LIBUNWIND_ENABLE_CROSS_UNWINDING=ON should work.
2018-01-02Don't use a strict larger-than comparison in the check_fit/does_fit static ↵Martin Storsjo
assert For builds that only target one architecture, this was required to be an exact match, while it previously required the allocation to be strictly larger than the largest concrete one. Requiring it to be larger than on equal should be enough. This makes it more straightforward to update _LIBUNWIND_CONTEXT_SIZE and _LIBUNWIND_CURSOR_SIZE.
2018-01-02Revert `rL321667: [PPC64] Port to ppc64le - initial version`Tim Shen
Differential Revision: https://reviews.llvm.org/D41386