Commit Graph

5523 Commits

Author SHA1 Message Date
Louis Dionne
b3672483a6 [libc++] Only add dylib-related features when using the system's libc++
Otherwise, when testing trunk libc++ on an older system, lit will think
that the dylib features are disabled. Ideally, we'd have a notion of
running the tests with/without a deployment target (or, equivalently,
a deployment target representing trunk where everything is as recent
as can be). Since we always have a deployment target right now (which
defaults to the current system), we only enable those features when
we're going to also be testing with the system libc++.

We also need to disable the availability markup when we are not running
a system library flavor, because availability markup does not make sense
when building against the trunk libc++ (which has everything regardless
of what the current system is).

This is a re-application of r353319, which had been reverted due to
CI breakage. This time around, I made sure it didn't break our internal
CI before submitting.

This is also a partial undoing of r348296, in spirit at least. However,
with this patch, availability markup is enabled based on whether we're
using a system library or not, whereas previously one could enable
it or disable it arbitrarily. This was confusing as it led to testing
configurations that don't make sense (such as testing a system library
without availability markup, or trunk testing with availability markup).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355451 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 22:42:45 +00:00
Davide Italiano
a011222d74 Reinstate libc++ patches now that the lldb formatter has been updated.
"[libc++] Fix <atomic> failures on GCC"
"[libc++] Change memory_order to an enum class"
"[libc++] decoupling Freestanding atomic<T> from libatomic.a"

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355427 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 18:40:49 +00:00
Davide Italiano
3438c15d15 [libcxx] Revert set of atomic patches that broke lldb.
Revert "[libc++] Fix <atomic> failures on GCC"
Revert "[libc++] Change memory_order to an enum class"
Revert "[libc++] decoupling Freestanding atomic<T> from libatomic.a"

The lldb formatter nededs to be updated. Shafik and Louis will
coordinate to do so.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355417 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 17:38:33 +00:00
Louis Dionne
018402394d [libc++] Fix <atomic> failures on GCC
Summary:
In https://reviews.llvm.org/D58201, we turned memory_order into an enum
class in C++20 mode. However, we were not casting memory_order to its
underlying type correctly for the GCC implementation, which broke the
build bots. I also fixed a test that was failing in C++17 mode on GCC 5.

Reviewers: EricWF, jfb, mclow.lists

Subscribers: zoecarver

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355409 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 15:49:58 +00:00
Louis Dionne
1bf0d1eb64 [libc++] Change memory_order to an enum class
This implements P0439R0.

Thanks to Zoe Carver for the patch.
Differential Revision: https://reviews.llvm.org/D58201

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355403 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 14:50:25 +00:00
Eric Fiselier
1f820d84ec Fix -fsanitize=vptr badness in <__debug>
Summary:

This patch fixes a lifetime bug when inserting a new container into the debug database. It is
diagnosed by UBSAN when debug mode is enabled. This patch corrects how nodes are constructed
during insertion.

The fix requires unconditionally breaking the debug mode ABI. Users should not expect ABI
stability from debug mode.

Reviewers: ldionne, serge-sans-paille, EricWF

Reviewed By: EricWF

Subscribers: mclow.lists, christof, libcxx-commits

Tags: #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355367 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 02:10:31 +00:00
Eric Fiselier
e718b5a8a8 Make VCRuntime ABI configuration a first-class option.
Summary:
On Windows we currently provide two separate ABI configurations. One which defers to `vcruntime` to provide the C++ runtime and another which doesn't.
Using `vcruntime` allows interoperability which programs compiled against the MSVC STL, and should be preferred whenever possible.

When deferring to `vcruntime` much of the ABI we provide changes. Including the layout of `<stdexcept>` types, their vtables, and how the linkage of their members.

This patch introduces the `_LIBCPP_ABI_VCRUNTIME` macro to denote this configuration. It also cleans up the existing configuration for using `vcruntime`.

This cleanup lays the groundwork for fixing a number of ABI and interoperability bugs in  `<stdexcept>`.


Reviewers: thomasanderson, ldionne, smeenai

Reviewed By: smeenai

Subscribers: jdoerfert, libcxx-commits, #libc

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355366 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 01:57:01 +00:00
Louis Dionne
7f3087ed7c [libc++] Remove old CMake workaround
We haven't had any complaints so far, and I don't think anybody builds
libc++ from source for that old platform anymore.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355336 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 20:52:14 +00:00
Eric Fiselier
a6c5a26883 Install GCC 5 on buildbots to replace GCC 4.9.
LLVM is dropping support for GCC 4.9. This patch adds
a GCC 5 installation to the buildbot image so we can upgrade
the 4.9 bot to GCC 5.

As a temporary workaround until zorg updates, we install GCC 5
as GCC 4.9.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355334 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 20:49:18 +00:00
Louis Dionne
fb86c4426b [libc++] decoupling Freestanding atomic<T> from libatomic.a
This patch introduces non-lockfree atomics that do not require using
an external libatomic. This work is done with the long-term goal of
allowing the use of <atomic> in freestanding environments.

Thanks to Olivier Giroux for the patch.
Differential Revision: https://reviews.llvm.org/D56913

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355318 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 15:26:27 +00:00
Louis Dionne
d386d7e49a [libc++] Fix forgotten fclose() in unit test
Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D58732

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355162 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 01:32:44 +00:00
Louis Dionne
f1546581e5 [libc++] Increase portability of xalloc test
Do not assume that xalloc() starts at 0, which is not specified by the
Standard.

Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D58299

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355160 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-01 00:51:54 +00:00
Louis Dionne
b0ac43ab90 [NFC][libc++] Update comment about oldest supported macosx for back-deployment
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355043 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 23:36:22 +00:00
Louis Dionne
aeeba70ab1 [libc++] Add is_nothrow_convertible from P0758R1
Reviewed as https://reviews.llvm.org/D58019.
Thanks to Zoe Carver for the patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355010 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 17:57:38 +00:00
Louis Dionne
9a0df177ae [libc++] Remove visibility-related warnings with Clang 8
The attributes were placed incorrectly -- they need to be after the
"struct" keyword, not before.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@355006 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 17:33:25 +00:00
Marshall Clow
dee3c9a01a I changed a 'enable_if<...>::type to' 'enable_if_t<...>' but forgot to remove the preceding 'typename'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354995 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 16:09:35 +00:00
Marshall Clow
ae4afd034b Implment the last part of P1024: tuple-like interface to span. Reviewed as https://reviews.llvm.org/D58706.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354988 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 15:41:37 +00:00
Marshall Clow
4542e7bf56 In the review of D58642, Louis asked: 'Is there a reason for making this inline? Templates are already inline by default'. I told him that I didn't want to change the one call (ssize) that I was adding, but would come back later and clean them all (data/empty/begin/end/cbegin/cend/rbegin/rend/crbegin/crend/size/ssize) up later. Now it is later. Remove the unnecessary 'inline' modifiers from all these calls.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354952 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 03:25:43 +00:00
Marshall Clow
dd2ae1242f Implement the second part of P1227R2 - Signed ssize() functions. Reviewed as https://reviews.llvm.org/D58642
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354950 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 02:58:56 +00:00
Marshall Clow
680a56e1aa Fix an ambiguity in the tests that gcc-tot complained about.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354944 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 01:29:52 +00:00
Louis Dionne
a4bb2d075d [libc++] Add a test for PR14074
PR14074 was fixed in r165884, but no tests were added.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354943 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 01:29:09 +00:00
Louis Dionne
21c042e77e [libc++] Mark several tests as XFAIL on macosx10.7
Those tests fail when linking against a new dylib but running against
macosx10.7. I believe this is caused by a duplicate definition of the
RTTI for exception classes in libc++.dylib and libc++abi.dylib, but
this matter still needs some investigation.

This issue was not caught previously because all the tests always linked
against the same dylib used for running (because LIT made it impossible
to do otherwise before r349171).

rdar://problem/46809586

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354940 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 00:57:57 +00:00
Marshall Clow
b3c66aa0ab First part of P1227R2 - change span over to use 'size_t' instead of 'ptrdiff_t'. Reviewed as https://reviews.llvm.org/D58639.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354936 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-27 00:32:16 +00:00
Louis Dionne
b71643a4c0 [libc++] Add <filesystem> to the min-mac macro header test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354932 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-26 23:14:58 +00:00
Marshall Clow
f7374c69a9 Remove P1272R1, it was not moved in Kona
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354904 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-26 18:17:30 +00:00
Marshall Clow
b0560e2ae9 Put a 'first implemented' version into the entry for P1357
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354901 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-26 17:22:47 +00:00
Marshall Clow
02ee9a6e9a Mark several issues (and one paper) as complete. Reviewed as D58099; but I added LWG3101 and LWG3144 and P1357R1 as well.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354898 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-26 17:01:00 +00:00
Marshall Clow
452149ea33 Implement P1357: Traits for [Un]bounded Arrays; adopted in Kona
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354891 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-26 16:07:03 +00:00
Louis Dionne
d772e8009d [libc++] Rename _NOALIAS macro to _LIBCPP_NOALIAS
Summary:
For consistency, libc++ macros always start with _LIBCPP. This should
have no functionality change.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354848 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-26 06:34:42 +00:00
Marshall Clow
a333218455 LWG3101 - span's Container constructors need another constraint. Reviewed as https://reviews.llvm.org/D57058.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354805 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-25 18:32:57 +00:00
Marshall Clow
c67930bd74 Commit LWG3144 - span does not have a const_pointer typedef. Reviewed as D57039.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354802 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-25 17:58:03 +00:00
Marshall Clow
e5cb744bf1 First part of P1024: Usability Enhancements for std::span. Remove operator() for indexing, and add 'front' and 'back' calls.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354801 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-25 17:54:08 +00:00
Marshall Clow
1c2f15d4c4 Update status page with papers/issues adopted in Kona
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354796 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-25 16:12:00 +00:00
Louis Dionne
98173dc3c4 [libcxx] Make sure all experimental tests are disabled when enable_experimental=False
Summary:
Previously, we'd run some experimental tests even when enable_experimental=False
was used with lit.

Reviewers: EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits, mclow.lists

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354725 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-23 11:24:03 +00:00
Louis Dionne
06dd101a65 [NFC] Fix incorrect comment in std::function test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354537 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-21 00:53:26 +00:00
Dimitry Andric
fd04b117fc Fix the build with gcc when -Wredundant-decls is passed
Summary:
gcc warns that `__throw_runtime_error` is declared both in `<__locale>`
and `<stdexcept>`, if `-Wredundant-decls` is passed on the command
line; this is the case with FreeBSD when ${WARNS} == 6.

Since `<__locale>` gets its first declaration via a transitive include
of `<stdexcept>`, and the second declaration is after the first
invocation of `__throw_runtime_error`, delete that second declaration.

Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>

Reviewers: kristina, MaskRay, EricWF, ldionne, ngie

Reviewed By: EricWF

Subscribers: krytarowski, brooks, emaste, dim, christof, jdoerfert, libcxx-commits

Tags: #libc

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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354515 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-20 21:01:31 +00:00
Jonas Hahnfeld
22d3f6dd25 [compiler-rt] Build custom libcxx with libcxxabi
This changes add_custom_libcxx to also build libcxxabi and merges
the two into a static and hermetic library.
There are multiple advantages:
1) The resulting libFuzzer doesn't expose C++ internals and looks
   like a plain C library.
2) We don't have to manually link in libstdc++ to provide cxxabi.
3) The sanitizer tests cannot interfere with an installed version
   of libc++.so in LD_LIBRARY_PATH.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@354212 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-17 12:16:20 +00:00
Louis Dionne
712d476de3 [libcxx] Do not assume the number of elements in a moved-from associative container
Reviewed as https://reviews.llvm.org/D57903.
Thanks to Andrey Maksimov for the patch.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353955 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13 16:43:44 +00:00
Louis Dionne
af15bb4cdf [libc++] Avoid UB in the no-exceptions mode in a few places
Summary:
A few places in the library seem to behave unexpectedly when the library
is compiled or used with exceptions disabled. For example, not throwing
an exception when a pointer is NULL can lead us to dereference the pointer
later on, which is UB. This patch fixes such occurences.

It's hard to tell whether there are other places where the no-exceptions
mode misbehaves like this, because the replacement for throwing an
exception does not always seem to be abort()ing, but at least this
patch will improve the situation somewhat.

See http://lists.llvm.org/pipermail/libcxx-dev/2019-January/000172.html

Reviewers: mclow.lists, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353850 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12 16:06:02 +00:00
Petr Hosek
f759756c12 [CMake] Avoid passing -rtlib=compiler-rt when using compiler-rt
We build libc++ and libc++abi with -nodefaultlibs, so -rtlib=compiler-rt
has no effect and results in an 'argument unused during compilation'
warning which breaks the build when using -Werror. We can therefore drop
-rtlib=compiler-rt without any functional change; note that the actual
compiler-rt linking is handled by HandleCompilerRT.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353786 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12 01:35:29 +00:00
Eric Fiselier
e88eb48b17 Don't declare fenv.h functions when they're a macro.
libc still provides function declarations, and these declarations
conflict with libc++'s

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353774 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12 00:05:14 +00:00
Eric Fiselier
199f01c55f Make the sym_diff utilities more useful.
In particular when working with static libraries and libstdc++.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353772 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-12 00:00:43 +00:00
Eric Fiselier
ecc2c089fd Add fenv.h header
Summary:
Some implementations of fenv.h use macros to define the functions they provide. This can cause problems when `std::fegetround()` is spelled in source.

This patch adds a `fenv.h` header to libc++ for the sole purpose of turning those macros into real functions.

Reviewers: rsmith, mclow.lists, ldionne

Reviewed By: rsmith

Subscribers: mgorny, christof, libcxx-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353767 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11 23:47:19 +00:00
Petr Hosek
fc1ec361d3 [libcxx] Preserve order, avoid duplicates when merging static archives
glob can return files in arbitrary order which breaks deterministic
builds. Rather, use `ar t` to list the files in each archive and
preserve the original order. Using `ar q` results in duplicate entries
in the archive, instead use `ar r` to avoid duplicates.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353671 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11 08:48:47 +00:00
Chandler Carruth
c882476dfa The new file header didn't get carried over when these files were
"moved" somehow, update them to use it.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353669 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11 08:39:23 +00:00
Chandler Carruth
b20da37b6b Update some newly added files that mistakenly used the old file header
to the new one.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353668 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11 08:39:14 +00:00
Eric Fiselier
d47c19a055 fix -Wextra-semi warnings
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353650 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-10 18:29:00 +00:00
Eric Fiselier
bc415828df Make LIBCXX_STANDARD_VER configurable
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353649 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-10 18:27:55 +00:00
Eric Fiselier
b9a4d073af Format sym_extract.py output to minimize diff output.
Different versions of python print dictionaries in different orders.
 This can mess up diffs when updating ABI lists. This patch uses
 pprint.pformat to print the dicts to get a consistent ordering.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353634 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-10 04:48:54 +00:00
Eric Fiselier
25c089ef5d Add missing symbols to Apple v2 abi list.
The itoa symbols were added and their addition is documented in the CHANGELOG.
I'm not sure why the valarray symbols were missing previously, but they're
present in the v1 ABI lists and should be here as well.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@353633 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-10 04:41:48 +00:00