Commit Graph

234 Commits

Author SHA1 Message Date
Kuba Brecka ab61c74f93 [compiler-rt] Exclude compiler-rt from using -fmodules when LLVM_ENABLE_MODULES=On
Sanitizers are intentionally not including system headers and often declare slightly different function prototypes, which is incompatible with -fmodules and -fcxx-modules. Let’s simply exclude compiler-rt from using -fmodules.

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

llvm-svn: 283658
2016-10-08 09:01:27 +00:00
Vedant Kumar cb7110be27 [ubsan] Turn on 'Has CXXABI' to enable support for -fsanitize=vptr on Darwin
Differential Revision: https://reviews.llvm.org/D24990

llvm-svn: 283466
2016-10-06 16:45:40 +00:00
Francis Ricci 0b6f487c63 [compiler-rt] Don't use -fPIC when building for Windows
Summary: This flag doesn't make sense on Windows systems.

Reviewers: beanz, kubabrecka, compnerd

Subscribers: dberris, llvm-commits, beanz

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

llvm-svn: 280953
2016-09-08 15:57:22 +00:00
Francis Ricci 9cf5e4fc00 [compiler-rt] Make cxxabi availability configurable in cmake
Summary:
Allow for use of cxxabi to be disabled from cmake.

This will make sanitizers usable when c++ abi is unavailable.

Reviewers: pcc, rnk, samsonov, beanz, compnerd

Subscribers: llvm-commits, compnerd, dberris

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

llvm-svn: 279451
2016-08-22 18:31:37 +00:00
Jonas Hahnfeld ddbab7d982 [CMake] Fix ASM building in llvm/runtimes
When compiler-rt's CMake is not directly invoked, it will currently not call
project() and thus ASM will not be enabled.
We also don't need to put the .S files through the C compiler then.

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

llvm-svn: 279215
2016-08-19 06:46:00 +00:00
Francis Ricci 39bc97a1ec Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
This reverts commit dbb6e905684e2e9488887b26c02ee8881849f09f.

llvm-svn: 278852
2016-08-16 20:52:22 +00:00
Francis Ricci 6802eb0868 [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.

Reviewers: samsonov, beanz, pcc, rnk

Subscribers: llvm-commits, kubabrecka, compnerd, dberris

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

llvm-svn: 278848
2016-08-16 20:39:10 +00:00
Francis Ricci 3d6aa8a475 Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
This reverts commit cd5fa595648378f38cdad8b07e18433639c28a9c.

llvm-svn: 278800
2016-08-16 13:58:56 +00:00
Francis Ricci fda072de97 [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.

    Reviewers: samsonov, beanz, pcc, rnk

    Subscribers: llvm-commits, kubabrecka, compnerd, dberris

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

llvm-svn: 278772
2016-08-16 02:15:51 +00:00
Francis Ricci 1185b4ae8d Revert "[compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration"
This reverts commit 9528d86531b1289600e18c407b8e992d7fedb94f.

llvm-svn: 278769
2016-08-16 01:11:07 +00:00
Francis Ricci 13a5a9d7f1 [compiler-rt] Allow c++ abi to be explictly disabled in cmake configuration
Summary: This will allow for the sanitizers to be used when c++ abi is unavailable.

Reviewers: samsonov, beanz, pcc, rnk

Subscribers: llvm-commits, kubabrecka, compnerd, dberris

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

llvm-svn: 278764
2016-08-16 00:16:47 +00:00
Dean Michael Berris 6af0a6bcfe [compiler-rt][XRay] Default COMPILER_RT_BUILD_XRAY to ON
llvm-svn: 277975
2016-08-08 03:58:57 +00:00
Jonas Hahnfeld 8ad6cc1c26 Revert "[CMake] Pass -nostdlib if supported"
This reverts commit r277419.

llvm-svn: 277420
2016-08-02 06:01:05 +00:00
Jonas Hahnfeld 55933dfb32 [CMake] Pass -nostdlib if supported
The sanitizers use C++ but don't require linking with the library.

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

llvm-svn: 277419
2016-08-02 05:51:09 +00:00
Jonas Hahnfeld 9b2c3ab620 [CMake] Load LLVMConfig for standalone build of builtins
Therefore move some code into reusable macros.

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

llvm-svn: 277418
2016-08-02 05:51:05 +00:00
Reid Kleckner 1734b97901 [winasan] Try to fix LNK4099 warnings seen by users
/Zi creates a separate PDB that we're supposed to pass along with our
sanitizer libraries, but the object library compilation rules aren't set
up to handle that. Rather than set that up, put the debug info in the
object files the way every other platform does it with /Z7.

llvm-svn: 277406
2016-08-02 01:02:46 +00:00
Dean Michael Berris 7094aa4f8d Revert "Default COMPILER_RT_BUILD_XRAY=ON"
This reverts commit 23240d8de38c79220a888f645a1f4b686bfb87c6.

Broke the build because the build bots haven't gotten the latest config
from zorg yet.

llvm-svn: 276847
2016-07-27 08:10:04 +00:00
Dean Michael Berris d3aaa77ff9 Default COMPILER_RT_BUILD_XRAY=ON
llvm-svn: 276845
2016-07-27 07:27:35 +00:00
Reid Kleckner f6d5475e20 Disable thread safe statics in clang-cl, they call the CRT
Also remove the needless static that was using them.

llvm-svn: 276327
2016-07-21 20:03:37 +00:00
Dean Michael Berris f9d9077c84 Default XRay building to OFF to let build bots that do not support building sanitizers to disable explicitly too
llvm-svn: 276255
2016-07-21 08:53:31 +00:00
Dean Michael Berris 938c5031ab [compiler-rt][XRay] re-submitting r276117, with fixes for build breakage due to extraneous and missing dependencies and attempts to build on unsupported OSes
Summary:
This is a fixed-up version of D21612, to address failure identified post-commit.

Original commit description:

This patch implements the initialisation and patching routines for the XRay runtime, along with the necessary trampolines for function entry/exit handling. For now we only define the basic hooks for allowing an implementation to define a handler that gets run on function entry/exit. We expose a minimal API for controlling the behaviour of the runtime (patching, cleanup, and setting the handler to invoke when instrumenting).

Fixes include:
- Gating XRay build to only Linux x86_64 and with the right dependencies in case it is the only library being built
- Including <cstddef> to fix std::size_t issue

Reviewers: kcc, rnk, echristo

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 276251
2016-07-21 07:39:55 +00:00
Reid Kleckner 8367634c7a [xray] Only build xray on Linux for now
Should fix the Windows buildbots, and maybe some other non-Linux Unix
bots too.

XRay currently depends on sanitizer_common, so associate it with the
"build sanitizers" option and remove the option for separately
controlling the XRay build.

llvm-svn: 276124
2016-07-20 14:58:07 +00:00
Dean Michael Berris e1c81d10d7 [compiler-rt] [XRay] Basic initialization and flag definition for XRay runtime
Summary:
This patch implements the initialisation and patching routines for the XRay runtime, along with the necessary trampolines for function entry/exit handling. For now we only define the basic hooks for allowing an implementation to define a handler that gets run on function entry/exit. We expose a minimal API for controlling the behaviour of the runtime (patching, cleanup, and setting the handler to invoke when instrumenting).

Depends on D19904

Reviewers: echristo, kcc, rnk

Subscribers: rnk, mehdi_amini, llvm-commits

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

llvm-svn: 276117
2016-07-20 14:14:50 +00:00
Chris Bieneman 990ff38786 [CMake] Check for androidabi in CMakeLists.txt not base-config-ix.cmake
COMPILER_RT_DEFAULT_TARGET_ABI is not set in base-config-ix.cmake, so we need to move this check into CMakeLists.txt.

llvm-svn: 273957
2016-06-27 22:52:05 +00:00
Chris Bieneman 90b46fba3d Revert "Parse the triple in base-config-ix to propagate ANDROID variable correctly"
This reverts commit r273914.

This commit broke bots building compiler-rt using LLVM_BUILD_EXTERNAL_COMPILER_RT. See:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/22221/console

llvm-svn: 273956
2016-06-27 22:52:03 +00:00
Sumanth Gundapaneni f0fa61ffcf Parse the triple in base-config-ix to propagate ANDROID variable correctly
The triple must be parsed in base-config-ix.cmake.
Otherwise, the cmake variable ANDROID won't be set and this
will confuse cmake to build unsupported targets targeted for
android.

Diferential revision: http://reviews.llvm.org/D21474

llvm-svn: 273914
2016-06-27 19:46:50 +00:00
Chris Bieneman 8a99ecd01c [CMake] NFC. An unset variable evaluates to false, so this else is unneeded
This change is mostly to enable me to do some experimentation with building runtime libraries (See: D20992). It is harmless because unset variables evaluate to false in conditional expressions.

llvm-svn: 273320
2016-06-21 21:28:40 +00:00
Reid Kleckner 44e6e36299 Turn off -Wunused-parameter when building compiler-rt with clang on Windows, it is very noisy
It is turned on as part of "clang-cl /W4", which enables -Wextra.

llvm-svn: 273028
2016-06-17 18:30:37 +00:00
Reid Kleckner d0680ad717 Fix some warnings in the MSVC build
- Fixes warnings about the ignored -fms-compatibility-version flag.
- Fixes warnings about overriding /W4 with /W3 and back.
- Fixes a warning where PREFETCH() expanded to nothing in a braceless if
  block.

llvm-svn: 273021
2016-06-17 17:48:52 +00:00
Chris Bieneman bae0eeaf2e [CMake] Cleanup CMake version checking for 2.8.12
Now that we're on CMake 3.4.3 this stuff isn't needed anymore.

The cmake_2_8_12_* variables were unused in Compiler-RT, and the policies being set to NEW are all NEW by default now.

llvm-svn: 272313
2016-06-09 21:32:17 +00:00
Xinliang David Li 2baff11d05 Fix build failure with cmake version bump
llvm-svn: 271582
2016-06-02 20:33:33 +00:00
Chris Bieneman 5c3112cebe [CMake] Update to requiring CMake 3.4.3
Summary:
This is as per the discussions on developer lists:

http://lists.llvm.org/pipermail/llvm-dev/2016-April/098780.html
http://lists.llvm.org/pipermail/llvm-dev/2016-May/100058.html

Subscribers: llvm-commits

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

llvm-svn: 271327
2016-05-31 20:21:42 +00:00
Kuba Brecka 83460cfe74 [sanitizer] Don't use -fomit-frame-pointer in COMPILER_RT_DEBUG=On builds
Using -fomit-frame-pointer sometimes makes a crash log miss some frames. Let's not use this optimization in debug builds.

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

llvm-svn: 270376
2016-05-22 19:59:06 +00:00
Chris Bieneman c49e5e336b [CMake] Support platform building builtins without a full toolchain
Summary:
This patch adds support for building lib/builtins without a fully functioning toolchain. It allows you to bootstrap a cross-compiler, which previously couldn't be done with CMake.

This patch contains the following specific changes:

* Split builtin-specific code out of config-ix.cmake into builtin-config-ix.cmake
* Split some common CMake functionality needed by both builtins and sanitizers into base-config-ix.cmake
* Made lib/builtins/CMakeLists.txt able to be a top-level CMake configuration

I have tested this on Darwin targeting embedded Darwin, and on FreeBSD x86_64 targeting FreeBSD AArch64.

This patch depends on http://reviews.llvm.org/D19692, and is the last part of http://reviews.llvm.org/D16653.

Reviewers: samsonov, iains, jroelofs

Subscribers: compnerd, aemerson, tberghammer, danalbert, srhines, emaste, llvm-commits

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

llvm-svn: 268977
2016-05-09 21:45:52 +00:00
Reid Kleckner 21aca4897d [asan] Disable thread-safe static initilization with VS 2015
ASan interceptors contain local statics which run before the CRT is
initialized. Thread-safe statics appear to rely on CRT-internal state,
and will crash without this flag.

llvm-svn: 263979
2016-03-21 20:08:59 +00:00
Chris Bieneman e8c7d77955 [CMake] Fix a really simple, silly bug from r261797
This should fix bots with CMake older than 2.8.12.

llvm-svn: 261801
2016-02-24 22:42:47 +00:00
Chris Bieneman 956eceae9f [CMake] Default CMAKE_MACOSX_RPATH to On, this is the default with CMP0042
Summary: Building the sanitizer libraries without rpaths causes all sorts of problems when you try to use them. This simple fix should make it all work.

Reviewers: samsonov, zaks.anna

Subscribers: llvm-commits

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

llvm-svn: 261797
2016-02-24 22:29:42 +00:00
Andrey Turetskiy bc0122bca9 [CMake] Add partial support for MSVC in compiler-rt builtins, by Roman Shirokiy.
This enables MSVC build of complex number arithmetic compiler-rt builtins.

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

llvm-svn: 261432
2016-02-20 12:56:04 +00:00
Niels Ole Salscheider c656363533 Fix the libdir suffix for LLVM_CMAKE_PATH
llvm-svn: 259841
2016-02-04 23:15:29 +00:00
Niels Ole Salscheider bd2515461a Fix the search path for CMake files
This fixes the build after moving LLVM's CMake files in r259821.

llvm-svn: 259832
2016-02-04 21:45:02 +00:00
Daniel Sanders 440b8610e6 [compiler-rt] add_custom_libcxx should pass LLVM_PATH and a C++ compiler
Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 259493
2016-02-02 12:55:28 +00:00
Reid Kleckner b3e847ebac [ubsan] Stop thinking we can rely on C++ ABI knowledge on Windows
We already disabled various tests relying on C++ ABI knowledge, but we
still tried to build in this configuration on Windows which was a
mistake.

Fixes PR26415.

llvm-svn: 259388
2016-02-01 19:13:28 +00:00
Chris Bieneman 69a372dc50 [CMake] Support externalizing debug info on Darwin
* Adds COMPILER_RT_EXTERNALIZE_DEBUGINFO option
* On Darwin this results in calling dsymutil and strip after linking
* This generates an error on non-darwin platforms, matching the LLVM behavior

llvm-svn: 254643
2015-12-03 20:08:22 +00:00
Chris Bieneman 9586a38870 [CMake] Moving -fvisibility-inlines-hidden append as per post-commit review
Thanks Alexey.

llvm-svn: 254316
2015-11-30 19:16:42 +00:00
Chris Bieneman 679ab85a7c [CMake] Add options to control building sanitizers and builtins.
There are situations where a user may want to build only the compiler-rt builtins, or only the sanitizer runtimes. This exposes options to do that. Both default to On, so there should be no implicit change in behavior.

llvm-svn: 247607
2015-09-14 19:59:24 +00:00
Chris Bieneman fb92d9a249 [CMake] If COMPILER_RT_INCLUDE_TESTS is off we shouldn't include the root test directory.
llvm-svn: 247606
2015-09-14 19:54:12 +00:00
Alexey Samsonov 63eaeca7d0 [CMake] Remove all uses of LLVM_NATIVE_ARCH.
Instead, assume we're going to target triple specified by
COMPILER_RT_DEFAULT_TARGET_TRIPLE and build runtimes for this triple
(and hope that the host compiler can target them).

This will help users that use cross-compiler on their host to build
Clang that would work on a different architecture. This will also come in
handy if one would want to configure several compiler-rt build trees on
the same host, using just-built Clang that can target many
architectures.

This doesn't change the behavior in the default build configuration.

llvm-svn: 247099
2015-09-08 23:13:47 +00:00
Alexey Samsonov 0d0200d727 [CMake] Rename COMPILER_RT_TEST_TARGET_TRIPLE to more appropriate COMPILER_RT_DEFAULT_TARGET_TRIPLE.
llvm-svn: 247094
2015-09-08 22:48:35 +00:00
Chris Bieneman 361231ecd5 [CMake] Add experimental support for building compiler-rt for iOS
Summary:
This is a reunification of three separate reviews D11073, D11082, D11083.

Having them separate was not constructive even though the patches were smaller because it led to fragmented conversations, and this is really all about one change.

This patch incorporates feedback from samsonov, and refactors the hacky darwin code out of the root CMakeLists.txt and int config-ix.cmake.

Reviewers: zaks.anna, bogner, kubabrecka, chandlerc, samsonov

Subscribers: jevinskie, filcab, llvm-commits

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

llvm-svn: 244948
2015-08-13 20:38:16 +00:00
Chris Bieneman ba325eaa4c NFC. Fixing a red squiggly line in my editor.
llvm-svn: 244699
2015-08-11 23:31:43 +00:00