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

827 Commits

Author SHA1 Message Date
Reid Kleckner
ef6f724429 [cmake] Pass /manifest:no to the linker when asan is enabled
This is a workaround for PR24476.

llvm-svn: 245945
2015-08-25 16:06:40 +00:00
NAKAMURA Takumi
5f184b4bb7 [CMake] add_llvm_external_project: Just warn about nonexistent directories.
These entries were generated accidentally.

llvm-svn: 245783
2015-08-22 05:11:02 +00:00
NAKAMURA Takumi
4cfca08317 [CMake] Make LLVM_EXTERNAL_*_SOURCE_DIR consistent against older buildsites.
If corresponding in-tree subdirectory exists, just ignore LLVM_EXTERNAL* stuff.
Otherwise, set LLVM_TOOL_*_BUILD ON/OFF properly according to LLVM_EXTERNAL_*.

This makes easier to walk among old revisions *without* deleteing CMakeCache.txt.

Before r242059, LLVM_EXTERNAL_* was working like;

  if(EXISTS ${*_SOURCE_DIR}/CMakeLists.txt)
    set(*_BUILD ON CACHE)
    if(*_BUILD is ON)
      add_subdirectory(*_SOURCE_DIR)
    endif()
  endif()

llvm-svn: 245782
2015-08-22 04:53:52 +00:00
Dan Liew
dd489fffd3 Filter libraries that are not installed out of CMake exports (currently
gtest and gtest_main) when generating ``Makefile.llvmbuild``.

Libraries that are not installed should not be exported because they
won't be available from an install tree.  Rather than filtering out the
gtest libraries in cmake/modules/Makefile, simply teach llvm-build to
filter out libraries that will not be installed from its generated list
of exported libraries.

Note that LLVMBUILD_LIB_DEPS_* are used during our own CMake build
process so we cannot filter LLVMBUILD_LIB_DEPS_gtest* out in llvm-build.
We must leave this gtest filter logic in cmake/modules/Makefile.

llvm-svn: 245718
2015-08-21 18:10:57 +00:00
Dan Liew
3e6b9ffdd7 llvm-build: Adopt generation of LLVM_LIBS_TO_EXPORT. Patch by
Brad King.

Move `LLVM_LIBS_TO_EXPORT` over to Makefile.llvmbuild and generate it
from `llvm-build` using the same logic used to export the dependencies
of these libraries.  This avoids depending on `llvm-config`.

This refactoring was originally motivated by issue #24154 due to commit
r243297 (Fix `llvm-config` to emit the linker flag for the combined
shared object, 2015-07-27) changing the output of `llvm-config --libs`
to not have the individual libraries when we configure with
`--enable-shared`.  That change was reverted by r244108 but this
refactoring makes sense on its own anyway.

llvm-svn: 245717
2015-08-21 18:10:55 +00:00
Yaron Keren
6479d6085a Disable Visual C++ 2013 Debug mode assert on null pointer in some STL algorithms,
such as std::equal on the third argument. This reverts previous workarounds.

Predefining _DEBUG_POINTER_IMPL disables Visual C++ 2013 headers from defining
it to a function performing the null pointer check. In practice, it's not that
bad since any function actually using the nullptr will seg fault. The other
iterator sanity checks remain enabled in the headers.

Reviewed by Aaron Ballmanþ and Duncan P. N. Exon Smith.

llvm-svn: 245711
2015-08-21 17:31:03 +00:00
Reid Kleckner
d2823e636e [cmake] Start adding support for LLVM_USE_SANITIZER=Address on Windows
Pass "-fsanitize=address" to the compiler and "-debug" to the linker.

llvm-svn: 245070
2015-08-14 16:48:34 +00:00
Rafael Espindola
340e0df2ed Use /Zc:inline when building with MSVC.
This reduces the total .obj size when building llvm from
496,690,342 to 219,334,936 bytes.

llvm-svn: 244767
2015-08-12 17:09:25 +00:00
Reid Kleckner
3c27958d3f Revert "[cmake] Add helper for finding potentially external projects"
This reverts commit r244633.

We aren't going to be able to use it because the compiler-rt build can
be built standalone without an LLVM source dir *or* an installed copy of
LLVM.

llvm-svn: 244648
2015-08-11 19:02:57 +00:00
Reid Kleckner
680373b126 [cmake] Add helper for finding potentially external projects
I plan to use this from compiler-rt, but it's useful for any LLVM
project that depends on more than just LLVM.

llvm-svn: 244633
2015-08-11 17:16:35 +00:00
Justin Bogner
59cbd5e6a5 Remove the configure and cmake checks for sys/wait.h
If we don't have sys/wait.h and we're on a unix system there's no way
that several of the llvm tools work at all. This includes clang.

Just remove the configure and cmake checks entirely - we'll get a
build error instead of building something broken now.

llvm-svn: 243957
2015-08-04 06:29:58 +00:00
Douglas Katzman
97a4d33479 Use a specified list of languages in cmake project() command.
This allows asm files and Cxx files to be compiled with different flags
rather than treating them identically. LLVM itself has no asm files
other than tests, but this setting is inherited by the compiler-rt
project (unless compiled standalone), which does have asm files.

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

llvm-svn: 243419
2015-07-28 14:43:53 +00:00
Saleem Abdulrasool
52d579554f build: fix small typo in cmake doxygen build
A search word spelled as "searhc" in the LLVM_DOXYGEN_SEARCHENGINE_URL cmake
variable docstring.

Patch by Daniel Otero!

llvm-svn: 243082
2015-07-24 01:14:25 +00:00
Yaron Keren
2ec88a0c61 Avoid using -Wl,-z,defs on Cygwin.
Prior to CMAKE 2.8.4 that was covered by the WIN32 conditional but
from 2.8.4 CMAKE no longer defined WIN32 when running under Cygwin
and it needs its own test.

Patch by Martell Malone!

http://reviews.llvm.org/D11347

llvm-svn: 242993
2015-07-23 08:06:12 +00:00
Chris Bieneman
db73898a0e [CMake] Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly specified.
One part of my refactoring from r242705 is untenable due to how CMake caches variables. There is no way other than caching to allow variables to be set in one directory and globally readable, but we really don't want to cache the temporary value marking that a directory has already been included.

llvm-svn: 242793
2015-07-21 15:53:09 +00:00
Andrew Wilkins
d655ae71f1 [cmake] pass GO_EXECUTABLE to llgo-go
Summary:
When calling llgo-go from the llvm_add_go_executable
cmake function, specify $GO_EXECUTABLE as the go
command to call. Without this, llgo-go searches $PATH
which may be inconsistent with $GO_EXECUTABLE.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 242749
2015-07-21 00:46:23 +00:00
Chris Bieneman
f446b9894e [CMake] Fixing inconsistency caused by copy-pasta.
This will actually fix the PR 24194.

llvm-svn: 242748
2015-07-21 00:44:47 +00:00
Chris Bieneman
12cdd5a5a4 [CMake] Fixing a problem with external projects that aren't getting enabled properly.
This should address PR 24194, and some builedbot failures.

llvm-svn: 242746
2015-07-21 00:39:53 +00:00
Aaron Ballman
2bf3f3dd45 Suppress two warnings from MSVC 2015 that are triggered under /W4. Since we turn off exceptions in the code base, C4577 is moot. C4091 triggers on system headers and is a benign construct.
llvm-svn: 242708
2015-07-20 21:14:14 +00:00
Chris Bieneman
136e6dc16b [CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working.
Re-landing r242059 which re-landed r241621... I'm really bad at this.

Summary (r242059):
This change re-lands r241621, with an additional fix that was required to allow tool sources to live outside the llvm checkout. It also no longer renames LLVM_EXTERNAL_*_SOURCE_DIR. This change was reverted in r241663, because it renamed several variables of the format LLVM_EXTERNAL_*_* to LLVM_TOOL_*_*.

Summary (r241621):
The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are:

* factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools
* removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off
* Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code.
* Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt

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

llvm-svn: 242705
2015-07-20 20:36:06 +00:00
NAKAMURA Takumi
07289582f7 [CMake] Unbreak add_llvm_external_project when external projects are specified.
LLVM_EXTERNAL_*_SOURCE_DIR is reset as PATH with set(CACHE PATH).
Then the CACHE PATH variable, LLVM_EXTERNAL_*_SOURCE_DIR, is normalized as
${CMAKE_SOURCE_DIR}/${path_var} if ${path_var} is relative.

llvm-svn: 242120
2015-07-14 05:12:53 +00:00
Chris Bieneman
e9b932f094 [CMake] Forgot to quote the first part of STREQUAL.
llvm-svn: 242103
2015-07-14 01:19:07 +00:00
Chris Bieneman
efe18d13a6 [CMake] We shouldn't be storing values in the cache unless they actually need CMake cache behavior.
add_llvm_external_project puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache even if it is just the in-tree default path. This causes all sorts of oddness, and makes it so that I can't change the behavior of this variable.

This patch never puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache. It will only end up in the cache if it is specified on the command line, which is the correct behavior.

There is also a temporary change to remove non-default values from the cache if they are already present. This should have the impact of cleaning out unncecissary values from the caches on the buildbots and people's local build directories. This part of the change is marked with a TODO and can be removed in a few days.

llvm-svn: 242102
2015-07-14 01:17:43 +00:00
Chris Bieneman
4f92ca8a9e Revert "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working."
Reverting r242059 because it broke some bots. I'm attempting to reproduce the failures now.

llvm-svn: 242060
2015-07-13 20:30:58 +00:00
Chris Bieneman
3076439d02 [CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working.
Summary:
This change re-lands r241621, with an additional fix that was required to allow tool sources to live outside the llvm checkout. It also no longer renames LLVM_EXTERNAL_*_SOURCE_DIR. This change was reverted in r241663, because it renamed several variables of the format LLVM_EXTERNAL_*_* to LLVM_TOOL_*_*.

Original Summary:
The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are:

* factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools
* removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off
* Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code.
* Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt

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

llvm-svn: 242059
2015-07-13 20:23:15 +00:00
NAKAMURA Takumi
4e774b69fd Revert r241621, "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working."
It broke the build that relies on LLVM_EXTERNAL_CLANG_*.

llvm-svn: 241663
2015-07-08 02:35:43 +00:00
Chris Bieneman
13e1693131 [CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working.
Summary:
The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are:

* factored out canonicalizing tool names from paths to CMake variables
* removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools
* removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off
* Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code.
* Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt

Reviewers: bogner, samsonov, chapuni, beanz

Subscribers: llvm-commits

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

llvm-svn: 241621
2015-07-07 20:24:55 +00:00
NAKAMURA Takumi
843c7b07fa [CMake] add_llvm_symbol_exports: Use Python oneliner instead of "cmd.exe /c type" to generate *.def.
llvm-svn: 241402
2015-07-05 08:56:38 +00:00
Leny Kholodov
76adfcc946 [Support] Lazy load of dbghlp.dll on Windows
This patch changes linkage with dbghlp.dll for clang from static (at load time)
to on demand (at the first use of required functions). Clang uses dbghlp.dll
only in minor use-cases. First of all in case of crash and in case of plugin load.
The dbghlp.dll library can be absent on system. In this case clang will fail
to load. With lazy load of dbghlp.dll clang can work even if dbghlp.dll
is not available.

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

llvm-svn: 241271
2015-07-02 14:34:57 +00:00
Dan Liew
2ad7bffa0f [CMake] Make the CMake files (LLVMConfig.cmake and LLVMExports.cmake)
generated by the Autoconf/Makefile build system relocatable.

Previously the generated CMake files contained hardcoded paths which
prevented a binary installation from being relocated to a different
place in the file system. This problem was most noticeable in LLVM's
official binary releases which were completely unusable by a downstream
project trying to import the CMake targets.

Package maintainers who choose to modify the install location of the
CMake directory without using the ``PROJ_cmake`` Makefile variable
override will need to patch the generated``LLVMConfig.cmake`` so that
``LLVM_INSTALL_PREFIX`` and ``_LLVM_CMAKE_DIR`` variables are set
correctly.

llvm-svn: 241080
2015-06-30 17:16:39 +00:00
Dan Gohman
e04339a4ce [WebAssembly] Initial WebAssembly backend
This WebAssembly backend is just a skeleton at this time and is not yet
functional.

llvm-svn: 241022
2015-06-29 23:51:55 +00:00
Dan Liew
290240ec68 Fix bug #23967. The gtest and gtest_main targets were exported into the
CMake files and should not be by both build systems and also the targets
were also installed by the CMake build system which they should not be.

The problem was that

- the CMake build of LLVM installs and exports the gtest library
targets. We should not being doing this, these are not part of LLVM.

- the Autoconf/Makefile build of LLVM still had gtest libraries in the
installed LLVMConfig.cmake.

These problems would cause problems for an external project because when
calling llvm_map_components_to_libnames(XXX all) ${XXX} would to contain
LLVM's internal gtest libraries.

llvm-svn: 240981
2015-06-29 18:45:56 +00:00
Peter Zotov
7ae792d667 [OCaml] Bump ctypes dependency to 0.4.
ctypes 0.3 and earlier contains an interface-definig bug:
its ptr_of_raw_address accepts Int64 and not Nativeint. ctypes 0.4
was not released during the 3.6 cycle, and because of that, LLVM 3.6
was released with ctypes 0.3 as a dependency, which now breaks
the build on modern ctypes.

Unbreak.

llvm-svn: 240882
2015-06-27 14:32:30 +00:00
Douglas Katzman
d3fbf4c212 Spelling fixes in comments.
llvm-svn: 240594
2015-06-24 21:46:53 +00:00
Rafael Espindola
c87c2aa297 Support Solaris unused sections' gc link syntax.
It is not clear if this would work or not with LLVM_NO_DEAD_STRIP
binaries, so be conservative for now.

Patch by Xan López.

llvm-svn: 240287
2015-06-22 15:06:17 +00:00
Rafael Espindola
2c6ed3c85c Do not pass optimization flags to Solaris' linker.
It is not supported.

Patch by Xan López.

llvm-svn: 240276
2015-06-22 12:41:52 +00:00
Rafael Espindola
5fb5fa8872 Use right syntax to pass version script to Solaris' ld.
Patch by Xan Lopez!

llvm-svn: 240275
2015-06-22 12:34:54 +00:00
Filipe Cabecinhas
d3cef61b59 CMake: Stop using LLVM's custom parse_arguments (delete implementation). NFC
Summary:
Finally, delete LLVM's parse_arguments() definition.
Second part of D10531.

This is dependent on http://reviews.llvm.org/D10529

Reviewers: pcc, beanz, chapuni

Subscribers: llvm-commits

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

llvm-svn: 240122
2015-06-19 03:45:42 +00:00
Filipe Cabecinhas
e0b15f1053 CMake: Stop using LLVM's custom parse_arguments. NFC
Summary:
Use CMake's cmake_parse_arguments() instead.
It's called in a slightly different way, but supports all our use cases.
It's in CMake 2.8.8, which is our minimum supported version.

CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc):
http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments

Reviewers: pcc, beanz, chapuni

Subscribers: llvm-commits

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

llvm-svn: 240121
2015-06-19 03:45:40 +00:00
Peter Collingbourne
390eab456d Silence resource compiler using /nologo flag.
llvm-svn: 239983
2015-06-18 01:15:18 +00:00
James Y Knight
a72dd36d78 Repair cmake libatomic check.
The cmake check for whether libatomic could be used had been
unconditionally setting the result to false. Which was somewhat
fortunate, because the prerequisite check for whether it was *needed*
was always claiming it was, even if it was not.

However, this made platforms where libatomic is actually necessary
fail to link.

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

llvm-svn: 239819
2015-06-16 14:00:01 +00:00
NAKAMURA Takumi
88867efd68 [CMake] Try to fix r239612, not to miss resources/windows_version_resource.rc in clang build.
- Who defines ${LLVM_SOURCE_DIR} ?
  - Would windows_version_resource.rc be available in an *installed* llvm tree?
    I suggest it may be installed in ${PREFIX}/share.

llvm-svn: 239703
2015-06-14 21:47:29 +00:00
Greg Bedwell
46ad93c20c In MSVC builds embed a VERSIONINFO resource in our exe and DLL files.
This reinstates my commits r238740/r238741 which I reverted due to a failure
in the clang-cl selfhost tests on Windows.  I've now fixed the issue in
clang-cl that caused the failure so hopefully all should be well now.

llvm-svn: 239612
2015-06-12 15:58:29 +00:00
Peter Zotov
c1bd6359e1 [cmake] [OCaml] Make ocamldoc targets depend on output files
OCaml doc builds fail without .cmi files, and .cmi files are collected
in ocaml_outputs. Therefore, make doc targets depend on ocaml_outputs as
well.

Fixes: https://llvm.org/bugs/show_bug.cgi?id=23777

Patch by Michał Górny <mgorny@gentoo.org>

llvm-svn: 239259
2015-06-07 19:22:22 +00:00
Greg Bedwell
694d2315ee [CMake] Revert commits r238740/r238741 for embedding Windows version info.
The clang Windows bots are showing mysterious failures.
Reverting until I can figure out what's going on.

llvm-svn: 238744
2015-06-01 13:40:14 +00:00
Greg Bedwell
9e79c1bce3 remove the use of the LOCATION CMake variable from r238740.
It caused the following failure:
"Policy CMP0026 is not set: Disallow use of the LOCATION target property."

llvm-svn: 238741
2015-06-01 13:06:10 +00:00
Greg Bedwell
6bfe85af79 In MSVC builds embed a VERSIONINFO resource in our exe and DLL files.
This embeds Windows version information into our executables and DLLs.
The most visible place to view this data is in the details tab of the file
properties window in Windows explorer.

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

llvm-svn: 238740
2015-06-01 12:41:55 +00:00
Chris Bieneman
0f8139f9c6 [CMake] Bug 23468 - LLVM_OPTIMIZED_TABLEGEN does not work with Visual Studio
Summary: Multi-configuration builds put their binaries into ${CMAKE_BINARY_DIR}/Release/bin/. The table-gen cross-compilation support needs to take that into account.

Reviewers: yaron.keren

Reviewed By: yaron.keren

Subscribers: llvm-commits

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

llvm-svn: 238592
2015-05-29 18:34:41 +00:00
Reid Kleckner
7c81755db9 Try to fix the build with MSVC 2015 by disabling sized deallocation
I can't actually test this properly because uninstalling MSVC 2015 CTP 6
and reinstalling the 2015 RC takes hours. I can only verify that this
doesn't mess up MSVC 2013 and 2015 CTP 6 builds, which is what I've
done.

Should fix PR23513.

llvm-svn: 237743
2015-05-19 23:28:23 +00:00
Yaron Keren
3bde7c1cd0 Use cat and not type Under MSYS, same as Cygwin.
type means something else under the MSYS shell.

Patch by Tzafrir Poupko!

llvm-svn: 237692
2015-05-19 12:59:23 +00:00