llvm-project/llvm
Vlad Tsyrklevich 4dc1c9735b Statically link llvm-cfi-verify's libraries.
Summary:
llvm-cfi-verify (D38379) introduced a potential build failure when compiling with `-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON`. Specific versions of cmake seem to treat the `add_subdirectory()` rule differently. It seems as if old versions of cmake BFS these rules, adding them to the fringe for expansion later. Newer versions of cmake seem to immediately execute CMakeFiles that are present in this subdirectory.

If the subdirectory is expanded through the fringe, the globbing resultant from `llvm_add_implicit_projects()` from `cmake/modules/AddLLVM.cmake:1012` means that `tools/llvm-shlib/CMakeFile.txt` gets executed before `tools/llvm-cfi-verify/lib/CMakeFile.txt`. As the latter CMakeFile adds a new library, this expansion order means that the library files required the unit tests in `unittests/tools/llvm-cfi-verify/` are not present in the dynamic library. This causes unit tests to fail as the required functions can't be found.

This change now ensures that the libraries created by `llvm-cfi-verify` are statically linked into the unit tests. As `tools/llvm-cfi-verify/lib` no longer adds anything to `llvm-shlib`, there should be no concern about the order-of-compilation.

Reviewers: skatkov, pcc

Reviewed By: skatkov, pcc

Subscribers: llvm-commits, kcc, pcc, aheejin, vlad.tsyrklevich, mgorny

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

llvm-svn: 316059
2017-10-18 04:27:53 +00:00
..
bindings Reverting r315590; it did not include changes for llvm-tblgen, which is causing link errors for several people. 2017-10-15 14:32:27 +00:00
cmake Revert "[cmake] Use find_package to discover zlib" 2017-10-17 20:51:25 +00:00
docs Add !callees metadata 2017-10-16 22:22:11 +00:00
examples Fix broken links to the Itanium CXX ABI 2017-09-12 00:19:11 +00:00
include [ScalarEvolution] Handling for ICmp occuring in the evolution chain. 2017-10-18 01:36:16 +00:00
lib [ScalarEvolution] Handling for ICmp occuring in the evolution chain. 2017-10-18 01:36:16 +00:00
projects
resources
runtimes [CMake][runtimes] Use the same configuration for non-target and "default" target 2017-09-08 22:26:50 +00:00
test [ScalarEvolution] Handling for ICmp occuring in the evolution chain. 2017-10-18 01:36:16 +00:00
tools Statically link llvm-cfi-verify's libraries. 2017-10-18 04:27:53 +00:00
unittests Statically link llvm-cfi-verify's libraries. 2017-10-18 04:27:53 +00:00
utils Add a utility to update MIR checks, similar to update_llc_test_checks 2017-10-18 02:20:31 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt cmake: BSD: Mark /usr/local/include as system include directory 2017-10-16 23:03:21 +00:00
CODE_OWNERS.TXT
CREDITS.TXT Add myself to CREDITS.txt 2017-09-18 14:33:39 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.