Commit Graph

947 Commits

Author SHA1 Message Date
Jake Egan 1cf4113952 [libcxx][AIX] Switch build compiler to clang
This patch switches the build compiler for AIX from ibm-clang to clang. ibm-clang++_r has `-pthread` by default, but clang for AIX doesn't, so `-pthread` had to be added to the test config. A bunch of tests now pass, so the `XFAIL` was removed. This patch also switch the build to use the visibility support available in clang-15 to control symbols exported by the shared library (AIX traditionally uses explicit export lists for this purpose).

Reviewed By: #libc, #libc_abi, daltenty, #libunwind, ldionne

Differential Revision: https://reviews.llvm.org/D127470
2022-06-13 21:45:18 -04:00
Mark de Wever a7bd1ab776 [libc++][CI] Updates Docker image.
- Updates the image to use Ubuntu Jammy.
- Installs GCC-12 as preparation to migrate to that GCC version.

NOTE: This is a re-application of f2f0dba818, which was reverted
in 2b5e3ef83c due to an issue with the CI nodes. The CI nodes have
since then been updated and this appears to be fine.

Differential Revision: https://reviews.llvm.org/D126666
2022-06-09 08:53:20 -04:00
Louis Dionne 0e9a01dcac [libc++] Fix modules builds when features are removed
When some headers are not available because we removed features like
localization or threads, the compiler should not try to include these
headers when building modules. To avoid that from happening, add a
requires-declaration that is never satisfied when the configuration
in use doesn't support a header.

rdar://93777687

Differential Revision: https://reviews.llvm.org/D127127
2022-06-08 18:48:25 -04:00
Mark de Wever 2b5e3ef83c Revert "[libc++][CI] Updates Docker image."
This reverts commit f2f0dba818.

This Docker file doesn't work on the CI. It fails to clone the checkout.
This seems like an issue with a newer glibc on an older Docker where the
clone3() call fails.

This needs further investigation before relanding.
2022-06-08 19:18:35 +02:00
Louis Dionne 90668adf68 [libc++] Make sure we add /llvm to the list of safe directories
With the new version of Git in Ubuntu Jammy (which is now what we use in
our Docker image), we need to add `/llvm` to the list of safe directories
to avoid failures.
2022-06-08 12:26:17 -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
Mark de Wever f2f0dba818 [libc++][CI] Updates Docker image.
- Updates the image to use Ubuntu Jammy.
- Installs GCC-12 as preparation to migrate to that GCC version.

Reviewed By: ldionne, #libc, jloser

Differential Revision: https://reviews.llvm.org/D126666
2022-06-07 18:52:31 +02:00
Louis Dionne 222bd83d50 [libc++] Forgot to bump the CI timeout everywhere 2022-06-07 10:01:01 -04:00
Louis Dionne 76c7e1f2a8 [libc++] Bump timeout to avoid spurious failures on AIX 2022-06-07 10:00:32 -04:00
Martin Storsjö 4940caaebb [libcxx] [test] Don't use header defines for detecting linking against a DLL
In clang-cl/MSVC environments, linking against a DLL C++ standard
library requires having dllimport attributes in the headers; this
has been used for detecting whether the tests link against a DLL,
by looking at the libc++ specific define
_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS.

In mingw environments, thanks to slightly different code generation
and a couple linker tricks, it's possible to link against a DLL C++
standard library without dllimport attributes. Therefore, don't
rely on the libc++ specific header define for the detection.

Replace the detection with a runtime test.

Differential Revision: https://reviews.llvm.org/D125922
2022-06-06 23:19:22 +03:00
David Spickett c8db406127 Revert "[libcxx] Temporarily skip Arm configs"
This reverts commit d4220af527.

Linaro bots are back online.
2022-06-06 08:25:51 +00:00
Xing Xue dfaee3c9cf [libunwind][ci][AIX] Add libunwind to buildbot CI
Summary:
This patch changes scripts to add libunwind CI on AIX. Test config file ibm-libunwind-shared.cfg.in is introduced for testing on AIX.

Reviewed by: ldionne, MaskRay, libunwind, ibc++abi

Differential Revision: https://reviews.llvm.org/D126017
2022-06-02 09:03:10 -04:00
David Spickett d4220af527 [libcxx] Temporarily skip Arm configs
The machine hosting these agents will be down
for maintenance June 2nd.

We (Linaro) will remove this once the agents are back online.

Differential Revision: https://reviews.llvm.org/D126688
2022-06-01 08:37:32 +00:00
Mark de Wever 9e5c293492 [libc++] Removes __cpp_lib_monadic_optional.
P0798R8 "Monadic operations for std::optional" has been implemented, so
this LWG issue can be adopted.

During review it was discovered another paper bumped the macro. The
part affecting optional of this paper is done, the variant isn't. The
status page is updated to reflect the current state.

Implements
- LWG 3621 Remove feature-test macro __cpp_lib_monadic_optional

Updates status of
- P2231R1 Missing constexpr in std::optional and std::variant

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D125813
2022-05-31 19:18:34 +02:00
Louis Dionne f8239eec8d [libc++] Reduce the verbosity when running the libc++ Lit configuration
We print the same information as before, however we do it with less
verbosity unless `--debug` is used.
2022-05-30 12:03:24 -04:00
Louis Dionne a7f9895cc1 [runtimes] Rename various libcpp-has-no-XYZ Lit features to just no-XYZ
Since those features are general properties of the environment, it makes
sense to use them from libc++abi too, and so the name libcpp-has-no-xxx
doesn't make sense.

Differential Revision: https://reviews.llvm.org/D126482
2022-05-27 15:24:45 -04:00
Louis Dionne 719bf2d9d9 [runtimes] Officially deprecate the legacy testing configuration system
Add a warning and tweak the release note to explain that the deprecation
targets libc++, libc++abi and libuwnind as well.

Also, as a fly-by, ensure that our CI runs the legacy testing configuration
for libc++, libc++abi and libunwind. This doesn't matter too much since
it's deprecated, but we might as well test it properly.

Differential Revision: https://reviews.llvm.org/D126478
2022-05-27 13:15:48 -04:00
Louis Dionne 92bbcfaa97 [libunwind] Tidy-up the testing configuration for libunwind
Start testing Apple backdeployment with older libunwinds, and stop
explicitly specifying the libunwind testing config, since it is
already selected correctly by default.

Differential Revision: https://reviews.llvm.org/D126470
2022-05-26 15:29:39 -04:00
Louis Dionne 3bba72e653 [libc++] Time tests during CI 2022-05-26 14:58:29 -04:00
Louis Dionne d8afac7a2b [libc++] Use Python subprocess instead of libc++'s own utilities
Once we move off entirely from the legacy testing framework, this will
allow removing a bunch of code.

Differential Revision: https://reviews.llvm.org/D126303
2022-05-25 09:33:22 -04:00
Louis Dionne 643df8fa8e [libc++] Make sure that all headers can be included with modules enabled
This commit ensures that we can include all libc++ headers with modules
enabled. It adds a test to ensure that this doesn't regress, which is
necessary because our modules CI job does not build in all Standard modes.

Differential Revision: https://reviews.llvm.org/D125331
2022-05-25 03:44:48 -04:00
Louis Dionne a9a6e20012 [libc++] Rename the generic-singlethreaded CI job to generic-no-threads for consistency 2022-05-24 09:58:57 -04:00
Louis Dionne fa7ce8e685 [runtimes] Fix the build of merged ABI/unwinder libraries
Also, add a CI job that tests this configuration. The exact configuration
is that we build a shared libc++ and merge objects for the ABI library
and the unwinder library into it.

Differential Revision: https://reviews.llvm.org/D125903
2022-05-19 10:49:36 -04:00
Louis Dionne aa656f6c2d [runtimes] Introduce object libraries
This is a variant of D116689 rebased on top of the new (proposed) ABI
refactoring in D120727. It should conserve the basic properties of the
original patch by @phosek, except it also allows cleaning up the merging
of libc++abi into libc++ from the libc++ side.

Differential Revision: https://reviews.llvm.org/D125393
2022-05-16 08:41:16 -04:00
Louis Dionne 374d789997 [runtimes] Fix how we trigger CI
For example, we used to trigger CI even for commits that touched a file
whose path contained 'cmake', even if it's not the root cmake directory.
Fix that.
2022-05-13 14:45:35 -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 586efd52b9 [libc++][P0943] Add stdatomic.h header.
* https://wg21.link/P0943
* https://eel.is/c++draft/stdatomic.h.syn

This is a re-application of 5d1c1a24, which was reverted in 987c7f407
because it broke the LLDB build.

Co-authored-by: Marek Kurdej <marek.kurdej@gmail.com>

Differential Revision: https://reviews.llvm.org/D97044
2022-05-06 09:52:48 -04:00
John Brawn f3a970a825 [libc++] Mark tests that use check_assertion.h as requiring unix headers
On targets without unistd.h or sys/wait.h (such as bare metal targets)
any test that uses check_assertion.h will fail, so add
REQUIRES: has-unix-headers to them and autodetect whether we have
these headers or not.

These tests currently have unsupported on windows, but that's exactly
because windows doesn't have these headers so we can remove the
specific check for windows.

Differential Revision: https://reviews.llvm.org/D124623
2022-05-06 10:59:42 +01:00
Martin Storsjö 30194d45f0 [libcxx] [ci] Add a i386 Windows configuration to CI
Adding a mingw based config is easy in the current CI environment
(where we can just choose the different target by calling
`i686-w64-mingw32-clang`), while adding a clang-cl based config would
require setting up different environment variables pointing to the
i386 library directory.

Just adding one config (DLL) instead of exhaustively testing both
(DLL and static) as very few tests would differ in practice, to keep
the CI load reasonable.

Differential Revision: https://reviews.llvm.org/D124991
2022-05-06 10:12:04 +03:00
Mark de Wever d563df88e9 Revert "[msan][libcxx] Enable -fsanitize-memory-param-retval"
This reverts commit beff64ee44.

The original commit was reviewed as D123979.

This commit caused the libc++ pre-commit CI to fail
https://buildkite.com/llvm-project/libcxx-ci/builds/10483

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D124713
2022-04-30 15:19:16 +02:00
Vitaly Buka beff64ee44 [msan][libcxx] Enable -fsanitize-memory-param-retval
We are considering to make -fsanitize-memory-param-retval enabled by default so probably this patch is unnneded.

Reviewed By: #libc, EricWF

Differential Revision: https://reviews.llvm.org/D123979
2022-04-28 19:12:41 -07:00
Nikolas Klauser 425620ccdd [libc++] Implement P0980R1 (constexpr std::string)
Reviewed By: #libc, ldionne

Spies: daltenty, sdasgup3, ldionne, arichardson, MTC, ChuanqiXu, mehdi_amini, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes, tatianashp, rdzhabarov, teijeong, cota, dcaballe, Chia-hungDuan, wrengr, wenzhicui, arphaman, Mordante, miscco, Quuxplusone, smeenai, libcxx-commits

Differential Revision: https://reviews.llvm.org/D110598
2022-04-27 12:25:34 +02:00
Nikolas Klauser 29c8c070a1 [libc++] Use bit field for checking if string is in long or short mode
This makes the code a bit simpler and (I think) removes the undefined behaviour from the normal string layout.

Reviewed By: ldionne, Mordante, #libc

Spies: labath, dblaikie, JDevlieghere, krytarowski, jgorbe, jingham, saugustine, arichardson, libcxx-commits

Differential Revision: https://reviews.llvm.org/D123580
2022-04-21 14:20:21 +02:00
Yuanfang Chen 81b51b61f8 Fix libcxx build after cd0a5889d7 2022-04-12 15:42:56 -07:00
Louis Dionne 8b5e4c038e [runtimes][CI] Add a 20 minutes individual test time out
If a single test has been running for more than 20 minutes on a CI node,
something is wrong and it should time-out instead of running until the
node potentially times out itself.

Differential Revision: https://reviews.llvm.org/D114896
2022-04-11 17:47:05 -04:00
Louis Dionne c292b6066c [libc++] Implement P1007R3: std::assume_aligned
This supersedes and incoroporates content from both D108906 and D54966,
and also some original content.

Co-Authored-by: Marshall Clow <mclow.lists@gmail.com>
Co-Authored-by: Gonzalo Brito Gadeschi

Differential Revision: https://reviews.llvm.org/D118938
2022-04-11 10:46:52 -04:00
Louis Dionne 2c6217f252 [libc++] Make .version.pass.cpp tests be compile-only tests
We don't really need to run them.
2022-04-11 10:40:04 -04:00
Nikolas Klauser a96443edde [libc++] Implement P0401R6 (allocate_at_least)
Reviewed By: ldionne, var-const, #libc

Spies: mgorny, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D122877
2022-04-09 16:03:45 +02:00
Mark de Wever d49c0ba5ab [libc++][test] Use the Japanese locale.
This change is done to see whether all platforms have a CI with the
Japanese locale installed.

This wires in the locale in the tests and uses it in one test. This is
a preparation for the tests of the chrono formatters.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D122738
2022-04-08 20:00:34 +02:00
Louis Dionne b7042b73a3 [libc++] Add back-deployment testing on arm64 macs
Differential Revision: https://reviews.llvm.org/D123081
2022-04-07 10:15:40 -04:00
Martin Storsjö 7594e23679 [libcxx] [test] Stop defining LIBCXX-WINDOWS-FIXME
There are no such markings left - all of them have been fixed or
analyzed.

This closes llvm.org/PR32730 (github issue #32077).

Differential Revision: https://reviews.llvm.org/D123145
2022-04-06 22:54:39 +03:00
Louis Dionne e27a122b3a [libc++] Support arrays in make_shared and allocate_shared (P0674R1)
This patch implements P0674R1, i.e. support for arrays in std::make_shared
and std::allocate_shared.

Co-authored-by: Zoe Carver <z.zoelec2@gmail.com>

Differential Revision: https://reviews.llvm.org/D62641
2022-04-06 08:42:55 -04:00
Louis Dionne 9a44ed43cf [libc++] Implement tests for private headers using the new generator
Differential Revision: https://reviews.llvm.org/D123028
2022-04-04 17:44:47 -04:00
Louis Dionne a4f73b9b14 [libc++][NFC] Rename generate_assertion_tests.py to generate_header_tests.py 2022-04-04 09:10:52 -04:00
Louis Dionne be1294de9d [libc++] Implement all public header tests using the new generator
Note that `generate_assertion_tests.py` will be renamed to
`generate_header_tests.py` separately to facilitate change tracking.

Differential Revision: https://reviews.llvm.org/D123000
2022-04-04 09:09:37 -04:00
Martin Storsjö 64d7f778e6 [libcxx] [ci] Enable -Werror for libcxxabi and libunwind too
Differential Revision: https://reviews.llvm.org/D122800
2022-04-01 10:12:52 +03:00
Mark de Wever 11c14bca58 [libc++][ci] Installs Japanese locale in Docker.
The alternative outputs of std::put_time and std::strftime are the
easiest to test with the Japanese locale. This is a preparation for the
tests of the chrono formatters.

Note since it takes a while before the Docker file changes propagate to
the build nodes the verification of the locale is done in a separate
patch.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D122736
2022-03-31 17:41:06 +02:00
Louis Dionne 0a460416e6 [libc++] Install psutil on the macOS nodes 2022-03-31 10:52:58 -04:00
Louis Dionne 19246b0779 [libc++] Remove the __libcpp_version file
It seems to have been added back in 761e42fa3d for Clang to use it,
however it seems to have never been used for that purpose, so it is
probably fine to remove it.

Differential Revision: https://reviews.llvm.org/D122330
2022-03-31 09:34:41 -04:00
Louis Dionne cb055e51f9 [libc++] Add a CI job running MSAN
For some reason, we've been going without a MSAN CI job, even though
even run-buildbot defined a generic-msan job. This must have been an
oversight that went unnoticed. Thanks to @EricWF for the catch.

Differential Revision: https://reviews.llvm.org/D120851
2022-03-31 09:31:22 -04:00