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

993 Commits

Author SHA1 Message Date
Justin Bogner
fc9b621e7a cmake: Fix color diags under ninja if the compiler is "AppleClang"
Apparently cmake differentiates between Clang and AppleClang, and we
fail to color our diagnostics if you have the latter. Fix that.

llvm-svn: 271442
2016-06-01 23:29:26 +00:00
Ismail Donmez
98307fb038 Since some time clang itself figures out the default for ms-compatibility-version and uses it. Trying to figure it out during build is redundant and also will not work when the environment variable VSINSTALLDIR is not defined (which is not defined if you don't install whole Visual Studio but use Visual C++ Build Tools package).
Tested by bootstrapping clang with clang-cl.

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

llvm-svn: 270860
2016-05-26 15:52:23 +00:00
John Brawn
af398354eb Add auto-exporting of symbols from tools so that plugins work on Windows
The problem with plugins on Windows is that when building a plugin DLL it needs
to explicitly link against something (an exe or DLL) if it uses symbols from
that thing, and that thing must explicitly export those symbols. Also there's a
limit of 65535 symbols that can be exported. This means that currently plugins
only work on Windows when using BUILD_SHARED_LIBS, and that doesn't work with
MSVC.

This patch adds an LLVM_EXPORT_SYMBOLS_FOR_PLUGINS option, which when enabled
automatically exports from all LLVM tools the symbols that a plugin could want
to use so that a plugin can link against a tool directly. Plugins can specify
what tool they link against by using PLUGIN_TOOL argument to llvm_add_library.
The option can also be enabled on Linux, though there all it should do is
restrict the set of symbols that are exported as by default all symbols are
exported.

This option is currently OFF by default, as while I've verified that it works
with MSVC, linux gcc, and cygwin gcc, I haven't tried mingw gcc and I have no
idea what will happen on OSX. Also unfortunately we can't turn on
LLVM_ENABLE_PLUGINS when the option is ON as bugpoint-passes needs to be
loaded by both bugpoint.exe and opt.exe which is incompatible with this
approach. Also currently clang plugins don't work with this approach, which
will be fixed in future patches.

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

llvm-svn: 270839
2016-05-26 11:16:43 +00:00
Steven Wu
2a3de303da Revert "[CMake] LINK_LIBS need to be public for Darwin dylib targets"
This reverts r270723. This commit breaks greendragon.

llvm-svn: 270820
2016-05-26 04:35:35 +00:00
Chris Bieneman
2b1c02aa22 [CMake] LINK_LIBS need to be public for Darwin dylib targets
This should actually address PR27855. This results in adding references to the system libs inside generated dylibs so that they get correctly pulled in when linking against the dylib.

llvm-svn: 270723
2016-05-25 17:08:43 +00:00
Kevin Enderby
b9ab4d056f Add the printing the Mach-O (__LLVM,__bundle) xar archive file section "verbosely"
to llvm-objdump. This section is created with -fembed-bitcode option.

This requires the use of libxar and the Cmake and lit support were crafted by
Chris Bieneman!

rdar://26202242

llvm-svn: 270491
2016-05-23 21:34:12 +00:00
Richard Smith
74e8540951 Add a configure-time check for the existence of sigaltstack. It seems that some
systems provide a <signal.h> that doesn't declare it.

llvm-svn: 270278
2016-05-20 21:26:00 +00:00
Richard Smith
d86d870067 Reinstate r269992 (reverting r270267), but restricted to cases where glibc is
the C standard library implementation in use.

This works around a glibc bug in the backtrace() function where it fails to
produce a backtrace on x86_64 if libgcc / libunwind is statically linked.

llvm-svn: 270276
2016-05-20 21:18:12 +00:00
Chris Bieneman
681d988432 Revert "Work around a glibc bug: backtrace() spuriously fails if..."
This commit has been breaking the FreeBSD bots:
http://lab.llvm.org:8011/builders/lld-x86_64-freebsd

This reverts commit r269992.

llvm-svn: 270267
2016-05-20 20:15:17 +00:00
Richard Smith
b9f1b721c1 Work around a glibc bug: backtrace() spuriously fails if
- glibc is dynamically linked, and
 - libgcc_s is unavailable (for instance, another library is being used to
   provide the compiler runtime or libgcc is statically linked), and
 - the target is x86_64.

If we run backtrace() and it fails to find any stack frames, try using
_Unwind_Backtrace instead if available.

llvm-svn: 269992
2016-05-18 22:26:36 +00:00
Chris Bieneman
07ab4cac09 [CMake] Add some extra variables to LLVMConfig.cmake.in
Compiler-RT needs LLVM_LIBRARY_DIR, LLVM_BINARY_DIR.

Setting these in LLVMConfig.cmake will allow Compiler-RT to not need to run llvm-config as long as the LLVMConfig.cmake module is in the CMake module path.

llvm-svn: 269104
2016-05-10 19:45:17 +00:00
Justin Bogner
9040306a47 cmake: Avoid continue, apparently that's new
llvm-svn: 268812
2016-05-06 22:22:25 +00:00
Justin Bogner
6d6bd1c06e CMake: generate check targets for lit suites without their own lit.cfgs
Currently our cmake generates targets like check-llvm-unit and
check-llvm-transforms-loopunroll-x86, but not check-llvm-transforms or
check-llvm-transforms-adce. This is because the search for test suites
only lists the ones with a custom lit.cfg or lit.local.cfg.

Instead, we can do something a little smarter - any directory under
test that isn't called Inputs or inside a directory called Inputs is a
test suite.

llvm-svn: 268806
2016-05-06 21:57:30 +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
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
70a99e369b cmake: Fix grammar
llvm-svn: 268038
2016-04-29 13:03:40 +00:00
Richard Smith
8417406355 When building with LLVM_ENABLE_MODULES, put the module cache into the build
directory. This is important for build bots to avoid filling up /tmp.

llvm-svn: 266571
2016-04-17 20:58:01 +00:00
Mehdi Amini
5e6f018471 Add SVN version to libLLVMLTO
Summary: For Incremental LTO, we need to make sure that an old
cache entry is not used when incrementally re-linking with a new
libLTO.
Adding a global LLVM_REVISION in llvm-config.h would for to
rebuild/relink the world for every "git pull"/"svn update".
So instead only libLTO is made dependent on the VCS and will
be rebuilt (and the dependent binaries relinked, i.e. as of
today: libLTO.dylib and llvm-lto).

Reviewers: beanz

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266523
2016-04-16 07:33:14 +00:00
Alex Denisov
9fcc64726a Replace hardcoded comment at 'lit.site.cfg.in'
At the moment almost every lit.site.cfg.in contains two lines comment:

## Autogenerated by LLVM/Clang configuration.
# Do not edit!

The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from 
configure_lit_site_cfg with the note and some useful information.

llvm-svn: 266515
2016-04-16 06:47:41 +00:00
Richard Smith
c8f9cc971a Update and fix LLVM_ENABLE_MODULES:
1) We need to add this flag prior to adding any other, in case the user has
specified a -fmodule-cache-path= flag in their custom CXXFLAGS. Such a flag
causes -Werror builds to fail, and thus all config checks fail, until we add
the corresponding -fmodules flag. The modules selfhost bot does this, for
instance.

2) Delete module maps that were putting .cpp files into modules.

3) Enable -fmodules-local-submodule-visibility, to get proper module
visibility rules applied across submodules of the same module. Disable
-fmodules for C builds, since that flag is not available there.

llvm-svn: 266502
2016-04-16 00:48:58 +00:00
Chris Bieneman
918b321130 [CMake] Make llvm_ExternalProject always call the build action
This makes it so that when running 'ninja test-suite' from the top-level LLVM ninja build it *always* re-runs the ninja command in the test-suite directory.

This mechanism is required because the top-level ninja file doesn't have a view into the subdirectory dependency tree, so it can't know what, if anything, needs to be rebuilt.

llvm-svn: 265863
2016-04-08 22:46:04 +00:00
Jeroen Ketema
c27156c4e1 [CMake] Check for sys/types.h in config-ix.cmake
`sys/types.h` has a related define in `config.h.cmake`, but was never
checked for in CMake. Sync this.

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

llvm-svn: 265648
2016-04-07 08:36:13 +00:00
Chris Bieneman
df715f714d [CMake] Provide the ability to skip stripping when generating dSYMs
For debugging it is useful to be able to generate dSYM files but not strip the executables. This change adds the ability to skip stripping by setting LLVM_EXTERNALIZE_DEBUGINFO_SKIP_STRIP=On.

llvm-svn: 265041
2016-03-31 20:03:19 +00:00
Reid Kleckner
2045f67567 [cmake] Instead of testing char16_t for MSVC compat, directly ask cl.exe its version
Credit to Aaron Ballman for thinking of this.

llvm-svn: 264886
2016-03-30 18:19:39 +00:00
Reid Kleckner
353c55531c [cmake] Add -fms-compatibility-version=19 when clang-cl gives errors about char16_t
What we are really trying to do here is to figure out if we are using
the 2015 STL. Unfortunately, so far as I know the MSVC STL does not
define a version macro that we can check directly. Instead I wrote a
check to see if char16_t works.

llvm-svn: 264881
2016-03-30 17:30:26 +00:00
Reid Kleckner
33b2ba219f [cmake] Allow EH usage with clang-cl
llvm-svn: 264880
2016-03-30 17:28:21 +00:00
Saleem Abdulrasool
55a643e94a cmake: include what you use
Add a missing include.  This is important in the case HandleLLVMOptions is
included prior to the missing CheckCXXSourceCompiles or CheckCXXCompilerFlag
which includes CheckCXXSourceCompiles.

llvm-svn: 262949
2016-03-08 18:56:00 +00:00
Chris Bieneman
4c05063985 [CMake] Refactor add_llvm_implicit_projects to be reusable
This adds llvm_add_implicit_projects which takes a project name and is wrapped by add_llvm_implicit_projects.

llvm-svn: 262948
2016-03-08 18:43:28 +00:00
NAKAMURA Takumi
6a76c59fc3 Revert r130657, "Windows/DynamicLibrary.inc: Clean up ELM_Callback. We may check the decl instead of the versions of individual libraries."
We may assume the type of 1st argument as PCSTR in PENUMLOADED_MODULES_CALLBACK. PSTR was in the ancient mingw32.

llvm-svn: 262810
2016-03-07 00:13:09 +00:00
Reid Kleckner
9feb4e3a93 [cmake] Check the compiler version first
Otherwise users get messages from CheckAtomic about missing libatomic
instead of a sensible message that says "use GCC 4.7 or newer".

I structured the change along the lines of HandleLLVMStdlib.cmake, so
that the standalone build of Clang still gets the compiler version
check.

Reviewers: beanz

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

llvm-svn: 262491
2016-03-02 16:42:56 +00:00
Rafael Espindola
c165498992 Refactor duplicated code for linking with pthread.
llvm-svn: 262344
2016-03-01 15:54:40 +00:00
Renato Golin
b62da81886 [CMAKE] Update build on recent Haiku
This patch updates cmake build scripts to build on Haiku. It adds Haiku x86_64 to config.guess.
Please consider reviewing.

Pathc by Jérôme Duval.

llvm-svn: 262038
2016-02-26 17:01:45 +00:00
Justin Bogner
dec93a4fca cmake: Simplify the iOS.cmake toolchain
- Remove a comment that was clearly copy pasted from Android.cmake and
  isn't relevant.
- Remove the toolchain's sensitivity to the environment. It's less
  error prone to just allow users to set CMAKE_OSX_SYSROOT if they
  want to use a custom SDK.
- Stop explicitly setting -mios-version-min to the default value. It
  just adds needless complexity.

This makes building the native tablegen work for me even when SDKROOT
is set in the environment (or passed in as -DCMAKE_OSX_SYSROOT).

llvm-svn: 260763
2016-02-12 23:36:05 +00:00
Andrew Wilkins
fb2090fa73 Avoid linking LLVM component libraries with libLLVM
Patch by Jack Howarth.

When linking to libLLVM, don't also link to the component
libraries that constitute libLLVM.

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

llvm-svn: 260641
2016-02-12 01:42:43 +00:00
Reid Kleckner
0249db6d41 Disable MSVC 2015's warning about zero extending after ~ and others
Very often in LLVM we have APIs that take a bitwidth and a uint64_t that
we pass immediates such as ~0U to. Consider APInt, Constant, and
MachineInstrBuilder::addImm. Fixing all uses of these APIs to manually
extend their arguments to uint64_t doesn't seem worth it.

llvm-svn: 260416
2016-02-10 19:25:51 +00:00
Reid Kleckner
30549aa2c3 Revert "Turn on LLVM_ENABLE_PLUGINS by default on Windows"
This reverts r260262, it broke some LLVM tests (bugpoint).

llvm-svn: 260339
2016-02-10 01:06:37 +00:00
Ehsan Akhgari
cfc837ef51 Turn on LLVM_ENABLE_PLUGINS by default on Windows
Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 260262
2016-02-09 19:37:27 +00:00
Justin Bogner
edbd3d1ae7 cmake: Use "set" instead of "option" for LLVM_ENABLE_LTO
Apparently option is for bools and cmake-gui will display this
strangely with option.

Pointed out by edward-san - thanks!

llvm-svn: 260154
2016-02-08 21:55:19 +00:00
Justin Bogner
974dab4e8f cmake: Accept "thin" or "full" as arguments to -DLLVM_ENABLE_LTO
Mehdi suggested in a review of r259766 that it's also useful to easily
set the type of LTO. Augment the cmake variable to support that.

llvm-svn: 260143
2016-02-08 21:01:24 +00:00
Niels Ole Salscheider
a0cd125976 Install cmake files to lib/cmake/llvm
This is the right location for platform-specific files.

On some distributions (e. g. Exherbo), a package can be installed for several
architectures in parallel, but the architecture-independent files are shared.
Therefore, we must not install architecture-dependent files (like the CMake
config and export files) to share/.

llvm-svn: 259821
2016-02-04 20:08:19 +00:00
Justin Bogner
d393294b5b cmake: Add a flag to enable LTO
This adds -DLLVM_ENABLE_LTO, rather than forcing people to manually
add -flto to the various _FLAGS variables.

llvm-svn: 259766
2016-02-04 07:28:30 +00:00
Chris Bieneman
1b8d4f74aa Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html

"I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened."
- Obi Wan Kenobi

Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark

Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits

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

llvm-svn: 258861
2016-01-26 21:29:08 +00:00
Aaron Ballman
aabad88851 Reapplying r256836 with a fix for MSVC 14 support.
Enable more strict standards conformance in MSVC for rvalue casting and string literal type conversion to non-const types. Also enables generation of intrinsics for more functions.

Patch by Alexander Riccio

llvm-svn: 258687
2016-01-25 14:17:39 +00:00
Reid Kleckner
b68cad5bbe [cmake] Disable manifest generation when LLD is the linker
Running mt.exe to make the manifest is really slow. Disabling manifest
generation doesn't seem to break anything.

llvm-svn: 258581
2016-01-22 23:27:13 +00:00
Owen Anderson
28c07122cf Strip local symbols when using externalized debug info.
When we build LLVM with externalized debug info, all debugging and
symbolication related data is extracted into dSYM files prior to
stripping. As such, there is no need to preserve local symbols in LLVM
binaries after dSYM creation.

This shrinks libLLVM.dylib from 58MB to 55MB on my system.

llvm-svn: 258566
2016-01-22 22:07:24 +00:00
Andrew Wilkins
e690f5b8b2 tools/llvm-config: improve shared library support
Summary:

This is a re-commit of r257003, which was reverted,
along with the fixes from http://reviews.llvm.org/D15986.

r252532 added support for reporting the monolithic library
when LLVM_BUILD_LLVM_DYLIB is used. This would only be done
if the individual components were not found, and the dynamic
library is found.

This diff extends this as follows:
 - If LLVM_LINK_LLVM_DYLIB is set, then prefer the shared
   library, even if all component libraries exist.
 - Two flags, --link-shared and --link-static are introduced
   to provide explicit guidance. If --link-shared is passed
   and the shared library does not exist, an error results.

Additionally, changed the expected shared library names from
(e.g.) LLVM-3.8.0 to LLVM-3.8. The former exists only in an
installation (and then only in CMake builds I think?), and not
in the build tree; this breaks usage of llvm-config during
builds, e.g. by llvm-go.

Reviewers: DiamondLovesYou, beanz

Subscribers: llvm-commits

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

llvm-svn: 258283
2016-01-20 04:03:09 +00:00
Nico Weber
31b01d59cc Reenable -Wexpansion-to-defined.
I think I fixed all instances of this in the codebase
(r258202, 258200, 258190).  Also, the suppression didn't
have an effect on bots using make anyways, and it looks
like many bots still use configure/make bots.

llvm-svn: 258210
2016-01-19 22:46:33 +00:00
Nico Weber
70c6fe4d8d Fix bootstrap -Werror builds after clang r258128
llvm-svn: 258181
2016-01-19 20:52:17 +00:00
Geoff Berry
40581de42f [cmake] Fix add_version_info_from_vcs git svn version bug.
Summary:
add_version_info_from_vcs was setting SVN_REVISION to the last fetched
svn revision when using git svn instead of the svn revision
corresponding to HEAD.  This leads to conflicts with the definition of
SVN_REVISION in SVNVersion.inc generated by GetSVN.cmake when HEAD is
not the most recently fetched svn revision.

Use 'git svn info' to determine SVN_REVISION when git svn is being used
instead (as is done in GetSVN.cmake).

Reviewers: beanz

Subscribers: llvm-commits

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

llvm-svn: 258148
2016-01-19 17:36:02 +00:00
Chris Bieneman
499dd6ea19 [CMake] Need to install VersionFromVCS.cmake as part of LLVM's CMake modules
This is required to support clang --version detecting the clang repository information.

llvm-svn: 257909
2016-01-15 17:49:46 +00:00
NAKAMURA Takumi
0ff6f8a2a4 [autoconf] Install VersionFromVCS.cmake, too. clang/CMakeLists.txt requires it.
llvm-svn: 257856
2016-01-15 02:13:04 +00:00
Chris Bieneman
2de1f4cb59 [CMake] Add support for populating LLVM_REPOSITORY from CMake.
Autoconf does this in the GetRepositoryPath script, CMake's VersionFromVCS does grab the SVN_REVISION, but doesn't populate the repository URL.

llvm-svn: 257826
2016-01-14 22:44:29 +00:00
Axel Naumann
04fcf95002 Explicitly enable OBJECT library "target".
With this, one can build a lib from the objects of other libs:
set(SOURCES
  $<TARGET_OBJECTS:obj.clingInterpreter>
  $<TARGET_OBJECTS:obj.clingMetaProcessor>
  $<TARGET_OBJECTS:obj.clingUtils>
  )

Reviewed by Chris Bieneman - thanks!

llvm-svn: 257459
2016-01-12 07:44:58 +00:00
Andrew Wilkins
a734d141fe Revert r257003
This revision breaks llvm-config if you set
BUILD_SHARED_LIBS=on in a CMake build. Backing
out until the fix is ready to land.

llvm-svn: 257457
2016-01-12 07:23:58 +00:00
Andrew Wilkins
51a57d89a6 tools/llvm-config: improve shared library support
Summary:
r252532 added support for reporting the monolithic library
when LLVM_BUILD_LLVM_DYLIB is used. This would only be done
if the individual components were not found, and the dynamic
library is found.

This diff extends this as follows:
 - If LLVM_LINK_LLVM_DYLIB is set, then prefer the shared
   library, even if all component libraries exist.
 - Two flags, --link-shared and --link-static are introduced
   to provide explicit guidance. If --link-shared is passed
   and the shared library does not exist, an error results.

Additionally, changed the expected shared library names from
(e.g.) LLVM-3.8.0 to LLVM-3.8. The former exists only in an
installation (and then only in CMake builds I think?), and not
in the build tree; this breaks usage of llvm-config during
builds, e.g. by llvm-go.

Reviewers: DiamondLovesYou, beanz

Subscribers: llvm-commits

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

llvm-svn: 257003
2016-01-07 00:18:56 +00:00
Nico Weber
f2a28338f0 Make WinCOFFObjectWriter.cpp's timestamp writing not use ENABLE_TIMESTAMPS
LLVM_ENABLE_TIMESTAMPS controls if timestamps are embedded into llvm's
binaries. Turning it off is useful for deterministic builds.

r246905 made it so that the define suddenly also controls if the binaries that
the llvm binaries _create_ embed timestamps or not – but this shouldn't be a
configure-time option. r256203/r256204 added a driver option to toggle this on
and off, so this patch now passes this driver option in LLVM_ENABLE_TIMESTAMPS
builds so that if LLVM_ENABLE_TIMESTAMPS is set, the build of LLVM is
deterministic – but the built clang can still write timestamps into other
executables when requested.

This also allows removing some of the test machinery added in r292012 to work
around this problem.

See PR24740 for background.
http://reviews.llvm.org/D15783

llvm-svn: 256958
2016-01-06 19:05:19 +00:00
Aaron Ballman
0e898e92c4 Reverting r256836; it causes a build bot failure: http://lab.llvm.org:8011/builders/lldb-x86-win7-msvc/builds/14050/steps/build/logs/stdio
llvm-svn: 256837
2016-01-05 14:35:01 +00:00
Aaron Ballman
a446e7a779 Enable more strict standards conformance in MSVC for rvalue casting and string literal type conversion to non-const types. Also enables generation of intrinsics for more functions.
Patch by Alexander Riccio

llvm-svn: 256836
2016-01-05 14:24:01 +00:00
Nico Weber
4d29f9cae5 win: Pass /W4 in front of all the -wd flags.
This should fix many many -Wunused-parameter warnings in self-host builds on
Windows after r255382.  cl.exe doesn't care about the order of /W4 and
/wd flags, but clang-cl currently does (just like -Wno-foo -Wall order
matters for clang).  We might want to change how clang-cl behaves in
the future, but until then this change makes self-host builds much more
silent.

llvm-svn: 256315
2015-12-23 02:38:31 +00:00
Andy Gibbs
d9ba2c9d06 Revert r254592 (virtual dtor in SCEVPredicate).
Clang has better diagnostics in this case.  It is not necessary therefore
to change the destructor to avoid what is effectively an invalid warning
in gcc.  Instead, better handle the warning flags given to the compiler.

llvm-svn: 255905
2015-12-17 16:43:53 +00:00
Sumanth Gundapaneni
947a2bf7c3 Install runtime dlls in the INSTALL_DIR/bin directory. NFC
One of the earlier patches updated the cmake rule to install the
runtime dlls in INSTALL_DIR/lib which is not correct. This patch
updates the rule to install CMake's RUNTIME in bin directory
Differential Revision: http://reviews.llvm.org/D15505

llvm-svn: 255781
2015-12-16 17:07:15 +00:00
Chris Bieneman
28da4411df [CMake] Add LLVM_BUILD_INSTRUMENTED option to enable building with -fprofile-instr-generate
This is the first step in supporting PGO data generation via CMake. I've marked the option as advanced and experimental until it is fleshed out further.

llvm-svn: 255298
2015-12-10 21:19:07 +00:00
Chris Bieneman
b9a96af62d [CMake] Ignore externalizing debuginfo for unit tests
If you externalize debug info for unit tests the test runner finds the mach-o inside the dsym bundle and tries to execute it as a test.

llvm-svn: 255056
2015-12-08 21:51:48 +00:00
Aaron Ballman
96865a146b Silence all C4592 warnings with MSVC 2015 Update 1. This warning produces false positives that Microsoft says will be fixed in Update 2. Until this produces reliable diagnostics, it is safe to disable the diagnostic -- the compiler is not doing anything different than it previously did aside from issuing the diagnostic.
(Note, this silences at least one false positive in LLVM with FeatureBitset uses.)

llvm-svn: 254915
2015-12-07 15:44:34 +00:00
Chris Bieneman
3c356b4f56 [CMake] Fixing bots
CMake calls to set_property with APPEND string need to have a leading space.

llvm-svn: 254659
2015-12-03 22:55:36 +00:00
Chris Bieneman
00f689303f [CMake] set_target_properties doesn't append link flags
This fixes a bug introduced in r254627, and another occurance of the same bug in this file.

llvm-svn: 254657
2015-12-03 22:51:08 +00:00
Chris Bieneman
57f58fbc10 [CMake] Removing an unnecessary layer of variable indirection
This prevents passthrough variables from having values.

llvm-svn: 254641
2015-12-03 19:47:04 +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
Pavel Labath
f570e610a0 Fix non-PIC build after 253959
CMAKE_EXE_LINKER_FLAGS is a string. Appending a flag using list(APPEND) introduces an extra
semicolon which breaks stuff. Change this to append the value in the same way that everyone else
seems to be doing.

llvm-svn: 253968
2015-11-24 09:46:01 +00:00
Chris Bieneman
fc7b01b423 [CMake] When disabling PIC, also pass -fno-pie when linking if it is supported.
Building clang with -fno-pie generates slightly faster code. In my not-very-rigorous testing I saw about a 4% speed up using the clang test-suite sources.

llvm-svn: 253959
2015-11-24 08:04:59 +00:00
Chris Bieneman
a03449653c [CMake] export_executable_symbols also needs to add -rdynamic to the linker flags on Darwin
Without -rdynamic LLVM built with LTO fails to pass "check" due to loadable modules failing.

llvm-svn: 253944
2015-11-24 00:58:58 +00:00
Chris Bieneman
88e7e42aae NFC. Fixing my consistently incorrect spelling.
llvm-svn: 253936
2015-11-23 23:34:09 +00:00
Yaron Keren
762fa03531 Unbreak build on OpenBSD by not adding -Wl,-z,defs to linker flags.
This is similar to the fix for FreeBSD in r226862. Without this patch,
the build aborts when linkling libLTO.so, complaining about undefined
references to assert2, cxa_atexit, etc.

Patch by Stefan Kempf!

http://reviews.llvm.org/D14236

llvm-svn: 253769
2015-11-21 06:33:54 +00:00
Chris Bieneman
d9f3ae9820 [CMake] Fix handling of passing through semi-colon separated lists.
When passing around CMake arguments as lists of arguments any arguments containing lists need to have their semi-colons escaped otherwise CMake will split the arguments in the middle.

llvm-svn: 253719
2015-11-20 22:08:49 +00:00
Reid Kleckner
131251d95d Don't search for third party libraries while using MSan
On the average user's system, those libraries will not be compiled with
MSan. Prior to this change, the LLVM test suite was full of false
positives from calls from third party libraries to MSan interceptors
like strlen.

We can remove this check if MSan ever grows a suppression mechanism
similar to TSan's.

llvm-svn: 253526
2015-11-19 00:05:21 +00:00
Chris Bieneman
76a5e53fc4 [CMake] Support -fvisibility-inlines-hidden when LLVM_ENABLE_PIC=Off
I'm unaware of any reasons why -fvisibility-inlines-hidden would depend on PIC, and since autoconf supports this flag without PIC, we should support it in CMake too.

llvm-svn: 253517
2015-11-18 22:49:26 +00:00
NAKAMURA Takumi
03c82bdb8b LLVM_ENABLE_MODULES: No need to set -fcxx-modules in trunk, just -fmodules.
llvm-svn: 252996
2015-11-13 01:26:31 +00:00
Chris Bieneman
59a6ab650e [CMake] Fixing passthrough for variables starting with the sub-project name
This allows TEST_SUITE variables to be passed from the top-level CMake into the external project.

llvm-svn: 252810
2015-11-11 21:54:31 +00:00
Chris Bieneman
eb8c2f9160 [CMake] Make llvm_install_library_symlink respect LLVM_LIBDIR_SUFFIX.
This is required to support multilib install targets, and addresses a regression introduced in r252093.

llvm-svn: 252749
2015-11-11 16:19: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
Andrew Wilkins
c444ebb143 [cmake] move SONAME handling to llvm_add_library
Summary:
Move handling of the SONAME option from add_llvm_library
to llvm_add_library, so that it can be used in sub-projects.
In particular, this makes it possible to have consistently
named shared libraries for LLVM, Clang and LLDB.

Also, base the SONAME and symlinks on the output name
by extracting the OUTPUT_NAME property, rather than assuming
it is the same as the target name.

Reviewers: beanz

Subscribers: llvm-commits

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

llvm-svn: 252669
2015-11-10 23:19:21 +00:00
Ramkumar Ramachandra
d29ac7efe7 AddLLVM: squelch CMP0007 by not adding empty elements to list
When configuring various llvm projects that use AddLLVM.cmake, this warning is
emitted many times, flooding the screen:

Policy CMP0007 is not set: list command no longer ignores empty elements.

The fix is removing an extra semicolon.

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

llvm-svn: 252628
2015-11-10 18:26:34 +00:00
Chris Bieneman
c127f2db5e [CMake] Bug 25059 - CMake libllvm.so.$MAJOR.$MINOR shared object name not compatible with ldconfig
Summary:
This change makes the CMake build system generate libraries for Linux and Darwin matching the makefile build system.

Linux libraries follow the pattern lib${name}.${MAJOR}.${MINOR}.so so that ldconfig won't pick it up incorrectly.

Darwin libraries are not versioned.

Note: On linux the non-versioned symlink is generated at install-time not build time. I plan to fix that eventually, but I expect that is good enough for the purposes of fixing this bug.

Reviewers: loladiro, tstellarAMD

Subscribers: axw, llvm-commits

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

llvm-svn: 252093
2015-11-04 23:11:12 +00:00
Tom Stellard
9c18b9c83d llvm-config: Add --has-rtti option
Summary:
This prints NO if LLVM was built with -fno-rtti or an equivalent flag
and YES otherwise.  The reasons to add -has-rtti rather than adding -fno-rtti
to --cxxflags are:

1. Building LLVM with -fno-rtti does not always mean that client
applications need this flag.

2. Some compilers have a different flag for disabling rtti, and the
compiler being used to build LLVM may not be the compiler being used to
build the application.

Reviewers: echristo, chandlerc, beanz

Subscribers: llvm-commits

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

llvm-svn: 252075
2015-11-04 20:57:43 +00:00
David Blaikie
bd89751462 Revert parts accidentally included in r251823
llvm-svn: 251826
2015-11-02 20:05:54 +00:00
David Blaikie
a98b9cfa54 StringRef-ify DiagnosticInfoSampleProfile::Filename
llvm-svn: 251823
2015-11-02 20:01:13 +00:00
Chris Bieneman
ac8e8a99a1 [CMake] Fixing dependency issue with parallel make when building with LLVM_OPTIMIZED_TABLEGEN.
Patch by Alex Wang

llvm-svn: 251138
2015-10-23 19:48:17 +00:00
Manuel Klimek
a014a467dc Fix add_llvm_external_project.
r250835 unintentionally discarded the optional parameter to the
add_llvm_external_project() macro that may point to a path when the said
path is different from ${name}. This should fix it by passing ${ARGN} on
to add_llvm_subdirectory(). The problem manifests itself with e.g.
add_llvm_external_project(clang-tools-extra extra) from
clang/tools/CMakeLists.txt

Patch by Luchesar V. Iliev.

llvm-svn: 251001
2015-10-22 08:31:46 +00:00
Chris Bieneman
fc5c467cf1 [CMake] Refactor subdirectory inclusion code to take a project name.
Summary:
This refactoring makes some of the code used to control including subdirectories parameterized so it can be re-used elsewhere.

Specifically I want to re-use this code in clang to be able to turn off specific tool subdirectories.

Reviewers: chapuni, filcab, bogner, Bigcheese

Subscribers: emaste, llvm-commits

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

llvm-svn: 250835
2015-10-20 16:42:58 +00:00
Chris Bieneman
f6944257e9 [CMake] Cleaning up and generalizing the LLVMInstallSymlink script so that it can be used for libraries too.
In order to resolve PR25059, we're going to need to be able to generate symlinks to libraries manually, so I need this code to be reusable.

llvm-svn: 250573
2015-10-16 23:17:13 +00:00
Eric Fiselier
064bc4af87 Split -pedantic and -Wno-long-long into two separate flags so libc++ can remove -pedantic
llvm-svn: 250255
2015-10-13 23:51:58 +00:00
Pawel Bylica
51dcd3d0fd cmake: Avoid leading space in LLVM_DEFINITIONS.
Summary: Unnecessary space at the beginning of LLVM_DEFINITIONS in cmake shared files can break projects that use the variable.

Subscribers: llvm-commits

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

llvm-svn: 250025
2015-10-12 10:42:03 +00:00
Chris Bieneman
b8bce812e5 [CMake] Parallel make breaks on native tablegen
Patch by Alex Wang

This patch resolves a parallelization issue that occurs when native tablegen targets are built at the same time. They both try to build libSupport and clobber each other causing the builds to fail.

llvm-svn: 249911
2015-10-09 22:26:04 +00:00
Reid Kleckner
1ea7758a17 Enable gtest SEH when building with clang-cl
Clang supports SEH well enough that this should work out of the box.  If
it doesn't, we'll hear about it.

llvm-svn: 249766
2015-10-08 22:44:39 +00:00
David Blaikie
0c7821b2aa Revert "Enable -Wdeprecated in the cmake build now that LLVM (& Clang, Polly, and LLD) are -Wdeprecated clean"
This reverts commit r248963.

Seems there's some standard libraries (and libcxxabi implementations)
that aren't -Wdeprecated clean... hrm.

llvm-svn: 248972
2015-10-01 00:44:21 +00:00
David Blaikie
818afe7a1c Enable -Wdeprecated in the cmake build now that LLVM (& Clang, Polly, and LLD) are -Wdeprecated clean
This particularly helps enforce the C++ Rule of 5 (for new move ops this
is already an error, but for a type only using C++98 features (copy
ctor/assign, dtor) it is only deprecated, not invalid)

Applying the flag for any GCC compatible compiler - GCC doesn't warn on
the Rule of 5 cases that C++11 deprecates, but it doesn't have other
false positives so far as I could see (compiling with GCC 4.8 didn't
produce any -Wdeprecated warnings I could spot).

Reviewers: aaron.ballman

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

llvm-svn: 248963
2015-09-30 23:36:12 +00:00
John Brawn
7f04c1f289 [CMake] Make the bindir and libdir arguments to set_output_directory optional
When building a plugin against an installed LLVM toolchain using
add_llvm_loadable_module (in the documented manner) doesn't work as nothing sets
the *_OUTPUT_INTDIR variables causing an error when set_output_directory is
called. Making those arguments optional (causing the default output directory
to be used) fixes this.

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

llvm-svn: 248911
2015-09-30 15:20:51 +00:00
John Brawn
4db280055c [CMake] Adjust the variables set by LLVMConfig.cmake
When using LLVMConfig.cmake from an installed toolchain in order to build a
loadable pass using add_llvm_loadable_module LLVM_ENABLE_PLUGINS and
LLVM_PLUGIN_EXT must be set. Also make LLVM_DEFINITIONS be set to what it
actually is.

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

llvm-svn: 248884
2015-09-30 10:34:06 +00:00
John Brawn
820801b9dd [CMake] Move the setting of LLVM_COMPILER_IS_GCC_COMPATIBLE to a separate file
Currently LLVM_COMPILER_IS_GCC_COMPATIBLE is set as a side-effect of determining
the stdlib to use in HandleLLVMStdlib, which causes problems when attempting to
use AddLLVM from an installed LLVM toolchain, as HandleLLVMStdlib is not used.
Move the setting of this variable into DetermineGCCCompatible and include that
from both AddLLVM and HandleLLVMStdlib.

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

llvm-svn: 248798
2015-09-29 14:33:58 +00:00
Chris Bieneman
002bf95a73 [CMake] Adding ALWAYS_GENERATE option to symlink utility functions.
This implements the behavior required for clang symlinks which should be always generated.

llvm-svn: 248039
2015-09-18 21:08:32 +00:00