Commit Graph

112 Commits

Author SHA1 Message Date
Stefan Granitz f8699965ec [CMake] External compiler-rt-configure requires LLVMTestingSupport when including tests
Summary:
Apparently `LLVMTestingSupport` must be built before `llvm-config` can be asked for it. Symptom with `LLVM_INCLUDE_TESTS=ON` is:
```
$ ./path/to/llvm-build/bin/llvm-config --ldflags --libs testingsupport
-L/path/to/llvm-build/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
llvm-config: error: component libraries and shared library

llvm-config: error: missing: /path/to/llvm-build/lib/libLLVMTestingSupport.a
```

With `LLVMTestingSupport` as dependency of `compiler-rt-configure` we get the expected behavior:
```
$ ./path/to/llvm-build/bin/llvm-config --ldflags --libs testingsupport
-L/path/to/llvm-build/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
-lLLVMTestingSupport -lLLVMSupport -lLLVMDemangle
```

Reviewers: ab, beanz

Subscribers: dberris, mgorny, erik.pilkington, llvm-commits, cfe-commits

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

llvm-svn: 352881
2019-02-01 15:35:25 +00:00
Evgeniy Stepanov 5794028f16 Fix check-hwasan with LLVM_BUILD_EXTERNAL_COMPILER_RT=ON
Add a forwarding target for check-hwasan in clang.

llvm-svn: 350363
2019-01-03 22:50:45 +00:00
Evgeniy Stepanov c78931003d [cmake] Fix monorepo + LLVM_BUILD_EXTERNAL_COMPILER_RT=ON.
In cmake 3.10.2, if (${VARIABLE_NAME}) seems to always be false no
matter what documentation says (or maybe I just failed at reading).

Anyway, if (VARIABLE_NAME) seems to do what this code intended.

llvm-svn: 350361
2019-01-03 22:41:10 +00:00
Ahmed Bougacha 8b597883a1 [CMake] Make bootstrap and compiler-rt depend on cxx-headers.
Since r334468, we no longer always copy the libcxx headers by virtue of
their presence when cmake runs.

This makes some of the later stages (compiler-rt, and the bootstrapped
stages) depend on them being copied, via the cxx-headers target.

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

llvm-svn: 335898
2018-06-28 18:35:25 +00:00
Shoaib Meenai 669cae1f28 [clang] Use add_llvm_install_targets
Use this function to create the install targets rather than doing so
manually, which gains us the `-stripped` install targets to perform
stripped installations.

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

llvm-svn: 319489
2017-11-30 22:35:02 +00:00
George Karpenkov cb24b14995 Allow building libFuzzer tests in two-stage compiler-rt build.
llvm-svn: 315776
2017-10-13 23:50:53 +00:00
George Karpenkov a3cd5247b3 Allow building libFuzzer in two-stage compiler-rt build
When LLVM_BUILD_EXTERNAL_COMPILER_RT option is set to true,
all of projects in compiler-rt are built with a freshly-built compiler using
a recursive CMake invocation.
(e.g. that's how compiler-rt is used in Swift)

Just now I have noticed that libFuzzer binaries were missing in such a case,
and ninja fuzzer returned "no such target", while ninja asan worked just fine.

To my surprise, the list of allowed targets was actually hardcoded in Clang!
While the current setup is clearly suboptimal, for the lack of a better fix
I'm just adding `fuzzer` to a list of `compiler-rt` targets.

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

llvm-svn: 315771
2017-10-13 22:03:09 +00:00
Zachary Turner ce92db13ea Resubmit "[lit] Force site configs to run before source-tree configs"
This is a resubmission of r313270.  It broke standalone builds of
compiler-rt because we were not correctly generating the llvm-lit
script in the standalone build directory.

The fixes incorporated here attempt to find llvm/utils/llvm-lit
from the source tree returned by llvm-config.  If present, it
will generate llvm-lit into the output directory.  Regardless,
the user can specify -DLLVM_EXTERNAL_LIT to point to a specific
lit.py on their file system.  This supports the use case of
someone installing lit via a package manager.  If it cannot find
a source tree, and -DLLVM_EXTERNAL_LIT is either unspecified or
invalid, then we print a warning that tests will not be able
to run.

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

llvm-svn: 313407
2017-09-15 22:10:46 +00:00
Zachary Turner 83dcb68468 Revert "[lit] Force site configs to run before source-tree configs"
This patch is still breaking several multi-stage compiler-rt bots.
I already know what the fix is, but I want to get the bots green
for now and then try re-applying in the morning.

llvm-svn: 313335
2017-09-15 02:56:40 +00:00
Zachary Turner a7049bd48c Fix 2 stage build on some apple bots.
The recent lit refactor changed the location of the lit script
run by check targets from <source>/utils/lit/lit.py to
<bin>/llvm-lit.py.  In some 2-stage build scenarios, the location
of <bin> was not properly passed through to the second stage,
and it was looking for /llvm-lit.py instead, causing failures.

Fix suggested by Mike Edwards and Chris Bieneman @apple

llvm-svn: 313300
2017-09-14 21:30:27 +00:00
Evgeniy Stepanov 6bbe39c3e0 Enable check-ubsan-minimal in standalone compiler-rt build.
llvm-svn: 312361
2017-09-01 20:37:20 +00:00
Kuba Mracek 0c7c687b5b [sanitizer] Passthrough CMAKE_OSX_DEPLOYMENT_TARGET and CMAKE_OSX_SYSROOT when building compiler-rt from clang/runtime/CMakeLists.txt
Differential Revision: https://reviews.llvm.org/D26558

llvm-svn: 289890
2016-12-15 23:20:54 +00:00
Kuba Brecka d71de87be7 [sanitizer] Passthrough CMAKE_OSX_DEPLOYMENT_TARGET when building compiler-rt from clang/runtime/CMakeLists.txt
This breaks some Swift builds, because Swift's build scripts explicitly set CMAKE_OSX_DEPLOYMENT_TARGET. This however isn't propagated to the compiler-rt build, causing build errors.

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

llvm-svn: 286898
2016-11-14 22:38:57 +00:00
Chris Bieneman 3b1a4ee7b1 [CMake] Properly connecting Compiler-RT check and test-depends
This correctly connects compiler-rt-test-depends to test-depends and
check-compiler-rt to check-all.

Based on LLVM r280392, and Compiler-RT r280393.

llvm-svn: 280394
2016-09-01 18:28:49 +00:00
Chris Bieneman 91c66275e9 [CMake] Adding USES_TERMINAL to a few additional custom targets
These are all long-running commands that should be in the ninja console job pool.

llvm-svn: 274056
2016-06-28 20:30:52 +00:00
Chris Bieneman ce45e39c24 [CMake] Connect check-compiler-rt to check-all
When using the LLVM_BUILD_EXTERNAL_COMPILER_RT option with
LLVM_ENABLE_TESTS we should also bind check-compiler-rt to check-all so
that the compiler-rt tests run too.

llvm-svn: 274045
2016-06-28 18:32:22 +00:00
Chris Bieneman dd0f09b31d [CMake] Pass LLVM_LIT_ARGS into compiler-rt build.
If top-level lit args are specified, you probably want that in the sub-project too.

llvm-svn: 274035
2016-06-28 17:00:49 +00:00
Chris Bieneman f325b8c71b [CMake] Cleaning up CMake version checks in ExternalProject calls
Now that we're on CMake 3.4.3 all the ExternalProject features we use are supported everywhere, so we don't need the version checks anymore.

llvm-svn: 272324
2016-06-09 22:38:42 +00:00
Chris Bieneman 98102e7447 [CMake] Cleanup uses of USES_TERMINAL
Now that we are on CMake 3.4.3 we no longer need a version check around this.

This is the clang side of r272211.

llvm-svn: 272213
2016-06-08 22:20:43 +00:00
Chris Bieneman 47033ca521 [CMake] Fixing a typo in a CMake option
CMake defines are set with -D, forgetting the D doesn’t work.

llvm-svn: 271937
2016-06-06 20:18:38 +00:00
Chris Bieneman 129fba7fb6 [CMake] Pass LLVM_LIBDIR_SUFFIX into Compiler-RT
Not passing this causes Compiler-RT to fail to configure on multi-lib systems.

llvm-svn: 269069
2016-05-10 16:10:22 +00:00
Peter Collingbourne 3afb266886 Re-apply r267784, r267824 and r267830.
I have updated the compiler-rt tests.

llvm-svn: 267903
2016-04-28 17:09:37 +00:00
Benjamin Kramer 5556a5cf3b Revert r267784, r267824 and r267830.
It makes compiler-rt tests fail if the gold plugin is enabled.

Revert "Rework interface for bitset-using features to use a notion of LTO visibility."
Revert "Driver: only produce CFI -fvisibility= error when compiling."
Revert "clang/test/CodeGenCXX/cfi-blacklist.cpp: Exclude ms targets. They would be non-cfi."

llvm-svn: 267871
2016-04-28 12:14:47 +00:00
Peter Collingbourne a8b2f7c0d7 Rework interface for bitset-using features to use a notion of LTO visibility.
Bitsets, and the compiler features they rely on (vtable opt, CFI),
only have visibility within the LTO'd part of the linkage unit. Therefore,
only enable these features for classes with hidden LTO visibility. This
notion is based on object file visibility or (on Windows)
dllimport/dllexport attributes.

We provide the [[clang::lto_visibility_public]] attribute to override the
compiler's LTO visibility inference in cases where the class is defined
in the non-LTO'd part of the linkage unit, or where the ABI supports
calling classes derived from abstract base classes with hidden visibility
in other linkage units (e.g. COM on Windows).

If the cross-DSO CFI mode is enabled, bitset checks are emitted even for
classes with public LTO visibility, as that mode uses a separate mechanism
to cause bitsets to be exported.

This mechanism replaces the whole-program-vtables blacklist, so remove the
-fwhole-program-vtables-blacklist flag.

Because __declspec(uuid()) now implies [[clang::lto_visibility_public]], the
support for the special attr:uuid blacklist entry is removed.

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

llvm-svn: 267784
2016-04-27 20:39:53 +00:00
Aaron Ballman 2db2677878 Moving clang-test-depends into the Clang tests folder and moving vtables_blacklist into the Misc folder; NFC, this simply cleans up the generated solution so that these targets don't live in the root folder of the IDE.
llvm-svn: 266079
2016-04-12 15:09:17 +00:00
Filipe Cabecinhas 08830c705e [cmake] Add a few more compiler-rt check-* targets for EXTERNAL_COMPILER_RT
llvm-svn: 262341
2016-03-01 15:33:52 +00:00
Filipe Cabecinhas e5bee80802 [cmake] Try to appease the buildbots.
llvm-svn: 262340
2016-03-01 15:07:19 +00:00
Filipe Cabecinhas 2cc9d4795f [cmake] Pass through the cmake_3_2_USES_TERMINAL variable so we get progress bars on an external compiler-rt build
llvm-svn: 262336
2016-03-01 14:10:38 +00:00
Filipe Cabecinhas a3c4f2f479 [cmake] Use CMake's USES_TERMINAL for the test targets.
llvm-svn: 262335
2016-03-01 14:08:18 +00:00
Filipe Cabecinhas 03ca68d6a6 [cmake] Fallback to LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR if COMPILER_RT_SRC_ROOT doesn't exist.
llvm-svn: 262334
2016-03-01 14:08:13 +00:00
Peter Collingbourne 2a610381bc Make vtables_blacklist dependency conditional on existence of clang target.
llvm-svn: 261960
2016-02-26 03:07:33 +00:00
Peter Collingbourne fb532b9a34 Add whole-program vtable optimization feature to Clang.
This patch introduces the -fwhole-program-vtables flag, which enables the
whole-program vtable optimization feature (D16795) in Clang.

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

llvm-svn: 261767
2016-02-24 20:46:36 +00:00
Chris Bieneman 2bf68c6c1c 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

    "This is the way [autoconf] ends
    Not with a bang but a whimper."
    -T.S. Eliot

Reviewers: chandlerc, grosbach, bob.wilson, echristo

Subscribers: klimek, cfe-commits

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

llvm-svn: 258862
2016-01-26 21:30:40 +00:00
Chris Bieneman 77c5e78e71 [CMake] ExternalProject for compiler-rt needs to depend on llvm-config and clang
The add_dependencies call on compiler-rt-configure adds llvm-config and clang to the phony target, but not to the actual configure custom command. We need the dependency bound to the custom command so that it can't be re-ordered by Ninja.

llvm-svn: 255798
2015-12-16 18:42:14 +00:00
Chris Bieneman 3d9f89f04f [CMake] Pass CMAKE_MAKE_PROGRAM through to compiler-rt build.
This is needed if your make tool is overridden.

llvm-svn: 255172
2015-12-09 22:46:25 +00:00
Alexey Samsonov af89de9d66 Add llvm-objdump to compiler-rt test deps.
llvm-svn: 254961
2015-12-07 22:45:36 +00:00
Chris Bieneman 865c4ee9cb [CMake] Removing an unnecessary layer of variable indirection
This prevents passthrough variables from having values.

llvm-svn: 254642
2015-12-03 19:47:25 +00:00
Chris Bieneman ae88ac200d NFC. Fixing my consistently incorrect spelling.
llvm-svn: 253937
2015-11-23 23:34:13 +00:00
Chris Bieneman 5b390b53c6 [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: 253720
2015-11-20 22:09:03 +00:00
Chris Bieneman 74d20e4853 [CMake] Fixing passthrough for variables starting with COMPILER_RT
This allows COMPILER_RT_* variables to be passed from the top-level CMake into the external project when LLVM_BUILD_EXTERNAL_COMPILER_RT=On.

llvm-svn: 252809
2015-11-11 21:53:08 +00:00
Tim Northover 33e3ed17da Revert "Support watchOS and tvOS in compiler-rt builds"
The required compiler-rt changes aren't present yet so attempting to
build with compiler-rt breaks. And since we're trying to deprecate
autotools we actually want to fix this in CMake primarily anyway.

This reverts r251712.

llvm-svn: 251953
2015-11-03 18:14:42 +00:00
Tim Northover 15fb74beb4 Support watchOS and tvOS in compiler-rt builds
Hopefully autotools will be deprecated soon and this entire file can go away,
but until then...

llvm-svn: 251712
2015-10-30 16:30:51 +00:00
Chris Bieneman 38b2dec37e [CMake] Make external compiler-rt install scripts relative to CMAKE_INSTALL_PREFIX.
This change makes LLVM_BUILD_EXTERNAL_COMPILER_RT work correctly when overriding CMAKE_INSTALL_PREFIX on the install action (which is how LLVM_CREATE_XCODE_TOOLCHAIN works).

This fix is two parts:
(1) Pass CMAKE_INSTALL_PREFIX in as a variable from the parent install to the child install
(2) When passing COMPILER_RT_INSTALL_PATH into the external project make sure it is passed as a string not a path.

Not specifying the full path for COMPILER_RT_INSTALL_PATH isn't enough to fix the issue because relative paths specified on the CMake command line are expanded relative to the working directory before the cache is populated. Forcing this to a string allows it to remain a relative path through to the install() calls. Relative paths specified in install() calls are expanded relative to CMAKE_INSTALL_PREFIX at install time.

llvm-svn: 250834
2015-10-20 16:39:25 +00:00
Chris Bieneman 4977f4261e [CMake] When building clang as an external project we should pass through all variables that start with COMPILER_RT
llvm-svn: 250196
2015-10-13 18:17:30 +00:00
Chris Bieneman a1566a414a [CMake] Bug 14109 - CMake build for compiler-rt should use just-built clang
Summary:
Many small improvements to LLVM_BUILD_EXTERNAL_COMPILER_RT.

* Works correctly with Ninja by working around CMake Bug 14771 (https://cmake.org/Bug/view.php?id=14771)
* Has install-compiler-rt target, and installs as part of the default install target
* Sets the install paths properly so that it matches the non-standalone build
* Only generate the test targets if(LLVM_INCLUDE_TESTS)

Reviewers: samsonov, Bigcheese

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

llvm-svn: 250064
2015-10-12 16:34:23 +00:00
Keno Fischer 75fada0211 Fix makefile build on OSX when ARM targets are not enabled
Summary: When LLVM/Clang is built without ARM support, the ios_kext runtime
library is not built, but without this patch, the Makefile still tries to
copy it. This is a recent regression, because the ios_kext library used
to also be built on x86_64.

Reviewers: beanz

Subscribers: aemerson, cfe-commits, rengolin

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

llvm-svn: 249281
2015-10-04 18:51:04 +00:00
Chris Bieneman 25bc0debf3 [darwin] [builtins] Stop generating cc_kext_ios5 and move iOS architectures out of cc_kext into cc_kext_ios
Summary:
This corresponds to a patch to compiler-rt (D13112).

Xcode 7 doesn't support targeting iOS5 and earlier. Instead of just dropping cc_kext_ios5, I've repurposed it to cc_kext_ios, and I'm pulling the iOS architectures out of cc_kext. Putting OS X and iOS slices inside the same archive was just odd.

Reviewers: bogner, bob.wilson

Subscribers: cfe-commits

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

llvm-svn: 248442
2015-09-23 22:52:35 +00:00
Alexey Samsonov 498f3c3416 [UBSan] Use shared library for UBSan on OS X (Clang part).
Summary:
UBSan is now used in the same way as ASan, and is supported on
OSX and on iOS simulator. At the moment ASan and UBSan can't be used
together due to PR21112, but I hope to resolve it soon by
embedding UBSan into ASan.

Test Plan: regression test suite.

Reviewers: zaks.anna, kubabrecka

Subscribers: cfe-commits

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

llvm-svn: 233035
2015-03-23 23:14:05 +00:00
Alexey Samsonov f29e3f0791 Remove support for building sanitizers from Makefile/autoconf build on Linux.
This is a re-application of r229554 restricted to Linux build only.
Apple still uses Makefile/autoconf to build Clang and sanitizers.

llvm-svn: 229755
2015-02-18 22:26:22 +00:00
Matthias Braun 44bf1c9c53 Revert "Remove support for building sanitizers from Makefile/autoconf build."
This reverts commit r229554.

Reverting this commit for now as several apple internal builds still
rely on this functionality.

llvm-svn: 229582
2015-02-17 23:27:37 +00:00