Commit Graph

10 Commits

Author SHA1 Message Date
Chris Bieneman 7590a1ee61 [CMake] For multi-stage builds to be deterministic we need to disable timestamps.
Duh! With this change I've verified -O3 builds are deterministic.

llvm-svn: 260350
2016-02-10 02:17:21 +00:00
Chris Bieneman a0a0317dbc [CMake] Fixing the 3-stage cmake cache.
I had hoped this would work from a single cache file, but turns out there is a bug I can't quite figure out relating to passing list arguments to recursive CMake invocations.

This change works around that.

llvm-svn: 260340
2016-02-10 01:09:56 +00:00
Chris Bieneman b79e55577e [CMake] Updating caches README with explanations of useful cache files.
This is in response to silvas' post-commit suggestion.

llvm-svn: 260203
2016-02-09 06:49:08 +00:00
Chris Bieneman 6ced921f8c [CMake] Providing a CMake cache for 3-stage builds
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.

llvm-svn: 260201
2016-02-09 06:01:47 +00:00
Chris Bieneman b2920a779c [CMake] Support a simple case for bootstrap builds to generate PGO data
Summary:
This patch adds support for the clang multi-stage bootstrapping to support PGO profdata generation, and can build a 2 or 3 stage compiler.

With this patch applied 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).

Reviewers: bogner, silvas, chandlerc

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D15584

llvm-svn: 256873
2016-01-05 23:51:42 +00:00
Chris Bieneman b657449399 Revert "[CMake] Support a simple case for bootstrap builds to generate PGO data"
This reverts commit r256069, which was an unintentional tag along on
another commit.

llvm-svn: 256088
2015-12-19 05:47:50 +00:00
Chris Bieneman a948007062 [CMake] Support a simple case for bootstrap builds to generate PGO data
Summary:
This patch adds support for the clang multi-stage bootstrapping to support PGO profdata generation, and can build a 2 or 3 stage compiler.

With this patch applied 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).

Reviewers: bogner, silvas, chandlerc

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D15584

llvm-svn: 256069
2015-12-19 00:56:10 +00:00
Chris Bieneman bca3d933ce [CMake] Set CLANG_LINKS_TO_CREATE in Apple-stage2.cmake so that we create cc and c++ links.
llvm-svn: 248016
2015-09-18 18:11:18 +00:00
Chris Bieneman ea7ecde87c [CMake] Add cache scripts for Apple-style clang builds.
Summary:
These CMake cache scripts are my first pass at replicating Apple's packaging logic from autoconf. They can be used on any Darwin machine to approximate an Apple Clang build.

The included README file includes documentation and a sample CMake invocation.

Reviewers: chandlerc, echristo

Subscribers: echristo, cfe-commits

Differential Revision: http://reviews.llvm.org/D12817

llvm-svn: 247726
2015-09-15 21:52:42 +00:00
Reid Kleckner ed8bca4f42 Make it easier to build against a pre-built Clang package with CMake
Installing <prefix>/share/clang/cmake/ClangConfig.cmake makes CMake's
builtin find_package() utility work with Clang. This also allows
downstream consumers of Clang to statically link against libraries like
clangAST and have that pull in dependencies like clangBasic and
LLVMSupport.

See the CMake docs on packages:
http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html

llvm-svn: 221411
2014-11-05 23:14:59 +00:00