1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 10:32:48 +02:00
Commit Graph

426 Commits

Author SHA1 Message Date
Peter Zotov
40de94a24e [CMake] [OCaml] Add -DLLVM_ENABLE_OCAMLDOC switch
Patch by Michael Gorny.

llvm-svn: 279544
2016-08-23 18:07:16 +00:00
Jacques Pienaar
e532c7cb3b [lanai] Make Lanai backend non-experimental
Summary:
Add Lanai backend to default targets.

Discussion of proposal: http://lists.llvm.org/pipermail/llvm-dev/2016-July/102480.html. ISA added in r279149.

Reviewers: jyknight, rengolin, eliben, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 279498
2016-08-23 01:06:44 +00:00
Chris Bieneman
7cd2668bb7 [CMake] Silence message on multi-configuration generators
The Xcode and Visual Studio generators always log "-- No build type selected, default to Debug". This is because CMake doesn't initialize "CMAKE_CONFIGURATION_TYPES" until the generator's EnableLanguage call gets hit.

The first place EnableLanguage gets hit in our configuration is in the project() call. Since CMAKE_BUILD_TYPE isn't used until after we call project() it is safe to just move this check down a bit.

llvm-svn: 279110
2016-08-18 18:17:28 +00:00
Jonas Hahnfeld
432bf8f81d Remove LLVM_ENABLE_LIBCXXABI
libc++.so is now a linker script that includes -lc++abi if necessary.

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

llvm-svn: 277714
2016-08-04 10:24:48 +00:00
Sumanth Gundapaneni
dd83de66a8 Build llvm with ccache if package is present
This patch has the following changes

The CMake variable LLVM_CCACHE_BUILD is set to OFF by default.
Set this to ON for a ccache enabled build

CCACHE_CPP2 is required to compile the source file directly instead
of compiling the preprocessed file. This will help WERROR is turned ON
for a host clang compiler

The below two options makes more sense in the context of a buildbot

CCACHE_HASHDIR is required to maintain the separate cached data across
builders. This will also help the debuggers to point to the correct source
location

CCACHE_SIZE is important in the perspective of buildbot to increase the
limit on the amount of data to hold in cache for faster compilation

CCACHE_DIR is used to save the cached data to a specific directory.

llvm-svn: 277389
2016-08-01 21:28:03 +00:00
Eugene Zelenko
aef9df0c15 Add LLVM_ENABLE_LLD option to use LLD as C/C++ linker.
Differential revision: https://reviews.llvm.org/D22896

llvm-svn: 277093
2016-07-29 00:46:13 +00:00
Chris Bieneman
11e49d70ad [CMake] Support feeding DYLD_LIBRARY_PATH into archiver calls
OS X 10.11 has a feature named System Integrity Protection. The goal of the feature is to make system binaries immutable (even as root). One part of this is that protected binaries do not receive DYLD_* environment variables because the kernel scrubs them before process launch.

This causes problems for LTO bootstrap builds on Darwin that try to use the just-built libLTO with the host ar, ranlib, or libtool.

This patch addresses two problems.

(1) The tools themselves aren't protected binaries but the shim tools installed at / are, so we need to call xcrun -find to find libtool instead of using the one CMake finds.

(2) Some build tools (ninja and make) use /bin/sh to invoke their subprocesses. Since /bin/sh is a system binary, the kernel scrubs the DYLD envars from their environment. To work around this we need to set the environment variables as part of the archiver commands, so the envars are set by the shell process instead of on the shell process.

llvm-svn: 276710
2016-07-25 23:46:08 +00:00
Vedant Kumar
f67bc851fc [cmake] Use a sane default for LLVM_PROFILE_DATA_DIR
It's been pointed out that arbitrarily spraying raw profiles into a
build directory is insane. Doing this wastes a tremendous amount of
space and is also very lossy, since the test harness tends to wipe away
temporary sub-directories (which usually contain relevant profile data).

The new default is a `profiles` directory inside of the build dir.

llvm-svn: 276504
2016-07-23 00:38:11 +00:00
Michael Gottesman
adecc6a299 [cmake] Move the including of utils/unittests under LLVM_INCLUDE_UTILS instead of LLVM_INCLUDE_TESTS.
This does not change anything by default since LLVM_INCLUDE_UTILS is already set
to TRUE by default. In addition, since LLVM_INCLUDE_TESTS => LLVM_INCLUDE_UTILS,
the only way that this can cause changes is in the case where LLVM_INCLUDE_UTILS
is set to TRUE, but LLVM_INCLUDE_TESTS is FALSE. In that case, building gtest is
not a huge cost.

The reason to do this is that without this change, one can not turn off
LLVM_INCLUDE_TESTS in downstream projects that also use gtest for unittests. It
also just in general makes more sense since LLVM_INCLUDE_UTILS gates FileCheck
and other utilities that are along the lines of gtest.

Additionally from talking with chandlerc, this was not done for any specific
reason, so there is no reason not to do it and lots of benefit to doing it.

llvm-svn: 276342
2016-07-21 21:35:23 +00:00
Quentin Colombet
02adacfe73 [CMake][GlobalISel] Turn LLVM_BUILD_GLOBAL_ISEL into an option. NFC.
Previously LLVM_BUILD_GLOBAL_ISEL was a boolean variable and although,
this is strictly identical to an option, it did not convey the
information that the user may set it. Options are here for that.

llvm-svn: 276306
2016-07-21 17:26:45 +00:00
Chandler Carruth
93b744cf6b Add AIX support to Path.inc, Host.h, and CMake.
Patch by Andrew Paprocki!

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

llvm-svn: 276045
2016-07-19 22:46:39 +00:00
Hans Wennborg
39d26639c0 Bump the trunk version to 4.0.0svn.
Differential Revision: https://reviews.llvm.org/D21821

llvm-svn: 275827
2016-07-18 17:51:04 +00:00
Michael Gottesman
a1e74f182b [cmake] Create the LLVM_BUILD_UTILS option.
This option is the equivalent option to LLVM_BUILD_TOOLS but for executables
created via add_llvm_utility.

This is a useful tool for improving compile time in situations where LLVM is
used as a library and no testing tools are needed.

It follows the exact same implemention model as LLVM_BUILD_TOOLS.

Since the option is by default set to on, no behavior is changed unless one sets
it from the command line to be false.

llvm-svn: 275007
2016-07-10 02:43:47 +00:00
Vassil Vassilev
7007fed7cc [CMake] Module builds depend on target intrinsics_gen to be built first.
When compiling with modules, header A and B can be in the same module M.
B depends on intrinsics_gen and A doesn't. Compiling a source file #include-ing
header A, we implicitly request module M to be built. It puts header A and B in
the same TU and tries to build them. Since B depends on intrinsics_gen (which
might not be built yet) we run into build failures.

This should fix our modules buildbot.

Patch reviewed by Chris Bieneman.

llvm-svn: 274270
2016-06-30 20:35:56 +00:00
Adrian Prantl
a0611feb1f [CMake] Add an LLVM_ENABLE_MODULE_DEBUGGING flag for building with -gmodules.
This flag is only effective in builds with debug info and modules.
The default is On for Darwin only.

rdar://problem/27019000

llvm-svn: 274244
2016-06-30 17:15:44 +00:00
Adrian Prantl
18577887ec [CMake] Introduce a LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY flag.
On Darwin it is currently impossible to build LLVM with modules
because the Darwin system module map is not compatible with
-fmodules-local-submodule-visibility at this point in time.  This
patch makes the flag optional and off by default on Darwin so it
becomes possible to build LLVM with modules again.

http://reviews.llvm.org/D21827
rdar://problem/27019000

llvm-svn: 274196
2016-06-30 01:46:49 +00:00
Chris Bieneman
3fe6b38cf2 [CMake] Add LLVM runtimes directory
Summary:
There are a few LLVM projects that produce runtime libraries. Ideally
runtime libraries should be built differently than other projects,
specifically they should be built using the just-built toolchain.

There is support for building compiler-rt in this way from the clang
build. Moving this logic into the LLVM build is interesting because it
provides a simpler way to extend the just-built toolchain to include
LLD and the LLVM object file tools.

Once this functionality is better fleshed out and tested we’ll want to
encapsulate it in a module that can be used for clang standalone
builds, and we’ll want to make it the default way to build compiler-rt.

With this patch applied there is no immediate change in the build.
Moving compiler-rt out from llvm/projects into llvm/runtimes enables
the functionality.

This code has a few improvements over the method provided by
LLVM_BUILD_EXTERNAL_COMPILER_RT. Specifically the sub-ninja command is
always invoked, so changes to compiler-rt source files will get built
properly, so this patch can be used for iterative development with
just-built tools.

This first patch only works with compiler-rt. Support for other
runtime projects will be coming in follow-up patches.

Reviewers: chandlerc, bogner

Subscribers: kubabrecka, llvm-commits

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

llvm-svn: 273620
2016-06-23 22:07:21 +00:00
Vedant Kumar
c6b8569cc2 Add support for collating profiles for use with code coverage
Differential Revision: http://reviews.llvm.org/D20993

llvm-svn: 272599
2016-06-13 23:33:48 +00:00
Chris Bieneman
cc15f2401c [CMake] Cleanup version checks for CMake 3.0
This just removes some redundant checks and updates warning text.

llvm-svn: 272218
2016-06-08 22:38:30 +00:00
Chris Bieneman
746ef5229c [CMake] Cleanup uses of USES_TERMINAL
Now that we are on CMake 3.4.3 we no longer need a version check around this.

llvm-svn: 272211
2016-06-08 22:19:25 +00:00
Chris Bieneman
b087e27002 [CMake] Support overriding binary install directory
This patch adds a new option LLVM_TOOLS_INSTALL_DIR which allows customizing the location executables and symlinks get installed to. This adds the functionality provided by autoconf's --bindir flag.

This patch is based on patches from and collaboration with Tony Kelman, and replaces http://reviews.llvm.org/D20934.

llvm-svn: 272200
2016-06-08 21:19:26 +00:00
Chris Bieneman
a234eb432f [CMake] Update to requiring CMake 3.4.3
Summary:
This is as per the discussions on developer lists:

http://lists.llvm.org/pipermail/llvm-dev/2016-April/098780.html
http://lists.llvm.org/pipermail/llvm-dev/2016-May/100058.html

Subscribers: llvm-commits

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

llvm-svn: 271325
2016-05-31 20:21:32 +00:00
Chris Bieneman
64aa95c1c8 Remove LLVM_ENABLE_TIMESTAMPS
Summary:
As per the discussion on LLVM-dev this patch proposes removing LLVM_ENABLE_TIMESTAMPS.

The only complicated bit of this patch is the Windows support. On windows we used to log an error if /INCREMENTAL was passed to the linker when timestamps were disabled.

With this change since timestamps in code are always disabled we will always compile on windows with /Brepro unless /INCREMENTAL is specified, and we will log a warning when /INCREMENTAL is specified to notify the user that the build will be non-deterministic.

See: http://lists.llvm.org/pipermail/llvm-dev/2016-May/098990.html

Reviewers: bogner, silvas, rnk

Subscribers: llvm-commits

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

llvm-svn: 268670
2016-05-05 19:57:03 +00:00
James Y Knight
49bc30f7bb Remove bit-rotten CppBackend.
This backend was supposed to generate C++ code which will re-construct
the LLVM IR passed as input. This seems to me to have very marginal
usefulness in the first place.

However, the code has never been updated to use IRBuilder, which makes
its current value negative -- people who look at the output may be
steered to use the *wrong* C++ APIs to construct IR.

Furthermore, it's generated code that doesn't compile since at least
2013.

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

llvm-svn: 268631
2016-05-05 14:35:40 +00:00
Tobias Grosser
47b6dec455 cmake: Prefix Polly options with LLVM_ to avoid variable shadowing
Summary:
Before this change certain Polly variables have been used both as user-facing
CACHED cmake variables as well as uncached internal variables. Even though
this seems to have worked OK in practice, the behavior only worked due to
one variable shadowing the other. This behavior has been found confusing.
To make the use of cmake variables more clear we now prefix the cached, user
facing variables with LLVM_ as it is common habit for LLVM options and also
moved the _POLLY_ term to the beginning to ensure related options are sorted
after each other. The variables that control the behavior of LLVM/Polly are then
set by forwarding the values set in the user facing option variables.
As a result, Polly is now enabled with LLVM_POLLY_BUILD instead of BUILD_POLLY
and the linking behavior of Polly is controlled with LLVM_POLLY_LINK_INTO_TOOLS
instead of LINK_POLLY_INTO_TOOLS.

Reviewers: bogner, Meinersbur

Subscribers: pollydev, llvm-commits

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

llvm-svn: 268537
2016-05-04 20:04:40 +00:00
Chris Bieneman
56186a0a2f Disable LLVM_ENABLE_TIMESTAMPS by default
This change is based on the discussion from http://lists.llvm.org/pipermail/llvm-dev/2016-May/098990.html.

The goal is to make the default LLVM configuration build deterministically.

llvm-svn: 268441
2016-05-03 21:22:14 +00:00
Filipe Cabecinhas
c8ae081a57 Unify XDEBUG and EXPENSIVE_CHECKS (into the latter), and add an option to the cmake build to enable them.
Summary:
Historically, we had a switch in the Makefiles for turning on "expensive
checks". This has never been ported to the cmake build, but the
(dead-ish) code is still around.

This will also make it easier to turn it on in buildbots.

Reviewers: chandlerc

Subscribers: jyknight, mzolotukhin, RKSimon, gberry, llvm-commits

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

llvm-svn: 268050
2016-04-29 15:22:48 +00:00
Tobias Grosser
c59be741e5 cmake: Set LINK_POLLY_INTO_TOOLS to ON (v2)
This is the second try. This time we disable this feature if no Polly checkout
is available. For this to work we need to check if tools/polly is present
early enough that our decision is known before cmake generates Config/config.h.

With Polly checked into LLVM it was since a long time possible to compile
clang/opt/bugpoint with Polly support directly linked in, instead of only
providing Polly as a separate loadable module. This commit switches the
default from providing Polly as a module to linking Polly into tools, such
that it becomes unnecessary to load the Polly module when playing with Polly.
Such configuration has shown a lot more convenient for day-to-day Polly use.

This change does not impact the default behavior of any tool, if Polly is not
explicitly enabled when calling clang/opt/bugpoint Polly does not affect
compilation.

This change also does not impact normal LLVM/clang checkouts that do not
contain Polly.

Reviewers: jdoerfert, Meinersbur

Subscribers: pollydev, llvm-commits

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

llvm-svn: 268048
2016-04-29 15:07:22 +00:00
Tobias Grosser
98d937f925 Revert "cmake: Set LINK_POLLY_INTO_TOOLS to ON"
This reverts commit r268033 as it breaks some buildbots.

llvm-svn: 268035
2016-04-29 12:38:24 +00:00
Tobias Grosser
8072212fd5 cmake: Set LINK_POLLY_INTO_TOOLS to ON
With Polly checked into LLVM it was since a long time possible to compile
clang/opt/bugpoint with Polly support directly linked in, instead of only
providing Polly as a separate loadable module. This commit switches the
default from providing Polly as a module to linking Polly into tools, such
that it becomes unnecessary to load the Polly module when playing with Polly.
Such configuration has shown a lot more convenient for day-to-day Polly use.

This change does not impact the default behavior of any tool, if Polly is not
explicitly enabled when calling clang/opt/bugpoint Polly does not affect
compilation.

This change also does not impact normal LLVM/clang checkouts that do not
contain Polly.

Reviewers: jdoerfert, Meinersbur, sebpop, etherzhhb, zinob, hiraditya

Subscribers: pollydev, llvm-commits

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

llvm-svn: 268033
2016-04-29 12:23:11 +00:00
Chris Bieneman
d575650867 [CMake] [Darwin] Use libtool instead of ar && ranlib
Summary: Using libtool instead of ar and ranlib on Darwin shaves a minute off my clang build. This is because on Darwin libtool is optimized to give hints to the kernel about filesystem interactions that allow it to be faster.

Reviewers: bogner, pete

Subscribers: llvm-commits

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

llvm-svn: 267930
2016-04-28 20:14:19 +00:00
Aaron Ballman
97d20cba92 Moving llvm-test-depends and test-depends into the Tests folder; NFC, this simply cleans up the generated solution so that these targets don't live in the root folder of the IDE.
llvm-svn: 266078
2016-04-12 15:09:14 +00:00
Reid Kleckner
11380bdeed dos2unix CMakeLists.txt
The sign now reads "0 days since the last line ending confusion"

llvm-svn: 264609
2016-03-28 18:19:32 +00:00
Mike Spertus
2b661ae3a6 Forgot to commit this file in revision 264601
llvm-svn: 264602
2016-03-28 17:59:40 +00:00
Justin Bogner
57ad3995ac llvm-shlib: Remove the option to override __cxa_atexit
If anybody is actually using this, it probably doesn't do what they
think it does. This actually causes the dylib to *export* a
__cxa_atexit symbol, so anything that links it probably loses their
exit time destructors as well as disabling LLVM's.

This just removes the option entirely. If somebody does need this
behaviour we should figure out a more principled way to do it.

This is effectively a revert of r223805.

llvm-svn: 263498
2016-03-14 21:54:45 +00:00
Chris Bieneman
d5c3a96844 [CMake] Add test-depends target to build dependencies of check-all
This is just another convenience target for bots to use. It enables isolation of building and testing.

llvm-svn: 262494
2016-03-02 17:56:30 +00:00
Chris Bieneman
d204338a75 [CMake] Add distribution target that is the "just-build" side of install-distribution
This is just a convenience target to allow limiting what you build.

llvm-svn: 262427
2016-03-02 00:27:12 +00:00
Chris Bieneman
d8e8c23332 [CMake] Allow LLVM_TARGETS_TO_BUILD to accept "Native"
This allows a user to specify "Native" as a target when configuring LLVM. Native will resolve to the LLVM_NATIVE_ARCH, which is the target that supports code generation for the host.

llvm-svn: 262070
2016-02-26 21:21:40 +00:00
Chris Bieneman
c833f3d653 [CMake] Create an install-distribution target driven by LLVM_DISTRIBUTION_COMPONENTS
The idea here is to provide a customizable install target that only depends on building the things you actually want to install. It relies on each component being installed having an auto-generated install-${component}, which in turn depends only on the target being installed.

This is fundamentally a workaround for the fact that CMake generates build files which have their "install" target depend on the "all" target. This results in "ninja install" building a bunch of unneeded things.

llvm-svn: 261681
2016-02-23 20:33:53 +00:00
Chris Bieneman
aa34a674c5 [CMake] Properly set CMAKE_BUILD_TYPE to Debug by default
Summary:
PR26666: CMAKE_BUILD_TYPE was previously being reset to blank.

Reviewers: rnk, beanz

Subscribers: llvm-commits

Patch By: Derek Bruening

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

llvm-svn: 261273
2016-02-18 23:07:09 +00:00
Quentin Colombet
fb75f3ace2 [CMake] Add a macro definition to detect if we are building GlobalISel:
LLVM_BUILD_GLOBAL_ISEL

llvm-svn: 260457
2016-02-10 23:00:57 +00:00
Quentin Colombet
8d3acd6266 [GlobalISel] Add the proper cmake plumbing.
This patch adds the necessary plumbing to cmake to build the sources related to
GlobalISel.

To build the sources related to GlobalISel, we need to add -DBUILD_GLOBAL_ISEL=ON.
By default, this is OFF, thus GlobalISel sources will not impact people that do
not explicitly opt-in.

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

llvm-svn: 258344
2016-01-20 20:58:56 +00:00
Hans Wennborg
63448e6292 Update version to 3.9.
llvm-svn: 257627
2016-01-13 17:32:32 +00:00
Dan Liew
277612653e Revert "Teach the CMake build system to run lit's test suite. These can be run"
This reverts r257221.

This caused several build bot failures

* It looks like some of the tests don't work correctly under Windows
* It looks like the lit per test timeout tests fail

So I'm reverting for now. Once the above failures are fixed running
lit's tests can be enabled again.

llvm-svn: 257268
2016-01-09 21:42:57 +00:00
Dan Liew
c14975ef62 Teach the CMake build system to run lit's test suite. These can be run
directy with ``make check-lit`` and are run as part of
``make check-all``.

In principle we should run lit's testsuite before testing LLVM using lit
so that any problems with lit get discovered before testing LLVM so we
can bail out early.  However this implementation (``check-all`` runs all
tests together) seemed simpler and will still report failing lit tests.

Note that the tests and the configured ``lit.site.cfg`` have to be
copied into the build directory to avoid polluting the source tree.

llvm-svn: 257221
2016-01-08 22:36:22 +00:00
Benjamin Kramer
620dbe5571 Generate a clang CompilationDatabase when running CMake
This generates a compile_commands.json file, which tells tools like
YouCompleteMe and clang_complete exactly how to build each source file.

Patch by Justin Lebar!

llvm-svn: 255789
2015-12-16 18:17:45 +00:00
Chris Bieneman
fa052602ba [CMake] Add option LLVM_EXTERNALIZE_DEBUGINFO
Summary: This adds support for generating dSYM files and stripping debug info from executables and dylibs. It also supports passing -object_path_lto to the linker to generate dSYMs for LTO builds.

Reviewers: bogner, friss

Subscribers: llvm-commits

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

llvm-svn: 254627
2015-12-03 18:45:39 +00:00
Chris Bieneman
610384b321 [CMake] Add support for building the llvm test-suite as part of an LLVM build using clang and lld
Summary:
This patch adds a new CMake module for working with ExternalProjects. This wrapper for ExternalProject supports using just-built tools and can hook up dependencies properly so that projects get cleared out.

The example usage here is for the llvm test-suite. In this example, the test-suite is setup as dependent on clang and lld if they are in-tree. If the clang or lld binaries change the test-suite is re-configured, cleaned, and rebuilt.

This cleanup and abstraction wrapping ExternalProject can be extended and applied to other runtime libraries like compiler-rt and libcxx.

Reviewers: samsonov, jroelofs, rengolin, jmolloy

Subscribers: jmolloy, llvm-commits

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

llvm-svn: 252747
2015-11-11 16:14:03 +00:00
Rafael Espindola
92414e9e7f Relax the check for ninja.
On fedora the ninja executable is called ninja-build :-(

llvm-svn: 252062
2015-11-04 19:18:11 +00:00
Chris Bieneman
d3dd2855e4 [CMake] Get rid of LLVM_DYLIB_EXPORT_ALL, and make it the default, add libLLVM-C on darwin to cover the C API needs.
Summary:
We've had a lot of discussion in the past about the meaningful and useful default behaviors for the llvm-shlib tool. The original implementation was heavily geared toward Apple's use, and I think that was wrong. This patch seeks to correct that.

I've removed the LLVM_DYLIB_EXPORT_ALL variable and made libLLVM export everything by default.

I've also added a new target that is only built on Darwin for libLLVM-C as a library that re-exports the LLVM-C API. This library is not built on Linux because ELF doesn't support re-export libraries in the same way MachO does.

Reviewers: chapuni, resistor, bogner, axw

Subscribers: llvm-commits

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

llvm-svn: 251411
2015-10-27 16:02:04 +00:00