llvm-project/clang/cmake/caches
Hans Wennborg 09cebfb978 Revert "[libc++] Always build c++experimental.a"
This caused build failures when building Clang and libc++ together on Mac:

  fatal error: 'experimental/memory_resource' file not found

See the code review for details. Reverting until the problem and how to
solve it is better understood.

(Updates to some test files were not reverted, since they seemed
unrelated and were later updated by 340b48b267b96.)

> This is the first part of a plan to ship experimental features
> by default while guarding them behind a compiler flag to avoid
> users accidentally depending on them. Subsequent patches will
> also encompass incomplete features (such as <format> and <ranges>)
> in that categorization. Basically, the idea is that we always
> build and ship the c++experimental library, however users can't
> use what's in it unless they pass the `-funstable` flag to Clang.
>
> Note that this patch intentionally does not start guarding
> existing <experimental/FOO> content behind the flag, because
> that would merely break users that might be relying on such
> content being in the headers unconditionally. Instead, we
> should start guarding new TSes behind the flag, and get rid
> of the existing TSes we have by shipping their Standard
> counterpart.
>
> Also, this patch must jump through a few hoops like defining
> _LIBCPP_ENABLE_EXPERIMENTAL because we still support compilers
> that do not implement -funstable yet.
>
> Differential Revision: https://reviews.llvm.org/D128927

This reverts commit bb939931a1.
2022-07-18 16:57:15 +02:00
..
3-stage-base.cmake Update PGO and 3-stage cache files 2022-04-27 14:41:56 -05:00
3-stage.cmake
Android-stage2.cmake
Android.cmake Add an explicit toggle for the static analyzer in clang-tidy 2020-09-10 10:48:17 -04:00
Apple-stage1.cmake [apple clang] disable in-process CC1 to preserve crashlog compatibility 2020-06-05 10:55:42 -07:00
Apple-stage2-ThinLTO.cmake
Apple-stage2.cmake Ship `llvm-cxxfilt` in the toolchain. 2021-04-13 11:58:33 -07:00
BaremetalARM.cmake Re-land [CodeView] Add full repro to LF_BUILDINFO record 2022-01-19 19:44:37 -05:00
CrossWinToARMLinux.cmake [libc++] Overhaul how we select the ABI library 2022-05-13 08:32:09 -04:00
DistributionExample-stage2.cmake
DistributionExample.cmake
Fuchsia-stage2.cmake Revert "[libc++] Always build c++experimental.a" 2022-07-18 16:57:15 +02:00
Fuchsia.cmake Revert "[libc++] Always build c++experimental.a" 2022-07-18 16:57:15 +02:00
HLSL.cmake [NFC] Add CMake cache file for HLSL 2022-04-13 11:28:18 -05:00
MultiDistributionExample.cmake [cmake] Add support for multiple distributions 2021-05-12 11:13:18 -07:00
PGO-stage2-instrumented.cmake
PGO-stage2.cmake Update PGO and 3-stage cache files 2022-04-27 14:41:56 -05:00
PGO.cmake Update PGO and 3-stage cache files 2022-04-27 14:41:56 -05:00
README.txt

README.txt

CMake Caches
============

This directory contains CMake cache scripts that pre-populate the CMakeCache in
a build directory with commonly used settings.

You can use the caches files with the following CMake invocation:

cmake -G <build system>
  -C <path to cache file>
  [additional CMake options (i.e. -DCMAKE_INSTALL_PREFIX=<install path>)]
  <path to llvm>

Options specified on the command line will override options in the cache files.

The following cache files exist.

Apple-stage1
------------

The Apple stage1 cache configures a two stage build similar to how Apple builds
the clang shipped with Xcode. The build files generated from this invocation has
a target named "stage2" which performs an LTO build of clang.

The Apple-stage2 cache can be used directly to match the build settings Apple
uses in shipping builds without doing a full bootstrap build.

PGO
---

The PGO CMake cache can be used to generate a multi-stage instrumented compiler.
You can configure your build directory with the following invocation of CMake:

cmake -G <generator> -C <path_to_clang>/cmake/caches/PGO.cmake <source dir>

After configuration the following additional targets will be generated:

stage2-instrumented:
Builds a stage1 x86 compiler, runtime, and required tools (llvm-config,
llvm-profdata) then uses that compiler to build an instrumented stage2 compiler.

stage2-instrumented-generate-profdata:
Depends on "stage2-instrumented" and will use the instrumented compiler to
generate profdata based on the training files in <clang>/utils/perf-training

stage2:
Depends on "stage2-instrumented-generate-profdata" and will use the stage1
compiler with the stage2 profdata to build a PGO-optimized compiler.

stage2-check-llvm:
Depends on stage2 and runs check-llvm using the stage3 compiler.

stage2-check-clang:
Depends on stage2 and runs check-clang using the stage3 compiler.

stage2-check-all:
Depends on stage2 and runs check-all using the stage3 compiler.

stage2-test-suite:
Depends on stage2 and runs the test-suite using the stage3 compiler (requires
in-tree test-suite).

3-stage
-------

This cache file can be used to generate a 3-stage clang build. You can configure
using the following CMake command:

cmake -C <path to clang>/cmake/caches/3-stage.cmake -G Ninja <path to llvm>

You can then run "ninja stage3-clang" to build stage1, stage2 and stage3 clangs.

This is useful for finding non-determinism the compiler by verifying that stage2
and stage3 are identical.