summaryrefslogtreecommitdiffstats
path: root/compiler-rt/cmake/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [CMake] Fix lld detection after D69685Fangrui Song2019-12-281-1/+1
| | | | | | | | | | | | | | | | | | | D69685 actually broke lld detection for my build (probably due to CMake processing order). Before: ``` build projects/compiler-rt/lib/sanitizer_common/tests/Sanitizer-x86_64-Test-Nolibc: ... bin/clang || ... ``` After: ``` build projects/compiler-rt/lib/sanitizer_common/tests/Sanitizer-x86_64-Test-Nolibc: ... bin/clang bin/lld || ... ``` Differential Revision: https://reviews.llvm.org/D71950
* [CMake] Use correct include path for InstrProfData.inc on DarwinPetr Hosek2019-11-241-1/+4
| | | | | | | | On Darwin, part of the profile runtime is included in the builtin library. f35032e changed the location of InstrProfData.inc but the builtin build for Darwin hasn't been updated to include the new path which causes a breakage when building for Darwin. This change addresses this breakage.
* [CMake] Prevent adding lld to test dependency (TEST_DEPS) when lld project ↵Kelvin Li2019-11-051-1/+1
| | | | | | | | | | is not built D69405 causes failure if running LIT when the compiler was built without lld. Patch by Anh Tuyen Tran (anhtuyen) Differential Revision: https://reviews.llvm.org/D69685
* [compiler-rt] Use xcrun instead of xcodebuild to find the SDK directoryAlex Richardson2019-10-311-2/+3
| | | | | | | | | | | | | | | | | | Summary: xcodebuild does not work unless XCode is installed whereas xcrun also work when only the Command Line Tools are installed. Unlike the check for the version (D69610), this did not cause an erro for me since the fallback to /usr/include for the OSX sysroot worked. Reviewers: yln, delcypher Reviewed By: yln Subscribers: dberris, mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D69659
* Fix compiler-rt build on macOS without XCodeAlex Richardson2019-10-311-2/+2
| | | | | | | | | | | | | | | | | | Summary: Starting with 8a5bfbe6db2824642bf9a1d27a24c5b6132b244f (D68292) this file unconditionally uses xcodebuild to get the SDK version. On my system this always fails with `xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance` Reviewers: delcypher, yln Reviewed By: delcypher, yln Subscribers: dberris, mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D69610
* [msan] Blacklist __gxx_personality_v0.Evgenii Stepanov2019-10-312-1/+2
| | | | | | | | | | | | | | | | | | | | Summary: Fixes https://bugs.llvm.org/show_bug.cgi?id=31877. Fixes https://github.com/google/sanitizers/issues/1155. Enables exceptions in msan/tsan buid of libcxx, and in msan tests. -fdepfile-entry stuff is a workaround for https://reviews.llvm.org/D69290 (default blacklist missing from -MMD output). Reviewers: pcc, dvyukov Subscribers: mgorny, christof, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D69587
* [compiler-rt] cmake: add include(BuiltinTests) to CompilerRTDarwinUtilsPuyan Lotfi2019-10-241-0/+1
| | | | | | | | | In cmake, if TEST_COMPILE_ONLY is set compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake invokes try_compile_only() but try_compile_only() is defined in BuiltinTests.cmake and is not included in CompilerRTDarwinUtils.cmake. This patch simply includes it BuiltinTests. Differential Revision: https://reviews.llvm.org/D69410
* [CMake] Disable building all Darwin libraries (except builtins) for macOS ↵Dan Liew2019-10-161-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i386 when the SDK is >= 10.15. Summary: In the macOS 10.15 SDK the ability to link i386 binaries was removed and in the corresponding OS it is not possible to run macOS i386 binaries. The consequence of these changes meant that targets like `check-asan` would fail because: * Unit tests could not be linked for i386 * Lit tests for i386 would fail due to not being able to execute compiled binaries. The simplest fix to this is to simply disable building for i386 for macOS when using the 10.15 SDK (or newer). This disables building the i386 slice for most compiler-rt libraries and consequently disables the unit and lit tests for macOS i386. Note that because the `DARWIN_osx_ARCHS` CMake variable is a cache variable this patch will have no affect on existing builds unless the existing cache variable is deleted. The simplest way to deal with this is delete existing builds and just do a fresh configure. Note this should not affect the builtins which are managed with the `DARWIN_osx_BUILTIN_ARCHS` CMake cache variable. For those who wish to force using a particular set of architectures when using newer SDKs passing `-DDARWIN_osx_ARCHS=i386;x86_64;x86_64h` to CMake should provide a usable (but completely unsupported) workaround. rdar://problem/55668535 rdar://problem/47939978 Reviewers: kubamracek, yln, azhar, kcc, dvyukov, vitalybuka, cryptoad, eugenis, thakis, phosek Subscribers: mgorny, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D68292 llvm-svn: 374977
* [NFC] Invoke lipo from CMAKE_LIPO.Puyan Lotfi2019-09-241-1/+3
| | | | | | | This shouldn't change anything, except that a cmake cache file that specifies CMAKE_LIPO can specify an alternate lipo to use. llvm-svn: 372790
* [cmake] Strip quotes in try_compile_onlyHans Wennborg2019-09-191-0/+6
| | | | | | | | | | | | | | | | | After r372209, the compile command can end up including an argument with quotes in it, e.g. -fprofile-instr-use="/foo/bar.profdata" when invoking the compiler with execute_process, the compiler ends up getting that argument with quotes and all, and fails to open the file. This all seems horribly broken, but one way of working around it is to simply strip the quotes from the string here. If they were there to protect a path that's got spaces in it, that wasn't going to work anyway because the string is later split by spaces. llvm-svn: 372312
* Fix bug in `darwin_test_archs()` when the cache variable is set but empty.Dan Liew2019-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: If the cache variable named in `${valid_archs}` (e.g. `DARWIN_osx_BUILTIN_ARCHS`) is set in the cache but is empty then the cache check `if(${valid_archs})` will be false so the function will probe the compiler but the `set(...)` command at the end of the function to update the cache variable will be a no-op. This is because `set(...)` will not update an existing cache variable unless the `FORCE` argument is provided. To fix this this patch adds `FORCE` so the cache is always updated. rdar://problem/55323665 Reviewers: vsk, kubamracek Subscribers: mgorny, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D67530 llvm-svn: 371872
* [CMake] Separate the detection Darwin platforms architectures for theDan Liew2019-09-131-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | built-ins from the rest of compiler-rt. The detection of supported platform (os) architectures for Darwin relies on the `darwin_test_archs()` CMake function. This is used both for building the builtins (`builtin-config-ix.cmake`) and for the rest of the compiler-rt (`config-ix.cmake`). `darwin_test_archs()` implements a cache, presumably to speed up CMake re-configures. Unfortunately this caching is buggy because it depends on external global state (i.e. the `TEST_COMPILE_ONLY` variable) and this is not taken into account. For `config-ix.cmake` `TEST_COMPILE_ONLY` is not set and for `builtin-config-ix.cmake` `TEST_COMPILE_ONLY` is set to `On`. This makes the `darwin_test_archs()` function racey in the sense that a call from one calling context will poison the cache for the other calling context. This is actually an issue George Karpenkov discovered a while back and had an incomplete patch for (https://reviews.llvm.org/D45337) but this was never merged. To workaround this, this patch switches to using a different set of variables for the platform architecture builtins, i.e. `DARWIN_<OS>_ARCHS` -> `DARWIN_<OS>_BUILTIN_ARCHS`. This avoids the cache poisoning problem because the cached variable names are different. This also has the advantage that the the configured architectures for builtins and the rest of the compiler-rt are now independent and can be set differently if necessary. Note in `darwin_test_archs()` we also now pass `-w` to the compiler because `try_compile_only()` treats compiler warnings as errors. This was extremely fragile because compiler warnings (can easily appear due to a buggy compiler or SDK headers) would cause compiler-rt to think an architecture on Darwin wasn't supported. rdar://problem/48637491 llvm-svn: 371871
* [sanitizer] Add lld into dependency of sanitizer_common unittestsVitaly Buka2019-08-271-0/+5
| | | | llvm-svn: 370007
* reland [gtest] Fix printing of StringRef and SmallString in assert messages.Sam McCall2019-08-211-2/+2
| | | | | | | | | Renames GTEST_NO_LLVM_RAW_OSTREAM -> GTEST_NO_LLVM_SUPPORT and guards the new features behind it. This reverts commit a063bcf3ef5a879adbe9639a3c187d876eee0e66. llvm-svn: 369527
* Enable compiler-rt on SPARCRainer Orth2019-07-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables compiler-rt on SPARC targets. Most of the changes are straightforward: - Add 32 and 64-bit sparc to compiler-rt - lib/builtins/fp_lib.h needed to check if the int128_t and uint128_t types exist (which they don't on sparc) There's one issue of note: many asan tests fail to compile on Solaris/SPARC: fatal error: error in backend: Function "_ZN7testing8internal16BoolFromGTestEnvEPKcb": over-aligned dynamic alloca not supported. Therefore, while asan is still built, both asan and ubsan-with-asan testing is disabled. The goal is to check if asan keeps compiling on Solaris/SPARC. This serves asan in gcc, which doesn't have the problem above and works just fine. With this patch, sparcv9-sun-solaris2.11 test results are pretty good: Failing Tests (9): Builtins-sparc-sunos :: divtc3_test.c Builtins-sparcv9-sunos :: compiler_rt_logbl_test.c Builtins-sparcv9-sunos :: divtc3_test.c [...] UBSan-Standalone-sparc :: TestCases/TypeCheck/misaligned.cpp UBSan-Standalone-sparcv9 :: TestCases/TypeCheck/misaligned.cpp The builtin failures are due to Bugs 42493 and 42496. The tree contained a few additonal patches either currently in review or about to be submitted. Tested on sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D40943 llvm-svn: 365880
* Specify log level for CMake messages (less stderr)Stefan Granitz2019-06-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Specify message levels in CMake. Prefer STATUS (stdout). As the default message mode (i.e. level) is NOTICE in CMake, more then necessary messages get printed to stderr. Some tools, noticably ccmake treat this as an error and require additional confirmation and re-running CMake's configuration step. This commit specifies a mode (either STATUS or WARNING or FATAL_ERROR) instead of the default. * I used `csearch -f 'llvm-project/.+(CMakeLists\.txt|cmake)' -l 'message\("'` to find all locations. * Reviewers were chosen by the most common authors of specific files. If there are more suitable reviewers for these CMake changes, please let me know. Patch by: Christoph Siedentop Reviewers: zturner, beanz, xiaobai, kbobyrev, lebedev.ri, sgraenitz Reviewed By: sgraenitz Subscribers: mgorny, lebedev.ri, #sanitizers, lldb-commits, llvm-commits Tags: #sanitizers, #lldb, #llvm Differential Revision: https://reviews.llvm.org/D63370 llvm-svn: 363821
* [compiler-rt] Respect CMAKE_NMShoaib Meenai2019-06-151-2/+8
| | | | | | | | | | | The default nm executable may not be able to handle the architecture we're building the sanitizers for. Respect CMAKE_NM if it's set to ensure we're using the correct nm tool. Preserve the existing NM environment variable override to not break its users. Differential Revision: https://reviews.llvm.org/D63368 llvm-svn: 363483
* [builtins] Use libtool for builtins when building for Apple platformPetr Hosek2019-06-041-0/+50
| | | | | | | | | | | | compiler-rt already uses libtool instead of ar when building for Apple platform, but that's not being used when builtins are being built separately e.g. as part of the runtimes build. This change extracts the logic setting up libtool into a separate file and uses it from both the compiler-rt and standalone builtins build. Differential Revision: https://reviews.llvm.org/D62820 llvm-svn: 362466
* [Driver] Change layout of per-target runtimes to resemble multiarchPetr Hosek2019-05-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This is a follow up to r361432, changing the layout of per-target runtimes to more closely resemble multiarch. While before, we used the following layout: [RESOURCE_DIR]/<target>/lib/libclang_rt.<runtime>.<ext> Now we use the following layout: [RESOURCE_DIR]/lib/<target>/libclang_rt.<runtime>.<ext> This also more closely resembles the existing "non-per-target" layout: [RESOURCE_DIR]/lib/<os>/libclang_rt.<runtime>-<arch>.<ext> This change will enable further simplification of the driver logic in follow up changes. Differential Revision: https://reviews.llvm.org/D62469 llvm-svn: 361784
* Use CMAKE_C_COMPILER_ARG1 in compiler invocationPetr Hosek2019-05-191-1/+2
| | | | | | | | | This is needed when using compiler wrappers such as ccache or distcc and should address the failure on clang-x86_64-debian-fast bot. Differential Revision: https://reviews.llvm.org/D62104 llvm-svn: 361111
* [compiler-rt] Create install targets for Darwin librariesShoaib Meenai2019-05-073-44/+66
| | | | | | | | | | | Darwin targets were generating CMake install rules but not the corresponding install targets. Centralize the existing install target creation to a function and use that function for both Darwin and non-Darwin builds. Differential Revision: https://reviews.llvm.org/D61541 llvm-svn: 360181
* [compiler-rt] Cleanup the --target and --sysroot handlingPetr Hosek2019-05-011-4/+3
| | | | | | This addresses issue introduced in r359646. llvm-svn: 359650
* [compiler-rt] Pass sysroot and disable pedantic for crtbegin.o/crtend.oPetr Hosek2019-05-011-1/+4
| | | | | | | | These are needed to make bots happy. Differential Revision: https://reviews.llvm.org/D61363 llvm-svn: 359646
* [compiler-rt] Rework the object build supportPetr Hosek2019-05-011-8/+33
| | | | | | | | | | The initial implementation didn't properly support cross-compilation via the runtime build, the updated implementation should address that by expanding the CMAKE_C_COMPILE_OBJECT variable with correct values. Differential Revision: https://reviews.llvm.org/D61356 llvm-svn: 359644
* Reland "[compiler-rt] Simple crtbegin.o and crtend.o implementation"Petr Hosek2019-04-301-17/+35
| | | | | | | | | | | | | | | Clang relies on existence of certain symbols that are normally provided by crtbegin.o/crtend.o. However, LLVM does not currently provide implementation of these files, instead relying on either libgcc or implementations provided as part of the system. This change provides an initial implementation of crtbegin.o/crtend.o that can be used on system that don't provide crtbegin.o/crtend.o as part of their C library. Differential Revision: https://reviews.llvm.org/D28791 llvm-svn: 359591
* Revert "[compiler-rt] Simple crtbegin.o and crtend.o implementation"Petr Hosek2019-04-301-35/+17
| | | | | | This reverts commit r359576 since it's failing on Windows bots. llvm-svn: 359579
* [compiler-rt] Simple crtbegin.o and crtend.o implementationPetr Hosek2019-04-301-17/+35
| | | | | | | | | | | | | | | Clang relies on existence of certain symbols that are normally provided by crtbegin.o/crtend.o. However, LLVM does not currently provide implementation of these files, instead relying on either libgcc or implementations provided as part of the system. This change provides an initial implementation of crtbegin.o/crtend.o that can be used on system that don't provide crtbegin.o/crtend.o as part of their C library. Differential Revision: https://reviews.llvm.org/D28791 llvm-svn: 359576
* [compiler-rt] Build custom libc++abi without exceptions.Matt Morehouse2019-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Since neither compiler-rt nor the libc++ we build use exceptions, we don't need libc++abi to have them either. This resolves an issue where libFuzzer's private libc++ contains implementations for __cxa_throw and friends, causing fuzz targets built with their own C++ library to segfault during exception unwinding. See https://github.com/google/oss-fuzz/issues/2328. Reviewers: phosek, EricWF, kcc Reviewed By: phosek Subscribers: kcc, dberris, mgorny, christof, llvm-commits, metzman Tags: #llvm Differential Revision: https://reviews.llvm.org/D61053 llvm-svn: 359218
* [cmake] Change deprecated $<CONFIG> to $<CONFIGURATION>. NFCFangrui Song2019-03-301-1/+1
| | | | | | | See rL357338 for a similar change. The informational expression $<CONFIGURATION> has been deprecated since CMake 3.0 llvm-svn: 357348
* [CMake] Fix broken uses of `try_compile_only()` and improve the function.Dan Liew2019-03-153-4/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There were existing calls to `try_compile_only()` with arguments not prefixed by `SOURCE` or `FLAGS`. These were silently being ignored. It looks like the `SOURCE` and `FLAGS` arguments were first introduced in r278454. One implication of this is that for a builtins only build for Darwin (see `darwin_test_archs()`) it would mean we weren't actually passing `-arch <arch>` to the compiler). This would result in compiler-rt claiming all supplied architectures could be targetted provided the compiler could build for Clang's default architecture. This patch fixes this in several ways. * Fixes all incorrect calls to `try_compile_only()`. * Adds code to `try_compile_only()` to check for unhandled arguments and raises a fatal error if this occurs. This should stop any incorrect calls in the future. * Improve the documentation on `try_compile_only()` which seemed completely wrong. rdar://problem/48928526 Reviewers: beanz, fjricci, dsanders, kubamracek, yln, dcoughlin Subscribers: mgorny, jdoerfert, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D59429 llvm-svn: 356295
* [TSan][libdispatch] Enable linking and running of tests on LinuxJulian Lettner2019-03-151-0/+1
| | | | | | | | | | | | | | | | | | | | | When COMPILER_RT_INTERCEPT_LIBDISPATCH is ON the TSan runtime library now has a dependency on the blocks runtime and libdispatch. Make sure we set all the required linking options. Also add cmake options for specifying additional library paths to instruct the linker where to search for libdispatch and the blocks runtime. This allows us to build TSan runtime with libdispatch support without installing those libraries into default linker library paths. `CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY` is necessary to avoid aborting the build due to failing the link step in CMake's check_c_compiler test. Reviewed By: dvyukov, kubamracek Differential Revision: https://reviews.llvm.org/D59334 llvm-svn: 356281
* [compiler-rt][CMake] Set project for the custom libc++Petr Hosek2019-02-191-0/+1
| | | | | | | | | | | | | This is another follow up to r354212 which is broken on Darwin when cross-compiling runtimes to Linux when it ignores the -fuse-ld=lld linker flag and attempts to use the host linker when performing the compiler identification. Upon investigation, I noticed that setting the project with appropriate list of languages makes the error go away and it shouldn't hurt either. Differential Revision: https://reviews.llvm.org/D58372 llvm-svn: 354350
* [compiler-rt] Build custom libcxx with libcxxabiJonas Hahnfeld2019-02-172-2/+30
| | | | | | | | | | | | | | | This changes add_custom_libcxx to also build libcxxabi and merges the two into a static and hermetic library. There are multiple advantages: 1) The resulting libFuzzer doesn't expose C++ internals and looks like a plain C library. 2) We don't have to manually link in libstdc++ to provide cxxabi. 3) The sanitizer tests cannot interfere with an installed version of libc++.so in LD_LIBRARY_PATH. Differential Revision: https://reviews.llvm.org/D58013 llvm-svn: 354212
* [CMake] Avoid clang dependencies in the runtimes buildPetr Hosek2019-02-131-1/+1
| | | | | | | Dependencies like clang aren't available in the runtimes build, this was accidentally omitted in D57992. llvm-svn: 353914
* [CMake][XRay] Silence llvm-config error when checking library supportPetr Hosek2019-02-121-2/+4
| | | | | | | | | | Otherwise this propagates all the way to CMake and results in an error during configuration. We check and handle the result and report warning separately so this is not changing the behavior. Differential Revision: https://reviews.llvm.org/D58086 llvm-svn: 353784
* [CMake] Don't set <PROJECT>_STANDALONE_BUILDPetr Hosek2019-02-091-1/+1
| | | | | | | | | We shouldn't be treating runtimes builds as standalone builds since we have enough of the context loaded into the runtimes environment. Differential Revision: https://reviews.llvm.org/D57992 llvm-svn: 353601
* [CMake] Mark runtime library link libraries as privatePetr Hosek2019-02-071-1/+1
| | | | | | | | | There's no need to expose these dependencies to consumers. This matches the change made to other runtimes in D57456. Differential Revision: https://reviews.llvm.org/D57873 llvm-svn: 353376
* [test] Disable sunrpc tests when rpc/xdr.h is missingMichal Gorny2019-01-141-8/+0
| | | | | | | | | | | | | | | | | 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 llvm-svn: 351109
* sanitizer_common: Change gen_dynamic_list.py to take a -o argument instead ↵Peter Collingbourne2019-01-111-2/+2
| | | | | | | | | | | 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 llvm-svn: 350980
* [xray] [tests] Detect and handle missing LLVMTestingSupport gracefullyMichal Gorny2018-12-211-1/+21
| | | | | | | | | | | | | | | | | | 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 llvm-svn: 349899
* [CMake] Add a missing case of TO_CMAKE_PATHMartin Storsjo2018-11-271-0/+1
| | | | | | This fixes building sanitizers for mingw natively. llvm-svn: 347646
* [compiler-rt] Use exact spelling when building for default targetPetr Hosek2018-11-161-1/+4
| | | | | | | | | | | 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 llvm-svn: 347022
* [CMake] Passthrough CFLAGS when checking the compiler-rt pathPetr Hosek2018-11-141-0/+3
| | | | | | | | | | 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 llvm-svn: 346820
* [compiler-rt] Support for passing through linker flags to libc++ buildPetr Hosek2018-11-031-2/+7
| | | | | | | | This may be needed when cross-compiling to certain platforms. Differential Revision: https://reviews.llvm.org/D54027 llvm-svn: 346063
* [compiler-rt] Pass CMake C and C++ flags to the custom libc++Petr Hosek2018-10-311-3/+7
| | | | | | | | | | | 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 llvm-svn: 345788
* [asan] Remove flags for clang-cl before it supported EHReid Kleckner2018-10-311-9/+0
| | | | | | | Also remove -Wno-undefined-inline, which needed to work around PR19898, which was fixed. llvm-svn: 345677
* [compiler-rt] Don't explicitly set CMAKE_CXX_FLAGS.Dan Albert2018-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 344751
* [XRay] Clean up XRay build configurationDean Michael Berris2018-09-241-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 342859
* [XRay][compiler-rt] FDRLogWriter AbstractionDean Michael Berris2018-09-202-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 342617
* Revert "[XRay][compiler-rt] FDRLogWriter Abstraction" and 1 more.Evgeniy Stepanov2018-09-191-10/+0
| | | | | | | | Revert the following 2 commits to fix standalone compiler-rt build: * r342523 [XRay] Detect terminfo library * r342518 [XRay][compiler-rt] FDRLogWriter Abstraction llvm-svn: 342596
OpenPOWER on IntegriCloud