1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

758 Commits

Author SHA1 Message Date
Rafael Espindola
e72663a555 Don't use -ffunction-sections -fdata-sections on debug builds.
Unfortunately, on ELF there is not used attribute on the .o files,
so there is no easy way to keep the dump function alive.

If we are not gcing, we may as well produce non gcable files and
avoid the cost.

Linking a debug clang now takes 18.856225992 seconds, before it
took 21.206897447.

I will try avoiding --gc-sections -O3 on a followup patch.

llvm-svn: 234159
2015-04-06 14:34:43 +00:00
NAKAMURA Takumi
52594548a7 Try to unbreak Clang build to export LLVM_ABI_BREAKING_CHECKS, fixup for r233310.
FIXME: Should ENABLE_ABI_BREAKING_CHECKS be tri-state, "ON/OFF/blank"?
llvm-svn: 233801
2015-04-01 11:46:15 +00:00
Sanjoy Das
e31f623da1 [CMake] Cache LLVM_ABI_BREAKING_CHECKS in LLVMConfig.cmake.
Not having this breaks clang builds that use an already-built LLVM.

llvm-svn: 233784
2015-04-01 03:16:10 +00:00
Chris Bieneman
ce44007143 [CMake] Removing duplicates from the list of test suites to generate targets for.
Not doing this causes some headaches for users migrating from autoconf to CMake.

llvm-svn: 233428
2015-03-27 21:45:49 +00:00
Derek Schuff
22a695cbe1 CMake: enable installing utils
Added a new boolean CMake flag, LLVM_INSTALL_UTILS. When set,
the 'install' target will include in the bin directory the
utils binaries - e.g. FileCheck. This mirrors the autoconfig
behavior.

Test Plan:
Locally verified that utils binaries are copied when flag is set,
and not copied when flag is not set.

Reviewers: jfb, dschuff, beanz

Reviewed By: beanz

Subscribers: llvm-commits

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

Patch by Mircea Trofin

llvm-svn: 233385
2015-03-27 16:53:06 +00:00
Sanjoy Das
d429dd288c [ADT][CMake][AutoConf] Fail-fast iterators for DenseMap
Summary:
This patch is an attempt at making `DenseMapIterator`s "fail-fast".
Fail-fast iterators that have been invalidated due to insertion into
the host `DenseMap` deterministically trip an assert (in debug mode)
on access, instead of non-deterministically hitting memory corruption
issues.

Enabling fail-fast iterators breaks the LLVM C++ ABI, so they are
predicated on `LLVM_ENABLE_ABI_BREAKING_CHECKS`.
`LLVM_ENABLE_ABI_BREAKING_CHECKS` by default flips with
`LLVM_ENABLE_ASSERTS`, but can be clamped to ON or OFF using the CMake /
autoconf build system.

Reviewers: chandlerc, dexonsmith, rnk, zturner

Subscribers: llvm-commits

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

llvm-svn: 233310
2015-03-26 19:25:01 +00:00
Andrew Kaylor
614de5f815 Disabling warnings for MSVC build to enable /W4 use.
Differential Revision: http://reviews.llvm.org/D8572

llvm-svn: 233133
2015-03-24 23:37:10 +00:00
Chris Bieneman
12a0a5d060 Re-land: Generate targets for each lit suite.
Summary:
This change makes CMake scan for lit suites and generate a target for each lit test suite. The targets follow the format check-<project>-<suite path>.

For example:
check-llvm-unit - Runs the LLVM unit tests
check-llvm-codegen-arm - Runs the ARM codeine tests

Note: These targets are not generated during multi-configuration generators (i.e. Xcode and Visual Studio) because target clutter impacts UI usability.

* Also fixed a minor issue that Duncan pointed out to me I was passing the suite to lit twice

Reviewers: chandlerc

Subscribers: aemerson, llvm-commits

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

llvm-svn: 233009
2015-03-23 20:04:00 +00:00
Chris Bieneman
513563f41e Raising minimum required CMake version to 2.8.12.2.
This commit is in reference to the llvm-dev thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083672.html

llvm-svn: 233008
2015-03-23 20:03:57 +00:00
Peter Collingbourne
a47e3b75e5 test: Make a start on a test suite for libLTO.
This works in a similar way to the gold plugin tests. We search for a compatible
linker on $PATH and use it to run tests against our just-built libLTO. To start
with, test the just added opt level functionality.

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

llvm-svn: 232785
2015-03-19 23:55:38 +00:00
Chris Bieneman
e6f4b4012c Fixing dependencies for native tablegen.
The dependencies for cross-built tablegen were a bit confused. This fixes that. The following dependencies are now enforced:

(1) Tablegen tasks depend on the native tablegen
(2) Native tablegen depends on the cross-compiled tablegen

Although the native tablegen doesn't actually require the cross tablegen, having this dependency forces the native tablegen to rebuild whenever the cross tablegen changes.

llvm-svn: 232730
2015-03-19 16:49:44 +00:00
Greg Bedwell
b3d2075d40 [CMake] Don't pass in MSVC warning flags as definitions.
NFC currently but required as a prerequisite for using
the Microsoft resource compiler in conjunction with
CMake's ninja generator, which knows how to filter flags
appropriately, but not definitions.

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

llvm-svn: 232727
2015-03-19 16:32:47 +00:00
Chris Bieneman
52e1e1f609 Revert "Generate targets for each lit suite."
This change broke Polly. I'll track down the failure when I have a chance and re-apply the change.

llvm-svn: 232676
2015-03-18 21:53:29 +00:00
Chris Bieneman
d37a9d1b50 Generate targets for each lit suite.
Summary:
This change makes CMake scan for lit suites and generate a target for each lit test suite. The targets follow the format check-<project>-<suite path>.

For example:
check-llvm-unit - Runs the LLVM unit tests
check-llvm-codegen-arm - Runs the ARM codeine tests

Note: These targets are not generated during multi-configuration generators (i.e. Xcode and Visual Studio) because target clutter impacts UI usability.

Reviewers: chandlerc

Subscribers: aemerson, llvm-commits

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

llvm-svn: 232671
2015-03-18 21:19:06 +00:00
Reid Kleckner
8387c0d5ea CMake: Disable ENABLE_EXPORTS for executables with MSVC
The MSVC linker won't produce a .lib file for an executable that doesn't
export anything, and LLVM doesn't maintain dllexport annotations or .def
files listing all C++ symbols. It also doesn't support exporting all
symbols, like binutils ld.

CMake 3.2 changed the Ninja generator to list both the .exe and .lib
files as outputs of executable build targets. Ninja would always re-link
executables with ENABLE_EXPORTS because the .lib output file was not
present, and therefore the target was out of date.

llvm-svn: 232662
2015-03-18 20:09:13 +00:00
Chris Bieneman
ad94dbf12e Refactoring CMake CrossCompile module.
* put most of the cross-compiling support into a function llvm_create_cross_target_internal.
* when CrossCompile is included it still generates a NATIVE target.
* llvm_create_cross_target function takes a target_name which should match a toolchain.
* llvm_create_cross_target can now be used to target more than one cross-compilation target.

llvm-svn: 232067
2015-03-12 17:33:34 +00:00
Chris Bieneman
b095c9ea11 Doing some cleanup to the iOS toolchain.
* There is no reason to require SDKROOT as an environment variable because we can derive it from xcrun
* Setting CMAKE_RANLIB makes our static archives usable

llvm-svn: 232053
2015-03-12 16:19:16 +00:00
Greg Bedwell
217d7299b1 Revert "[CMake] Don't pass in MSVC warning flags as definitions"
reverting while I investigate why it broke the sanitizer-windows build.
This reverts commit r231924.

llvm-svn: 231925
2015-03-11 14:57:48 +00:00
Greg Bedwell
420fef5420 [CMake] Don't pass in MSVC warning flags as definitions
NFC currently but required as a prerequisite for using
the Microsoft resource compiler in conjunction with
CMake's ninja generator, which knows how to filter flags
appropriately, but not definitions.

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

llvm-svn: 231924
2015-03-11 14:26:29 +00:00
Chris Bieneman
d24ea211dc Add new LLVM_OPTIMIZED_TABLEGEN build setting which configures, builds and uses a release tablegen build when LLVM is configured with assertions enabled.
Summary: This change leverages the cross-compiling functionality in the build system to build a release tablegen executable for use during the build.

Reviewers: resistor, rnk

Reviewed By: rnk

Subscribers: rnk, joker.eph, llvm-commits

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

llvm-svn: 231842
2015-03-10 20:48:02 +00:00
Benjamin Kramer
61481a2f9a Drop the hacks used for partial C99 math libraries.
All supported platforms have half-way decent C99 support.

llvm-svn: 231679
2015-03-09 18:35:18 +00:00
Chandler Carruth
6769e8f1f7 Teach the LLVM CMake build how to explicitly use libc++abi when using
libc++. This lets me almost self-host on Linux with libc++ and libc++abi
very simply.

Currently, MCJIT and OrcJIT are failing due to uncaught exceptions, and
the Go binding tests are failing to build due to not linking in the
correct C++ standard library.

llvm-svn: 231560
2015-03-07 10:30:34 +00:00
Kostya Serebryany
285f1f0e41 [sanitizer/coverage] Add AFL-style coverage counters (search heuristic for fuzzing).
Introduce -mllvm -sanitizer-coverage-8bit-counters=1
which adds imprecise thread-unfriendly 8-bit coverage counters.

The run-time library maps these 8-bit counters to 8-bit bitsets in the same way
AFL (http://lcamtuf.coredump.cx/afl/technical_details.txt) does:
counter values are divided into 8 ranges and based on the counter
value one of the bits in the bitset is set.
The AFL ranges are used here: 1, 2, 3, 4-7, 8-15, 16-31, 32-127, 128+.

These counters provide a search heuristic for single-threaded
coverage-guided fuzzers, we do not expect them to be useful for other purposes.

Depending on the value of -fsanitize-coverage=[123] flag,
these counters will be added to the function entry blocks (=1),
every basic block (=2), or every edge (=3).

Use these counters as an optional search heuristic in the Fuzzer library.
Add a test where this heuristic is critical.

llvm-svn: 231166
2015-03-03 23:27:02 +00:00
Reid Kleckner
0667f1b1dc cmake: Use MSVC atomics with clang-cl
llvm-svn: 231022
2015-03-02 22:00:23 +00:00
Chris Bieneman
b56a22490e Making the SO version major.minor instead of just major because ABI and API change between minor versions.
llvm-svn: 230981
2015-03-02 17:50:13 +00:00
Reid Kleckner
89f1e184dc Minor follow-ups to r229720 suggested on llvmdev
"svn" patch by Sedat Dilek plus trimming whitespace added in r229720.

llvm-svn: 230773
2015-02-27 18:22:46 +00:00
Zachary Turner
e5d7d65572 [CMake] Fix the clang-cl self host build.
This allows clang-cl to self-host cleanly with no magic setup
steps required.

After this patch, all you have to do is set CC=CXX=clang-cl and
run cmake -G Ninja.

These changes only exist to support C++ features which are
unsupported in clang-cl, so regardless of whether the user
specifies they want to use them, we still have to disable them.

llvm-svn: 230539
2015-02-25 20:42:19 +00:00
Saleem Abdulrasool
20506b171b build: check if atomic routines are implicitly provided
It is possible for the atomic routines to be provided by the compiler without
requiring any additional libraries.  Check if that is the case before checking
for a library.

Patch by Matt Glazar!

llvm-svn: 230452
2015-02-25 02:38:03 +00:00
Tobias Grosser
3022fe4913 Revert "Raising minimum required CMake version to 2.8.12.2."
This reverts commit r230062.

Debian stable (wheezy) ships still with cmake 2.8.9.

The commit broke my LLVM/Polly buildbot, to my knowledge our only Linux+cmake
buildbot.

llvm-svn: 230343
2015-02-24 16:39:46 +00:00
Chad Rosier
96f24682d4 Revert "Revert "Raising minimum required CMake version to 2.8.12.2.""
This reverts commit r230240, which was an accidental commit.

llvm-svn: 230246
2015-02-23 19:34:04 +00:00
Chad Rosier
5f625fb96e Revert "Raising minimum required CMake version to 2.8.12.2."
This reverts commit 247aed4710e8befde76da42b27313661dea7cf66.

llvm-svn: 230240
2015-02-23 19:15:08 +00:00
Reid Kleckner
f0735a01d1 cmake: Don't do the libstdc++ version check when clang simulates MSVC
If we're using clang-cl, that's a pretty good indication that we're
going to use MSVC's STL.

This simplifies the clang-cl ninja self-host configuration down to:
CC=clang-cl CXX=clang-cl cmake .. -GNinja

Modified version of zturner's patch:
Differential Revision: http://reviews.llvm.org/D7824

llvm-svn: 230239
2015-02-23 19:07:25 +00:00
Zachary Turner
d3cf2628a4 Remove log statements from config scripts.
The bots seem to be happy now.

llvm-svn: 230164
2015-02-22 07:31:42 +00:00
Zachary Turner
05a56f4191 Really fix the build this time.
I was setting the python variable to "@HAVE_DIA_SDK@", which will
always be a string, and will always evaluate to True.

llvm-svn: 230163
2015-02-22 07:13:52 +00:00
Zachary Turner
9f8e48c6b4 [llvm-pdbdump] Resubmit "Add some tests for llvm-pdbdump".
NOTE: This patch intentionally breaks the build.  It attempts
to resubmit r230083, but with some debug logging in the CMake
and lit config files to determine why certain bots do not
correctly disable the DIA tests when DIA is not available.

After a sufficient number of bots fail, this patch will either
be reverted or, if the cause of the failure becomes obvious,
a fix submitted with the log statements removed.

llvm-svn: 230161
2015-02-22 06:47:32 +00:00
Chris Bieneman
cae658de0e Raising minimum required CMake version to 2.8.12.2.
llvm-svn: 230062
2015-02-20 21:28:18 +00:00
Davide Italiano
0e29a94c44 [Support/Timer] Make GetMallocUsage() aware of jemalloc.
Differential Revision:	D7657
Reviewed by:	shankarke, majnemer

llvm-svn: 229824
2015-02-19 07:27:14 +00:00
Peter Collingbourne
604243217b CMake: Fix add_lit_target for the case where a test suite has zero target dependencies.
This can happen with a standalone project containing a test suite with no
internal dependencies.

llvm-svn: 229753
2015-02-18 22:25:35 +00:00
Chris Bieneman
74f0557556 Adding install targets for individual LLVM tools and libraries.
Summary:
* add_llvm_tool and add_llvm_library now add install-${name} targets to install specific components
* added installhdrs target to install just the LLVM headers
* The above changes only apply for single-configuration generators (Ninja, Makefiles...), not for multi-configuration generators (Visual Studio, Xcode...)

Reviewers: pete

Reviewed By: pete

Subscribers: pete, llvm-commits

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

llvm-svn: 229727
2015-02-18 19:25:47 +00:00
Chris Bieneman
eb4def6a36 Enable standard so versioning for libLLVM.
Summary: This resolves Bugzilla bug 15493.

Reviewers: chapuni, pete

Reviewed By: pete

Subscribers: pete, llvm-commits

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

Conflicts:
	cmake/modules/AddLLVM.cmake

llvm-svn: 229720
2015-02-18 18:52:06 +00:00
Filipe Cabecinhas
94af5c68a5 Downgrade build system error message to a warning
Instead of requiring MSVC 2013 U4, we simply warn users, since some might
not bt able to immediately upgrade.

llvm-svn: 229598
2015-02-18 01:12:38 +00:00
Filipe Cabecinhas
10401763d4 We require MSVC 2013 Update 4 due to previous versions miscompiling ASTMatchers
Previous versions of MSVC 2013 would miscompile ASTMatchers (and/or their
tests). Bump up the requirement and make sure we know about the minor
revision.

Minimum required version found by Michael Edwards!

llvm-svn: 229584
2015-02-17 23:29:00 +00:00
Benjamin Kramer
4579422ac9 Update the docs to require at least MSVC 2013.
llvm-svn: 229323
2015-02-15 19:34:17 +00:00
NAKAMURA Takumi
3e2afcf188 Reapply r229185(cbieneman) -- Raising minimum required Visual Studio version to 2013.
This is based on the discussions on: [LLVMdev] [RFC] Raising LLVM minimum required MSVC version to 2013 for trunk

llvm-svn: 229320
2015-02-15 17:53:10 +00:00
Chandler Carruth
735d694283 [gold] Consolidate the gold plugin options and actually search for
a gold binary explicitly. Substitute this binary into the tests rather
than just directly executing the 'ld' binary.

This should allow folks to inject a cross compiling gold binary, or in
my case to use a gold binary built and installed somewhere other than
/usr/bin/ld. It should also allow the tests to find 'ld.gold' so that
things work even if gold isn't the default on the system.

I've only stubbed out support in the makefile to preserve the existing
behavior with none of the fancy logic. If someone else wants to add
logic here, they're welcome to do so.

llvm-svn: 229251
2015-02-14 09:43:57 +00:00
NAKAMURA Takumi
3d46f9bdd2 Revert r229185, "Raising minimum required Visual Studio version to 2013."
All builders are not ready yet.

llvm-svn: 229199
2015-02-14 00:45:32 +00:00
Chris Bieneman
0af06f4763 Raising minimum required Visual Studio version to 2013.
This is based on the discussions on: [LLVMdev] [RFC] Raising LLVM minimum required MSVC version to 2013 for trunk

llvm-svn: 229185
2015-02-13 23:24:14 +00:00
Zachary Turner
a8bf06418d Teach llvm_add_library() to find include dirs.
Since header files are not compilation units, CMake does not require
you to specify them in the CMakeLists.txt file.  As a result, unless a
header file is explicitly added, CMake won't know about it, and when
generating IDE-based projects, CMake won't put the header files into
the IDE project.  LLVM currently tries to deal with this in two ways:

  1) It looks for all .h files that are in the project directory, and
     adds those.
  2) llvm_add_library() understands the ADDITIONAL_HEADERS argument,
     which allows one to list an arbitrary list of headers.

This patch takes things one step further.  It adds the ability for
llvm_add_library() to take an ADDITIONAL_HEADER_DIRS argument, which
will specify a list of folders which CMake will glob for header files.
Furthermore, it will glob not only for .h files, but also for .inc
files.

Included in this CL is an update to one of the existing users of
ADDITIONAL_HEADERS to use this new argument instead, to serve as an
illustration of how this cleans up the CMake.

The big advantage of this new approach is that until now, there was no
way for the IDE projects to locate the header files that are in the
include tree.  In other words, if you are in, for example,
lib/DebugInfo/DWARF, the corresponding includes for this project will
be located under include/llvm/DebugInfo/DWARF.  Now, in the
CMakeLists.txt for lib/DebugInfo/DWARF, you can simply write:

  ADDITIONAL_HEADER_DIRS
  ../../include/llvm/DebugInfo/DWARF

as an argument to llvm_add_library(), and all header files will get
added to the IDE project.

Differential Revision: http://reviews.llvm.org/D7460
Reviewed By: Chris Bieneman

llvm-svn: 228670
2015-02-10 05:04:37 +00:00
Zachary Turner
0d4fc2d795 Define HAVE_DIA_SDK on Windows when DIA is present.
This allows all CMake projects, as well as C++ code, to detect if
and when DIA SDK is available for use so that we can enable the
DIA-based PDB reader implementation.

Differential Revision: http://reviews.llvm.org/D7457
Reviewed By: Chandler Carruth

llvm-svn: 228669
2015-02-10 05:04:25 +00:00
Filipe Cabecinhas
774b1b57ed Handle LLVM_USE_SANITIZER=Address;Undefined (and the other way around)
Summary:
Handle LLVM_USE_SANITIZER=Address;Undefined to enable ASan and UBSan
If UBSan is compatible with more of the other sanitizers, maybe we should
deal with this in a better way where we allow combining UBSan with any of
the other sanitizers.

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 228219
2015-02-04 22:33:31 +00:00