Commit Graph

483 Commits

Author SHA1 Message Date
Louis Dionne
e46de4e54f
[runtimes] Fix link order of system librarires on Apple platforms (#66940)
On Apple platforms, we always support the -nostdlib++ flag. Hence, it is
not necessary to manually link against system libraries. In fact, doing
so causes us to link against libSystem explicitly, which messes up with
the order of libraries we should use. Indeed:

   Before patch, using the system unwinder (LIBCXXABI_USE_LLVM_UNWINDER = OFF)
   ===========================================================================
   $ otool -L lib/{libc++.1.dylib,libc++abi.1.dylib,libunwind.1.dylib}
   lib/libc++.1.dylib:
         @rpath/libc++.1.dylib
         /usr/lib/libSystem.B.dylib
         @rpath/libc++abi.1.dylib
   lib/libc++abi.1.dylib:
         @rpath/libc++abi.1.dylib
         /usr/lib/libSystem.B.dylib
   lib/libunwind.1.dylib:
         @rpath/libunwind.1.dylib
         /usr/lib/libSystem.B.dylib

   After patch, using the system unwinder (LIBCXXABI_USE_LLVM_UNWINDER = OFF)
   ===========================================================================
   $ otool -L lib/{libc++.1.dylib,libc++abi.1.dylib,libunwind.1.dylib}
   lib/libc++.1.dylib:
         @rpath/libc++.1.dylib
         @rpath/libc++abi.1.dylib
         /usr/lib/libSystem.B.dylib
   lib/libc++abi.1.dylib:
         @rpath/libc++abi.1.dylib
         /usr/lib/libSystem.B.dylib
   lib/libunwind.1.dylib:
         @rpath/libunwind.1.dylib
         /usr/lib/libSystem.B.dylib

   Before patch, with the LLVM unwinder (LIBCXXABI_USE_LLVM_UNWINDER = ON)
   =======================================================================
   $ otool -L lib/{libc++.1.dylib,libc++abi.1.dylib,libunwind.1.dylib}
   lib/libc++.1.dylib:
         @rpath/libc++.1.dylib
         /usr/lib/libSystem.B.dylib
         @rpath/libc++abi.1.dylib
         @rpath/libunwind.1.dylib
   lib/libc++abi.1.dylib:
         @rpath/libc++abi.1.dylib
         /usr/lib/libSystem.B.dylib
         @rpath/libunwind.1.dylib
   lib/libunwind.1.dylib:
         @rpath/libunwind.1.dylib
         /usr/lib/libSystem.B.dylib

   After patch, with the LLVM unwinder (LIBCXXABI_USE_LLVM_UNWINDER = ON)
   ======================================================================
   $ otool -L lib/{libc++.1.dylib,libc++abi.1.dylib,libunwind.1.dylib}
   lib/libc++.1.dylib:
         @rpath/libc++.1.dylib
         @rpath/libc++abi.1.dylib
         @rpath/libunwind.1.dylib
         /usr/lib/libSystem.B.dylib
   lib/libc++abi.1.dylib:
         @rpath/libc++abi.1.dylib
         @rpath/libunwind.1.dylib
         /usr/lib/libSystem.B.dylib
   lib/libunwind.1.dylib:
         @rpath/libunwind.1.dylib
         /usr/lib/libSystem.B.dylib

As we can see, libSystem appears before the just-built libraries before
the patch, which causes the libunwind.dylib bundled in libSystem.dylib
to be used instead of the just-built libunwind.dylib.

We didn't notice the issue until recently when I tried to update the
macOS CI builders to macOS 13.5, where it is necessary to use the right
libunwind library (the exact reason still needs to be investigated).
2023-09-21 05:10:05 -04:00
Louis Dionne
008bd84625
[libc++] Remove unused CMake option LIBCXX_DISABLE_MACRO_CONFLICT_WARNINGS (#66249)
Thanks @Gadal for noticing.

Fixes #63703
2023-09-13 16:05:39 -04:00
Konstantin Varlamov
b85e1862c1 [libc++][hardening] Add back the safe mode.
The safe mode is in-between the hardened and the debug modes, extending
the checks contained in the hardened mode with certain checks that are
relatively cheap and prevent common sources of errors but aren't
security-critical. Thus, the safe mode trades off some performance for
a wider set of checks, but unlike the debug mode, it can still be used
in production.

Differential Revision: https://reviews.llvm.org/D158823
2023-09-12 12:01:51 -07:00
Konstantin Varlamov
5795e7ba3e [libc++][hardening][NFC] Fix the 17 release notes to remove mentions of hardening
This is to bring `main` in sync with `release/17.x` after https://reviews.llvm.org/D159171.

Differential Revision: https://reviews.llvm.org/D159454
2023-09-08 11:41:13 -07:00
Mark de Wever
0735a6e3fa [NFC][libc++] Adds spaces in the CMake output.
The line continuations didn't have the proper spaces.
2023-09-06 20:54:43 +02:00
Mark de Wever
f78f93bc9f [libc++][chrono] Adds tzdb_list implementation.
This is the first step to implement time zone support in libc++. This
adds the complete tzdb_list class and a minimal tzdb class. The tzdb
class only contains the version, which is used by reload_tzdb.

Next to these classes it contains documentation and build system support
needed for time zone support. The code depends on the IANA Time Zone
Database, which should be available on the platform used or provided by
the libc++ vendors.

The code is labeled as experimental since there will be ABI breaks
during development; the tzdb class needs to have the standard headers.

Implements parts of:
- P0355 Extending <chrono> to Calendars and Time Zones

Addresses:
- LWG3319 Properly reference specification of IANA time zone database

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D154282
2023-09-06 20:48:07 +02:00
Mark de Wever
d9e3c85f57 [libc++][modules] Simplifies C++20 module testing.
The building of the std module has been moved from `params.py` and
`dsl.py` to a `lit.local.cfg` for the entire test suite. In theory this
change allows testing modules in most configurations, except:
- combined with clang modules
- C++ versions that don't support the std module

Currently only C++23 with all parts enabled works.
C++26 is expected to work properly with CMake 3.27. That versions of CMake
knows how to invoke clang using C++26.
The parts disabled modi of libc++ have not been modularized yet.

It still is the goal that in the future CMake will be able to do the work
done in `lit.local.cfg`. Doing this in CMake would require a more mature
libc++ implementation.

Thanks a lot to @ldionne for giving hints how to enable modules in a
`lit.local.cfg`.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D157625
2023-08-22 20:06:28 +02:00
Louis Dionne
760261a3da [libc++] Fix a few incorrect CMake configuration options
This patch fixes a few CMake options that were set using incorrect
mechanisms.

CMake's man page for the -D <var>=<value> option states: If a command in
the project sets the type to PATH or FILEPATH, then the <value> will be
converted to an absolute path. That's not what we want for most of the
paths we have as configuration options. Otherwise, using -D to set the
configuration option results in an absolute path being used, which
breaks things.

option() denotes a boolean variable, but what was desired was a
string/list variable. Fix this to prevent cmake from changing any
non-empty user provided values to 'ON'.

Differential Revision: https://reviews.llvm.org/D157926
2023-08-17 09:43:09 -04:00
Martin Storsjö
9b02e8d4a0 [libcxx] Respect CMAKE_MSVC_RUNTIME_LIBRARY wrt whether to use the debug CRT
If CMAKE_MSVC_RUNTIME_LIBRARY isn't set, then CMake defaults to
the debug CRT, if CMAKE_BUILD_TYPE is set to Debug. If
CMAKE_MSVC_RUNTIME_LIBRARY is set though, that overrides any
implicit defaults.

Match this in libcxx's own manual linking logic. This allows
decoupling the debug CRT from the CMAKE_BUILD_TYPE and allows users
to configure their builds exactly how they want.

Differential Revision: https://reviews.llvm.org/D155561
2023-08-04 15:53:45 +03:00
Martin Storsjö
e777e44546 [libcxx] Allow linking against the MSVC static CRT
This respects the CMAKE_MSVC_RUNTIME_LIBRARY option for selecting
the right CRT to use.

Add a CI configuration that tests building this way.

Based on a patch by Andrew Ng.

The test config files end up accumulating and duplicating a fair
bit of cmake-specific logic here; if preferred, we could also add
that in `libcxx/test/CMakeLists.txt` and export a few more variables
to `cmake-bridge.cfg.in` instead.

Differential Revision: https://reviews.llvm.org/D155560
2023-07-28 23:51:28 +03:00
Martin Storsjö
7506cb3c92 [libcxx] Link to fewer MSVC CRT libraries
The library msvcrt.lib pulls in ucrt.lib and vcruntime.lib anyway,
there's no need to manually link against the individual dependencies.

This matches how the tests link against libraries - they only link
against msvcrt and msvcprt, not directly against ucrt and vcruntime.

Differential Revision: https://reviews.llvm.org/D155555
2023-07-19 11:31:53 +03:00
Louis Dionne
8ac71b026e [libc++] Remove internal "build-with-external-thread-library" configuration
Our threading support layer is currently a huge mess. There are too many
configurations with too many confusing names, and none of them are tested
in the usual CI. Here's a list of names related to these configurations:

  LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY
  _LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL

  LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY
  _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL

  LIBCXX_HAS_EXTERNAL_THREAD_API
  _LIBCPP_HAS_THREAD_API_EXTERNAL

This patch cleans this up by removing the ability to build libc++ with
an "external" threading library for testing purposes, removing 4 out of
6 "names" above. That setting was meant to be used by libc++ developers,
but we don't use it in-tree and it's not part of our CI.

I know the ability to use an external threading API is used by some folks
out-of-tree, and this patch doesn't change that. This only changes the
way they will have to test their external threading support. After this
patch, the intent would be for them to set `-DLIBCXX_HAS_EXTERNAL_THREAD_API=ON`
when building the library, and to provide their usual `<__external_threading>`
header when they are testing the library. This can be done easily now
that we support custom lit configuration files in test suites.

The motivation for this patch is that our threading support layer is
basically unmaintainable -- anything beyond adding a new "backend" in
the slot designed for it requires incredible attention. The complexity
added by this setting just doesn't pull its weigh considering the
available alternatives.

Concretely, this will also allow future patches to clean up
`<__threading_support>` significantly.

Differential Revision: https://reviews.llvm.org/D154466
2023-07-17 09:32:36 -04:00
varconst
f0dfe682bc [libc++][hardening] Deprecate _LIBCPP_ENABLE_ASSERTIONS.
`_LIBCPP_ENABLE_ASSERTIONS` was used to enable the "safe" mode in
libc++. Libc++ now provides the hardened mode and the debug mode that
replace the safe mode.

For backward compatibility, enabling `_LIBCPP_ENABLE_ASSERTIONS` now
enables the hardened mode. Note that the hardened mode provides
a narrower set of checks than the previous "safe" mode (only
security-critical checks that are performant enough to be used in
production).

Differential Revision: https://reviews.llvm.org/D154997
2023-07-14 16:58:47 -07:00
Nikolas Klauser
2b2e7f6e57 [libc++][PSTL] Add a GCD backend
Reviewed By: ldionne, #libc

Spies: arichardson, mgrang, krytarowski, libcxx-commits, h-vetinari

Differential Revision: https://reviews.llvm.org/D151717
2023-07-12 13:27:33 -07:00
varconst
1ba514c2cb [libc++][hardening][NFC] Remove the LIBCXX_DEBUG_BUILD CMake variable.
It's no longer necessary to define `_DEBUG` because we use our own
internal assertion mechanism in libc++.

Differential Revision: https://reviews.llvm.org/D155038
2023-07-12 10:16:00 -07:00
varconst
d1367ca46e [libc++][hardening][NFC] Add macros to enable hardened mode.
This patch only adds new configuration knobs -- the actual assertions
will be added in follow-up patches.

Differential Revision: https://reviews.llvm.org/D153902
2023-07-12 10:12:58 -07:00
David Spickett
43cfc788fa [libcxx] Check MSVC flag directly instead of setting LIBCXX_TARGETING_MSVC
MSVC is set for actual msvc and clang-cl. LIBXX_TARGETTING_CLANG_CL is
still used over in runtimes to configure warning flags.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D154698
2023-07-10 09:25:26 +00:00
David Spickett
36df92dcd9 [libcxx] Only add -GR- option to MSVC or clang-cl builds
Previously we added both `-GR-` and `-fno-rtti` if RTTI was disabled.
When building with clang 16.x, that caused this error in part of the build:
```
clang-16: error: argument unused during compilation: '-G R-' [-Werror,-Wunused-command-line-argument]
```
I think the strange message is because clang is seeing `R-` as the argument
to `-G`, which is a valid clang option.

`-GR-` is an alternate syntax for the `/GR-` option for MSVC
(the dash means disable RTTI):
https://learn.microsoft.com/en-us/cpp/build/reference/gr-enable-run-time-type-information?view=msvc-170

This error is sort of fixed by cd18efb61d
but not intentionally. Also, we'd have to wait for 17.x to benefit from that.

The proper fix here is to only add `-GR-` if we are building with MSVC
or the MSVC-like clang-cl, and add `-fno-rtti` if not.

Reviewed By: #libc, simon_tatham, michaelplatings, ldionne

Differential Revision: https://reviews.llvm.org/D154582
2023-07-06 14:47:02 +00:00
varconst
b5270ba20d [libc++] Remove the legacy debug mode.
See https://discourse.llvm.org/t/rfc-removing-the-legacy-debug-mode-from-libc/71026

Reviewed By: #libc, Mordante, ldionne

Differential Revision: https://reviews.llvm.org/D153672
2023-06-29 14:49:51 -07:00
Louis Dionne
afc5cca0d4 [libc++] Get rid of _LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS
Whether we include operator new and delete into libc++ has always
been a build time setting, and piggy-backing on a macro like
_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS is inconsistent with how
we handle similar cases for e.g. LIBCXX_ENABLE_RANDOM_DEVICE. Instead,
simply avoid including new.cpp in the sources of the library when we
do not wish to include these operators in the build.

This also makes us much closer to being able to share the definitions
between libc++ and libc++abi, since we could technically build those
definitions into a standalone static library and decide whether we link
it into libc++abi.dylib or libc++.dylib.

Differential Revision: https://reviews.llvm.org/D153272
2023-06-21 09:01:24 -04:00
Mark de Wever
9b08c8a225 [libc++][modules] Adds the C++23 std module.
The patch is based on D144994.

D151030 added the module definitions for the module std.
This patch wires in the module and enables the basic testing.

Some notable features are missing:
- There is no test that libc++ can be fully imported as a module.
- This lacks the parts for the std.compat module.
- The module is not shipped with libc++.

Implements parts of
- P2465R3 Standard Library Modules std and std.compat

Reviewed By: ldionne, aaronmondal, #libc

Differential Revision: https://reviews.llvm.org/D151814
2023-06-15 18:14:15 +02:00
Louis Dionne
66a562d22e [libc++] Roll up fstream support into filesystem support
LIBCXX_ENABLE_FILESYSTEM should represent whether the platform has
support for a filesystem, not just whether we support <filesystem>.
This patch slightly generalizes the setting to also encompass whether
we provide <fstream>, since that only makes sense when a filesystem is
supported.

Differential Revision: https://reviews.llvm.org/D152168
2023-06-07 08:04:58 -07:00
Louis Dionne
1939eb3dc2 [libc++] Disable int128_t and ship filesystem on MSVC by default
Back in 2020 [1], we went very close to enabling Filesystem on MSVC
by disabling int128_t, but decided to wait because MSVC support
for int128_t was supposed to come shortly after. Since it's not
there yet, I propose turning off int128_t support by default on MSVC.
This will make <filesystem> available by default on MSVC, and most
importantly will open the possibility for changing
LIBCXX_ENABLE_FILESYSTEM to mean "the system doesn't have support
for a filesystem" instead of simply "don't build the std::filesystem
library", which is what I'm really after with this change.

In a way, this is a resurection of D91139.

[1]: https://reviews.llvm.org/D91139#2429595

Differential Revision: https://reviews.llvm.org/D134912
2023-06-06 13:31:03 -07:00
Mark de Wever
cbaa3597aa Reland "[CMake] Bumps minimum version to 3.20.0.
This reverts commit d763c6e5e2.

Adds the patch by @hans from
https://github.com/llvm/llvm-project/issues/62719
This patch fixes the Windows build.

d763c6e5e2 reverted the reviews

D144509 [CMake] Bumps minimum version to 3.20.0.

This partly undoes D137724.

This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193

Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.

D150532 [OpenMP] Compile assembly files as ASM, not C

Since CMake 3.20, CMake explicitly passes "-x c" (or equivalent)
when compiling a file which has been set as having the language
C. This behaviour change only takes place if "cmake_minimum_required"
is set to 3.20 or newer, or if the policy CMP0119 is set to new.

Attempting to compile assembly files with "-x c" fails, however
this is workarounded in many cases, as OpenMP overrides this with
"-x assembler-with-cpp", however this is only added for non-Windows
targets.

Thus, after increasing cmake_minimum_required to 3.20, this breaks
compiling the GNU assembly for Windows targets; the GNU assembly is
used for ARM and AArch64 Windows targets when building with Clang.
This patch unbreaks that.

D150688 [cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump

The build uses other mechanism to select the runtime.

Fixes #62719

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D151344
2023-05-27 12:51:21 +02:00
Nikolas Klauser
e837f4b7db [libc++][PSTL] Add a simple std::thread backend
This is just to test that the PSTL works with parallelization. This is not supposed to be a production-ready backend.

Reviewed By: ldionne, #libc

Spies: EricWF, arichardson, libcxx-commits

Differential Revision: https://reviews.llvm.org/D150284
2023-05-24 15:33:58 -07:00
Nico Weber
d763c6e5e2 Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""
This reverts commit 65429b9af6.

Broke several projects, see https://reviews.llvm.org/D144509#4347562 onwards.

Also reverts follow-up commit "[OpenMP] Compile assembly files as ASM, not C"

This reverts commit 4072c8aee4.

Also reverts fix attempt  "[cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump"

This reverts commit 7d47dac5f8.
2023-05-17 10:53:33 -04:00
Mark de Wever
dc95245e69 [libc++][format] Removes format sources.
The source file is used to anchor the destructor of format_error. When
format is moved from experimental to stable this code would move to the
dylib. One issue with code in the dylib is that it can't be used in
constexpr context. There is a proposal to make format work during
constant evaluation

  P2758 Emitting messages at compile time

This paper has initially been received favourable by EWG. Therefore move
the code to the header. This also avoids possible availability issues on
Mac back deployment targets.

Note it is expected that format will no longer be experimental with the
next LLVM release.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D150073
2023-05-16 20:31:44 +02:00
Mark de Wever
65429b9af6 Reland "[CMake] Bumps minimum version to 3.20.0."
The owner of the last two failing buildbots updated CMake.

This reverts commit e8e8707b4a.
2023-05-13 11:42:25 +02:00
Mark de Wever
e8e8707b4a Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""
Unfortunatly not all buildbots are updated.

This reverts commit ffb807ab53.
2023-05-06 17:03:56 +02:00
Mark de Wever
ffb807ab53 Reland "[CMake] Bumps minimum version to 3.20.0."
All build bots should be updated now.

This reverts commit 44d38022ab.
2023-05-06 11:43:02 +02:00
Nikolas Klauser
e7e3711885 [libc++][PSTL] Make the PSTL available by default under -fexperimental-library
This removes the need for a custom libc++ build to have a basic set of PSTL algorithms.

Reviewed By: ldionne, #libc

Spies: miyuki, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D149624
2023-05-05 13:53:17 -07:00
Nikolas Klauser
2445603296 [libc++][PSTL] Integrate the headers and add a CI job
Reviewed By: ldionne, #libc

Spies: libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D141780
2023-04-26 13:11:25 -07:00
Nikolas Klauser
7d98590b3a [libc++][PSTL] Remove current integration
We decided to go a different route. To make the switch easier, rip out the old integration first and build on a clean base.

Reviewed By: ldionne, #libc, #libc_abi

Spies: arichardson, libcxx-commits

Differential Revision: https://reviews.llvm.org/D148480
2023-04-21 05:31:07 +02:00
Mark de Wever
44d38022ab Revert "Revert "Revert "[CMake] Bumps minimum version to 3.20.0."""
This reverts commit 1ef4c3c859.

Two buildbots still haven't been updated.
2023-04-15 20:12:24 +02:00
Mark de Wever
1ef4c3c859 Revert "Revert "[CMake] Bumps minimum version to 3.20.0.""
This reverts commit 92523a35a8.

Reland to see whether CIs are updated.
2023-04-15 13:12:04 +02:00
Mark de Wever
d0398d3593 Revert "Reland "[CMake] Bumps minimum version to 3.20.0.""
This reverts commit a72165e5df.

Some buildbots have not been updated yet.
2023-03-18 20:32:43 +01:00
Mark de Wever
a72165e5df Reland "[CMake] Bumps minimum version to 3.20.0."
This reverts commit 92523a35a8.

Test whether all CI runners are updated.
2023-03-18 13:33:42 +01:00
Nikolas Klauser
a7aade1f36 [runtimes] Synchronize warnings flags between libc++/libc++abi/libunwind
This mostly keeps the same warning flags. The most important exceptions are `-Wpedantic` and `-Wconversion`, which are now removed from libc++abi and libunwind.

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

Spies: mikhail.ramalho, phosek, libcxx-commits

Differential Revision: https://reviews.llvm.org/D144252
2023-03-17 00:40:59 +01:00
Mark de Wever
c416234c38 [libc++] Disables transitive includes in library.
I noticed this wile investigating https://llvm.org/PR61314

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D145798
2023-03-15 18:01:03 +01:00
Nikolas Klauser
e65cd4ce83 [libc++] Enable -Wunused-template
Clang wants to enable this flag by default, but libc++ isn't working with it yet.

Reviewed By: Mordante, #libc, #libc_abi, EricWF

Spies: libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D144667
2023-03-08 19:26:49 +01:00
Mark de Wever
92523a35a8 Revert "[CMake] Bumps minimum version to 3.20.0."
Some build bots have not been updated to the new minimal CMake version.
Reverting for now and ping the buildbot owners.

This reverts commit 44c6b905f8.
2023-03-04 18:28:13 +01:00
Mark de Wever
44c6b905f8 [CMake] Bumps minimum version to 3.20.0.
This partly undoes D137724.

This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193

Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.

Reviewed By: mehdi_amini, MaskRay, ChuanqiXu, to268, thieta, tschuett, phosek, #libunwind, #libc_vendors, #libc, #libc_abi, sivachandra, philnik, zibi

Differential Revision: https://reviews.llvm.org/D144509
2023-03-04 12:40:57 +01:00
Nikolas Klauser
d0e95fec65 [runtimes] Remove add_target_flags* functions and use add_flags* instead
Reviewed By: phosek, #libunwind, #libc, #libc_abi

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D144398
2023-02-21 13:16:44 +01:00
Nikolas Klauser
0af67d167d [runtimes] Move common functions from Handle{Libcxx,Libcxxabi,Libunwind}Flags.cmake to runtimes/cmake/Modules/HandleFlags.cmake
Reviewed By: phosek, #libunwind, #libc, #libc_abi

Spies: arichardson, libcxx-commits

Differential Revision: https://reviews.llvm.org/D144395
2023-02-21 13:15:25 +01:00
Chuanqi Xu
226c444b38 [libc++] Remove <experimental/coroutine>
We've been shipping <coroutine> since LLVM 14, so LLVM 17 won't ship
the <experimental/coroutine> header per our policy for removing TSes.

Differential Revision: https://reviews.llvm.org/D108697
2023-01-30 16:32:48 -05:00
Joe Loser
07a341c2e4 [libc++] Remove warning for LIBCXX_SYSROOT, LIBCXX_TARGET_TRIPLE, and LIBCXX_GCC_TOOLCHAIN
Support for these CMake variables has been a warning for a while now.  The
comment indicates to just remove the warning message entirely as anyone impacted
had to have update to new mechanisms in order to use `libc++`.  So, remove the
warning message.

Differential Revision: https://reviews.llvm.org/D141345
2023-01-10 13:07:04 -07:00
Nikolas Klauser
841399a218 [libc++] Add custom clang-tidy checks
Reviewed By: #libc, ldionne

Spies: jwakely, beanz, smeenai, cfe-commits, tschuett, avogelsgesang, Mordante, sstefan1, libcxx-commits, ldionne, mgorny, arichardson, miyuki

Differential Revision: https://reviews.llvm.org/D131963
2022-12-23 15:42:13 +01: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
Louis Dionne
609b95cea1 [libc++] Remove CMake workaround for the discontinued Projects build
Differential Revision: https://reviews.llvm.org/D138801
2022-11-28 11:10:52 -05:00