Commit Graph

329 Commits

Author SHA1 Message Date
Louis Dionne
87cec86597 [libc++] Remove symbols for a std::allocator_arg & friends from the dylib
This patch removes the symbols defined in the library for std::allocator_arg,
std::defer_lock, std::try_to_lock, std::adopt_lock, and std::piecewise_construct.
Those were defined in the library because we provided them in C++03 as an
extension, and in C++03 it was impossible to define them as `constexpr`
variables, like in the spec.

This is technically an ABI break since we are removing symbols from the
library. However, in practice, only programs compiled in C++03 mode who
take the address of those objects (or pass them as a reference) will have
an undefined ref to those symbols. In practice, this is expected to be
rare. First, those are C++11 features that we happen to provide in C++03,
and only the C++03 definition can potentially lead to code referencing
the dylib definition. So any code that is using these objects but compiling
in C++11 mode (as they should) is not at risk. Second, all uses of these
types in the library is done by passing those types by value to a function
that can get inlined. Since they are empty types, the compiler won't
generate an undefined reference if passed by value, since there's nothing
to pass anyway.

Long story short, the risk for code actually containing an undefined
reference to one of these types is rather small (but non-zero). I also
couldn't find any app on the App Store that referenced these symbols,
which supports my impression that this won't be an issue in practice.

Differential Revision: https://reviews.llvm.org/D145587
2023-04-19 17:27:14 -04:00
Louis Dionne
a6a74fa5b3 [libc++][NFC] Clean up the ABI changelog
Fix a few typos and remove TODOs
2023-03-19 10:37:24 -04:00
Nikolas Klauser
97b5e0147c [libc++] Remove explicit instantiations of __insertion_sort_incomplete and __sort5 from the dylib
These instantiations were never visible, because they are only used in `__sort`, which is also explicitly instantiated in the dylib.

Reviewed By: ldionne, #libc

Spies: #libc_vendors, emaste, nemanjai, libcxx-commits

Differential Revision: https://reviews.llvm.org/D142185
2023-02-01 19:53:38 +01:00
Ed Maste
146c7d0b6a [libc++] Add FreeBSD exceptions.nonew ABI list
This matches the configuration used by the prospective FreeBSD CI runner.
Remove the (unused) ABI list created in my local environment.

This reverts commit eca9196dc8.

Reviewed by: Mordante
Differential Revision: https://reviews.llvm.org/D141496
2023-01-11 13:42:04 -05:00
Ed Maste
eca9196dc8 [libc++] Add FreeBSD ABI list
Generated via `nina generate-cxx-abilist`.

Reviewed By: Mordante, ldionne, philnik
Differential Revision: https://reviews.llvm.org/D140431
2022-12-21 12:29:11 -05:00
Leonard Chan
96d63993dd Revert "[CMake] Use LLVM_TARGET_TRIPLE in runtimes"
This reverts commit bec8a372fc.

This causes many of these errors to appear when rebuilding runtimes part
of fuchsia's toolchain:

ld.lld: error:
/usr/local/google/home/paulkirth/llvm-upstream/build/lib/x86_64-unknown-linux-gnu/libunwind.a(libunwind.cpp.o)
is incompatible with elf64-x86-64

This can be reproduced by making a complete toolchain, saving any source
file with no changes, then rerunning ninja distribution.
2022-12-05 22:20:51 +00:00
Petr Hosek
bec8a372fc [CMake] Use LLVM_TARGET_TRIPLE in runtimes
This variable is derived from LLVM_DEFAULT_TARGET_TRIPLE by default,
but using a separate variable allows additional normalization to be
performed if needed.

Differential Revision: https://reviews.llvm.org/D137451
2022-11-29 04:08:24 +00:00
Nikolas Klauser
57215eda64 [libc++][PMR] Move the pmr::memory_resource destructor into the dylib
This avoids emitting the VTable of `pmr::memory_resource` in every TU.

Reviewed By: ldionne

Spies: EricWF, nemanjai, libcxx-commits

Differential Revision: https://reviews.llvm.org/D136196
2022-11-01 00:37:04 +01:00
Louis Dionne
1e1c082f7e [libc++][NFC] Add missing SHA in ABI changelog 2022-10-12 17:46:08 -04:00
Arthur O'Dwyer
243da90ea5 [libc++] Add the C++17 <memory_resource> header (mono-patch)
This patch is the rebase and squash of three earlier patches.
It supersedes all three of them.

- D47111: experimental monotonic_buffer_resource.
- D47358: experimental pool resources.
- D47360: Copy std::experimental::pmr to std::pmr.

The significant difference between this patch and the-sum-of-those-three
is that this patch does not add `std::experimental::pmr::monotonic_buffer_resource`
and so on. This patch simply adds the C++17 standard facilities, and
leaves the `std::experimental` namespace entirely alone.

Differential Revision: https://reviews.llvm.org/D89057
2022-10-11 08:40:46 -04:00
Louis Dionne
507125af3d [libc++] Rename __libcpp_assertion_handler to __libcpp_verbose_abort
With the goal of reusing that handler to do other things besides
handling assertions (such as terminating when an exception is thrown
under -fno-exceptions), the name `__libcpp_assertion_handler` doesn't
really make sense anymore.

Furthermore, I didn't want to use the name `__libcpp_abort_handler`,
since that would give the impression that the handler is called
whenever `std::abort()` is called, which is not the case at all.

Differential Revision: https://reviews.llvm.org/D130562
2022-07-29 13:52:42 -04:00
Louis Dionne
3993c7a444 [libc++][NFC] Add missing SHA in ABI changelog 2022-07-26 07:44:26 -04:00
Louis Dionne
7de5aca84c [libc++] Generalize the customizeable assertion handler
Instead of taking a fixed set of arguments, use variadics so that
we can pass arbitrary arguments to the handler. This is the first
step towards using the handler to handle other non-assertion-related
failures, like std::unreachable and an exception being thrown in
-fno-exceptions mode, which would improve user experience by including
additional information in crashes (right now, we call abort() without
additional information).

Differential Revision: https://reviews.llvm.org/D130507
2022-07-26 07:42:38 -04:00
Louis Dionne
91941f0142 [libc++][NFC] Add commit SHA for ABI change 2022-07-19 17:16:53 -04:00
Louis Dionne
f1c3013541 [libc++] Drop the legacy debug mode symbols by default
Leave the escape hatch in place with a note, but don't include the
debug mode symbols by default since we don't support the debug mode
in the normal library anymore.

This is technically an ABI break for users who were depending on
those debug mode symbols in the dylib, however those users will
already be broken at compile-time because they must have been using
_LIBCPP_DEBUG=2, which is now an error.

Differential Revision: https://reviews.llvm.org/D127360
2022-07-19 17:16:06 -04:00
Louis Dionne
8711fcae27 [libc++] Treat incomplete features just like other experimental features
In particular remove the ability to expel incomplete features from the
library at configure-time, since this can now be done through the
_LIBCPP_ENABLE_EXPERIMENTAL macro.

Also, never provide symbols related to incomplete features inside the
dylib, instead provide them in c++experimental.a (this changes the
symbols list, but not for any configuration that should have shipped).

Differential Revision: https://reviews.llvm.org/D128928
2022-07-19 10:50:20 -04:00
Jake Egan
3af7aa5202 [libcxx][AIX] Enable ABI list checking for XCOFF
The existing nm extractors can't dump the loader symbol table information we need to do the ABI checks for XCOFF, so provide an implementation using the system dump utility. We match the symbol name, whether it's defined, it's import/export status, and its storage mapping class.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D124165
2022-06-14 13:16:00 -04:00
Louis Dionne
f3966eaf86 [libc++] Make the Debug mode a configuration-time only option
The debug mode has been broken pretty much ever since it was shipped
because it was possible to enable the debug mode in user code without
actually enabling it in the dylib, leading to ODR violations that
caused various kinds of failures.

This commit makes the debug mode a knob that is configured when
building the library and which can't be changed afterwards. This is
less flexible for users, however it will actually work as intended
and it will allow us, in the future, to add various kinds of checks
that do not assume the same ABI as the normal library. Furthermore,
this will make the debug mode more robust, which means that vendors
might be more tempted to support it properly, which hasn't been the
case with the current debug mode.

This patch shouldn't break any user code, except folks who are building
against a library that doesn't have the debug mode enabled and who try
to enable the debug mode in their code. Such users will get a compile-time
error explaining that this configuration isn't supported anymore.

In the future, we should further increase the granularity of the debug
mode checks so that we can cherry-pick which checks to enable, like we
do for unspecified behavior randomization.

Differential Revision: https://reviews.llvm.org/D122941
2022-06-07 16:33:53 -04:00
Louis Dionne
efcee4b06d [libc++] Remove the legacy LIBCXX_LIBCPPABI_VERSION option
I think this notion of libc++abi's version was relevant a long time ago
on Apple platforms when we were using a Xcode project to build the library.
As part of moving Apple's build to CMake, D59489 made it possible to
specify the "ABI version" of libc++abi in use. However, it's not possible
to build libc++abi with that old ABI anymore and we don't need the ability
to link against that version from libc++ anymore.

Hence, we can clean this up and stop falsely pretending that libc++abi
has more than one ABI version.

Differential Revision: https://reviews.llvm.org/D125687
2022-05-16 15:23:43 -04:00
Louis Dionne
a80e65e00a [libc++] Overhaul how we select the ABI library
This patch overhauls how we pick up the ABI library. Instead of setting
ad-hoc flags, it creates interface targets that can be linked against by
the rest of the build, which is easier to follow and extend to support
new ABI libraries.

This is intended to be a NFC change, however there are some additional
simplifications and improvements we can make in the future that would
require a slight behavior change.

Differential Revision: https://reviews.llvm.org/D120727
2022-05-13 08:32:09 -04:00
Louis Dionne
fea3ca5dc8 [libc++][NFC] Refactor the ABI changelog
Add missing commit SHAs in a few cases, and use "All Platforms" when
the change affected all platforms instead of explicitly listing the
platforms, since there's too many to list exhaustively.
2022-03-24 10:24:43 -04:00
Louis Dionne
5c458f3e57 [libc++][NFC] Update ABI changelog to account for new assertion handler 2022-03-24 09:57:41 -04:00
Louis Dionne
b0fd9497af [libc++] Add a lightweight overridable assertion handler
This patch adds a lightweight assertion handler mechanism that can be
overriden at link-time in a fashion similar to `operator new`.

This is a third take on https://llvm.org/D121123 (which allowed customizing
the assertion handler at compile-time), and https://llvm.org/D119969
(which allowed customizing the assertion handler at runtime only).

This approach is, I think, the best of all three explored approaches.
Indeed, replacing the assertion handler in user code is ergonomic,
yet we retain the ability to provide a custom assertion handler when
deploying to older platforms that don't have a default handler in
the dylib.

As-is, this patch provides a pretty good amount of backwards compatibility
with the previous debug mode:

- Code that used to set _LIBCPP_DEBUG=0 in order to get basic assertions
  in their code will still get basic assertions out of the box, but
  those assertions will be using the new assertion handler support.
- Code that was previously compiled with references to __libcpp_debug_function
  and friends will work out-of-the-box, no changes required. This is
  because we provide the same symbols in the dylib as we used to.
- Code that used to set a custom __libcpp_debug_function will stop
  compiling, because we don't provide that declaration anymore. Users
  will have to migrate to the new way of setting a custom assertion
  handler, which is extremely easy. I suspect that pool of users is
  very limited, so breaking them at compile-time is probably acceptable.

The main downside of this approach is that code being compiled with
assertions enabled but deploying to an older platform where the assertion
handler didn't exist yet will fail to compile. However users can easily
fix the problem by providing a custom assertion handler and defining
the _LIBCPP_AVAILABILITY_CUSTOM_ASSERTION_HANDLER_PROVIDED macro to
let the library know about the custom handler. In a way, this is
actually a feature because it avoids a load-time error that one would
otherwise get when trying to run the code on the older target.

Differential Revision: https://reviews.llvm.org/D121478
2022-03-23 15:35:46 -04:00
Louis Dionne
3ee0cec88e [runtimes] Remove FOO_TARGET_TRIPLE, FOO_SYSROOT and FOO_GCC_TOOLCHAIN
Instead, folks can use the equivalent variables provided by CMake
to set those. This removal aims to reduce complexity and potential
for confusion when setting the target triple for building the runtimes,
and make it correct when `CMAKE_OSX_ARCHITECTURES` is used (right now
both `-arch` and `--target=` will end up being passed, which is downright
incorrect).

Differential Revision: https://reviews.llvm.org/D112155
2022-03-01 08:39:42 -05:00
Louis Dionne
0e628a783b [libc++] Take more knobs into account when generating ABI lists
This change will make it possible to track exported symbols in more
configurations, notably the Apple system one, where we disable incomplete
features and the debug mode. Also, as a fly-by fix, shorten the name for
whether new is in libc++ or not.

Differential Revision: https://reviews.llvm.org/D119764
2022-02-15 16:11:16 -05:00
Mark de Wever
abb5dd6e99 Microsoft's floating-point to_chars powered by Ryu and Ryu Printf
Microsoft would like to contribute its implementation of floating-point to_chars to libc++. This uses the impossibly fast Ryu and Ryu Printf algorithms invented by Ulf Adams at Google. Upstream repos: https://github.com/microsoft/STL and https://github.com/ulfjack/ryu .

Licensing notes: MSVC's STL is available under the Apache License v2.0 with LLVM Exception, intentionally chosen to match libc++. We've used Ryu under the Boost Software License.

This patch contains minor changes from Jorg Brown at Google, to adapt the code to libc++. He verified that it works in Google's Linux-based environment, but then I applied more changes on top of his, so any compiler errors are my fault. (I haven't tried to build and test libc++ yet.) Please tell me if we need to do anything else in order to follow https://llvm.org/docs/DeveloperPolicy.html#attribution-of-changes .

Notes:

* libc++'s integer charconv is unchanged (except for a small refactoring). MSVC's integer charconv hasn't been tuned for performance yet, so you're not missing anything.
* Floating-point from_chars isn't part of this patch because Jorg found that MSVC's implementation (derived from our CRT's strtod) was slower than Abseil's. If you're unable to use Abseil or another implementation due to licensing or technical considerations, Microsoft would be delighted if you used MSVC's from_chars (and you can just take it, or ask us to provide a patch like this). Ulf is also working on a novel algorithm for from_chars.
* This assumes that float is IEEE 32-bit, double is IEEE 64-bit, and long double is also IEEE 64-bit.
* I have added MSVC's charconv tests (the whole thing: integer/floating from_chars/to_chars), but haven't adapted them to libcxx's harness at all. (These tests will be available in the microsoft/STL repo soon.)
* Jorg added int128 codepaths. These were originally present in upstream Ryu, and I removed them from microsoft/STL purely for performance reasons (MSVC doesn't support int128; Clang on Windows does, but I found that x64 intrinsics were slightly faster).
* The implementation is split into 3 headers. In MSVC's STL, charconv contains only Microsoft-written code. xcharconv_ryu.h contains code derived from Ryu (with significant modifications and additions). xcharconv_ryu_tables.h contains Ryu's large lookup tables (they were sufficiently large to make editing inconvenient, hence the separate file). The xmeow.h convention is MSVC's for internal headers; you may wish to rename them.
* You should consider separately compiling the lookup tables (see https://github.com/microsoft/STL/issues/172 ) for compiler throughput and reduced object file size.
* See https://github.com/StephanTLavavej/llvm-project/commits/charconv for fine-grained history. (If necessary, I can perform some rebase surgery to show you what Jorg changed relative to the microsoft/STL repo; currently that's all fused into the first commit.)

Differential Revision: https://reviews.llvm.org/D70631
2021-12-12 16:34:50 +01:00
Petr Hosek
ae53d02f55 Revert "Microsoft's floating-point to_chars powered by Ryu and Ryu Printf"
This reverts commit a8025e06fc since
it triggers PR52584 with debug info enabled.
2021-12-07 00:10:14 -08:00
Mark de Wever
a8025e06fc Microsoft's floating-point to_chars powered by Ryu and Ryu Printf
Microsoft would like to contribute its implementation of floating-point to_chars to libc++. This uses the impossibly fast Ryu and Ryu Printf algorithms invented by Ulf Adams at Google. Upstream repos: https://github.com/microsoft/STL and https://github.com/ulfjack/ryu .

Licensing notes: MSVC's STL is available under the Apache License v2.0 with LLVM Exception, intentionally chosen to match libc++. We've used Ryu under the Boost Software License.

This patch contains minor changes from Jorg Brown at Google, to adapt the code to libc++. He verified that it works in Google's Linux-based environment, but then I applied more changes on top of his, so any compiler errors are my fault. (I haven't tried to build and test libc++ yet.) Please tell me if we need to do anything else in order to follow https://llvm.org/docs/DeveloperPolicy.html#attribution-of-changes .

Notes:

* libc++'s integer charconv is unchanged (except for a small refactoring). MSVC's integer charconv hasn't been tuned for performance yet, so you're not missing anything.
* Floating-point from_chars isn't part of this patch because Jorg found that MSVC's implementation (derived from our CRT's strtod) was slower than Abseil's. If you're unable to use Abseil or another implementation due to licensing or technical considerations, Microsoft would be delighted if you used MSVC's from_chars (and you can just take it, or ask us to provide a patch like this). Ulf is also working on a novel algorithm for from_chars.
* This assumes that float is IEEE 32-bit, double is IEEE 64-bit, and long double is also IEEE 64-bit.
* I have added MSVC's charconv tests (the whole thing: integer/floating from_chars/to_chars), but haven't adapted them to libcxx's harness at all. (These tests will be available in the microsoft/STL repo soon.)
* Jorg added int128 codepaths. These were originally present in upstream Ryu, and I removed them from microsoft/STL purely for performance reasons (MSVC doesn't support int128; Clang on Windows does, but I found that x64 intrinsics were slightly faster).
* The implementation is split into 3 headers. In MSVC's STL, charconv contains only Microsoft-written code. xcharconv_ryu.h contains code derived from Ryu (with significant modifications and additions). xcharconv_ryu_tables.h contains Ryu's large lookup tables (they were sufficiently large to make editing inconvenient, hence the separate file). The xmeow.h convention is MSVC's for internal headers; you may wish to rename them.
* You should consider separately compiling the lookup tables (see https://github.com/microsoft/STL/issues/172 ) for compiler throughput and reduced object file size.
* See https://github.com/StephanTLavavej/llvm-project/commits/charconv for fine-grained history. (If necessary, I can perform some rebase surgery to show you what Jorg changed relative to the microsoft/STL repo; currently that's all fused into the first commit.)

Differential Revision: https://reviews.llvm.org/D70631
2021-12-05 13:25:33 +01:00
Muiez Ahmed
049f6c29a6 [libc++] Resolve missing table_size symbol
The aim of this patch is to resolve the missing `table_size` symbol (see reduced test case). That const variable is declared and defined in //libcxx/include/locale//; however, the test case suggests that the symbol is missing. This is due to a C++ pitfall (highlighted [[ https://quuxplusone.github.io/blog/2020/09/19/value-or-pitfall/ | here ]]). In summary, assigning the reference of `table_size` doesn't enforce the const-ness and expects to find `table_size` in the DLL. The fix is to use `constexpr` or have an out-of-line definition in the src (for consistency).

Differential Revision: https://reviews.llvm.org/D110647
2021-11-18 15:49:45 -05:00
Louis Dionne
df0c2b917d [libc++] Adjust comment about ABI change and std::bad_function_call 2021-11-16 15:32:15 -05:00
Konstantin Varlamov
434dc0a5bc [libc++] Always define a key function for std::bad_function_call in the dylib
However, whether applications rely on the std::bad_function_call vtable
being in the dylib is still controlled by the ABI macro, since changing
that would be an ABI break.

Also separate preprocessor definitions for whether to use a key function
and whether to use a `bad_function_call`-specific `what` message
(`what` message is mandated by [LWG2233](http://wg21.link/LWG2233)).

Differential Revision: https://reviews.llvm.org/D92397
2021-11-16 11:23:27 -08:00
Konstantin Varlamov
d7ab283996 Revert "[libc++] Always define a key function for std::bad_function_call in the dylib"
This reverts commit bc74231756. It was
committed accidentally.
2021-11-08 00:44:47 -08:00
Louis Dionne
bc74231756 [libc++] Always define a key function for std::bad_function_call in the dylib
However, whether applications rely on the std::bad_function_call vtable
being in the dylib is still controlled by the ABI macro, since changing
that would be an ABI break.

Differential Revision: https://reviews.llvm.org/D92397
2021-11-08 00:31:00 -08:00
Mikhail Maltsev
be10b1f1cc [libcxx] Make allocator<T>:allocate throw bad_array_new_length
Currently the member functions std::allocator<T>::allocate,
std::experimental::pmr::polymorphic_allocator::allocate and
std::resource_adaptor<T>::do_allocate throw an exception of type
std::length_error when the requested size exceeds the maximum size.

According to the C++ standard ([allocator.members]/4,
[mem.poly.allocator.mem]/1), std::allocator<T>::allocate and
std::pmr::polymorphic_allocator::allocate must throw a
std::bad_array_new_length exception in this case.

The patch fixes the issue with std::allocator<T>::allocate and changes
the type the exception thrown by
std::experimental::pmr::resource_adaptor<T>::do_allocate to
std::bad_array_new_length as well for consistency.

The patch resolves LWG 3237, LWG 3038 and LWG 3190.

Reviewed By: ldionne, #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D110846
2021-10-18 19:12:42 +01:00
Louis Dionne
ec2bdf86f0 [libc++][NFC] Add missing commits to the ABI changelog 2021-07-20 09:19:52 -04:00
Louis Dionne
395271ad11 [runtimes] Simplify how we set the target triple
Instead of using TARGET_TRIPLE, which is always set to LLVM_DEFAULT_TARGET_TRIPLE,
use that variable directly to populate the various XXXX_TARGET_TRIPLE
variables in the runtimes.

This re-applies 77396bbc98 and 5099e01568, which were reverted in
850b57c5fb because they broke the build.

Differential Revision: https://reviews.llvm.org/D106009
2021-07-16 10:33:39 -04:00
Louis Dionne
850b57c5fb [runtimes] Bring back TARGET_TRIPLE
This commit reverts 5099e01568 and 77396bbc98, which broke the build
in various ways. I'm reverting until I can investigate, since that
change appears to be way more subtle than it seemed.
2021-07-14 15:15:22 -04:00
Louis Dionne
77396bbc98 [runtimes] NFCI: Drop intermediate CMake variable TARGET_TRIPLE
We might as well use the various XXX_TARGET_TRIPLE variables directly.
2021-07-14 10:49:28 -04:00
Louis Dionne
2a9366c0e5 [libc++] Generate ABI list for macOS arm64 2021-07-13 10:16:50 -04:00
Louis Dionne
49e7be2e5b [libc++] Disentangle std::pointer_safety
This patch gets rid of technical debt around std::pointer_safety which,
I claim, is entirely unnecessary. I don't think anybody has used
std::pointer_safety in actual code because we do not implement the
underlying garbage collection support. In fact, P2186 even proposes
removing these facilities entirely from a future C++ version. As such,
I think it's entirely fine to get rid of complex workarounds whose goals
were to avoid breaking the ABI back in 2017.

I'm putting this up both to get reviews and to discuss this proposal for
a breaking change. I think we should be comfortable with making these
tiny breaks if we are confident they won't hurt anyone, which I'm fairly
confident is the case here.

Differential Revision: https://reviews.llvm.org/D100410
2021-05-03 14:33:49 -04:00
Mark de Wever
081c1db02d [libc++] Implement format_error.
This is the first step at implementing <format>. It adds the <format> header
and implements the `format_error`. class.

Implemnts parts of:
-P0645 Text Formatting

Reviewed By: ldionne, #libc, miscco, curdeius

Differential Revision: https://reviews.llvm.org/D92214
2021-01-28 18:02:53 +01:00
Louis Dionne
f75bf712de [libc++] Use TARGET_FILE instead of TARGET_SONAME_FILE when generating ABI lists
TARGET_SONAME_FILE isn't valid on Windows, and TARGET_FILE should achieve
the same results.

Differential Revision: https://reviews.llvm.org/D92856
2020-12-11 12:12:40 -05:00
Marek Kurdej
a984dcaf7c [libc++] [P0482] [C++20] Implement missing bits for codecvt and codecvt_byname.
Add codecvt*<char16_t, char8_t> and codecvt*<char32_t, char8_t>.
Deprecate codecvt<char(16|32)_t, char>.
Enable disabled tests.
Update _LIBCPP_STD_VER to use 20 for C++20. Add _LIBCPP_DEPRECATED_IN_CXX20 macro.

Reviewed By: ldionne, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D91517
2020-12-02 09:01:58 +01:00
Louis Dionne
da1b50d7df [libc++] Formalize what configurations are covered by the ABI lists
By encoding ABI-affecting properties in the name of the ABI list, it
makes it clear when an ABI list test should or should not be available,
and what results we should expect.

Note that we clearly don't encode all ABI-affecting parameters in the
name right now -- I just ported over what we supported in the code that
was there previously. As we encounter configurations that we wish to
support but produce different ABI lists, we can add those to the ABI
identifier and start supporting them.

This commit also starts checking the ABI list in the CI jobs that run
a supported configuration. Eventually, all configurations should have
a generated ABI list and the test should even run implicitly as part of
the Lit test suite.

Differential Revision: https://reviews.llvm.org/D92194
2020-11-27 10:01:07 -05:00
Louis Dionne
433d0a30c6 [libc++] Remove ABI lists for previous releases
We don't actually update the ABI lists at every release -- it's too much
work, since we'd technically have to do it even for minor releases.
Furthermore, I don't think anybody uses those (I certainly don't rely
on them for anything).

Instead, it is better to rely on the ABI list changelog and the canonical
ABI list that we always keep up to date. If one wants to know what symbols
were shipped in a specific release, that can be discovered easily using
Git, which is a superior tool than keeping textual copies of old versions.
2020-11-26 14:45:07 -05:00
Louis Dionne
557e268425 [libc++] NFC: Remove symbol from ABI list changelog that was never added
The `posix_memalign@GLIBC_2.2.5` symbol can't have been added by r284206,
because it doesn't show up in the corresponding ABI list. It's also not
defined in libc++, so that wouldn't make sense. It must have made it into
that comment by mistake.
2020-11-12 14:35:56 -05:00
Louis Dionne
997d41cdec [libc++] Instantiate additional <iostream> members in the dylib
This commit adds new explicit instantiations for some classes in <iostream>
in the library. This is done after noticing that many programs that use
streams end up containing weak definitions of these classes, which has a
negative impact on both code size and load times (due to the need to
resolve weak symbols at load time). Note that we are just adding the
additional explicit instantiations for the `char` specializations, since
the `wchar_t` specializations are not used as often, and as a result there
wouldn't be a clear benefit.

This change is not an ABI break, since we are just adding additional
symbols.

Differential Revision: https://reviews.llvm.org/D90677
2020-11-12 13:52:47 -05:00
Louis Dionne
2ca4406de8 [libc++] NFC: Re-generate the ABI lists with the new script
The new script keeps the results sorted, which is why the ABI lists appear
to have changed so much. However, this commit makes no actual ABI change.
2020-11-02 11:36:35 -05:00
Louis Dionne
b128373eb8 [libc++] Make it easier to re-generate the ABI lists
Instead of having to remember the command-line to use every time, this
commit adds a CMake target to generate the ABI list in the current
configuration, if it is supported.

As a fly-by change, remove scripts that are now unused (sym_match.py
and sym_extract.py).
2020-11-02 11:36:35 -05:00
Louis Dionne
1b2fa6e46e [libc++/libc++abi] Use Python3_EXECUTABLE consistently to run utilities 2020-11-02 11:07:31 -05:00