Commit Graph

5949 Commits

Author SHA1 Message Date
CuriousTommy
c47677d3ba
Merge pull request #3 from darlinghq/fedora_41_fix
Fix Building For Fedora 41
2024-11-02 09:22:42 -07:00
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
5243669cee Upload README.md 2023-05-10 10:42:14 -07:00
Thomas A
7417a390ab Fix building libcxx 2022-06-26 16:57:40 -07:00
Thomas A
93cb76477c Manually generate __config_size file 2022-06-26 16:57:04 -07:00
Thomas A
a574ade231 Downgrading libcxx to llvmorg-13.0.1
It turns out that llvmorg-14.0.6 might be too new for dyld (the vector base class no longer exist in that release).
2022-06-26 13:05:32 -07:00
Thomas A
e3bbeb7fdc Update libcxx source to llvmorg-14.0.6 2022-06-26 09:13:52 -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
Lubos Dolezel
f1d9f7bb21 Merge remote-tracking branch 'upstream/master' into HEAD 2020-04-17 14:51:11 +02:00
Zoe Carver
78d6a7767e [libcxx] Remove shared_ptr::make_shared
Summary: This patch removes `shared_ptr::make_shared` as it is not part of the standard. This patch also adds __create_with_cntrl_block, which is a help function that can be used in std::allocate_shared and std::make_shared. This is the third patch (out of 4) from D66178.

    Reviewers: EricWF, mclow.lists, ldionne

    Subscribers: christof, dexonsmith, libcxx-commits

    Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@375504 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-22 15:16:49 +00:00
Louis Dionne
4dff356569 [NFC] Fix typos in CMake comment
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@375469 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-21 23:38:32 +00:00
Dimitry Andric
41e7283b76 Refine check for _LIBCPP_C_HAS_NO_GETS on FreeBSD
Summary:
In D67316 we added `_LIBCPP_C_HAS_NO_GETS` to signal that the C library
does not provide `gets()`, and added a test for FreeBSD 13 or higher,
using the compiler-defined `__FreeBSD__` macro.

Unfortunately this did not work that well for FreeBSD's own CI process,
since the gcc compilers used for some architectures define `__FreeBSD__`
to match the build host, not the target.

Instead, we should use the `__FreeBSD_version` macro from the userland
header `<osreldate.h>`, which is more fine-grained.  See also
<https://reviews.freebsd.org/D22034>.

Reviewers: EricWF, mclow.lists, emaste, ldionne

Reviewed By: emaste, ldionne

Subscribers: dexonsmith, bsdjhb, krytarowski, christof, ldionne, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@375340 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-19 10:59:23 +00:00
Richard Smith
7e5c56366a P1152R4: Fix deprecation warnings in libc++ testsuite and in uses of is_invocable that would internally conjure up a deprecated function type.
Summary: The implementation of P1152R4 in Clang has resulted in some deprecation warnings appearing in the libc++ and libc++abi test suite. Fix or suppress these warnings.

Reviewers: mclow.lists, EricWF

Subscribers: christof, ldionne, libcxx-commits

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@375307 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-19 00:06:00 +00:00
Casey Carter
fb944628a6 [libc++][test] Use <version> to get config on MSVC
...instead of `<ciso646>`.

Also includes some NFC comment changes.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374854 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-15 00:22:38 +00:00
Casey Carter
5f31123bc7 [libc++][test] Portability fix for std::any tests
Ensure that `large_tracked_t` defined in `any_helpers.h` is in fact too large to fit in `std::any`'s small object buffer.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374806 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 19:05:04 +00:00
Casey Carter
cb623673dc [libc++][test] Add license headers to test/support/archetypes.*
Differential Revision: https://reviews.llvm.org/D68947

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374797 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 18:00:34 +00:00
Casey Carter
4fd9329d34 [libc++][test] Silence more warnings in variant tests
More cases of signed-to-unsigned conversion warnings that missed the train for d2623522.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374778 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-14 14:38:12 +00:00
Casey Carter
79d2a7134b [libc++][test] std::variant test cleanup
* Add the conventional `return 0` to `main` in `variant.assign/conv.pass.cpp` and `variant.ctor/conv.pass.cpp`

* Fix some MSVC signed-to-unsigned conversion warnings by replacing `int` literarls with `unsigned int` literals

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374723 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 16:46:16 +00:00
Casey Carter
6dc4120468 [libc++][test] <=> now has a feature-test macro
...which `test/support/test_macros.h` can use to detect compiler support.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374722 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-13 16:46:12 +00:00
Casey Carter
1f4cad9f28 [libc++][test] Silence MSVC warning in std::optional test
`make_optional<string>(4, 'X')` passes `4` (an `int`) as the first argument to `string`'s `(size_t, charT)` constructor, triggering a signed/unsigned mismatch warning when compiling with MSVC at `/W4`. The incredibly simple fix is to instead use an unsigned literal (`4u`).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374684 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-12 19:01:46 +00:00
Petr Hosek
437d5a5dcf [libc++] Fix linker script generation
Handle the case when libc++abi and libunwind are being built together
with libc++ in the runtimes build. This logic was used in the previous
implementation but dropped in r374116.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374510 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-11 04:54:35 +00:00
Casey Carter
dda1e448f9 [libc++][test] Change IsSmallObject's calculation for std::any's small object buffer
`sizeof(std::any) - sizeof(void*)` is correct for both libc++ and the MSVC standard library.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374407 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-10 18:07:12 +00:00
Casey Carter
193f1880bd [libc++][test] Miscellaneous MSVC cleanups
* Silence unused-local-typedef warnings: `map.cons/assign_initializer_list.pass.cpp` (and the `set.cons` variant) uses a local typedef only within `LIBCPP_ASSERT`s, so clang diagnoses it as unused when testing non-libc++.
* Add missing include: `c.math/abs.pass.cpp` uses `std::numeric_limits` but failed to `#include <limits>`.
* Don't test non-type: A "recent" change to `meta.trans.other/underlying_type.pass.cpp` unconditionally tests the type `F` which is conditionally defined.
* Use `hash<long long>` instead of `hash<short>` with `int` in `unordered_meow` deduction guide tests to avoid truncation warnings.
* Convert `3.14` explicitly in `midpoint.float.pass` since MSVC incorrectly diagnoses `float meow = 3.14;` as truncating.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374248 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-09 22:19:17 +00:00
Eric Fiselier
da6e915c73 Optimize operator=(const basic_string&) for tail call.
Patch by Martijn Vels (mvels@google.com)
Reviewed as https://reviews.llvm.org/D68276

This is a non trivial win for externally templated assignment operator.

x86 without tail call (current libc++)

0000000000000000 <std::string::operator=(std::string const&)>:
   0:   55                      push   %rbp
   1:   48 89 e5                mov    %rsp,%rbp
   4:   53                      push   %rbx
   5:   50                      push   %rax
   6:   48 89 fb                mov    %rdi,%rbx
   9:   48 39 f7                cmp    %rsi,%rdi
   c:   74 17                   je     25 <std::string::operator=(std::string const&)+0x25>
   e:   0f b6 56 17             movzbl 0x17(%rsi),%edx
  12:   84 d2                   test   %dl,%dl
  14:   79 07                   jns    1d <std::string::operator=(std::string const&)+0x1d>
  16:   48 8b 56 08             mov    0x8(%rsi),%rdx
  1a:   48 8b 36                mov    (%rsi),%rsi
  1d:   48 89 df                mov    %rbx,%rdi
  20:   e8 00 00 00 00          callq  25 <std::string::operator=(std::string const&)+0x25>
  25:   48 89 d8                mov    %rbx,%rax
  28:   48 83 c4 08             add    $0x8,%rsp
  2c:   5b                      pop    %rbx
  2d:   5d                      pop    %rbp
  2e:   c3                      retq

After:

0000000000000000 <std::string::operator=(std::string const&)>:
   0:   48 39 f7                cmp    %rsi,%rdi
   3:   74 14                   je     19 <std::string::operator=(std::string const&)+0x19>
   5:   0f b6 56 17             movzbl 0x17(%rsi),%edx
   9:   84 d2                   test   %dl,%dl
   b:   79 07                   jns    14 <std::string::operator=(std::string const&)+0x14>
   d:   48 8b 56 08             mov    0x8(%rsi),%rdx
  11:   48 8b 36                mov    (%rsi),%rsi
  14:   e9 00 00 00 00          jmpq   19 <std::string::operator=(std::string const&)+0x19>
  19:   48 89 f8                mov    %rdi,%rax
  1c:   c3                      retq

Benchmark (pending per https://reviews.llvm.org/D67667)

```
BM_StringAssignStr_Empty_Opaque                     6.23ns ± 0%             5.19ns ± 0%  -16.70%          (p=0.016 n=5+4)
BM_StringAssignStr_Empty_Transparent                5.86ns ± 0%             5.14ns ± 0%  -12.24%          (p=0.008 n=5+5)
BM_StringAssignStr_Small_Opaque                     8.79ns ± 1%             7.69ns ± 0%  -12.53%          (p=0.008 n=5+5)
BM_StringAssignStr_Small_Transparent                9.44ns ± 0%             8.00ns ± 0%  -15.26%          (p=0.008 n=5+5)
BM_StringAssignStr_Large_Opaque                     25.2ns ± 0%             24.3ns ± 0%   -3.50%          (p=0.008 n=5+5)
BM_StringAssignStr_Large_Transparent                23.6ns ± 0%             22.5ns ± 0%   -4.76%          (p=0.008 n=5+5)
BM_StringAssignStr_Huge_Opaque                       319ns ± 5%              317ns ± 5%     ~             (p=0.690 n=5+5)
BM_StringAssignStr_Huge_Transparent                  319ns ± 5%              317ns ± 5%     ~             (p=0.421 n=5+5)
BM_StringAssignAsciiz_Empty_Opaque                  7.41ns ± 0%             7.77ns ± 0%   +4.89%          (p=0.008 n=5+5)
BM_StringAssignAsciiz_Empty_Transparent             7.54ns ± 3%             7.30ns ± 0%   -3.24%          (p=0.008 n=5+5)
BM_StringAssignAsciiz_Small_Opaque                  9.87ns ± 0%            10.24ns ± 1%   +3.76%          (p=0.008 n=5+5)
BM_StringAssignAsciiz_Small_Transparent             10.4ns ± 1%              9.8ns ± 2%   -5.78%          (p=0.008 n=5+5)
BM_StringAssignAsciiz_Large_Opaque                  30.1ns ± 0%             30.1ns ± 0%     ~             (p=0.167 n=5+5)
BM_StringAssignAsciiz_Large_Transparent             27.1ns ± 0%             27.4ns ± 0%   +0.92%          (p=0.016 n=4+5)
BM_StringAssignAsciiz_Huge_Opaque                    383ns ± 4%              382ns ± 4%     ~             (p=0.548 n=5+5)
BM_StringAssignAsciiz_Huge_Transparent               375ns ± 0%              380ns ± 0%   +1.37%          (p=0.029 n=4+4)
BM_StringAssignAsciizMix_Opaque                     14.0ns ± 0%             14.0ns ± 0%     ~             (p=0.881 n=5+5)
BM_StringAssignAsciizMix_Transparent                13.7ns ± 1%             13.8ns ± 0%     ~             (p=0.056 n=5+5)
```

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374137 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-09 03:07:02 +00:00
Louis Dionne
76ba5dd1db [libc++] Workaround old versions of CMake that don't understand list(JOIN)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374120 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-08 21:33:35 +00:00
Louis Dionne
ef2d23967e [libc++] Move the linker script generation step to CMake
Summary:
This allows the linker script generation to query CMake properties
(specifically the dependencies of libc++.so) instead of having to
carry these dependencies around manually in global variables. Notice
the removal of the LIBCXX_INTERFACE_LIBRARIES global variable.

Reviewers: phosek, EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374116 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-08 21:10:20 +00:00
Louis Dionne
d265021834 [libc++] Make sure we link all system libraries into the benchmarks
It turns out that r374056 broke _some_ build bots again, specifically
the ones using sanitizers. Instead of trying to link the right system
libraries to the benchmarks bit-by-bit, let's just link exactly the
system libraries that libc++ itself needs.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374079 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-08 16:26:24 +00:00
Louis Dionne
2a88a04e08 [libc++] TAKE 2: Make system libraries PRIVATE dependencies of libc++
We tried doing that previously (in r373487) and failed (reverted in
r373506) because the benchmarks needed to link against system libraries
and relied on libc++'s dependencies being propagated. Now that this has
been fixed (in r374053), this commit marks the system libraries as
PRIVATE dependencies of libc++.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374056 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-08 14:53:11 +00:00
Louis Dionne
caa8e2ccef [libc++] Add missing link-time dependencies to the benchmarks
Since the benchmarks build with -nostdlib, they need to manually link
against some system libraries that are used by the benchmarks and the
GoogleBenchmark library itself.

Previously, we'd rely on the fact that these libraries were linked
through the PUBLIC dependencies of cxx_shared/cxx_static. However,
if we were to make these dependencies PRIVATE (as they should be
because they are implementation details of libc++), the benchmarks
would fail to link. This commit remediates that.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374053 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-08 14:28:56 +00:00
Louis Dionne
c7883618be [libc++] Use PRIVATE to link benchmark dependencies
It's better style to use PRIVATE when linking libraries to executables,
and it doesn't make a difference since executables don't need to propagate
their link-time dependencies anyway.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@374050 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-08 14:10:55 +00:00
Zoe Carver
f372cc7e82 [libc++] Remove C++03 variadics in shared_ptr (v2)
Summary: In my last patch (D67675) I forgot a few variadics. This patch removes the remaining make_shared and allocate_shared C++03 variadics.

    Reviewers: ldionne, EricWF, mclow.lists

    Subscribers: christof, dexonsmith, libcxx-commits

    Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373971 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-07 21:41:15 +00:00
Alex Langford
346d6e294c [libc++] Guard cxx_experimental settings behind LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY
If you explicitly set LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY to OFF, your
project will fail to configure because the cxx_experimental target
doesn't exist.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373809 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-04 23:08:20 +00:00
Louis Dionne
2f7d67c8fc [libc++] Localize common build flags into a single CMake function
Also, set those flags for the cxx_experimental target. Otherwise,
cxx_experimental doesn't build properly when neither the static nor
the shared library is compiled (yes, that is a weird setup).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373808 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-04 22:50:23 +00:00
Sterling Augustine
09d641ffc2 Add an off-by-default option to enable testing for gdb pretty printers.
Summary:
The current version of the pretty printers are not python3 compatible,
so turn them off by default until sufficiently improved.

Reviewers: MaskRay, tamur

Subscribers: mgorny, christof, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373796 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-04 22:15:28 +00:00
Louis Dionne
2f59751955 [libc++] Make the modules-related flags PUBLIC instead of PRIVATE
It appears that those need to be propagated to targets that use libc++
as well, otherwise they don't build properly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373773 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-04 19:10:56 +00:00
Louis Dionne
c1da965864 [libc++] Move more CMake flags to per-target definitions
This daily refactoring tackles flags related to modules,
exceptions and RTTI.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373767 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-04 18:03:17 +00:00
Fangrui Song
2b539adf22 Make libc++ gdb pretty printer Python 3 compatible
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373691 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-04 04:47:33 +00:00
Eric Fiselier
0d7477f78f Attempt to remove linker workaround on the buildbots: Attempt 2
The first commit removed the workaround in a old script.
This patch removes it in the file actually used by the bots.

I have no idea if this is still needed, but removing the
workaround seems like the easiest way to test.

I'll revert this change if the bots go red.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373653 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03 19:38:44 +00:00
Eric Fiselier
9dce2def7e Attempt to remove linker workaround on the buildbots.
I have no idea if this is still needed, but removing the
workaround seems like the easiest way to test.

I'll revert this change if the bots go red.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373650 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03 19:13:35 +00:00
Louis Dionne
8937697dbc [libc++] Add a per-target flag to include the generated config_site
This allows propagating the include automatically to targets that
depend on one of the libc++ targets such as the benchmarks. Note
that the GoogleBenchmark build itself still needs to manually specify
the -include, since I don't know of any way to have an external project
link against one of the libc++ targets (which would propagate the -include
automatically).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373631 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03 17:20:50 +00:00
Louis Dionne
d3253a749c [libc++] Add missing revision number in ABI changelog
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373625 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03 16:50:05 +00:00
Fangrui Song
11a6f223fb Fix libc++ pretty printer test for Python 3 after D67238 (take 2)
In both Python 2 and Python 3, gdb.Value.string returns a 'str'. We just
need to delete a `encode("utf-8")` which would return a 'bytes' in
Python 3.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373570 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-03 06:19:50 +00:00
Louis Dionne
48a15a7b3a [libc++] Use functions instead of global variables to set libc++ build flags
This commit follows the trend of doing things per-target instead of
modifying the C++ flags globally. It does so for visibility-related
flags, other basic build flags and Windows-specific flags.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@373517 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-02 20:07:01 +00:00