Age | Commit message (Collapse) | Author |
|
Disable tests requiring sunrpc when the relevant headers are missing.
In order to accommodate that, move the header check
from sanitizer_common to base-config-ix, and define the check result
as a global variable there. Use it afterwards both for definition
needed by sanitizer_common, and to control 'sunrpc' test feature.
While at it, remove the append_have_file_definition macro that was used
only once, and no longer fits the split check-definition.
Bug report: https://github.com/google/sanitizers/issues/974
Differential Revision: https://reviews.llvm.org/D47819
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351109 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
of writing to stdout.
This makes the script a little more gn friendly; gn does not support
redirecting the output of a script.
Differential Revision: https://reviews.llvm.org/D56579
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350980 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Add a code to properly test for presence of LLVMTestingSupport library
when performing a stand-alone build, and skip tests requiring it when
it is not present. Since the library is not installed, llvm-config
reported empty --libs for it and the tests failed to link with undefined
references. Skipping the two fdr_* test files is better than failing to
build, and should be good enough until we find a better solution.
NB: both installing LLVMTestingSupport and building it automatically
from within compiler-rt sources are non-trivial. The former due to
dependency on gtest, the latter due to tight integration with LLVM
source tree.
Differential Revision: https://reviews.llvm.org/D55891
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@349899 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This fixes building sanitizers for mingw natively.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@347646 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
When building for default target only, use exact target spelling
when deriving the name for the per-target runtime directory. This
is necessary for AArch32 where the CMake build by default rewrites
the architecture which leads to unexpected results.
Differential Revision: https://reviews.llvm.org/D54612
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@347022 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This is needed when cross-compiling for a different target since
CFLAGS may contain additional flags like -resource-dir which
change the location in which compiler-rt builtins are found.
Differential Revision: https://reviews.llvm.org/D54371
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346820 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This may be needed when cross-compiling to certain platforms.
Differential Revision: https://reviews.llvm.org/D54027
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346063 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
When building the custom libc++ that's used by libFuzzer as well as
MSan and TSan tests, passthrough the C and C++ flags that were passed
to the compiler-rt CMake build. These may be needed to successfuly
compile the library on a particular platform.
Differential Revision: https://reviews.llvm.org/D53862
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345788 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Also remove -Wno-undefined-inline, which needed to work around PR19898,
which was fixed.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345677 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
C++ flags should not be used for not-C++ files as it may trigger
-Werror=unused-command-line-argument. CMake will use CMAKE_C_FLAGS,
CMAKE_CXX_FLAGS, and CMAKE_ASM_FLAGS as appropriate implicitly, so
this does not need to be explicitly handled here.
This change depends on https://reviews.llvm.org/D53301, since one of
the builders depended on this behavior because it was not configuring
CMAKE_ASM_FLAGS.
Reviewers: eugenis, vitalybuka
Reviewed By: eugenis, vitalybuka
Subscribers: dberris, mgorny, delcypher, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D53335
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@344751 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
This change spans both LLVM and compiler-rt, where we do the following:
- Add XRay to the LLVMBuild system, to allow for distributing the XRay
trace loading library along with the LLVM distributions.
- Use `llvm-config` better in the compiler-rt XRay implementation, to
depend on the potentially already-distributed LLVM XRay library.
While this is tested with the standalone compiler-rt build, it does
require that the LLVMXRay library (and LLVMSupport as well) are
available during the build. In case the static libraries are available,
the unit tests will build and work fine. We're still having issues with
attempting to use a shared library version of the LLVMXRay library since
the shared library might not be accessible from the standard shared
library lookup paths.
The larger change here is the inclusion of the LLVMXRay library in the
distribution, which allows for building tools around the XRay traces and
profiles that the XRay runtime already generates.
Reviewers: echristo, beanz
Subscribers: mgorny, hiraditya, mboerger, llvm-commits
Differential Revision: https://reviews.llvm.org/D52349
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@342859 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
This change introduces an `FDRLogWriter` type which is responsible for
serialising metadata and function records to character buffers. This is
the first step in a refactoring of the implementation of the FDR runtime
to allow for more granular testing of the individual components of the
implementation.
The main contribution of this change is a means of hiding the details of
how specific records are written to a buffer, and for managing the
extents of these buffers. We make use of C++ features (templates and
some metaprogramming) to reduce repetition in the act of writing out
specific kinds of records to the buffer.
In this process, we make a number of changes across both LLVM and
compiler-rt to allow us to use the `Trace` abstraction defined in the
LLVM project in the testing of the runtime implementation. This gives us
a closer end-to-end test which version-locks the runtime implementation
with the loading implementation in LLVM.
We also allow using gmock in compiler-rt unit tests, by adding the
requisite definitions in the `AddCompilerRT.cmake` module. We also add
the terminfo library detection along with inclusion of the appropriate
compiler flags for header include lookup.
Finally, we've gone ahead and updated the FDR logging implementation to
use the FDRLogWriter for the lowest-level record-writing details.
Following patches will isolate the state machine transitions which
manage the set-up and tear-down of the buffers we're using in multiple
threads.
Reviewers: mboerger, eizan
Subscribers: mgorny, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D52220
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@342617 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Revert the following 2 commits to fix standalone compiler-rt build:
* r342523 [XRay] Detect terminfo library
* r342518 [XRay][compiler-rt] FDRLogWriter Abstraction
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@342596 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
This change introduces an `FDRLogWriter` type which is responsible for
serialising metadata and function records to character buffers. This is
the first step in a refactoring of the implementation of the FDR runtime
to allow for more granular testing of the individual components of the
implementation.
The main contribution of this change is a means of hiding the details of
how specific records are written to a buffer, and for managing the
extents of these buffers. We make use of C++ features (templates and
some metaprogramming) to reduce repetition in the act of writing out
specific kinds of records to the buffer.
In this process, we make a number of changes across both LLVM and
compiler-rt to allow us to use the `Trace` abstraction defined in the
LLVM project in the testing of the runtime implementation. This gives us
a closer end-to-end test which version-locks the runtime implementation
with the loading implementation in LLVM.
We also allow using gmock in compiler-rt unit tests, by adding the
requisite definitions in the `AddCompilerRT.cmake` module.
Finally, we've gone ahead and updated the FDR logging implementation to
use the FDRLogWriter for the lowest-level record-writing details.
Following patches will isolate the state machine transitions which
manage the set-up and tear-down of the buffers we're using in multiple
threads.
Reviewers: mboerger, eizan
Subscribers: mgorny, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D52220
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@342518 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
compiler-rt CMake build currently tries to parse the triple and then
put it back together, but doing so inherently tricky, and doing so
from CMake is just crazy and currently doesn't handle triples that
have more than three components. Fortunatelly, the CMake really only
needs the architecture part, which is typically the first component,
to construct variants for other architectures. This means we can keep
the rest of the triple as is and avoid the parsing altogether.
Differential Revision: https://reviews.llvm.org/D50548
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@339701 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Previously the the `weak_symbols.txt` files could be modified and the
build system wouldn't update the link flags automatically. Instead the
developer had to know to reconfigure CMake manually.
This is now fixed by telling CMake that the file being used to
read weak symbols from is a configure-time dependency.
Differential Revision: https://reviews.llvm.org/D50059
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@339559 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
llvm-config available
This is the same as libcxxabi/libcxx do.
Differential Revision: https://reviews.llvm.org/D50134
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@338818 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
when building with an IDE so that header files show up in the UI.
This massively improves the development workflow in IDEs.
To implement this a new function `compiler_rt_process_sources(...)` has
been added that adds header files to the list of sources when the
generator is an IDE. For non-IDE generators (e.g. Ninja/Makefile) no
changes are made to the list of source files.
The function can be passed a list of headers via the
`ADDITIONAL_HEADERS` argument. For each runtime library a list of
explicit header files has been added and passed via
`ADDITIONAL_HEADERS`. For `tsan` and `sanitizer_common` a list of
headers was already present but it was stale and has been updated
to reflect the current state of the source tree.
The original version of this patch used file globbing (`*.{h,inc,def}`)
to find the headers but the approach was changed due to this being a
CMake anti-pattern (if the list of headers changes CMake won't
automatically re-generate if globbing is used).
The LLVM repo contains a similar function named `llvm_process_sources()`
but we don't use it here for several reasons:
* It depends on the `LLVM_ENABLE_OPTION` cache variable which is
not set in standalone compiler-rt builds.
* We would have to `include(LLVMProcessSources)` which I'd like to
avoid because it would include a bunch of stuff we don't need.
Differential Revision: https://reviews.llvm.org/D48422
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336663 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This change adds a support for multiarch style runtimes layout, so in
addition to the existing layout where runtimes get installed to:
lib/clang/$version/lib/$os
Clang now allows runtimes to be installed to:
lib/clang/$version/$target/lib
This also includes libc++, libc++abi and libunwind; today those are
assumed to be in Clang library directory built for host, with the
new layout it is possible to install libc++, libc++abi and libunwind
into the runtime directory built for different targets.
The use of new layout is enabled by setting the
LLVM_ENABLE_RUNTIME_TARGET_DIR CMake variable and is supported by both
projects and runtimes layouts. The runtimes CMake build has been further
modified to use the new layout when building runtimes for multiple
targets.
Differential Revision: https://reviews.llvm.org/D45604
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335809 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
build with an IDE (e.g. Xcode) as the generator.
Previously the global `USE_FOLDERS` property wasn't set in standalone
builds leading to existing settings of FOLDER not being respected.
In addition to this there were several targets that appeared at the top
level that were not interesting and clustered up the view. These have
been changed to be displayed in "Compiler-RT Misc".
Now when an Xcode project is generated from a standalone compiler-rt
build the project navigator is much less cluttered. The interesting
libraries should appear in "Compiler-RT Libraries" in the IDE.
Differential Revision: https://reviews.llvm.org/D48378
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335728 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
OpenBSD needs lld linker for sanitisers.
Disabling lint checking as some symbols cannot be defined and block the proper unit tests launch.
Reviewers: lebedev.ri, vitalybuka
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D48528
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335524 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This reverts commit r332924 and followup r332936 silencing a warning.
The change breaks the build on x86 if there is no 32-bit version of the
C++ libraries, see discussion in https://reviews.llvm.org/D47169.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334903 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Respect a custom linker path provided by the user if one is present
(otherwise CMAKE_LINKER will have been set to the right value by CMake).
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334654 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
When XRay is being built as part of the just built compiler together
with libc++ as part of the runtimes build, we need an explicit
dependency from XRay to libc++ to make sure that the library is
available by the time we start building XRay.
Differential Revision: https://reviews.llvm.org/D48113
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334575 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This is needed when we're cross-compiling compiler-rt.
Differential Revision: https://reviews.llvm.org/D47834
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334570 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Reverts changes to AddCompilerRT.cmake due to breakage of
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334528 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Fixes http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/
buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334458 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
When building the dylib, the C++ headers are fundamentally non-module.
They require special versions of the headers in order to provide C++03 and
legacy ABI definitions. This causes ODR issues when modules are enabled
during both the build and the usage of the libc++ headers.
This patch fixes the build error by disabling modules when building the
libc++ sources.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334220 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
-z,defs is incompatible with sanitizers so we need to filter it out
from the linker flags before passing them to the libc++ build.
Differential Revision: https://reviews.llvm.org/D47865
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334212 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This is needed when we're cross-compiling compiler-rt.
Differential Revision: https://reviews.llvm.org/D47834
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@334139 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This is breaking the compiler check.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332936 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
When using system C++ library, assume we have a working C++ compiler and
try to compile a complete C++ program. When using in tree C++ library,
only check the C compiler since the C++ library likely won't have been
built yet at time of running the check.
Differential Revision: https://reviews.llvm.org/D47169
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332924 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This reverts commit rCRT332679 which doesn't quite work and will be
replaced by D47100 and D47115 which is a cleaner solution.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332871 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
r332683 passes flags to the compiler without first checking if they are
supported.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332754 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
NATIVE_COMMAND is only available since CMake 3.9.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332684 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Rather then requiring the user to specify runtime the compiler
runtime and C++ standard library, or trying to guess them which is
error-prone, use auto-detection by parsing the compiler link output.
Differential Revision: https://reviews.llvm.org/D46857
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332683 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The source being compiled is plain C, but using .cc extension forces it
to be compiled as C++ which requires a working C++ compiler including
C++ library which may not be the case when we're building compiler-rt
together with libcxx as part of runtimes build.
Differential Revision: https://reviews.llvm.org/D47031
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332679 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Rename the output variable and remove the unnecessary set call.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332661 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The Android sanitizer buildbot is failing with this change and it
looks like an additional change to cmake is necessary to fix the
build. Reverting this change for now.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@329828 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
CMAKE_CXX_FLAGS was added twice to the command line. This causes the command
line options to be doubled which works until it doesn't as not all options
can be specified twice.
For example,
clang-cl foo.c /GS- /GS- -mllvm -small-loop-cost=1 -mllvm -small-loop-cost=1
clang (LLVM option parsing): for the -small-loop-cost option: may only occur zero or one times!
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@329817 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This changes the add_custom_libcxx macro to resemble the
llvm_ExternalProject_Add. The primary motivation is to avoid
unnecessary libFuzzer rebuilds that are being done on every
Ninja/Make invocation. The libc++ should be only rebuilt whenever
the libc++ source itself changes.
Differential Revision: https://reviews.llvm.org/D43213
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326921 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Summary:
Support builtins for RISC-V, RV32 and RV64.
Reviewers: asb, apazos, mgrang
Differential Revision: https://reviews.llvm.org/D42958
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@326420 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
CMAKE_CXX_FLAGS.
Looks like it broke a bot: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/7195
Reverting until I have a chance to investigate.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323629 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
`set_target_compile_flags()` ultimately sets COMPILE_FLAGS which is
added to CMAKE_CXX_FLAGS in the compile rule, so passing
CMAKE_CXX_FLAGS causes them to be duplicated.
Differential Revision: https://reviews.llvm.org/D42398
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323626 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.
Differential Revision: https://reviews.llvm.org/D42462
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323606 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This addresses the error introduced in r323054 on some bots.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323061 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
add_custom_libcxx uses the just built compiler and installs the
built libc++, e.g. for testing, neither of which is desirable in
case of Fuzzer where the libc++ should be built using the host
compiler and it's only linked into the libFuzzer and should never
be installed. This change introduces additional arguments to
add_custom_libcxx to allow parametrizing its behavior.
Differential Revision: https://reviews.llvm.org/D42330
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323054 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This reverts commit r323032: failing on the sanitizer-x86_64-linux-autoconf bot.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323033 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
add_custom_libcxx uses the just built compiler and installs the
built libc++, e.g. for testing, neither of which is desirable in
case of Fuzzer where the libc++ should be built using the host
compiler and it's only linked into the libFuzzer and should never
be installed. This change introduces additional arguments to
add_custom_libcxx to allow parametrizing its behavior.
Differential Revision: https://reviews.llvm.org/D42330
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@323032 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Currently these files are being installed into a root installation
directory, but this triggers an error when the installation directory
is set to an empty string which is often the case when DESTDIR is
used to control the installation destination.
Differential Revision: https://reviews.llvm.org/D41673
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322451 91177308-0d34-0410-b5e6-96231b3b80d8
|