summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Silence warnings in libunwind.Logan Chien2014-12-212-6/+9
| | | | | | | | | | | | | | * Remove the embedded directive undefined behavior by moving the the #ifdef out of the macro arguments. [-Wembedded-directive] * Remove the local variable shadowing warning by renaming frameInfo in UnwindLevel1-gcc-ext.c. [-Wshadow] * Explicitly cast the function pointer to void pointer to avoid the comparison between function pointer and void pointer. [-Wpedantic] llvm-svn: 224690
* [libcxxabi] Add __cxa_thread_atexit for TLS support on Linux.Dan Albert2014-12-182-0/+36
| | | | | | | | | | | | | | | | | | | | | Summary: Fixes PR21738. The implementation for this is handled by __cxa_thread_atexit_impl, which is supplied by libc. More information: https://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables Reviewers: mclow.lists, EricWF, jroelofs Reviewed By: jroelofs Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D6708 llvm-svn: 224477
* [libcxxabi] Refactor building and testing libc++abi without threadsEric Fiselier2014-11-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds CMake support for building and testing libc++abi without threads. 1. Add `LIBCXXABI_ENABLE_THREADS` option to CMake. 2. Propagate `LIBCXXABI_ENABLE_THREADS` to lit via lit.site.cfg.in 3. Configure tests for `LIBCXXABI_ENABLE_THREADS=OFF Currently the test suite does not work when libc++abi is built without threads because that information does not propagate to the test suite. Reviewers: danalbert, mclow.lists, jroelofs Reviewed By: jroelofs Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6393 llvm-svn: 222702
* [libcxxabi] Delay adjustment of pointer to prevent referencing invalid memory.Eric Fiselier2014-11-241-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch delays the dereference adjustment until we are sure the thrown type is a pointer type. It is possible the thrown type is not a pointer and is smaller than `sizeof(void*)`. If the thrown type is is smaller than `sizeof(void*)` the deference adjustment will result in a heap buffer overflow. I audited all the call sites of `can_catch(...)` and there are no places where `adjustedPtr` is used if `can_catch(...)` returns false. For this reason the patch should not introduce any functionality change. This patch fixes the following tests when using ASAN: * unwind_01.cpp * unwind_02.cpp * unwind_04.cpp Reviewers: danalbert, jroelofs, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6353 llvm-svn: 222674
* [libcxxabi] Refactor CMakeLists.txt's handling of compile and link flags to ↵Eric Fiselier2014-11-182-18/+18
| | | | | | | | | | | | | | | | | | suppress warnings. Summary: This patch mirrors the recent change to libc++ found here http://reviews.llvm.org/D6277. This fixes PR20395 (http://llvm.org/bugs/show_bug.cgi?id=20395). Reviewers: jroelofs, mclow.lists, danalbert Reviewed By: danalbert Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6286 llvm-svn: 222252
* Make sure only NEON enabled devices save/restore D16+ registersRenato Golin2014-11-072-2/+2
| | | | llvm-svn: 221532
* Correctly export _Unwind_[GS]et(GR|IP) for EHABI.Dan Albert2014-10-133-2/+24
| | | | | | | | | | | | | | | | | | These need to have normal linkage instead of being static inline as many libraries expect to be able to declare these and have the linker find them rather than needing to include the header. http://mentorembedded.github.io/cxx-abi/abi-eh.html Also clean up some warnings while I'm here. Reviewers: jroelofs, kledzik Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5754 llvm-svn: 219629
* Use __atomic_exchange_n instead of Clang's __sync_swapReid Kleckner2014-10-032-8/+10
| | | | | | | | | | | Also remove an extra extern "C" from a global variable redeclaration. This allows building libcxxabi with GCC on my system. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D5604 llvm-svn: 219012
* Support Cortex-m0Jonathan Roelofs2014-10-023-21/+70
| | | | | | | | | As the title says... also, fix all the ARM asm return sequences so that they work on processors without the BX instruction. http://reviews.llvm.org/D5314 llvm-svn: 218869
* Adding ABI support for __cxa_throw_bad_array_new_length.Aaron Ballman2014-09-111-0/+5
| | | | llvm-svn: 217604
* ARM Unwind syntaxRenato Golin2014-09-112-6/+30
| | | | | | | | | | | This patch fixes the bad argument that GAS accepted but the IAS didn't, ie. {#0x20}, moving it to {0x20} which both accept. It also makes the ARMv7+ save/restore correct by using VFP instructions rather than old co-processor ones. Fixes PR20529. llvm-svn: 217585
* Implement post-review comments for r216730Jonathan Roelofs2014-09-091-2/+16
| | | | | | Feedback was 'this could use better comments'. llvm-svn: 217459
* Remove an unused typedef from __class_type_info::search_below_dstAlexander Potapenko2014-09-081-1/+0
| | | | | | to fix the -Wunused-local-typedef warning. llvm-svn: 217367
* Use correct __ARM_ARCH macroRenato Golin2014-09-072-2/+2
| | | | llvm-svn: 217341
* s/LIBCXXABI_SINGLE_THREADED/LIBCXXABI_HAS_NO_THREADS/ for consistency with ↵Jonathan Roelofs2014-09-055-15/+13
| | | | | | | | | libcxx Also remove the audotedection part so that if you're crazy enough to want a single-threaded abi library, you'll say so explicitly in the build. llvm-svn: 217262
* Allow LIBCXXABI_SINGLE_THREADED to be defined by build scriptsJonathan Roelofs2014-09-021-1/+2
| | | | llvm-svn: 216952
* Make _Unwind_Backtrace() work on ARM.Dan Albert2014-08-294-27/+91
| | | | | | | | | | | | | | | | | | | | | | Summary: Since the personality functions do the actual unwinding on ARM, and will also stop unwinding when they encounter a handler, we invoke _Unwind_VRS_Interpret() directly form _Unwind_Backtrace(). To simplify, the logic for decoding an EHT is moved out of unwindOneFrame() and into its own function, decode_eht_entry(). Unlike unwindOneFrame(), which could only handle ARM's compact personality function entries (section 6.3) decode_eht_entry() can handle the generic entries (section 6.2). Reviewers: jroelofs Reviewed By: jroelofs Subscribers: piman, aemerson, cfe-commits Differential Revision: http://reviews.llvm.org/D5112 llvm-svn: 216730
* Add baremetal ARM support to libcxxabi/libunwindJonathan Roelofs2014-08-213-2/+40
| | | | | | http://reviews.llvm.org/D4993 llvm-svn: 216202
* Improve logging of aborts for Android.Dan Albert2014-08-191-2/+21
| | | | | | | | In Android, stderr only goes to the console, and as such will only ever be seen by adb shell users. Since very few developers will ever actually see that, also send the abort message to logcat and the tombstone. llvm-svn: 215983
* libcxxabi must link to dl if using bundled unwindJonathan Roelofs2014-08-181-0/+1
| | | | | | | Patch by Ismail Donmez http://reviews.llvm.org/D4953 llvm-svn: 215950
* Fix the CMake build on Mac when setting MACOSX_DEPLOYMENT_TARGET=10.6Hans Wennborg2014-08-121-1/+1
| | | | | | | The build file was trying to use LIBCXXABI_VERSION, which isn't set anywhere. llvm-svn: 215465
* Fix a copy-pasta in r214573Jonathan Roelofs2014-08-051-1/+0
| | | | llvm-svn: 214873
* [unwinder] Tell the assembler that functions are functions so that the ↵Jonathan Roelofs2014-08-011-0/+19
| | | | | | | | | | linker knows how to link them. This fixes an interworking problem when the unwinder/libcxxabi is built for Thumb. When unw_getcontext is not marked as a function, 'bl' is used for the branch instead of 'bx'. llvm-svn: 214573
* Fix for libc++abi when using -Wl,--as-needed.Dan Albert2014-07-142-0/+8
| | | | | | | | | | | The cmake files for libc++abi and the unwinder weren't linking against libpthread or an unwind library. If the tests were linked with -Wl,--as-needed, these libraries wouldn't be linked, causing them to fail. Patch contributed by İsmail Dönmez. llvm-svn: 212958
* Support LLVM_LIBDIR_SUFFIX.Dan Albert2014-07-112-4/+4
| | | | | | | | This is useful for distros installing under /usr/lib64. Patch from İsmail Dönmez. llvm-svn: 212826
* Add support for building and testing the unwinder.Dan Albert2014-07-112-7/+102
| | | | | | | Note: The unwinder currently only works on Darwin and on ARM Linux. Non-ARM Linux support is not yet implemented, and will fail to build. llvm-svn: 212824
* Add lit configs for libcxxabi tests.Dan Albert2014-07-101-7/+1
| | | | | | | | | | | | | | | This makes running libcxxabi tests on Linux _much_ easier. Adds a check-libcxxabi target to cmake. Also defaults to building a dynamic libc++abi. This is so that the default options still test the libc++abi that is being built. There are two problems with testing a static libc++abi. In the case of a standalone build, the tests will link the system's libc++, which might not have been built against our libc++abi. In the case of an in tree build, libc++ will prefer a dynamic libc++abi from the system over a static libc++abi from the output directory. llvm-svn: 212672
* Add a cmake build system.Dan Albert2014-07-031-0/+99
| | | | | | | Will add support for tests with lit in a later patch. This does not yet support building the unwinder in src/Unwind. llvm-svn: 212286
* Fix a warning about undeclared call to abort().Dan Albert2014-07-021-1/+3
| | | | llvm-svn: 212232
* Revert the LSDA change to scan_eh_tab.Logan Chien2014-06-301-19/+8
| | | | | | | | | | | This commit reverts the LSDA-related change in r211745. The r211745 adds a new argument to scan_eh_tab(), i.e. lsda. However, IMO, calling _Unwind_GetLanguageSpecificData() directly in scan_eh_tab() was more intuitive and reduces several function call to _Unwind_GetLanguageSpecificData() in __cxx_personality_v0(). llvm-svn: 212037
* Silence the implicit signed/unsigned conversion warning.Logan Chien2014-06-272-27/+29
| | | | llvm-svn: 211912
* Silence unused variable and parameter warnings.Logan Chien2014-06-262-3/+9
| | | | llvm-svn: 211790
* Fix linux build.Logan Chien2014-06-261-8/+10
| | | | | | | | | * Replace strlcpy with snprintf since strlcpy is not available in glibc. * Replace __LINUX__ with __linux__. llvm-svn: 211784
* Add missing header for _LIBUNWIND_LOG().Logan Chien2014-06-261-0/+1
| | | | llvm-svn: 211775
* Fix building for iOSNick Kledzik2014-06-261-1/+1
| | | | llvm-svn: 211751
* Minor libc++abi changes to make things build better with gcc.Nico Weber2014-06-253-1/+3
| | | | llvm-svn: 211748
* Update libc++abi to use the ARM EHABI unwinder from its libunwind.Nico Weber2014-06-253-36/+85
| | | | llvm-svn: 211745
* Land support for ARM EHABI unwinding for libunwind.Nico Weber2014-06-258-63/+1596
| | | | | | | | | | | This was written by: Albert Wong <ajwong@chromium.org> Antoine Labour <piman@chromium.org> Dana Jansen <danakj@chromium.org Jonathan Roelofs <jonathan@codesourcery.com> Nico Weber <thakis@chromium.org> llvm-svn: 211743
* Start landing support for ARM EHABI unwinding.Nico Weber2014-06-252-14/+48
| | | | | | | | The new code will be behind a LIBCXXABI_ARM_EHABI define (so that platforms that don't want it can continue using e.g. SJLJ). This commit mostly just adds the LIBCXXABI_ARM_EHABI define. llvm-svn: 211739
* Let libc++abi compile with gcc.Nico Weber2014-05-301-11/+12
| | | | | | | | | | | | | | There was a single problem in cxa_demangle.cpp, where gcc would complain `error: changes meaning of 'String'` about the line `typedef String String;`. According to 3.3.7p2, this diagnostic is allowed (but not required, so clang does not have to report this). As a fix, make string_pair a template and pass String as template parameter. This fixes the error with gcc and also removes some repetition from the code. No behavior change. llvm-svn: 209909
* Fix typo in comment.Logan Chien2014-05-141-1/+1
| | | | llvm-svn: 208795
* PR19091: Track whether we're demangling a function template specialization toRichard Smith2014-05-121-11/+29
| | | | | | | determine whether we get a mangling for a return type, rather than trying to figure it out based on whether the mangled name ended with a '>'. llvm-svn: 208611
* Implement ARM EHABI exception handling.Logan Chien2014-05-104-5/+310
| | | | | | | This commit implements the ARM zero-cost exception handling support for libc++abi. llvm-svn: 208466
* Fixes more incorrect #ifs for SJ/LJ exceptionsJonathan Roelofs2014-05-081-16/+16
| | | | | | Replaces several `#if __arm__` with `#if __USING_SJLJ_EXCEPTIONS__`. llvm-svn: 208352
* Fix broken build from r208135Jonathan Roelofs2014-05-081-0/+1
| | | | llvm-svn: 208350
* Make libc++abi use the implementation of __numstr from libc++. No ↵Marshall Clow2014-05-071-127/+6
| | | | | | functionality change, just removal of duplicated code. llvm-svn: 208246
* On single threaded systems, turn mutexes into nopsJonathan Roelofs2014-05-065-5/+83
| | | | | | http://reviews.llvm.org/D3386 llvm-svn: 208135
* Fix cast warningNick Kledzik2014-04-281-2/+2
| | | | llvm-svn: 207469
* Use return address register from CIE. Move ↵Nick Kledzik2014-04-283-91/+20
| | | | | | DwarfInstructions::lastRestoreReg() to Register::lastDwarfRegNum(). llvm-svn: 207467
* No need to specialize DwarfInstructions::getCFA(). It is the same for all archsNick Kledzik2014-04-281-63/+12
| | | | llvm-svn: 207463
OpenPOWER on IntegriCloud