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

683 Commits

Author SHA1 Message Date
Nico Weber
3071e149df cmake: Make SVNVersion.inc work on Windows if svn is called svn.bat.
llvm-svn: 223864
2014-12-10 00:10:21 +00:00
Paul Robinson
cd39adad02 Make GetSVN.cmake do its VCS queries with native CMake code.
This lets the queries work on Windows as well as Linux.

This does mean make and cmake aren't using the same scripts to do the
queries (again), but at least GetSVN.cmake understands git and git-svn
as well as svn now.

llvm-svn: 223425
2014-12-05 00:50:15 +00:00
Rafael Espindola
d407c79665 Also use --icf=safe if we are being linked by gold.
llvm-svn: 223394
2014-12-04 22:16:08 +00:00
Rafael Espindola
b48b6db66b Detect if the linker is gold and if so always use --gc-sections.
llvm-svn: 223372
2014-12-04 17:54:35 +00:00
Peter Zotov
82181996ad [OCaml] [cmake] Disable OCaml bindings if ctypes >=0.3 is not found.
llvm-svn: 223195
2014-12-03 03:39:01 +00:00
Reid Kleckner
11736cf595 cmake: Remove MAXPATHLEN define as autoconf does not provide it
Presumably it was added to the CMake system when MAXPATHLEN was still
used by code built for Windows. Currently only lib/Support/Path.inc uses
MAXPATHLEN, and it should be available on all Unices.

llvm-svn: 223139
2014-12-02 18:59:08 +00:00
Peter Zotov
a05f11b29b [OCaml] [cmake] Add CMake buildsystem for OCaml.
Closes PR15325.

llvm-svn: 223071
2014-12-01 19:50:23 +00:00
Peter Collingbourne
749234c1e4 Teach LLVM about llgo subproject.
llvm-svn: 222860
2014-11-27 00:15:21 +00:00
Jordan Rose
db45777090 [CMake] Update GetSVN.cmake to use LLVM version control helper scripts.
This allows the logic to work with Git, and also uses the variable names
to match what Clang is actually looking for.

This is a re-application of r190556 and r190808. This changes the interface
of GetSVN.cmake. Clang change to follow.

llvm-svn: 222391
2014-11-19 22:03:21 +00:00
Eric Fiselier
370f4b9b46 Add support for LLVM_USE_SANITIZER=Thread
Summary: This will help in testing libc++ and libc++abi with tsan.

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits

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

llvm-svn: 222258
2014-11-18 21:23:38 +00:00
Peter Collingbourne
1220d2fcf7 CMake: Use the new USES_TERMINAL option for test suite targets when available.
llvm-svn: 222181
2014-11-17 22:16:15 +00:00
Eric Fiselier
b0df52fd4a Provide missing definition of uppercase_CMAKE_BUILD_TYPE in HandleLLVMOptions module
llvm-svn: 222082
2014-11-15 07:45:31 +00:00
Roman Divacky
a2f5d7b42b Use -Wcast-qual in cmake builds, not only autoconfo ones.
llvm-svn: 221913
2014-11-13 19:45:27 +00:00
Rafael Espindola
96ea479e09 Pass PRIVATE to target_link_libraries if using shared libraries.
A shared library (unlike a .a), has its dependencies recorded in the library and
we can pass PRIVATE to target_link_libraries.

This patch then removes some bogus dependencies when using
BUILD_SHARED_LIBS=ON. For example, we go from

build lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o:
CXX_COMPILER /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
|| include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so
lib/libLLVMCore.so lib/libLLVMBitReader.so
lib/libLLVMTransformUtils.so lib/libLLVMInstCombine.so
lib/libLLVMScalarOpts.so lib/libLLVMipa.so lib/libLLVMAnalysis.so
lib/libLLVMMCParser.so lib/libLLVMMC.so lib/libLLVMObject.so
lib/libLLVMTarget.so lib/libLLVMProfileData.so

to

build lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/AggressiveAntiDepBreaker.cpp.o:
CXX_COMPILER /home/espindola/llvm/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp
|| include/llvm/IR/intrinsics_gen lib/libLLVMSupport.so
lib/libLLVMCore.so lib/libLLVMTransformUtils.so
lib/libLLVMScalarOpts.so lib/libLLVMAnalysis.so lib/libLLVMMC.so
lib/libLLVMTarget.so

In fact, build.ninja goes from 5231028 bytes to 4896759 bytes.

With this, old verisons of bfd ld (2.24 is OK, 2.23 warns) will print a bogus
warning when building with BUILD_SHARED_LIBS.

llvm-svn: 221530
2014-11-07 15:33:56 +00:00
Rafael Espindola
1f28ebc73d Add a LLVM_BUILD_STATIC option to cmake.
Setting it to true causes all executables to be statically linked.

llvm-svn: 221345
2014-11-05 14:03:58 +00:00
Rafael Espindola
8be6fda142 [cmake] Pass -O3 when linking.
Gold and bfd ld enable misc optimizations. lld ignores the option for now.

llvm-svn: 221097
2014-11-02 12:14:22 +00:00
Reid Kleckner
ac54367706 Suppress MSVC's equivalent of -Wshadow warnings
IMO we need to clean up some of these, but the member variable one
(C4458) has false positives on static methods.  It is currently firing
on Twine, which has a static method like:
  struct Twine {
    uintptr_t LHS, RHS;
    static void staticMethod() {
      // warning C4458: declaration of 'LHS' hides class member
      uintptr_t LHS;
      ...
    }
  };

We should fix up clang's -Wshadow and clean it up, and then we can
re-enable some of these MSVC warnings.

llvm-svn: 221012
2014-10-31 22:55:57 +00:00
Chris Bieneman
052298786b EXPORTED_SYMBOL_FILE using mingw and cmake
Summary: This is a fix for the command line syntax error while building LTO when using MinGW.

Patch By: jsroemer

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, beanz, llvm-commits

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

llvm-svn: 220935
2014-10-30 22:37:58 +00:00
Rui Ueyama
a1707d7277 Re-commit r220667.
C++ source given to check_cxx_source_compile should have define "main".

llvm-svn: 220669
2014-10-27 08:16:18 +00:00
Rui Ueyama
f8270e4d8e Revert "Include stddef.h before including cxxabi.h" to un-break buildbot
This reverts commit r220665.

llvm-svn: 220667
2014-10-27 08:03:21 +00:00
Rui Ueyama
82ca2f4718 Include stddef.h before including cxxabi.h
On FreeBSD 10.0, size_t needs to be defined before including cxxabi.h.
Currenty HAVE_CXXABI_H is not defined on FreeBSD because of that reason.
This patch teaches cmake and configure how to include it.

http://reviews.llvm.org/D5940

llvm-svn: 220665
2014-10-27 07:37:57 +00:00
Peter Collingbourne
65b92cb354 Add llvm-go tool.
This tool lets us build LLVM components within the tree by setting up a
$GOPATH that resembles a tree fetched in the normal way with "go get".

It is intended that components such as the Go frontend will be built in-tree
using this tool.

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

llvm-svn: 220462
2014-10-23 02:33:23 +00:00
Peter Collingbourne
373678636f Do not add -gsplit-dwarf to LLVM_DEFINITIONS.
This would cause the flag to appear in the output of "llvm-config --cppflags",
which should contain only preprocessor flags. The -gsplit-dwarf flag in
particular can cause problems with certain downstream users such as cgo.

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

llvm-svn: 220410
2014-10-22 19:49:19 +00:00
Chandler Carruth
40ae319dfa Teach lit to filter the host LDFLAGS down from the build system and into
the CGO build environment. This lets things like -rpath propagate down
to the C++ code that is built along side the Go bindings when testing
them.

Patch by Peter Collingbourne, and verified that it works by me.

llvm-svn: 220252
2014-10-21 00:36:28 +00:00
Rafael Espindola
5f668ace49 Explain why we don't always use --gc-sections.
llvm-svn: 220237
2014-10-20 21:37:38 +00:00
NAKAMURA Takumi
b1a81d5420 Revert r220174, "Always use -Wl,-gc-sections on our build."
It dropped required functions for plugins with gnu ld 2.20 and 2.21.

  Failing Tests (1):
      LLVM :: Feature/load_module.ll

  Hello: bin/opt: symbol lookup error: lib/LLVMHello.so: undefined symbol: _ZN4llvm11raw_ostream13write_escapedENS_9StringRefEb

  Failing Tests (1):
      Clang :: Frontend/plugins.c

  error: unable to load plugin 'lib/PrintFunctionNames.so': 'lib/PrintFunctionNames.so: undefined symbol: _ZN5clang15PluginASTAction6anchorEv'

I think we should inspect linker's version or behavior to introduce --gc-sections for --export-dynamic.

llvm-svn: 220198
2014-10-20 12:12:21 +00:00
Rafael Espindola
965c115842 Always use -Wl,-gc-sections on our build.
Both bfd ld and gold correctly handle --export-dynamic, so gc-sections is safe even for binaries
that support plugins.

llvm-svn: 220174
2014-10-19 23:24:46 +00:00
Peter Collingbourne
55ac2d4e1f Disable ccache for go tests.
Should fix llvm-clang-lld-x86_64-debian-fast bot.

llvm-svn: 220071
2014-10-17 18:32:36 +00:00
Peter Collingbourne
22590da2c9 Initial version of Go bindings.
This code is based on the existing LLVM Go bindings project hosted at:
https://github.com/go-llvm/llvm

Note that all contributors to the gollvm project have agreed to relicense
their changes under the LLVM license and submit them to the LLVM project.

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

llvm-svn: 219976
2014-10-16 22:48:02 +00:00
Alexey Samsonov
6c7aeddca0 Re-land r219354: Use llvm-symbolizer to symbolize LLVM/Clang crash dumps.
In fact, symbolization is now expected to work only on Linux and
FreeBSD/NetBSD, where we have dl_iterate_phdr and can learn the
main executable name without argv0 (it will be possible on BSD systems
after http://reviews.llvm.org/D5693 lands). #ifdef-out the code for
all the rest Unix systems.

Reviewed in http://reviews.llvm.org/D5610

llvm-svn: 219534
2014-10-10 22:06:59 +00:00
Alexey Samsonov
88789ae22c Revert r219354. It seems to break some buildbots.
llvm-svn: 219355
2014-10-08 23:07:59 +00:00
Alexey Samsonov
6a2cac3b87 Use llvm-symbolizer to symbolize LLVM/Clang crash dumps.
This change modifies fatal signal handler used in LLVM tools.
Now it attempts to find llvm-symbolizer binary and communicates
with it in order to turn instruction addresses into
function/file/line info entries. This should significantly improve
stack traces readability in Debug builds.

This feature only works on selected platforms (including Darwin
and Linux). If the symbolization fails for some reason, signal
handler will fallback to the original behavior.

Reviewed in http://reviews.llvm.org/D5610

llvm-svn: 219354
2014-10-08 22:57:47 +00:00
Richard Smith
9e1420b2c0 Add LLVM_ENABLE_MODULES flag to CMake to enable building with C++ modules.
llvm-svn: 218551
2014-09-26 22:40:15 +00:00
Richard Smith
d5487b306e Fix CMake warning CMP0054: don't quote a variable name that is intended to be
expanded; future versions of cmake may not expand the variable in this case.

llvm-svn: 218543
2014-09-26 21:35:48 +00:00
Richard Smith
0a9e6a92b7 Fix misinterpretation of CMake rule found by a CMake warning (related to CMP0054).
lldb sets the variable SHARED_LIBRARY to 1, which breaks this conditional,
because older versions of CMake interpret

  if ("${t}" STREQUAL "SHARED_LIBRARY")

as meaning

  if ("${t}" STREQUAL "1")

in this case. Change the conditional so it does the right thing with both old
and new CMakes.

llvm-svn: 218542
2014-09-26 21:33:05 +00:00
Evgeniy Stepanov
6602036ef9 Add CMake check for libatomic.
llvm-svn: 217666
2014-09-12 11:08:59 +00:00
Dan Liew
f9d7c0a3bb Don't attempt to run llvm-config in cmake/modules/Makefile when doing
``make clean`` because it won't be available.

This is an attempt to unbreak buildbots broken by r217484.

llvm-svn: 217490
2014-09-10 11:09:23 +00:00
Dan Liew
a7dab6129d Attempt to fix PR20884
This fixes the generation of broken LLVMExports.cmake file by
the Autoconf/Makefile build system when --enable-shared is passed to
configure.

When --enable_shared is passed the Makefile.rules does not set the
LLVMConfigLibs variable which cmake/modules/Makefile previously relied
on. Now it runs the llvm-config command itself to get the library names.

This still isn't perfect because the generated LLVM targets refer to the
static libraries and not the shared library but that is much larger
problem to fix.

llvm-svn: 217484
2014-09-10 10:18:59 +00:00
Alexey Samsonov
98bb5b14e2 [CMake] Add -fno-sanitize=function to UBSan bootstrap
llvm-svn: 217217
2014-09-05 01:17:30 +00:00
Chris Bieneman
401492ce04 Enabling LLVM & Clang to be cross-compiled using CMake from a single configuration command line
The basic idea is similar to the existing cross compilation support. A directory must be configured to build host versions of tablegen tools and llvm-config. This directory can be user provided (and configured), or it can be created during the build. During a build the native build directory will be configured and built to supply the tablegen tools used during the build. A user could also explicitly provide the tablegen executables to run on the CMake command line.

llvm-svn: 217105
2014-09-03 23:21:18 +00:00
Matt Arsenault
46ad6e6208 cmake: Don't reject unknown cpp files that start with .
Some editors create hidden file backups in the same
directory as the file, and it's annoying when cmake
errors on them.

llvm-svn: 216941
2014-09-02 20:20:43 +00:00
Alexey Samsonov
e3176abfc7 Introduce -DLLVM_USE_SANITIZER=Undefined CMake option to build UBSan-ified version of LLVM/Clang.
I've fixed most of the simple bugs and currently "check-llvm" test suite
has 26 failures, and "check-clang" suite has 5 failures.

llvm-svn: 216701
2014-08-29 00:50:36 +00:00
Dylan Noblesmith
bae3ccb942 cmake: actually test -Wcomment
This test was testing nothing, as only -Werror was ever
being added to the compiler flags.

You can see the final nitty-gritty compiler invocation in
CMakeFiles/CMakeOutput.log (for successful tests) and
CMakeFiles/CMakeError.log (for failed tests).

Before:
Building C object CMakeFiles/cmTryCompileExec3385359576.dir/src.c.o
/usr/bin/clang   -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default  -DC_WCOMMENT_ALLOWS_LINE_WRAP  -Werror   -o CMakeFiles/cmTryCompileExec3385359576.dir/src.c.o   -c /home/nobled/code/llvm-b9/CMakeFiles/CMakeTmp/src.c

After:
Building C object CMakeFiles/cmTryCompileExec3385359576.dir/src.c.o
/usr/bin/clang   -fPIC -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default  -DC_WCOMMENT_ALLOWS_LINE_WRAP  -Werror -Wcomment   -o CMakeFiles/cmTryCompileExec3385359576.dir/src.c.o   -c /home/nobled/code/llvm-b9/CMakeFiles/CMakeTmp/src.c

llvm-svn: 216328
2014-08-23 21:10:58 +00:00
Dylan Noblesmith
47c1b1bf84 cmake: disable -Wnon-virtual-dtor when it gives false positives
clang has only been smart enough not to trigger -Wnon-virtual-dtor
warnings on final classes since r208449 (in clang 3.5). Building
with older versions is extremely noisy, so disable the warning
on those compilers.

llvm-svn: 216327
2014-08-23 21:10:56 +00:00
Aaron Ballman
5035042e58 Disabling an MSVC warning ('var' : definition from the for loop is ignored; the definition from the enclosing scope is used) which will trigger false positives more than true positives.
llvm-svn: 215895
2014-08-18 14:54:22 +00:00
Dan Liew
441d9ca885 Make message about building sphinx documentation with CMake more
informative by stating where the output is going.

llvm-svn: 215635
2014-08-14 11:57:16 +00:00
Dan Liew
4f050d39a1 Add SPHINX_WARNINGS_AS_ERRORS CMake option to allow warnings to not be
treated as errors (which is still the default). This is useful when
working on documentation that has existing errors.

llvm-svn: 215634
2014-08-14 11:57:13 +00:00
Josh Klontz
4a8465ca5b Fix for #20408 - CMake LLVM_ENABLE_FFI=ON build fails on reconfigure
llvm-svn: 215207
2014-08-08 14:32:56 +00:00
Dan Liew
7def43af36 Emit a warning if llvm_map_components_to_libraries() is used noting that its
use is deprecated in favour of llvm_map_components_to_libnames()

Although message(DEPRECATION "msg") would probably be a better fit this
does nothing if CMAKE_ERROR_DEPRECATED and CMAKE_WARNING_DEPRECATED are
both off, which is the default.

llvm-svn: 214078
2014-07-28 13:36:50 +00:00
Dan Liew
44ce1f4a26 Add LLVM_TOOLS_BINARY_DIR variable to LLVMConfig.cmake so clients
of LLVM using CMake can easily find the tools directory.

LLVM_BUILD_TOOLS_BINARY_DIR was removed because it is now
superfluous.

llvm-svn: 213674
2014-07-22 17:48:51 +00:00