Commit Graph

106 Commits

Author SHA1 Message Date
Hans Wennborg f2eafcc816 Update version to 8.0.0svn
llvm-svn: 338564
2018-08-01 14:25:03 +00:00
Sam Clegg 77c99ee5d9 [CMake] Don't use LIBCXXABI_ENABLE_STATIC option before its declared
Summary:
rL337867 introduced two new cmake_dependent_option options:
- LIBCXXABI_INSTALL_STATIC_LIBRARY
- LIBCXXABI_INSTALL_SHARED_LIBRARY

They depend on LIBCXXABI_ENABLE_STATIC and LIBCXXABI_ENABLE_SHARED
and so therefore need to (it seems) come after the declaration of
these two options.

Subscribers: mgorny, aheejin, christof, ldionne, cfe-commits

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

llvm-svn: 337982
2018-07-25 23:13:00 +00:00
Petr Hosek cbb4313b1c [CMake] Use LIBCXXABI_LIBDIR_SUFFIX in libc++abi build
This was changed unintentionally in r335809.

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

llvm-svn: 337937
2018-07-25 16:51:00 +00:00
Petr Hosek 4a1e14ea78 [CMake] Option to control whether shared/static library is installed
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

llvm-svn: 337867
2018-07-24 23:27:51 +00:00
Petr Hosek 058c04c3dd Reland "[CMake] Support statically linking dependencies only to shared or static library"
This is a reland of commit r337668.

llvm-svn: 337814
2018-07-24 07:06:17 +00:00
Petr Hosek 781ee0bc5a Revert "[CMake] Support statically linking dependencies only to shared or static library"
This reverts commit r337668: broke the cxxabi build when using Make.

llvm-svn: 337670
2018-07-23 05:07:44 +00:00
Petr Hosek 7a0295cbc8 [CMake] Support statically linking dependencies only to shared or static library
Currently it's possible to select whether to statically link unwinder
or the C++ ABI library, but this option applies to both the shared
and static library. However, in some scenarios it may be desirable to
only statically link unwinder and C++ ABI library into static C++
library since for shared C++ library we can rely on dynamic linking
and linker scripts. This change enables selectively enabling or
disabling statically linking only to shared or static library.

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

llvm-svn: 337668
2018-07-23 04:19:55 +00:00
Petr Hosek 6aae861e0e [CMake] Set per-runtime library directory suffix in runtimes build
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

llvm-svn: 336713
2018-07-10 19:13:33 +00:00
Shoaib Meenai 51d5cc9228 [libc++abi] Look for __config instead of vector
vector is a generic C++ header, whereas __config is libc++-specific, so
we can look for it instead to guarantee we're finding a libc++
installation. This was suggested by Eric in https://reviews.llvm.org/D48694.

This is less important now that we're limiting the header search to the
specified directories (which definitely shouldn't have any other C++
library's headers anyway), but it shouldn't hurt either. There's a
chance some other library could also be providing a __config header, so
there's still a trade-off there. It would be ideal if we could check for
the presence of both __config and vector in the same directory, but
there doesn't seem to be any easy way to do that in CMake.

llvm-svn: 336034
2018-06-30 01:25:47 +00:00
Shoaib Meenai 777ec37659 [libc++abi] Limit libc++ header search to specified paths
Right now, when libc++abi is locating libc++ headers, it specifies
several search locations, but it also doesn't prevent CMake from looking
for those headers in system directories. I don't know if this was
intentional or an oversight, but it has several issues:

* We're looking specifically for the vector header, which could just as
  easily be found in a libstdc++ (or other C++ library) installation.
* No system I know of places their C++ headers directly in system
  include directories (they're always under a C++ subdirectory), so the
  system search will never succeed.
* find_path searches system paths before the user-specified PATHS, so
  if some system does happen to have C++ headers in its system include
  directories, those headers will be preferred, which doesn't seem
  desirable.

It makes sense to me to limit this header search to the explicitly
specified paths (using NO_DEFAULT_PATH, as is done for the other
find_path call in this file), but I'm putting it up for review in case
there's some use case I'm not thinking of.

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

llvm-svn: 336032
2018-06-30 01:04:50 +00:00
Petr Hosek 887f26d470 Support for multiarch runtimes layout
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

llvm-svn: 335809
2018-06-28 03:11:52 +00:00
Nico Weber 297ec32b86 Move _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS macro to build system
_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS is currently used to
bring back std::unexpected, which is removed in C++17, but still needed
for libc++abi for backward compatibility.

This macro used to define in cxa_exception.cpp only, but actually
needed for all sources that touches exceptions.
So, a build-system-level macro is better fit to define this macro.

https://reviews.llvm.org/D46056
Patch from Taiju Tsuiku <tzik@chromium.org>!

llvm-svn: 331150
2018-04-29 23:05:11 +00:00
Petr Hosek 86a9ddcd1a [CMake] Support for monorepo layout
Support finding libcxx and libunwind sources in monorepo style layout.

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

llvm-svn: 329208
2018-04-04 17:40:59 +00:00
Don Hinton ae858bf65f [cmake] [libcxxabi] Fix find_path() problems when cross compiling
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, these find_path() invocations are looking for paths in
the libcxx and libunwind projects 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/D41623

llvm-svn: 323145
2018-01-22 19:41:05 +00:00
Don Hinton 964ea50ff8 [cmake] [libcxxabi] Don't print warning when tests are disabled.
Summary:
Don't print, possibly erroneous, warning if
LIBCXXABI_INCLUDE_TESTS is false.

This patch fixes a problem introduced in r291367.

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

llvm-svn: 322870
2018-01-18 18:29:36 +00:00
Hans Wennborg 4ebc5ab7a5 Update version to 7.0.0svn
llvm-svn: 321726
2018-01-03 15:42:34 +00:00
Petr Hosek aa96d2ebbc [libcxxabi][CMake] Provide option to disable installing of the library
This is useful in cases where we only build static library and
libc++abi.a is combined with libc++.a into a single archive in which
case we don't want to have libc++abi.a installed separately. The same
option is already provided by libcxx CMake build.

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

llvm-svn: 318568
2017-11-17 23:25:09 +00:00
NAKAMURA Takumi 83105a4ae1 libcxxabi: Suppress LLVM_ENABLE_MODULES
Differential Revision: https://reviews.llvm.org/D35542

llvm-svn: 309551
2017-07-31 09:35:08 +00:00
Hans Wennborg a25946c8e8 Update version to 6.0.0svn
llvm-svn: 308461
2017-07-19 13:42:18 +00:00
Petr Hosek 60fe5792ae [libcxxabi][CMake] Add install path variable to allow overriding the destination
This is going to be used by the runtime build in the multi-target
setup to allow using different install prefix for each target.

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

llvm-svn: 307611
2017-07-11 01:42:26 +00:00
Ismail Donmez dea7590a04 Set a default value for LIBCXXABI_LIBDIR_SUFFIX, fixes installing into lib64 after r304374
llvm-svn: 305278
2017-06-13 08:16:44 +00:00
Martell Malone 062f8f00ae [libcxxabi] Rework CMakeLists.txt into modules
Refactor cmake to remove dependence on LLVM's cmake modules.
This improves handling of cmake checks when cross compiling and brings
libcxxabi in line with libcxx and other project modules.

Differential revision: https://reviews.llvm.org/D33635

llvm-svn: 304374
2017-06-01 00:09:20 +00:00
Eric Fiselier 27db230ab0 Remove requirement for libunwind sources. Patch by Shiz.
As per r241993, libunwind_ext.h is not used anymore, and thus only the public libunwind includes are needed.
This eases distro packaging efforts and removes an unneeded requirement for out-of-tree building.

Reviewed as D33178

llvm-svn: 304359
2017-05-31 22:11:42 +00:00
Martell Malone 41119cd07b [libcxxabi] Disable DLL annotations on static
rL288692 renames
_LIBCXXABI_DISABLE_DLL_IMPORT_EXPORT to
_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS

llvm-svn: 304110
2017-05-28 22:46:50 +00:00
Eric Fiselier 70c2b1c551 Allow undefined symbols when linking libc++abi.dll on Windows
llvm-svn: 302761
2017-05-11 03:49:48 +00:00
Shoaib Meenai f43726cd22 [libc++abi] Disable libc++ extern templates project-wide
libc++abi can't depend on libc++, so disable extern templates in libc++
headers project-wide. This was previously done in cxa_demangle.cpp, but
I consider it more appropriate to do at the cmake level (since none of
libc++abi's source files can use libc++ extern templates).

I also think the _LIBCPP_NO_EXCEPTIONS in cxa_demangle.cpp is
suspicious, but I'm doing one thing at a time.

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

llvm-svn: 302739
2017-05-10 21:52:39 +00:00
Jonas Hahnfeld 57aa0d42d9 [libcxxabi][CMake] Set library dir when built under runtimes/
This will put libraries into the build root's lib/ directory by default.

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

llvm-svn: 302118
2017-05-04 06:04:49 +00:00
Petr Hosek d3a3fb8391 [CMake][libcxxabi] Fix the -target and -gcc-toolchain flag handling
CMake has the problem with the single dash variant because of the
space, so use the double dash with equal sign version. These flag
need to be included in compile flags to propagate correctly. We also
don't have to pass the target triple when checking for compiler-rt
since that flag is already included in compile flags now.

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

llvm-svn: 300418
2017-04-16 06:08:34 +00:00
Petr Hosek 5f3d5be3dd [CMake][libcxxabi] Use -nodefaultlibs for CMake checks
Since libc++abi is built with -nodefaultlibs, we should be using this
option even for CMake checks to avoid any inconsistency and also to
avoid dependency on a working C++ standard library just for the setting
up the build itself. The implementation is largely similar to the one
used by libc++.

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

llvm-svn: 299797
2017-04-07 20:10:41 +00:00
Asiri Rathnayake 4cc78d7008 Fix exception address alignment test for EHABI
This test fails on ARM bare-metal targets because it assumes the Itanium ABI,
whereas EHABI requires the exception address to be 8-byte aligned.

I was a bit puzzled at first because this should've failed on the public
arm-linux builder too. I think the reason it passes there is because we don't
include libunwind headers in the include path when running the libcxxabi tests,
so the system unwind.h gets picked up.

Reviewers: rengolin, EricWF
Differential revision: https://reviews.llvm.org/D31178

llvm-svn: 299435
2017-04-04 14:03:54 +00:00
Eric Fiselier 6f8d62ddee Fix CMake configuration errors on OS X
llvm-svn: 296954
2017-03-04 02:15:37 +00:00
Eric Fiselier 6aa4f1d1af Turn on -Wunused-function and cleanup occurances
llvm-svn: 296936
2017-03-04 01:02:35 +00:00
Eric Fiselier 38643b9d8a Work around GCC linking errors within libc++abi due to missing new/delete definitions
llvm-svn: 296823
2017-03-02 21:55:17 +00:00
Eric Fiselier 2ee1d90cb9 [libc++abi] Add option to enable definitions for the new/delete overloads.
Summary:
Currently both libc++ and libc++abi provide definitions for operator new/delete. However I believe this is incorrect and that one or the other should offer them.

This patch adds the CMake option `-DLIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS` which defaults to `OFF` unless otherwise specified. This means that by default
only libc++ provides the new/delete definitions.



Reviewers: mclow.lists, mehdi_amini, dexonsmith, beanz, jroelofs, danalbert, smeenai, rmaprath, mgorny

Reviewed By: mehdi_amini

Subscribers: cfe-commits

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

llvm-svn: 296801
2017-03-02 19:34:35 +00:00
Ranjeet Singh ef6e672d04 [libcxxabi] Clean up macro usage.
Convention in libcxxabi is to use !defined(FOO) not !FOO.

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

llvm-svn: 296612
2017-03-01 11:42:01 +00:00
Petr Hosek 460af4bb9e [CMake][libcxxabi] Update the libc++ test module path
The libcxx/test/libcxx Python package has been moved into
libcxx/utils/libcxx in r294651, but libcxxabi's CMakeLists.txt still
looks for the old path.

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

llvm-svn: 295540
2017-02-18 04:37:59 +00:00
Petr Hosek ef6f231f56 [libcxxabi][CMake] Support in-tree libunwind when building as part of runtimes
When building as part of runtimes, there is no predefined order in
which the runtimes are loaded, so the targets from other projects
might not be available. We need to rely on HAVE_<name> variables
instead in that case.

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

llvm-svn: 294552
2017-02-09 02:19:30 +00:00
Michal Gorny 40180b0360 [cmake] Handle missing LIBUNWIND_* directories gracefully
Add LIBUNWIND_* directories to include path only if they were actually
found, in order to fix the CMake error. Both of the directories are
usually unnecessary since libcxxabi uses only the common part of
unwind.h that is supplied both by GCC and Clang.

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

llvm-svn: 292018
2017-01-14 17:05:16 +00:00
Eric Fiselier ead6a4fc75 Don't dump llvm-config --cmakedir output if command fails.
This patch adjusts the out-of-tree CMake configuration so that
the stderr output is ignored when an old llvm-config is found
that doesn't support --cmakedir.

llvm-svn: 291993
2017-01-14 03:47:49 +00:00
James Y Knight 0d3145ff8d [libc++abi] Add a silent terminate handler to libcxxabi.
The current std::terminate_handler pulls in some string code, some I/O
code, and more. Since it is automatically setup as the default, this
means that any trivial binary linking against libcxxabi will get this
extra bloat.

This patch allows disabling it as a build-time option, if you want to
avoid the extra bloat.

Patch by Tom Rybka!

Reviewers: EricWF

Subscribers: danalbert, llvm-commits, mgorny

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

llvm-svn: 291946
2017-01-13 19:22:26 +00:00
Hans Wennborg 5d0ca65c98 Bump version to 5.0.0svn
llvm-svn: 291829
2017-01-12 21:36:22 +00:00
Michal Gorny db2e8acccf [cmake] Obtain LLVM_CMAKE_PATH from llvm-config if available
Use the new --cmakedir option to obtain LLVM_CMAKE_PATH straight from
llvm-config. Fallback to local reconstruction if llvm-config does not
support this option.

llvm-svn: 291506
2017-01-09 23:31:05 +00:00
Asiri Rathnayake a573fe25e6 [libcxxabi] Cleanup and adapt for r291275. NFC.
+ Now that libcxxabi shares the same threading API as libcxx, a whole
  chunk of code in src/config.h is made redundant (I missed this earlier).

+ r291275 split off the externalized-thread-api libcxx configuration from the
  external-thread-library libcxx configuration. libcxxabi should follow the
  same approach.

llvm-svn: 291440
2017-01-09 11:57:21 +00:00
Bryant Wong 04060ab619 [libcxxabi] Enable tests by default in standalone.
Tests targets will now be enabled by default when building libcxxabi out of tree
(unless turned off with LIBCXXABI_INCLUDE_TESTS=OFF).

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

llvm-svn: 291378
2017-01-08 00:33:30 +00:00
Bryant Wong 66b5441c86 [libcxxabi] Add flag to conditionally enable tests
Differential Revision: https://reviews.llvm.org/D28449

llvm-svn: 291367
2017-01-07 22:14:04 +00:00
Asiri Rathnayake 97ba9fae1f [libcxxabi] Introduce an externally threaded libc++abi variant.
r281179 Introduced an externally threaded variant of the libc++ library. This
patch adds support for a similar library variant for libc++abi.

Differential revision: https://reviews.llvm.org/D27575

Reviewers: EricWF
llvm-svn: 290888
2017-01-03 12:58:34 +00:00
Kostya Serebryany 4eb60cb9c9 add cxa_demangle_fuzzer
Summary:
All easy-to-find bugs in cxa_demangle where fixed now
(https://bugs.chromium.org/p/chromium/issues/detail?id=606626)
except for one (https://llvm.org/bugs/show_bug.cgi?id=31031).
Now I'd like to properly integrate this fuzzer with the source tree
and then run the fuzzer continuously on https://github.com/google/oss-fuzz

Reviewers: compnerd, mclow.lists, mehdi_amini

Subscribers: cfe-commits, mgorny

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

llvm-svn: 290650
2016-12-28 03:28:29 +00:00
Eric Fiselier 79ff8f0375 Fix GCC libc++abi build
llvm-svn: 286783
2016-11-13 22:27:00 +00:00
Logan Chien 71cdd30e70 [CMake] Fix libc++abi arm build w/o libunwind.
This commit fixes libc++abi build when LLVM unwinder (libunwind_llvm) is
not enabled.

This commit fixes the problem by removing "LLVM_NATIVE_ARCH MATCHES ARM"
from CMakeLists.txt so that LIBCXXABI_USE_LLVM_UNWINDER will only be
defined when LLVM unwinder is enabled.

We need LIBCXXABI_USE_LLVM_UNWINDER becase there is a subtle difference
between the unwinder from libgcc and the one from libunwind_llvm.  For
the unwinder from libgcc, we have to initialize register r12 with the
address of _Unwind_Control_Block; otherwise,
_Unwind_GetLanguageSpecificData() and _Unwind_GetRegionStart() won't
work properly.  Consequently, there is an extra _Unwind_SetGR() when
LLVM unwinder is disabled.  Check cxa_personality.cpp for details.

llvm-svn: 286759
2016-11-13 14:42:15 +00:00
Petr Hosek bfb371a083 [CMake] Check runtimes subdir when looking for libcxx and libuwind
The runtimes subdir is the new location for runtimes, we should
include it when looking for libcxx and libunwind headers.

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

llvm-svn: 286614
2016-11-11 19:12:58 +00:00