Commit Graph

136 Commits

Author SHA1 Message Date
Jonathan Roelofs 901c776d06 Don't defer to the GCC driver for linking arm-baremetal
Also comes with a cmake cache for building the runtime bits:

 $ cmake <normal cmake flags> \
   -DBAREMETAL_ARMV6M_SYSROOT=/path/to/sysroot \
   -DBAREMETAL_ARMV7M_SYSROOT=/path/to/sysroot \
   -DBAREMETAL_ARMV7EM_SYSROOT=/path/to/sysroot \
   -C /path/to/clang/cmake/caches/BaremetalARM.cmake \
   /path/to/llvm

https://reviews.llvm.org/D33259

llvm-svn: 303873
2017-05-25 15:42:13 +00:00
NAKAMURA Takumi 25f1a6ed16 Fix two-stage build on windows using DistributionExample cmake cache
Thanks to Matthew Larionov <matthewtff@gmail.com>

llvm-svn: 302795
2017-05-11 13:19:24 +00:00
Adrian Prantl 4ca3139179 Partially revert r302685 and swith Apple-style full LTO builds to
-gline-tables-only. The memory consumption is apparently still too
much for some of the green dragon builders.

<rdar://problem/28672159>

llvm-svn: 302740
2017-05-10 22:14:23 +00:00
Adrian Prantl dce1c1439e Build the Apple-style stage2 with full debug info
Green dragon had a green stage2 modules bot for a long time now[1] and
it is time to retire it and make a modules build the default for
Apple-style stage2 builds.

This patch switches the debug info generation from -gline-tables-only
to -g since full debug info does no longer cause any memory issues
even for full LTO builds [2].

[1] http://green.lab.llvm.org/green/job/clang-stage2-cmake-modulesRDA_build/
[2] http://llvm.org/devmtg/2015-10/#talk19
rdar://problem/28672159

llvm-svn: 302685
2017-05-10 15:58:22 +00:00
Adrian Prantl 1cc3474ec1 Build the Apple-style stage2 with modules
Green dragon had a green stage2 modules bot for a long time now[1] and
it is time to retire it and make a modules build the default for
Apple-style stage2 builds.

This patch turns on LLVM_ENABLE_MODULES.

[1] http://green.lab.llvm.org/green/job/clang-stage2-cmake-modulesRDA_build/
rdar://problem/28672159

Differential Revision: https://reviews.llvm.org/D32603

llvm-svn: 302556
2017-05-09 17:27:03 +00:00
Petr Hosek ce0ea76f40 [CMake] Enable ARM target in Fuchsia toolchain
This is still used by some users of Fuchsia toolchain. Also include
llc and opt which is useful for development and testing.

Differential Revision: https://reviews.llvm.org/D32231

llvm-svn: 300917
2017-04-20 23:06:53 +00:00
Petr Hosek 60f54ac8c5 [CMake] Support building Fuchsia toolchain on Darwin
This is already supported on Linux but on Darwin it requires some
extra flags.

Differential Revision: https://reviews.llvm.org/D30958

llvm-svn: 300257
2017-04-13 21:09:42 +00:00
Mehdi Amini 7103b2ecfd Add a cmake cache file for a stage-2 build with ThinLTO
This is intended to be targetted by a Green Dragon stage-2 bot
I'm bringing up currently. WIP.

llvm-svn: 297351
2017-03-09 01:18:31 +00:00
Petr Hosek 367ad73aff [CMake] Add Fuchsia toolchain CMake cache files
These cache files can be used to build Fuchsia toolchain. They also
demonstrate the use of multi-target builtins build.

Differential Revision: https://reviews.llvm.org/D26654

llvm-svn: 295480
2017-02-17 19:28:54 +00:00
Chris Bieneman 7e0f03ecf2 [CMake] Adding example distribution CMake cache files
These cache file are provided as an example of how to set up simple multi-stage CMake builds. I have a batch of documentation updates for LLVM.org which reference these files.

llvm-svn: 285206
2016-10-26 15:41:38 +00:00
Chris Bieneman ebe8b83fbc [CMake] Support thin LTO in PGO CMake cache
This allows you to set PGO_INSTRUMENT_LTO=Thin and have it work correctly.

llvm-svn: 284646
2016-10-19 21:12:04 +00:00
Chris Bieneman 981618da53 [CMake] Adding toolchain targets to PGO and Apple CMake caches
The Xcode toolchain targets are useful on OS X hosts because you can construct and install multiple toolchians that can be used seamlessly.

llvm-svn: 278987
2016-08-17 21:51:38 +00:00
Chris Bieneman a1aa4069d9 [CMake] Workflow improvements to PGO generation
This patch adds a few new convenience options used by the PGO CMake cache to setup options on bootstrap stages. The new options are:

PGO_INSTRUMENT_LTO - Builds the instrumented and final builds with LTO
PGO_BUILD_CONFIGURATION - Accepts a CMake cache script that can be used for complex configuration of the stage2-instrumented and stage2 builds.

The patch also includes a fix for bootstrap dependencies so that the instrumented LTO tools don't get used when building the final stage, and it adds distribution targets to the passthrough.

llvm-svn: 278862
2016-08-16 22:16:29 +00:00
Chris Bieneman 31cc8b3887 [CMake] [Apple Cache] Set CLANG_VENDOR_UTI for Apple builds
This is just a minor update to the Apple packaging configuration.

llvm-svn: 278849
2016-08-16 20:44:58 +00:00
Chris Bieneman bba9ee3b76 [CMake] Apple stage1 doesn't need to set libcxx options
LibCXX settings are configured in stage2 so we don't need them here.

llvm-svn: 278729
2016-08-15 20:15:22 +00:00
Chris Bieneman e55838d596 [CMake] [Apple Clang] Enable Compiler-RT tests on stage2 builds
We want to be able to run the compiler-rt tests on stage2 build configurations in CI. This should enable that.

llvm-svn: 274031
2016-06-28 16:32:48 +00:00
Vedant Kumar 400a3f66e2 [cmake] Enable zlib support for Apple stage2 builds
This allows llvm-profdata to interact with profiles containing
compressed name data.

rdar://problem/26122944

llvm-svn: 268947
2016-05-09 18:40:09 +00:00
Chris Bieneman 5239779465 [CMake] Removing LLVM_ENABLE_TIMESTAMPS from the cache files
Since the option was removed in r268670, the cache scripts should stop referring to it.

llvm-svn: 268685
2016-05-05 21:08:41 +00:00
Chris Bieneman 35de7bcfb7 [CMake][Apple-stage2] Don't link with -fno-pie
On Darwin the default is to build PIC and link PIE. We shouldn't need to override that in the Apple Clang distributions.

llvm-svn: 268642
2016-05-05 16:31:28 +00:00
Chris Bieneman b8f0a4ea33 [CMake] Enable LIBCXX HEADERS in Apple-Stage2.cmake
This enables installing the libcxx headers.

llvm-svn: 268322
2016-05-02 22:43:23 +00:00
Chris Bieneman d5a3b23736 [CMake] Install libcxx-headers as part of the Apple-stage2 distribution
This installs the clang headers as part of the install-distribution target.

llvm-svn: 268320
2016-05-02 22:42:09 +00:00
Chris Bieneman 9920c39aef [CMake] Adding clang-headers to the Apple-stage2 distribution
This installs the clang headers as part of the install-distribution target.

llvm-svn: 268319
2016-05-02 22:38:06 +00:00
Chris Bieneman 35c913dd4c [CMake] Use just-built clang and build iOS support when building stage2
The Apple stage2 build should include compiler-rt iOS libraries and be built with the stage2 compiler. This matches Apple's production clang builds.

llvm-svn: 267584
2016-04-26 18:39:20 +00:00
Chris Bieneman 3eaf5dc052 [Apple Clang] Expose llvm-config from stage2 builds in stage1
This exposes the stage2-llvm-config target though the stage1 build configuration.

llvm-svn: 264125
2016-03-23 01:47:05 +00:00
Chris Bieneman ba83735b2f [CMake] Updating Apple build configurations
This updates Apple build configurations to adapt to r263566 & r263570, which added a PACKAGE_VENDOR variable.

llvm-svn: 263571
2016-03-15 18:27:28 +00:00
Chris Bieneman cc2aded1ff [CMake] Updating Apple Clang CMake caches
This is a big update that gets the public configurations more in line with the ones we're actually using internally to ship Clang in Xcode.

From here forward I expect most of the changes in these files to be incremental as the changes get made internally.

llvm-svn: 263483
2016-03-14 20:23:21 +00:00
Chris Bieneman 33b41961c3 [CMake] Only configure Native target in stage 1, configure all in other stages
This patch causes the 3-stage build pipeline to only build a host compiler in the first stage, and to build all targets for subsequent stages. The host target is determined via the Native target specifier added in r262070.

llvm-svn: 262071
2016-02-26 21:23:59 +00:00
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