| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[libunwind] Fix wrong end argument passed to decodeEHHdr() (#68813) All but one callsite were actually passing start+length arguments. This should not have any functional change since the end argument is almost always ignored. I noticed this while debugging some incorrect error messages being printed while running the testsuite baremetal (using binaries that did not have a valid eh_frame_hdr section): the tests print libunwind: unsupported .eh_frame_hdr version: 20 at https://github.com/arichardson/upstream-llvm-project/commit/8000d308146ebf49cb364cb600e28a0a42e22c83 because libunwind is reading nonsense data for .eh_frame_hdr. | 2 年前 | |
[runtimes] Prefer -fvisibility-global-new-delete=force-hidden (#84917) 27ce26b06655cfece3d54b30e442ef93d3e78ac7 added the new option -fvisibility-global-new-delete=, where -fvisibility-global-new-delete=force-hidden is equivalent to the old option -fvisibility-global-new-delete-hidden. At the same time, the old option was deprecated. Test for and use the new option form first; if unsupported, try using the old form. This avoids warnings in the MinGW builds, if built with Clang 18 or newer. | 2 年前 | |
[libunwind] Fix a few libunwind includes In UnwindCursor.hpp, include config.h before checking _LIBUNWIND_SUPPORT_SEH_UNWIND. Include libunwind_ext.h for UNW_STEP_SUCCESS. Differential Revision: https://reviews.llvm.org/D86766 | 3 年前 | |
[runtimes][NFC] Remove trailing whitespace | 2 年前 | |
[libunwind] Handle G in personality string Tested with the following program: static volatile int* x = nullptr; void throws() __attribute__((noinline)) { if (getpid() == 0) return; throw "error"; } void maybe_throws() __attribute__((noinline)) { volatile int y = 1; x = &y; throws(); y = 2; } int main(int argc, char** argv) { int y; try { maybe_throws(); } catch (const char* e) { //printf("Caught\n"); } y = *x; printf("%d\n", y); // should be MTE failure. return 0; } Built using clang++ -c -O2 -target aarch64-linux -fexceptions -march=armv8-a+memtag -fsanitize=memtag-heap,memtag-stack Currently only Android implements runtime support for MTE stack tagging. Without this change, we crash on __cxa_get_globals when trying to catch the exception (because the stack frame __cxa_get_globals frame will fail due to tags left behind on the stack). With this change, we crash on the y = *x; as expected, because the stack frame has been untagged, but the pointer hasn't. Reviewed By: #libunwind, compnerd, MaskRay Differential Revision: https://reviews.llvm.org/D128998 | 3 年前 | |
[libunwind] Avoid reading OOB for non-existent .eh_frame_hdr (#68815) I was running the tests with baremetal picolibc which has a linker script that __eh_frame_start==__eh_frame_end (not equal to zero) in case there is no .eh_frame_hdr. I noticed that libunwind was trying to read nonsense data because it was printing messages such as libunwind: unsupported .eh_frame_hdr version: 20 at https://github.com/llvm/llvm-project/commit/8000d308146ebf49cb364cb600e28a0a42e22c83 This change adds a ehHdr size check to avoid reading this out-of-bounds data and potentially crashing. | 2 年前 | |
[libunwind] Fix a -Wextra-semi warning | 2 年前 | |
[runtimes][NFC] Remove filenames at the top of the license notice We've stopped doing it in libc++ for a while now because these names would end up rotting as we move things around and copy/paste stuff. This cleans up all the existing files so as to stop the spreading as people copy-paste headers around. | 4 年前 | |
[libunwind] Add GCS support for AArch64 (#99335) AArch64 GCS (Guarded Control Stack) is similar enough to CET that we can re-use the existing code that is guarded by _LIBUNWIND_USE_CET, so long as we also add defines to locate the GCS stack and pop the entries from it. We also need the jumpto function to exit using br instead of ret, to prevent it from popping the GCS stack. GCS support is enabled using the LIBUNWIND_ENABLE_GCS cmake option. This enables -mbranch-protection=standard, which enables GCS. For the places we need to use GCS instructions we use the target attribute, as there's not a command-line option to enable a specific architecture extension. (cherry picked from commit b32aac4358c1f6639de7c453656cd74fbab75d71) | 1 年前 | |
[libunwind] Fix build with -Wunused-function https://reviews.llvm.org/D144252 removed -Wno-unused-function from the libunwind build, but we have an unused function when you're building for armv7 without assertions. Mark that function as possibly unused to avoid the warning, and mark the parameter as a const pointer while I'm here to make it clear that nothing is modified by a debugging function. Reviewed By: #libunwind, philnik Differential Revision: https://reviews.llvm.org/D156496 | 3 年前 | |
[runtimes][NFC] Remove filenames at the top of the license notice We've stopped doing it in libc++ for a while now because these names would end up rotting as we move things around and copy/paste stuff. This cleans up all the existing files so as to stop the spreading as people copy-paste headers around. | 4 年前 | |
[libunwind] [SEH] Add debug logging in __libunwind_seh_personality Differential Revision: https://reviews.llvm.org/D148659 | 3 年前 | |
[libunwind][nfc] Avoid type warning of debug printf (#67390) Change PRIu32 to PRIxPTR to avoid type warning of debug printf since VE uses 64 bits SjLj. I don't use PRIuPTR since the print message has 0x-prefix from the beginning. I also change related PRIuPTR to PRIxPTR since those uses 0x-prefix too. | 2 年前 | |
[WebAssembly] __USING_WASM_EXCEPTIONS__ -> __WASM_EXCEPTIONS__ (#92840) We've decided to change __USING_WASM_EXCEPTIONS__ preprocessor to __WASM_EXCEPTIONS__ given that it's more concise. | 2 年前 | |
[libunwind] Add GCS support for AArch64 (#99335) AArch64 GCS (Guarded Control Stack) is similar enough to CET that we can re-use the existing code that is guarded by _LIBUNWIND_USE_CET, so long as we also add defines to locate the GCS stack and pop the entries from it. We also need the jumpto function to exit using br instead of ret, to prevent it from popping the GCS stack. GCS support is enabled using the LIBUNWIND_ENABLE_GCS cmake option. This enables -mbranch-protection=standard, which enables GCS. For the places we need to use GCS instructions we use the target attribute, as there's not a command-line option to enable a specific architecture extension. (cherry picked from commit b32aac4358c1f6639de7c453656cd74fbab75d71) | 1 年前 | |
[libunwind] Remove unnecessary strcpy dependency (#72043) libunwind uses a minimal set of necessary standard library functions, basically just memset and memcpy. There is a single use of strcpy to copy the bytes "CLNGUNW" into a uint64_t object. This is both an arguably odd use of the strcpy function as well as it unnecessarily widens the set of library functions that must be available to build libunwind, which can be an obstacle in baremetal scenarios. This change simply replaces this one strcpy with the more fundamental memcpy. | 2 年前 | |
[libunwind] Add GCS support for AArch64 (#99335) AArch64 GCS (Guarded Control Stack) is similar enough to CET that we can re-use the existing code that is guarded by _LIBUNWIND_USE_CET, so long as we also add defines to locate the GCS stack and pop the entries from it. We also need the jumpto function to exit using br instead of ret, to prevent it from popping the GCS stack. GCS support is enabled using the LIBUNWIND_ENABLE_GCS cmake option. This enables -mbranch-protection=standard, which enables GCS. For the places we need to use GCS instructions we use the target attribute, as there's not a command-line option to enable a specific architecture extension. (cherry picked from commit b32aac4358c1f6639de7c453656cd74fbab75d71) | 1 年前 | |
[libunwind] Fix problems caused by combining BTI and GCS (#102322) The libunwind assembly files need adjustment in order to work correctly when both BTI and GCS are both enabled (which will be the case when using -mbranch-protection=standard): * __libunwind_Registers_arm64_jumpto can't use br to jump to the return location, instead we need to use gcspush then ret. * Because we indirectly call __libunwind_Registers_arm64_jumpto it needs to start with bti jc. * We need to set the GCS GNU property bit when it's enabled. --------- Co-authored-by: Daniel Kiss <daniel.kristof.kiss@gmail.com> (cherry picked from commit 39529107b46032ef0875ac5b809ab5b60cd15a40) | 1 年前 | |
[libunwind][WebAssembly] Make libunwind compilable (#92192) This tries to make Wasm compilable in LLVM tree with CMake for non-Emscripten platform. This - Adds -D__USING_WASM_EXCEPTIONS__ when you compile with -fwasm-exceptions (like other EH options) in Clang - Exclude UnwindLevel1.c, UnwindRegistersSave.S, and UnwindRegistersRestore.S when compiling with Wasm - Changed some __USING_WASM_EXCEPTIONS__ to __wasm__; they should be applied when compiling with Wasm w/o exceptions. - Define some unused macros to make it compile Fixes #72771. | 2 年前 | |
[libunwind][AIX] Implement _Unwind_FindEnclosingFunction() using traceback table on AIX Summary: The implementation of _Unwind_FindEnclosingFunction(void *ip) takes the context of itself and then uses the context to get the info of the function enclosing ip. This approach does not work for AIX because on AIX, the TOC base in GPR2 is used as the base for calculating relative addresses. Since _Unwind_FindEnclosingFunction() may be in a different shared lib than the function containing ip, their TOC bases can be different. Therefore, using the value of GPR2 in the context from _Unwind_FindEnclosingFunction() as the base results in incorrect addresses. On the other hand, the start address of a function is available in the traceback table following the instructions of each function on AIX. To get to the traceback table, search a word of 0 starting from ip and the traceback table is located after the word 0. This patch implements _Unwind_FindEnclosingFunction() for AIX by obtaining the function start address from its traceback table. Reviewed by: compnerd, MaskRay, libunwind Differential Revision: https://reviews.llvm.org/D131709 | 3 年前 | |
[libunwind] Fix problems caused by combining BTI and GCS (#102322) The libunwind assembly files need adjustment in order to work correctly when both BTI and GCS are both enabled (which will be the case when using -mbranch-protection=standard): * __libunwind_Registers_arm64_jumpto can't use br to jump to the return location, instead we need to use gcspush then ret. * Because we indirectly call __libunwind_Registers_arm64_jumpto it needs to start with bti jc. * We need to set the GCS GNU property bit when it's enabled. --------- Co-authored-by: Daniel Kiss <daniel.kristof.kiss@gmail.com> (cherry picked from commit 39529107b46032ef0875ac5b809ab5b60cd15a40) | 1 年前 | |
[libunwind] Be more careful about enabling GCS (#101973) We need both GCS to be enabled by the compiler (which we do by checking if __ARM_FEATURE_GCS_DEFAULT is defined) and for arm_acle.h to define the GCS intrinsics. Check the latter by checking if _CHKFEAT_GCS is defined. (cherry picked from commit c649194a71b47431f2eb2e041435d564e3b51072) | 1 年前 | |
[libunwind][WebAssembly] Support Wasm EH This adds Wasm-specific libunwind port to support Wasm exception handling (https://github.com/WebAssembly/exception-handling). Wasm EH requires __USING_WASM_EXCEPTIONS__ to be defined. This adds Unwind-wasm.c, which defines libunwind APIs for Wasm. This also adds a thread_local struct of type _Unwind_LandingPadContext, which serves as a medium for input/output data between the user code and the personality function. How all these work is explained in https://github.com/WebAssembly/tool-conventions/blob/main/EHScheme.md. (The doc is old and "You Shouldn't Prune Unreachable Resumes" section doesn't apply anymore, but otherwise it should be good) The bulk of these changes was added back in Mar 2020 in https://github.com/emscripten-core/emscripten/pull/10577 to emscripten repo and has been used ever since. Now we'd like to upstream this so that other toolchains that don't use emscripten libraries, e.g., WASI, can use this too. Companion patch: D158918 Reviewed By: dschuff, #libunwind, phosek Differential Revision: https://reviews.llvm.org/D158919 | 2 年前 | |
[runtimes][NFC] Remove filenames at the top of the license notice We've stopped doing it in libc++ for a while now because these names would end up rotting as we move things around and copy/paste stuff. This cleans up all the existing files so as to stop the spreading as people copy-paste headers around. | 4 年前 | |
[WebAssembly] __USING_WASM_EXCEPTIONS__ -> __WASM_EXCEPTIONS__ (#92840) We've decided to change __USING_WASM_EXCEPTIONS__ preprocessor to __WASM_EXCEPTIONS__ given that it's more concise. | 2 年前 | |
[libunwind] On Darwin, add a callback-based lookup scheme for JIT'd unwind info. This commit adds support for a new callback-based lookup scheme for unwind info that was inspired by the _dyld_find_unwind_info_sections SPI that libunwind uses to find unwind-info in non-JIT'd frames. From llvm-project/libunwind/src/AddressSpace.hpp: struct dyld_unwind_sections { const struct mach_header* mh; const void* dwarf_section; uintptr_t dwarf_section_length; const void* compact_unwind_section; uintptr_t compact_unwind_section_length; }; extern bool _dyld_find_unwind_sections(void *, dyld_unwind_sections *); During unwinding libunwind calls _dyld_find_unwind_sections to both find unwind section addresses and identify the subarchitecture for frames (via the MachO-header pointed to by the mh field). This commit introduces two new libunwind SPI functions: struct unw_dynamic_unwind_sections { unw_word_t dso_base; unw_word_t dwarf_section; size_t dwarf_section_length; unw_word_t compact_unwind_section; size_t compact_unwind_section_length; }; typedef int (*unw_find_dynamic_unwind_sections)( unw_word_t addr, struct unw_dynamic_unwind_sections *info); // Returns UNW_ESUCCESS if successfully registered, UNW_EINVAL for duplicate // registrations, and UNW_ENOMEM to indicate too many registrations. extern int __unw_add_find_dynamic_unwind_sections( unw_find_dynamic_unwind_sections find_dynamic_unwind_sections); // Returns UNW_ESUCCESS if successfully deregistered, UNW_EINVAL to indicate // no such registration. extern int __unw_remove_find_dynamic_unwind_sections( unw_find_dynamic_unwind_sections find_dynamic_unwind_sections); These can be used to register and deregister callbacks that have a similar signature to _dyld_find_unwind_sections. During unwinding if _dyld_find_unwind_sections returns false (indicating that no frame info was found by dyld) then registered callbacks are run in registration order until either the unwind info is found or the end of the list is reached. With this commit, and by implementing the find-unwind-info callback in the ORC runtime in LLVM, we (1) enable support for registering JIT'd compact-unwind info with libunwind*, (2) provide a way to identify the subarchitecture for each frame (by returning a pointer to a JIT'd MachO header), and (3) delegate tracking of unwind info to the callback, which may be able to implement more efficient address-based lookup than libunwind. * JITLink does not process or register compact unwind info yet, so this patch does not fully enable compact unwind info in ORC, it simply provides some necessary plumbing. JITLink support for compact unwind should land some time in the LLVM 17 development cycle. Reviewed By: pete Differential Revision: https://reviews.llvm.org/D142176 | 3 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 3 年前 |