Commit Graph

545 Commits

Author SHA1 Message Date
Mehdi Amini b4459b1cb2 Fix typo in CMakeLists.txt: provide the path to libcxx checkout and not the include subdir
llvm-svn: 286164
2016-11-07 22:16:27 +00:00
Mehdi Amini c1f152d8d1 Fix libcxxabi CMake detection of libcxx path to handle LLVM_EXTERNAL_LIBCXX_SOURCE_DIR flag
Differential Revision: https://reviews.llvm.org/D26364

llvm-svn: 286161
2016-11-07 22:07:43 +00:00
Mehdi Amini a09c7e7e66 Revert "Add some facilities to work with a git monorepo (experimental setup)"
This reverts commit r286123, accidentally commited while testing itself...

llvm-svn: 286124
2016-11-07 17:43:08 +00:00
Mehdi Amini 7b9e9f2857 Add some facilities to work with a git monorepo (experimental setup)
Summary:
Some changes are made to cmake, especially the addition of a new
LLVM_ENABLE_PROJECTS option that makes the build system aware of
the monorepo directory structure.

Also a new script is added in llvm/utils/git-svn/. When present in
the $PATH, it enables a `git llvm` command. It is providing at this
point only the ability to push from the git monorepo: `git llvm push`.
It is intended to evolves with more features, for instance I plan on
features like `git llvm show r284955` to help working with sequential
revision numbers.
The push feature is taken from Justin Lebar's script available here:
https://github.com/jlebar/llvm-repo-tools/

Reviewers: jlebar

Subscribers: mgorny, modocache, llvm-commits

Differential Revision: https://reviews.llvm.org/D26334

llvm-svn: 286123
2016-11-07 17:40:28 +00:00
Richard Smith 80b64f0861 [p0012] Implement ABI support for throwing a noexcept function pointer and
catching as non-noexcept

This implements the following proposal from cxx-abi-dev:

http://sourcerytools.com/pipermail/cxx-abi-dev/2016-October/002988.html

... which is necessary for complete support of http://wg21.link/p0012,
specifically throwing noexcept function and member function pointers and
catching them as non-noexcept pointers.

Differential Review: https://reviews.llvm.org/D26178

llvm-svn: 285867
2016-11-02 23:41:51 +00:00
Eric Fiselier 82a1fc8db6 Spell libcxxabi-no-threads correctly
llvm-svn: 285571
2016-10-31 14:14:04 +00:00
Eric Fiselier 2d4fbb7b0c Mark thread exit test as unsupported w/o threads
llvm-svn: 285523
2016-10-30 20:05:52 +00:00
Eric Fiselier f6c4ab901b Get libc++abi building with LLVM_ENABLE_MODULES
llvm-svn: 285107
2016-10-25 20:07:49 +00:00
Vitaly Buka 5468832aca Fix typo in comment
llvm-svn: 284295
2016-10-15 00:02:20 +00:00
Vitaly Buka b8e9603acd Don't compile cxa_thread_atexit.cpp with -DLIBCXX_ENABLE_THREADS=OFF
Reviewers: rmaprath

Subscribers: beanz, mgorny

Differential Revision: https://reviews.llvm.org/D25636

llvm-svn: 284294
2016-10-14 23:51:41 +00:00
Eric Fiselier ccc6502abc Mark test as unsupported without threads
llvm-svn: 284217
2016-10-14 09:12:53 +00:00
Asiri Rathnayake 0b357ed2ab [libcxxabi] Fix gcc build after r284128
NFC.

llvm-svn: 284141
2016-10-13 18:40:57 +00:00
Asiri Rathnayake 6d3ea6831d [libcxxabi] Refactor pthread usage into a separate API
This patch refactors all pthread uses of libc++abi into a separate API. This
is the first step towards supporting an externlly-threaded libc++abi library.

I've followed the conventions already used in the libc++ library for the same
purpose.

Patch from: Saleem Abdulrasool and Asiri Rathnayake

Reviewed by: compnerd, EricWF

Differential revisions:
  https://reviews.llvm.org/D18482 (original)
  https://reviews.llvm.org/D24864 (final)

llvm-svn: 284128
2016-10-13 15:05:19 +00:00
Eric Fiselier 829c0eab91 Provide a fallback __cxa_thread_atexit() implementation. Patch from Tavian Barnes
llvm-svn: 283988
2016-10-12 08:54:10 +00:00
Eric Fiselier c3dc89e4ab Fix libc++abi test config after recent libc++ changes
llvm-svn: 283962
2016-10-12 01:19:16 +00:00
Eric Fiselier fc1b0d5c24 [libc++abi] Fix bug which cased the static libunwind to always be chosen
llvm-svn: 283699
2016-10-09 20:44:48 +00:00
Igor Kudrin d9edde4ae2 Recommit r282692: [libc++abi] Use fallback_malloc to allocate __cxa_eh_globals in case of dynamic memory exhaustion.
Throwing an exception for the first time may lead to call calloc to
allocate memory for __cxa_eh_globals. If the memory pool is exhausted
at that moment, it results in abnormal termination of the program.

This patch addresses the issue by using fallback_malloc in that case.

In this revision, some restrictions were added into the test to not
run it in unsuitable environments.

Differential Revision: https://reviews.llvm.org/D17815

llvm-svn: 283531
2016-10-07 08:48:28 +00:00
Logan Chien 78d8ac368f [CMake] Fix libc++abi standalone cmake build.
The cmake files install directory has been changed to
${prefix}/lib/cmake/llvm since r259821.  Searching cmake modules in
${prefix}/share/llvm/cmake will result in fatal errors.

This commit fixes the out-of-tree build by changing the CMake module
search path to: "$(llvm-config --obj-root)/lib/cmake/llvm"

llvm-svn: 283100
2016-10-03 11:08:17 +00:00
Igor Kudrin 49df799762 Revert r282692: Use fallback_malloc to allocate __cxa_eh_globals in case of dynamic memory exhaustion.
The test breaks build bots.

llvm-svn: 282703
2016-09-29 08:11:57 +00:00
Igor Kudrin 962750b511 [libc++abi] Use fallback_malloc to allocate __cxa_eh_globals in case of dynamic memory exhaustion.
Throwing an exception for the first time may lead to call calloc to
allocate memory for __cxa_eh_globals. If the memory pool is exhausted
at that moment, it results in abnormal termination of the program.

This patch addresses the issue by using fallback_malloc in that case.

Differential Revision: https://reviews.llvm.org/D17815

llvm-svn: 282692
2016-09-29 06:38:06 +00:00
Shoaib Meenai 88c6acfedc [libc++abi] Default to DLL annotations on Windows
`__declspec(dllexport)` and `__declspec(dllimport)` should only be used
when building libc++abi as a DLL, but that's the more common use case,
so default to adding the annotations and add an option to opt out.

Similar to r282449, which made the corresponding change for libc++.

Differential Revision: https://reviews.llvm.org/D24945

llvm-svn: 282470
2016-09-27 03:44:09 +00:00
Saleem Abdulrasool 7ec747fe95 annotate more function visibility
These data and text symbols were missing annotations for building with hidden
visibility.  As we do not currently enable hidden visibility by default, this is
a NFC for the buildbots.

llvm-svn: 282300
2016-09-23 21:36:24 +00:00
Asiri Rathnayake 7c98baab29 [libcxxabi] cleanup the use of LIBCXXABI_HAS_NO_THREADS macro (NFC)
Align the naming / use of the macro LIBCXXABI_HAS_NO_THREADS to follow what we
have in libcxx. NFC.

llvm-svn: 282062
2016-09-21 09:09:32 +00:00
Eric Fiselier b4e15b8cee Fix side effect in assertion
llvm-svn: 281709
2016-09-16 08:16:07 +00:00
Logan Chien 7a78e5113a [lit] Replace print with lit_config.note().
This commit replaces print statement with lit_config.note().  This fixes
python3 support for check-libcxxabi.

llvm-svn: 280484
2016-09-02 13:56:05 +00:00
Saleem Abdulrasool 7c4700525c libc++abi: fix some -Wunused-function warnings
is_initialized is only used in the no threads case or if on non ARM Apple
targets.  Use the preprocessor to remove the function otherwise.  NFC.

llvm-svn: 280286
2016-08-31 20:29:05 +00:00
Logan Chien b2e620a23b Wrap LIBCXXABI_USE_LLVM_UNWINDER with defined().
This commit fixes -Wundef by replacing:

    #if !LIBCXXABI_USE_LLVM_UNWINDER

with:

    #if !defined(LIBCXXABI_USE_LLVM_UNWINDER)

llvm-svn: 280251
2016-08-31 15:16:40 +00:00
Chris Bieneman fafcb85e79 [CMake] Trying to fix the bots I broke
See: http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-cxx1z/builds/981/steps/build.libcxxabi/logs/stdio
llvm-svn: 280023
2016-08-29 22:26:00 +00:00
Chris Bieneman 8223a1d09f [CMake] Use -std=c++11 if supported
Summary: This patch adds a check for if -std=c++11 is a supported flag, and adds it to CMAKE_CXX_FLAGS if it is supported.

Reviewers: EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D24007

llvm-svn: 280021
2016-08-29 22:12:21 +00:00
Eric Fiselier 36ca35f505 [CMake] Be more consistent about naming targets and components in libc++abi
This patch (and commit summary) mirror r279675 by Chris B which was applied
to libc++ but not libc++abi.

Summary:
The point of this patch is to have a consistent convention for naming build,
check and install targets so that the targets can be constructed from the
project name.

This change renames a bunch of CMake components and targets from libcxxabi to
cxxabi. For each renamed target I've added a convenience target that matches
the old target name and depends on the new target. This will preserve function
of the old targets so that the change doesn't break the world. We can evaluate
if it is worth removing the extra targets later.

llvm-svn: 279938
2016-08-28 18:28:51 +00:00
Eric Fiselier 4b3308c27f [CMake] Apply r279151 cleanup to libc++abi.
This patch applies changes similar to those in r279515 to libc++abi.

Summary of changes in this patch:

* Renamed variable LLVM_CONFIG -> LLVM_CONFIG_PATH
* Renamed variable LIBCXXABI_BUILT_STANDALONE -> LIBCXXABI_STANDALONE_BUILD
* Add an include of AddLLVM in the tests subdirectory for add_lit_testsuite.

llvm-svn: 279936
2016-08-28 18:16:18 +00:00
Saleem Abdulrasool 0b7b36a9dd test: fix test under ASAN and MSAN
When we're running tests under ASAN or MSAN, they're compiled with -O1, which
enables tail call elimination. This causes backtrace_test to fail: the compiler
performs tail call elimination for call3_nothrow, but it can't for call3_throw,
leading to a mismatched frame count. Disable tail call elimination (and
inlining, just to be explicit) to avoid this.

Patch by Shoaib Meenai!

llvm-svn: 279935
2016-08-28 18:16:00 +00:00
Eric Fiselier 937c13d922 Default LIBCXXABI_LIBDIR_SUFFIX to LLVM_LIBDIR_SUFFIX
llvm-svn: 278773
2016-08-16 03:44:55 +00:00
Mehdi Amini 4d03572c14 Fix ASAN failures in the demangler
These were found fuzzing with ASAN.

llvm-svn: 278579
2016-08-13 00:02:33 +00:00
Petr Hosek 8ec04577d6 Depend directly on unwind when not building standalone
When using libunwind and not building as standalone project, we
can directly depend on the unwind library target.

Differential Revision: https://reviews.llvm.org/D23289

llvm-svn: 278169
2016-08-09 21:28:52 +00:00
Petr Hosek b9a77f827d Add lib directory to linker paths when using libunwind
When using libunwind and not building as standalone project, we
need to add LLVM library directory to the list of linker directories
to ensure it can find libunwind dependency.

Differential Revision: https://reviews.llvm.org/D23287

llvm-svn: 278076
2016-08-09 00:27:19 +00:00
Petr Hosek daee3be364 Do not depend on unwind when building standalone
When libcxxabi is being built standalone, unwind dependency is not
available, so do not use it even when LLVM unwinder is being
requested.

Differential Revision: https://reviews.llvm.org/D23228

llvm-svn: 278058
2016-08-08 22:09:54 +00:00
Eugene Zelenko 9d09275fa6 CMakeLists.txt cleanups: synchronize version with rest of LLVM, consistent spacing.
Differential revision: https://reviews.llvm.org/D23092

llvm-svn: 278030
2016-08-08 17:59:02 +00:00
Richard Smith 398d9c0c4a Attempt to bring peace to -Werror buildbots.
llvm-svn: 276022
2016-07-19 20:35:09 +00:00
Richard Smith 2f984cab4f [libcxxabi] When catching an exception of type nullptr_t with a handler of
pointer-to-member type, produce a null value of the right type.

This fixes a bug where throwing an exception of type nullptr_t and catching it
as a pointer-to-member would not guarantee to produce a null value in the catch
handler. The fix is pretty simple: we statically allocate a constant null
pointer-to-data-member representation and a constant null
pointer-to-member-function representation, and produce the address of the
relevant value as the adjusted pointer for the exception.

llvm-svn: 276016
2016-07-19 20:19:37 +00:00
Eric Fiselier b6b04e2013 Fix arc config to use https
llvm-svn: 275752
2016-07-18 02:05:52 +00:00
Saleem Abdulrasool 6e2aa5e1a9 libc++abi: add a top level option for using CompilerRT
Add an option to opt into compiler-rt instead of libgcc.  This option defaults
to OFF to avoid a behaviour change.  It is not possible to mix and match
different runtime libraries.  Disabling this requires that libc++ is built
accordingly.  This knob is particularly useful for targets that are GCC by
default (i.e. Linux).

llvm-svn: 275505
2016-07-15 00:49:42 +00:00
Eric Fiselier d1804db966 Fix [libcxxabi] Fix warning about uninitialized const member.
llvm-svn: 272824
2016-06-15 19:59:16 +00:00
Eric Fiselier 567b755b7c Fix warning about uninitialized const member. NFC
llvm-svn: 272823
2016-06-15 19:48:26 +00:00
Eric Fiselier 78621e4076 [libcxxabi] Reorder base class initializers in libc++abi tests to prevent -Wreorder
Summary:
This patch fixes -Wreorder warnings on test classes with virtual bases. Since the compiler is performing the reordering anyway this change *should* have NFC.

However the test notes that it is checking that "virtual base classes work properly". Since initialization order is clearly part of correctness I want to confirm that this wasn't an intentional mistake.



Reviewers: mclow.lists, howard.hinnant

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D21396

llvm-svn: 272821
2016-06-15 19:33:01 +00:00
Eric Fiselier f5ff11c432 Suppress warnings about the operations currently under test.
llvm-svn: 272819
2016-06-15 19:07:19 +00:00
Eric Fiselier 2d6714a9c5 Partially revert r270816: build with -fvisibility=hidden.
This patch breaks the ABI on linux when libc++abi.a is statically linked into
libc++.so. Certain libc++ symbols get exported from libc++abi.a as hidden
and therefore they also get hidden in libc++.so.

The symbols is question are:

* _ZNKSt3__121__basic_string_commonILb1EE20__throw_out_of_rangeEv
* _ZNKSt3__121__basic_string_commonILb1EE20__throw_length_errorEv
* _ZNKSt3__120__vector_base_commonILb1EE20__throw_length_errorEv

I imagine we just need to fix the visibility for these symbols in the libc++
headers but I'm reverting the patch until it's sorted.

llvm-svn: 271500
2016-06-02 08:14:28 +00:00
Eric Fiselier ffd1893df5 [libcxxabi] Allow target flags to affect configuration tests.
Summary:
This patch changes the libc++abi CMake so that it adds certain target flags like  '-m32' or '--gcc-toolchain' before including `config-ix.cmake`.
Since these flags can affect things like `check_library_exists([...])` they needed to be added before the tests are performed.

Additionally this patch adds `LIBCXXABI_BUILD_32_BITS` which defaults to `LLVM_BUILD_32_BITS`.

This patch fixes:

https://llvm.org/bugs/show_bug.cgi?id=27950
https://llvm.org/bugs/show_bug.cgi?id=27959

Reviewers: danalbert, jroelofs, bcraig, compnerd, EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D20886

llvm-svn: 271470
2016-06-02 02:18:31 +00:00
Asiri Rathnayake ece18f4c14 [libcxxabi][test] Add missing return statement.
This causes a test failure when running with -Werror=return-type.

NFC.

llvm-svn: 271423
2016-06-01 19:13:53 +00:00
Ben Craig 658310b83e Missed part of D16545 (static lib testing)
http://reviews.llvm.org/D16545

llvm-svn: 271388
2016-06-01 12:50:30 +00:00