Commit Graph

185 Commits

Author SHA1 Message Date
Thomas A.
02996134da Remove "_LIBCPPABI_VERSION" Definition from CMakeLists.txt
Doesn't seem like we need to define this macro through CMake. It only seems to cause unnecessary build warnings about the macro being redefined.
2024-10-31 22:30:49 -07:00
Thomas A.
30a76a2c85 Build All Sources For CXX Static Library
I couldn't find an explantion for why we only build "stdexcept.cpp" instead of all of the libcxx source code...
2024-10-31 22:19:51 -07:00
Thomas A
7417a390ab Fix building libcxx 2022-06-26 16:57:40 -07:00
Ariel Abreu
bb80d09b3f
Merge remote-tracking branch 'origin/master' into update-sources 2020-11-10 12:18:09 -05:00
Sergey Bugaev
f6eac0450f Fix improper symbol visibility & weakness
We were forgetting to apply explicit weak/non-weak symbol lists that
the upsteam provides. This fixes certain symbols being weak when they
should not be. This matters if an executable ships its own copy of libc++,
whose symbols would conflict with the systems' copy (which is always
loaded into the process because of libSystem transitively depending on
it).

See https://github.com/darlinghq/darling/issues/879
2020-10-11 12:02:06 +03:00
Ariel Abreu
9df4336345
Remove macOS deployment target definitions
The deployment target is now set project-wide in the root Darling CMakeLists.txt
2020-06-12 21:16:38 -04:00
Ariel Abreu
262f031035
Initial update to clean up include directories
"initial" because there might some additional modifications necessary later on
2020-05-14 12:57:41 -04:00
Lubos Dolezel
8ef5f3373c Fix exception support 2020-04-20 17:12:44 +02:00
Lubos Dolezel
92147ed2a4 New ranlib location 2020-04-17 21:27:38 +02:00
Lubos Dolezel
0df0f79317 Finalize libc++abi update 2020-04-17 15:03:49 +02:00
Andrew Hyatt
48706becdc
Allow i386 or x86_64 only builds 2019-08-13 14:08:54 -04:00
Lubos Dolezel
598359531a Add missing install() statement 2017-03-27 23:43:08 +02:00
Lubos Dolezel
1afe1bb833 Merge remote-tracking branch 'upstream/master' 2017-03-27 20:46:19 +02:00
Shoaib Meenai
68fdad67e3 [libc++] Fix some comment typos
Remove a stray letter, add a missing letter. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@298766 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-25 03:42:20 +00:00
Shoaib Meenai
f23e281656 [libc++] Fix word transposition in comment
"to due" -> "due to". No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@298764 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-25 03:29:51 +00:00
Shoaib Meenai
e577401c13 [libc++] Fix capitalization in comment
Fix a stray capital letter in the middle of a sentence. No functional
change.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@298763 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-25 03:22:35 +00:00
Shoaib Meenai
5b0087fc62 [libc++] Update package version
Make it consistent with the rest of LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@298762 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-25 03:12:37 +00:00
Eric Fiselier
c51e0d21a1 Change test coverage generation to use llvm-cov instead of gcov.
Clang doesn't produce gcov compatible coverage files. This
causes lcov to break because it uses gcov by default. This
patch switches lcov to use llvm-cov as the gcov-tool.

Unfortunatly llvm-cov doesn't provide a gcov like interface by
default so it won't work with lcov. However `llvm-cov gcov` does.
For this reason we generate 'llvm-cov-wrapper' script that always
passes the gcov flag.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@297553 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-11 03:24:18 +00:00
Eric Fiselier
0cbd39f03a Work around GCC linking errors within libc++abi due to missing new/delete definitions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296822 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 21:55:03 +00:00
Eric Fiselier
dc69aac6c6 [libc++] Add option to disable new/delete overloads when libc++abi provides them.
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 `-DLIBCXX_ENABLE_NEW_DELETE_DEFINITIONS` which defaults no `ON` unless `-DLIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS=ON` is specified.



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

Reviewed By: mehdi_amini

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296802 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 19:35:33 +00:00
Eric Fiselier
c57fb58f18 Generate the test configuration even when LIBCXX_INCLUDE_TESTS=OFF.
This patch changes the CMake configuration so that it always
generates the test/lit.site.cfg file, even when testing is disabled.

This allows users to test libc++ without requiring them to have
a full LLVM checkout on their machine.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296685 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 21:53:30 +00:00
Lubos Dolezel
e9aa39b93f Do not set -m32/64 2017-02-17 18:32:03 +01:00
Eric Fiselier
1edf3166ef Recommit "Split exception.cpp and new.cpp implementation into different files for different runtimes."
This recommits r294707 with additional fixes. The main difference is
libc++ now correctly builds without any ABI library.

exception.cpp is a bloody mess. It's full of confusing #ifdef branches for
each different ABI library we support, and it's getting unmaintainable.

This patch breaks down exception.cpp into multiple different header files,
roughly one per implementation. Additionally it moves the definitions of
exceptions in new.cpp into the correct implementation header.

This patch also removes an unmaintained libc++abi configuration.
This configuration may still be used by Apple internally but there
are no other possible users. If it turns out that Apple still uses
this configuration internally I will re-add it in a later commit.
See http://llvm.org/PR31904.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294730 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 08:57:35 +00:00
Eric Fiselier
d3298ad74e Revert "Split exception.cpp and new.cpp implementation into different files for different runtimes."
The compiler-rt CMake configuration needs some tweaking before this can land.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294727 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 07:43:08 +00:00
Eric Fiselier
801e00b0cd Correctly default to using the system libc++abi on Apple.
This patch fixes a regression where libc++ didn't correctly
select the system libc++abi when no in-tree version was found.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294712 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 05:07:03 +00:00
Eric Fiselier
d60b66ad4f Split exception.cpp and new.cpp implementation into different files for different runtimes.
exception.cpp is a bloody mess. It's full of confusing #ifdef branches for
each different ABI library we support, and it's getting unmaintainable.

This patch breaks down exception.cpp into multiple different header files,
roughly one per implementation. Additionally it moves the definitions of
exceptions in new.cpp into the correct implementation header.

This patch also removes an unmaintained libc++abi configuration.
This configuration may still be used by Apple internally but there
are no other possible users. If it turns out that Apple still uses
this configuration internally I will re-add it in a later commit.
See http://llvm.org/PR31904.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294707 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 04:25:33 +00:00
Petr Hosek
f4699a5b99 [libcxx][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/D29575

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294553 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 02:19:43 +00:00
Eric Fiselier
1138f041fc Remove CMake hack
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294116 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 01:19:02 +00:00
Eric Fiselier
b89eba01e8 Recommit [libcxx] Never use <cassert> within libc++
It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`.
This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead.

Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS`  off by default,
because the standard library should not be aborting user programs unless explicitly asked to.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294107 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-04 23:22:28 +00:00
Lubos Dolezel
92bc443710 Fix fat build 2017-01-25 21:20:34 +01:00
Eric Fiselier
a49c64f182 Revert "[libcxx] Never use <cassert> within libc++"
This reverts commit r292883. Unfortunately <string_view> uses
_LIBCPP_ASSERT in a way which is not compatible with the C++11 dylib
build. I'll investigate more tomorrow.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 12:26:01 +00:00
Eric Fiselier
2c90d1f776 [libcxx] Never use <cassert> within libc++
Summary:
It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`. This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead.

Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS`  off by default, because the standard library should not be aborting user programs unless explicitly asked to.

Reviewers: mclow.lists, compnerd, smeenai

Reviewed By: mclow.lists

Subscribers: mgorny, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 04:57:33 +00:00
Eric Fiselier
8e39559043 Don't strip -m32 from the user provide command line flags. This fixes the compiler-rt 32 bit sanitizer build
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292291 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:27:56 +00:00
Eric Fiselier
bde2871b62 Improve CMake and LIT support for Windows
This patch contains multiple cleanups and fixes to better support building on
Windows.

* [Test] Fix handling of library runtime search paths by correctly adding them
  to the PATH variable when running the tests.

* [Test] Don't explicitly force "--target=i686-pc-windows" when running the
  test suite. Clang++ seems to deduce the correct target.

* [Test] Fix `.sh.cpp` tests on Windows by properly escaping flags used in
  shell commands. Specifically windows style paths which included spaces
  were causing these tests to fail.

* [CMake] Add "vcruntime" to the list of supported C++ ABI libraries in CMake, and
  teach the test suite how to handle it. For now libc++ defaults to using
  "vcruntime" on Windows except when libc++abi is in tree; That is probably
  a bug and should be changed to always use vcruntime, at least for now.

* [Misc] Move the "c++-build" include directory to the libc++ binary dir
  instead of the top level project dir and rename it "c++build". This is just
  misc cleanup. Libc++ shouldn't be creating internal build files and directories
  at the top-level projects root.

* [Misc] Build type_info's destructor when building for MSVC. This is a temporary
  work around to prevent link errors until we have a proper type_info
  implementation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292157 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 20:47:35 +00:00
Petr Hosek
6948dbedca Reland "[CMake][libcxx] Check that we have libcxxabi before using it"
This relands commit r291726.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292086 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 00:33:11 +00:00
Petr Hosek
c59c3172dc Reland "[CMake][libcxx] Do not rely on the existence of c++abi or unwind targets"
This relands commit r291727.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292085 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 00:33:09 +00:00
Petr Hosek
3508e7a877 Reland "[CMake][libcxx] Move Python check to main CMake file"
This relands commit r291728.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292084 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 00:33:07 +00:00
Eric Fiselier
157fd34124 [libc++][CMake] Use debug MSVC runtimes when libc++ is built in debug mode
Summary: This patch allows libc++ to be built against the debug MSVC runtimes instead of just the release ones.

Reviewers: rnk, majnemer, compnerd, smeenai

Subscribers: mgorny, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292006 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 07:54:39 +00:00
Eric Fiselier
fdd3c91b5f [libc++] [CMake] Link with /nodefaultlibs on Windows
Summary:
This patch attempts to fix the libc++ build/link so that it doesn't use an default C++ libraries on Windows.  This is needed to prevent linking to MSVC's STL library.

Additionally this patch changes libc++ so that it is always linked with the non-debug DLL's (e.g. `/MD`). This is needed so that the test suite can correctly link the same libraries without needing to know which configuration `c++.dll` was linked with.


Reviewers: compnerd, rnk, majnemer, kimgr, awson, halyavin, smeenai

Subscribers: cfe-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292001 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 06:06:47 +00:00
Petr Hosek
0758410191 Revert "[CMake][libcxx] Move Python check to main CMake file"
This reverts commit 39441fe9f0.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:56:33 +00:00
Petr Hosek
b81ce92008 Revert "[CMake][libcxx] Do not rely on the existence of c++abi or unwind targets"
This reverts commit 94fc5a96f5.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291727 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:56:31 +00:00
Petr Hosek
010074a596 Revert "[CMake][libcxx] Check that we have libcxxabi before using it"
This reverts commit 8c91834411.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291726 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:56:29 +00:00
Petr Hosek
8c91834411 [CMake][libcxx] Check that we have libcxxabi before using it
When doing standalone build, check that we actually have libcxxabi
before attempting to use it.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291723 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 23:11:40 +00:00
Petr Hosek
94fc5a96f5 [CMake][libcxx] Do not rely on the existence of c++abi or unwind targets
There is no guaranteed order in which CMake files for individual
runtimes are invoked and therefore we cannot rely on existence of
targets defined in other runtimes. Use the new HAVE_<name> options
instead in those cases.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291632 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-11 00:56:10 +00:00
Petr Hosek
39441fe9f0 [CMake][libcxx] Move Python check to main CMake file
This is to make sure this check is called even when building as
part of LLVM runtimes when we are doing standalone but not out of
tree build.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291592 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 19:51:17 +00:00
Lubos Dolezel
20f1ad64b6 More .dylib build fixes 2017-01-09 15:50:44 +01:00
Asiri Rathnayake
da39f1bc79 [libcxx] Fix externally-threaded shared library builds after r291275.
Need to allow unresolved symbols in the dylib. This was previously done for
LIBCXX_HAS_EXTERNAL_THREAD_API, but we have since split that into two with
LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY being the externally-threaded variant.

Also a minor CMakeLists.txt cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-09 10:38:56 +00:00
Eric Fiselier
bab7b41d2e Configure default ABI library as NONE on Windows
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291306 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 23:59:52 +00:00
Eric Fiselier
66134e8a5f [libc++] Cleanup and document <__threading_support>
Summary:
This patch attempts to clean up the macro configuration mess in `<__threading_support>`, specifically the mess involving external threading variants. Additionally this patch adds design documentation for `<__threading_support>` and the configuration macros it uses.

The primary change in this patch is separating the idea of an "external API" provided by `<__external_threading>` and the idea of having an external threading library. Now `_LIBCPP_HAS_THREAD_API_EXTERNAL` means that libc++ should use `<__external_threading>` and that the header is expected to exist.  Additionally the new macro `_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL` is now used to configure for using an "external library"  with the default threading API.

Reviewers: compnerd, rmaprath

Subscribers: smeenai, cfe-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291275 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06 20:05:40 +00:00
Asiri Rathnayake
e262e7b914 [libcxx] Add build/test support for the externally threaded libc++abi variant
Differential revision: https://reviews.llvm.org/D27576

Reviewers: EricWF

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@290889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-03 12:59:50 +00:00