aboutsummaryrefslogtreecommitdiff
path: root/libcxxabi
AgeCommit message (Collapse)AuthorFilesLines
2015-05-08Fix merge conflict that resulted in bad preprocessor blockEric Fiselier1-1/+0
llvm-svn: 236872
2015-05-08Merging r236299:Tom Stellard2-3/+23
------------------------------------------------------------------------ r236299 | ericwf | 2015-04-30 18:49:37 -0700 (Thu, 30 Apr 2015) | 7 lines Disallow conversions from function pointers to void*. Function pointers and member function pointers cannot be converted to void*. libc++abi incorrectly allows this conversion for function pointers. Review URL: http://reviews.llvm.org/D8811 ------------------------------------------------------------------------ llvm-svn: 236868
2015-05-08Merging r234254:Tom Stellard4-17/+118
------------------------------------------------------------------------ r234254 | ericwf | 2015-04-06 16:03:01 -0700 (Mon, 06 Apr 2015) | 25 lines [libcxxabi] Disallow Base to Derived conversions for catching pointers to members. Summary: I accidentally implemented the 4.11 [conv.mem] conversions for libc++abi in a recent patch. @majnemer pointed out that 5.13 [except.handle] only allows the pointer conversions in 4.10 and not those is 4.11. This patch no longer allows the following example code: ```c++ struct A {}; struct B : public A {}; int main() { try { throw (int A::*)0; } catch (int B::*) { // exception caught here. } } ``` Reviewers: mclow.lists, jroelofs, majnemer Reviewed By: majnemer Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D8845 ------------------------------------------------------------------------ llvm-svn: 236866
2015-05-08Add tests missed in r236862Tom Stellard2-4/+152
llvm-svn: 236864
2015-05-08Merging r233984:Tom Stellard3-0/+244
------------------------------------------------------------------------ r233984 | ericwf | 2015-04-02 16:26:37 -0700 (Thu, 02 Apr 2015) | 22 lines [libcxxabi] Fix multi-level pointer conversions and pointer to member conversion detection. Summary: Currently there are bugs in out detection of multi-level pointer conversions and pointer to member conversions. This patch fixes the following issues. * Allow multi-level pointers with different nested qualifiers. * Allow multi-level mixed pointers to objects and pointers to members with different nested qualifiers. * Allow conversions from `int Base::*` to `int Derived::*` but only for non-nested pointers. There is still some work that needs to be done to clean this patch up but I want to get some input on it. Open questions: * Does `__pointer_to_member_type_info::can_catch(...)` need to adjust the pointer if a base to derived conversion is performed? Reviewers: danalbert, compnerd, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8758 ------------------------------------------------------------------------ llvm-svn: 236862
2015-05-08Merging r231852:Tom Stellard1-1/+1
------------------------------------------------------------------------ r231852 | ericwf | 2015-03-10 14:32:53 -0700 (Tue, 10 Mar 2015) | 1 line Remove unneeded const_cast in readPointerHelper. Pointed out by jroelofs ------------------------------------------------------------------------ llvm-svn: 236861
2015-05-08Merging r231839:Tom Stellard1-12/+20
------------------------------------------------------------------------ r231839 | ericwf | 2015-03-10 13:43:34 -0700 (Tue, 10 Mar 2015) | 11 lines [libcxx] Fix PR21580 - Undefined behavior in readEncodedPointer() Summary: This patch fixes a bug in `readEncodedPointer()` where it would read from memory that was not suitably aligned. This patch fixes it by using memcpy. Reviewers: danalbert, echristo, compnerd, mclow.lists Reviewed By: compnerd, mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8179 ------------------------------------------------------------------------ llvm-svn: 236860
2015-02-10Merging r228359:Hans Wennborg1-0/+4
------------------------------------------------------------------------ r228359 | compnerd | 2015-02-05 15:27:41 -0800 (Thu, 05 Feb 2015) | 5 lines Fix compilation of unwind on Darwin-x86_64 EHABI related typedef sugar is gated via LIBCXXABI_ARM_EHABI which did not protect the EHABI header. This would cause declarations to be emitted on non-EHABI targets, resulting in errors. This permits compilation on Darwin. ------------------------------------------------------------------------ llvm-svn: 228666
2015-01-27Merging r226824:Hans Wennborg1-1/+0
------------------------------------------------------------------------ r226824 | logan | 2015-01-22 05:40:16 -0800 (Thu, 22 Jan 2015) | 2 lines Enable backtrace_test for ARM. ------------------------------------------------------------------------ llvm-svn: 227239
2015-01-27Merging r226823:Hans Wennborg2-0/+6
------------------------------------------------------------------------ r226823 | logan | 2015-01-22 05:39:08 -0800 (Thu, 22 Jan 2015) | 6 lines Add -funwind-tables to CMAKE_C_FLAGS. Without -funwind-tables, the compiler won't generate the unwinding table for these C functions. However, the functions in libunwind, such as `_Unwind_Backtrace()`, WILL unwind stack to get the backtrace. ------------------------------------------------------------------------ llvm-svn: 227238
2015-01-27Merging r226822:Hans Wennborg4-69/+109
------------------------------------------------------------------------ r226822 | logan | 2015-01-22 05:38:11 -0800 (Thu, 22 Jan 2015) | 16 lines Force unwind frame with user-defined personality. If libcxxabi is compiled as a shared library, and the executable references the user-defined personality routines (e.g. __gxx_personality_v0), then the pointer comparison in Unwind-EHABI.cpp won't work. This is due to the fact that the PREL31 will point to the PLT stubs for the personality routines (in the executable), while the __gxx_personality_v0 symbol reference is yet another (different) PLT stub (in the libunwind.) This will cause _Unwind_Backtrace() stops to unwind the frame whenever it reaches __gxx_personality_v0(). This CL fix the problem by calling the user-defined personality routines with an undocumented API for force unwinding. ------------------------------------------------------------------------ llvm-svn: 227237
2015-01-27Merging r226820:Hans Wennborg2-0/+14
------------------------------------------------------------------------ r226820 | logan | 2015-01-22 05:28:39 -0800 (Thu, 22 Jan 2015) | 5 lines Fix _Unwind_Backtrace for libc++abi built with libgcc. Implement an undocumented _US_FORCE_UNWIND flag for force unwinding. ------------------------------------------------------------------------ llvm-svn: 227236
2015-01-27Merging r226819:Hans Wennborg2-34/+46
------------------------------------------------------------------------ r226819 | logan | 2015-01-22 05:27:36 -0800 (Thu, 22 Jan 2015) | 9 lines Allow libc++abi to be built without unwinder. This CL adds a new compilation flags LIBCXXABI_USE_LLVM_UNWINDER to specify whether the LLVM unwinder is enabled. Besides, all unwinder-specific code are guarded with this definition. Now, libc++abi will be able to use the unwinding routine from libgcc when LIBCXXABI_USE_LLVM_UNWINDER is disabled. ------------------------------------------------------------------------ llvm-svn: 227235
2015-01-27Merging r226818:Hans Wennborg2-22/+26
------------------------------------------------------------------------ r226818 | logan | 2015-01-22 05:25:55 -0800 (Thu, 22 Jan 2015) | 12 lines Remove _Unwind_{Get,Set}{GR,IP} from ARM EHABI build. This commit partially reverts r219629. This functions are not a part of ARM EHABI specification, and AFAIK, the de facto implementation does not export these functions. Without this change, any programs compiled with this unwind.h will be incompatible with other implementations due to linkage error. ------------------------------------------------------------------------ llvm-svn: 227234
2015-01-14Change version from 3.6.0svn to 3.6.0Hans Wennborg1-1/+1
llvm-svn: 226021
2015-01-05Fix some formatting I messed up in r225187.Dan Albert1-1/+1
llvm-svn: 225194
2015-01-05Make the Unwinder -Werror clean.Dan Albert5-95/+110
Mostly just format string fixes. Tested clean on arm, x86, and x86_64 Linux. llvm-svn: 225187
2015-01-04Typo.Joerg Sonnenberger1-1/+1
llvm-svn: 225136
2014-12-29[cmake/multilib] Teach libc++abi's CMake build to support multilibChandler Carruth5-24/+30
libdir suffixes like 'lib64' or 'lib32'. This support is currently very rhudimentary. We define a variable LIBCXXABI_LIBDIR_SUFFIX. In a standalone build of libc++abi this can be directly set as a cached variable to control the multilib suffix used. When building libc++abi within a larger LLVM build, it is hard wired to whatever LLVM libdir suffix has been selected. If this doesn't work for someone, just let me know. I'm happy to change it. Unfortunately, libc++abi's lit setup made this somewhat problematic to change. It was setting variables up in a way that caused the resulting build to not work with lit at all. To fix that, I've moved some variables around in the CMake build to more closely match where and how they are defined in the libc++ CMake build. This includes specifically defining a library root variable in the CMake build where the libdir suffix can be applied, and then using that rather than re-computing it from the object directory in the lit config. This is essentially new functionality for libc++abi so I don't expect it to have any impact for folks until they start setting these variables. However, I know libc++abi is built in a diverse set of environments so just let me know if this causes you any problems. llvm-svn: 224927
2014-12-21Silence warnings in libunwind.Logan Chien2-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
2014-12-20[libunwind] improve x86_64 comments in compact_unwind_encoding.hNick Kledzik1-3/+7
llvm-svn: 224657
2014-12-20[libunwind] fix comment in compact_unwind_encoding.hNick Kledzik1-1/+1
llvm-svn: 224656
2014-12-18[libcxxabi] Add __cxa_thread_atexit for TLS support on Linux.Dan Albert6-0/+79
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
2014-12-13Use the newer python syntax for exceptionsJustin Bogner1-1/+1
We've dropped support for python 2.5, so now we can use the forward compatible "except ... as" syntax. llvm-svn: 224182
2014-11-25Fix comment on end of #endif to match #ifEric Fiselier1-1/+1
llvm-svn: 222719
2014-11-25Use lit.util.executeCommand instead of our own versionEric Fiselier1-20/+2
llvm-svn: 222718
2014-11-24[libcxxabi] Refactor building and testing libc++abi without threadsEric Fiselier7-3/+33
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
2014-11-24[libcxxabi] Refactor test timing logic and disable by default.Eric Fiselier7-43/+69
Summary: When using LIT the timing output is entirely unused but introduces a dependency on `<chrono>`. When libc++ is built without a montonic clock this causes some of the tests to fail. This patch factors out all of the timing logic into `support/timer.hpp` and disables it by default. To enable the timing you must define `LIBCXXABI_TIME_TESTS`. Reviewers: mclow.lists, danalbert, jroelofs Reviewed By: jroelofs Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6391 llvm-svn: 222701
2014-11-24[libcxxabi] Delay adjustment of pointer to prevent referencing invalid memory.Eric Fiselier1-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
2014-11-21Ensure llvm-sanitizer is found by the tests when using sanitizers.Eric Fiselier1-6/+22
llvm-svn: 222496
2014-11-21[libcxxabi] Cleanup memory in tests to placate ASAN.Eric Fiselier3-12/+15
Summary: ASAN fires on these tests because they don't clean up their memory. Reviewers: danalbert, jroelofs, mclow.lists Reviewed By: jroelofs Subscribers: dblaikie, cfe-commits Differential Revision: http://reviews.llvm.org/D6281 llvm-svn: 222493
2014-11-19Remove accidentally commited line in commit. SorryEric Fiselier1-2/+0
llvm-svn: 222314
2014-11-18Add support for LLVM_USE_SANITIZER=Thread to test suiteEric Fiselier1-0/+3
llvm-svn: 222260
2014-11-18[libcxxabi] Refactor CMakeLists.txt's handling of compile and link flags to ↵Eric Fiselier3-55/+60
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
2014-11-14Add -g -fno-omit-frame-pointer when compiling tests with sanitizersEric Fiselier1-0/+1
llvm-svn: 222053
2014-11-07Make sure only NEON enabled devices save/restore D16+ registersRenato Golin2-2/+2
llvm-svn: 221532
2014-11-07Move ARM failure from FIXME to XFAILRenato Golin1-5/+1
llvm-svn: 221515
2014-11-06Add support for UNSUPPORTED tag to litEric Fiselier1-1/+12
llvm-svn: 221460
2014-11-05Disable backtrace libcxxabi test on ARMRenato Golin1-0/+5
_Unwind_Backtrace is not clearly defined in EHABI and needs more testing. A bug was created with some initial investigation done http://llvm.org/PR21444. This test fails with both libunwind and libgcc_s. llvm-svn: 221348
2014-10-27Fix unicode chars into ascii in comment lines.NAKAMURA Takumi1-6/+6
llvm-svn: 220668
2014-10-23Change uses of `sys.platform == 'linux2' to `sys.platform.startswith('linux')Eric Fiselier1-3/+3
Although the current method is valid up till python 3.3 (which is not supported) this seems to be a clearer way of checking for linux and moves the tests towards python 3 compatibility. llvm-svn: 220535
2014-10-23Only link the tests against -ldl on linuxEric Fiselier1-1/+1
llvm-svn: 220509
2014-10-23[libcxxabi] Add support for running libc++abi tests with sanitizersEric Fiselier2-0/+26
Summary: Add support for LLVM_USE_SANITIZER to the libc++abi tests. Currently, if libc++abi is configured with LLVM_USE_SANITIZER then none of the tests will pass. Reviewers: jroelofs, mclow.lists, danalbert Reviewed By: danalbert Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5926 llvm-svn: 220464
2014-10-17Add an .arcconfig for libc++abi.Dan Albert1-0/+4
llvm-svn: 220050
2014-10-17[libcxxabi] Document the standalone build's requirements on llvm-config and ↵Eric Fiselier2-1/+13
llvm sources. The current documentation does not explain that the standalone build requires the LLVM sources. This patch updates the documentation to reflect this requirement and explains how to manually specify the location of the required files. llvm-svn: 220049
2014-10-13Correctly export _Unwind_[GS]et(GR|IP) for EHABI.Dan Albert4-27/+25
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
2014-10-03Use __atomic_exchange_n instead of Clang's __sync_swapReid Kleckner2-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
2014-10-02Support Cortex-m0Jonathan Roelofs3-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
2014-09-11Adding ABI support for __cxa_throw_bad_array_new_length.Aaron Ballman4-0/+48
llvm-svn: 217604
2014-09-11ARM Unwind syntaxRenato Golin2-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