summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* [CMake] Replace the sanitizer support in runtimes build with multilibPetr Hosek2019-04-221-2/+12
| | | | | | | | | | | | | | | This is a more generic solution; while the sanitizer support can be used only for sanitizer instrumented builds, the multilib support can be used to build other variants such as noexcept which is what we would like to use in Fuchsia. The name CMake target name uses the target name, same as for the regular runtimes build and the name of the multilib, concatenated with '+'. The libraries are installed in a subdirectory named after the multilib. Differential Revision: https://reviews.llvm.org/D60926 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358935 91177308-0d34-0410-b5e6-96231b3b80d8
* Explicitly say we don't define new/delete in libc++ during Apple stage1 ↵Louis Dionne2019-04-171-0/+3
| | | | | | | | | bootstrap This is not necessary in stage2 because we don't even build libc++.dylib there. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358582 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-fuzzer] Include ExternalProject before using it.Matt Morehouse2019-04-051-0/+1
| | | | | | | Some versions of CMake require ExternalProject to be included before we can use ExternalProject_Add. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357803 91177308-0d34-0410-b5e6-96231b3b80d8
* [fuchsia] Add clang-doc to Fuchsia distributionJulie Hockett2019-03-291-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D5997 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357275 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] Reset variable before using itShoaib Meenai2019-03-261-1/+2
| | | | | | | | | | | | | | | | A bunch of macros use the same variable name, and since CMake macros don't get their own scope, the value persists across macro invocations, and we can end up exporting targets which shouldn't be exported. Clear the variable before each use to avoid this. Converting these macros to functions would also help, since it would avoid the variable leaking into its parent scope, and that's something I plan to follow up with. It won't fully address the problem, however, since functions still inherit variables from their parent scopes, so if someone in the parent scope just happened to use the same variable name we'd still have the same issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357036 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Merge static libunwind and libc++abi into libc++ on DarwinPetr Hosek2019-03-261-0/+12
| | | | | | | | | We want to distribute only a single archive so -lc++ does the right thing and users don't have to explicitly link -lc++abi and -lunwind. Differential Revision: https://reviews.llvm.org/D59803 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356970 91177308-0d34-0410-b5e6-96231b3b80d8
* Moved everything SMT-related to LLVM and updated the cmake scripts.Mikhail R. Gadelha2019-03-251-51/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D54978 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356929 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Tell libc++ that we're using compiler-rt on Apple platformsLouis Dionne2019-03-121-0/+1
| | | | | | | | | | | | Reviewers: beanz, arphaman, EricWF Subscribers: dberris, mgorny, jkorous, dexonsmith, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58921 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355927 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Support stripping and linking output to .build-id directoryPetr Hosek2019-03-091-0/+7
| | | | | | | | | | | | | | | | | | | | | When installing runtimes with install-runtimes-stripped, we don't want to just strip them, we also want to preserve the debugging information for potential debugging. To make it possible to later find the stripped debugging information, we want to use the .build-id layout: https://fedoraproject.org/wiki/RolandMcGrath/BuildID#Find_files_by_build_ID That is, for libfoo.so with build ID abcdef1234, the debugging information will be installed into lib/debug/.build-id/ab/cdef1234. llvm-objcopy already has support for stripping files and linking the debugging stripped output into the right location. However, CMake doesn't support customizing strip invocation for the *-stripped targets. So instead, we replace CMAKE_STRIP with a custom script that invokes llvm-objcopy with the right command line flags. Differential Revision: https://reviews.llvm.org/D59127 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355765 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] Add libRemarks to LLVM_DISTRIBUTION_COMPONENTSFrancis Visoiu Mistrih2019-03-051-0/+1
| | | | | | | Add this in the Apple-stage2.cmake to ship the remark tooling library with the compiler. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355440 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] Create exports for umbrella library targetsShoaib Meenai2019-03-051-0/+1
| | | | | | | | | | When using the umbrella llvm-libraries and clang-libraries targets, we should export all library targets, otherwise they'll be part of our distribution but not usable from the CMake package. Differential Revision: https://reviews.llvm.org/D58862 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355354 91177308-0d34-0410-b5e6-96231b3b80d8
* [build] Rename clang-headers to clang-resource-headersShoaib Meenai2019-03-045-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The current install-clang-headers target installs clang's resource directory headers. This is different from the install-llvm-headers target, which installs LLVM's API headers. We want to introduce the corresponding target to clang, and the natural name for that new target would be install-clang-headers. Rename the existing target to install-clang-resource-headers to free up the install-clang-headers name for the new target, following the discussion on cfe-dev [1]. I didn't find any bots on zorg referencing install-clang-headers. I'll send out another PSA to cfe-dev to accompany this rename. [1] http://lists.llvm.org/pipermail/cfe-dev/2019-February/061365.html Reviewers: beanz, phosek, tstellar, rnk, dim, serge-sans-paille Subscribers: mgorny, javed.absar, jdoerfert, #sanitizers, openmp-commits, lldb-commits, cfe-commits, llvm-commits Tags: #clang, #sanitizers, #lldb, #openmp, #llvm Differential Revision: https://reviews.llvm.org/D58791 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355340 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Add CMake target for installing clang's CMake exportsShoaib Meenai2019-02-201-2/+11
| | | | | | | | This mirrors LLVM's install-cmake-exports target. Differential Revision: https://reviews.llvm.org/D58480 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354527 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Switch to LLVM_ENABLE_IDEShoaib Meenai2019-02-201-2/+2
| | | | | | | | | | | | r344555 switched LLVM to guarding install targets with LLVM_ENABLE_IDE instead of CMAKE_CONFIGURATION_TYPES, which expresses the intent more directly and can be overridden by a user. Make the corresponding change in clang. LLVM_ENABLE_IDE is computed by HandleLLVMOptions, so it should be available for both standalone and integrated builds. Differential Revision: https://reviews.llvm.org/D58284 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354525 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Add build and install targets for clang librariesShoaib Meenai2019-02-151-0/+2
| | | | | | | | | | | | | | | This is modeled after the existing llvm-libraries target. It's a convenient way to include all clang libraries in a distribution. This differs slightly from the llvm-libraries target in that it adds any library added via add_clang_library, whereas llvm-libraries only includes targets added via add_llvm_library that didn't use the MODULE or BUILDTREE_ONLY arguments. add_clang_library doesn't appear to have any equivalents of those arguments, so the conditions don't apply. Differential Revision: https://reviews.llvm.org/D58269 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354141 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Create install targets for non-shared librariesShoaib Meenai2019-02-151-1/+1
| | | | | | | | | | | I don't see a reason for these to not have install targets created, which in turn allows them to be bundled in distributions. This doesn't affect the "install" target, since that just runs all CMake install rules (and we were already creating install rules for these). Differential Revision: https://reviews.llvm.org/D58268 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354140 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Pass -ldl -lpthread LDFLAGS to second stagePetr Hosek2019-02-121-0/+6
| | | | | | | We're using static libc++ for the second stage which requires explicitly linking -ldl and -lpthread. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353853 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Drop libclang.so from distributionPetr Hosek2019-02-111-1/+0
| | | | | | This is no longer needed now that all users have switched to clangd. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353658 91177308-0d34-0410-b5e6-96231b3b80d8
* This reverts commit 1440a848a635849b97f7a5cfa0ecc40d37451f5b.Mikhail R. Gadelha2019-02-091-0/+51
| | | | | | | | and commit a1853e834c65751f92521f7481b15cf0365e796b. They broke arm and aarch64 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353590 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the SMT API to LLVMMikhail R. Gadelha2019-02-071-51/+0
| | | | | | | | Moved everything SMT-related to LLVM and updated the cmake scripts. Differential Revision: https://reviews.llvm.org/D54978 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353373 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Re-enable iOS runtimes for Fuchsia standardPetr Hosek2019-01-301-1/+0
| | | | | | | | Turned out this is used by Flutter which uses Fuchsia Clang toolchain. Differential Revision: https://reviews.llvm.org/D57432 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352586 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Enable hermetic static libunwind for FuchsiaPetr Hosek2019-01-301-0/+1
| | | | | | | | | In addition to libc++abi and libc++, we also want to use hermetic static libunwind on Fuchsia. Differential Revision: https://reviews.llvm.org/D57431 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352584 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Temporarily disable modules for second stagePetr Hosek2019-01-291-1/+0
| | | | | | This is breaking some of builders, disable modules until it's resolved. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352449 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Enable hermetic static libc++abi for FuchsiaPetr Hosek2019-01-241-1/+2
| | | | | | | | Similarly to libc++, we want to use hermetic static libc++abi. Differential Revision: https://reviews.llvm.org/D57136 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@352018 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Drop -DNDEBUG, re-enable modulesPetr Hosek2019-01-211-2/+3
| | | | | | | | | -DNDEBUG is no longer needed now that we don't enable assertions, modules should improve build times for the second stage. Differential Revision: https://reviews.llvm.org/D56972 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351709 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Disable modules for the second stage buildPetr Hosek2019-01-171-1/+0
| | | | | | | | This made the toolchain build 50% slower. Differential Revision: https://reviews.llvm.org/D56825 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351415 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Synchronize first and second stage buildsPetr Hosek2019-01-152-28/+31
| | | | | | | | | | | This reorders options between the first and second stage builds to make them better lined up. The change also re-enables tests for first stage which is useful e.g. for cross-compiling when we cannot run tests for second stage directly (i.e. without emulation). Differential Revision: https://reviews.llvm.org/D56652 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351145 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Use hidden visibility for static libc++ in FuchsiaPetr Hosek2019-01-061-0/+1
| | | | | | | | This is enables the use of libc++ in contexts such as device drivers. Differential Revision: https://reviews.llvm.org/D55405 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350491 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Enable build ID, relaxations for first stagePetr Hosek2019-01-061-0/+3
| | | | | | | | We want these to be used for the second stage compiler as well. Differential Revision: https://reviews.llvm.org/D56359 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350486 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[CMake][Fuchsia] Enable experimental new pass manager by default"Petr Hosek2019-01-051-1/+0
| | | | | | This reverts commit r350461 as it causes many of the Clang tests to fail. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350484 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Enable experimental new pass manager by defaultPetr Hosek2019-01-051-0/+1
| | | | | | | | This change enableds experimental new pass manager. Differential Revision: https://reviews.llvm.org/D56350 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350461 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Enable x86 relaxation by defaultPetr Hosek2019-01-051-0/+1
| | | | | | | | | | | This enables x86 relaxation by default. This depends on a linker new enough to support the new reloc types but since we default to lld we don't worry about host system linkers that might be too old to support the new reloc types. Differential Revision: https://reviews.llvm.org/D56349 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350460 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Enable --build-id linker flag by defaultPetr Hosek2019-01-051-0/+2
| | | | | | | | This enables passing --build-id to linker by default. Differential Revision: https://reviews.llvm.org/D56348 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350459 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Include check-lld in the list of bootstrap targetsPetr Hosek2019-01-021-0/+3
| | | | | | | | This allows running lld tests when doing 2-stage toolchain build. Differential Revision: https://reviews.llvm.org/D56181 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350202 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Support XRay on FuchsiaPetr Hosek2018-11-221-0/+1
| | | | | | | | This enables support for XRay in Fuchsia Clang driver. Differential Revision: https://reviews.llvm.org/D52160 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347444 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Use lld and llvm-objcopy for first stage compiler in FuchsiaPetr Hosek2018-11-161-0/+4
| | | | | | | | | | | When cross-compiling the second stage to a different target, we need to make sure that the first-stage compiler can produce binaries for that target. Using lld and llvm-objcopy as the default linker and objcopy tool eliminates some of the dependencies on the host toolchain. Differential Revision: https://reviews.llvm.org/D54655 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347108 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Support cross-compiling with Fuchsia toolchain buildPetr Hosek2018-11-161-1/+32
| | | | | | | | | | When second stage is being cross-compiled for a different platform we need to build enough of first stage runtimes to get a working compiler. Differential Revision: https://reviews.llvm.org/D54463 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347026 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Use the correct spelling for armv7 in Fuchsia's toolchainPetr Hosek2018-11-161-1/+1
| | | | | | | | We need to explicitly specify the architecture version. Differential Revision: https://reviews.llvm.org/D54613 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@347021 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Explicitly list Linux targets for Fuchsia toolchainPetr Hosek2018-11-151-31/+31
| | | | | | | | | Not all Linux targets use the ${arch}-linux-gnu spelling, so instead specify the list of Linux explicitly. Differential Revision: https://reviews.llvm.org/D54598 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346997 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Include clang-apply-replacements in Fuchsia toolchainPetr Hosek2018-11-141-0/+1
| | | | | | | | This is needed for run-clang-tidy.py. Differential Revision: https://reviews.llvm.org/D54505 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346827 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Set -fuse-ld=lld explicitly for Linux runtimesPetr Hosek2018-11-021-13/+19
| | | | | | | | | | We set lld as the default linker on non-Darwin platforms, but we still need to set -fuse-ld=lld explicitly in to support cross-compiling Linux runtimes on Darwin. Differential Revision: https://reviews.llvm.org/D54026 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346056 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Don't restrict Linux runtimes to UNIXPetr Hosek2018-11-011-32/+32
| | | | | | | | | This allows building Linux runtimes on any platform if the correct sysroot is provided via CMake option. Differential Revision: https://reviews.llvm.org/D53970 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345889 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Drop the LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULTPetr Hosek2018-10-291-4/+0
| | | | | | | | | Now that libc++ uses __exclude_from_explicit_instantiation__ attribute, this is no longer needed. Differential Revision: https://reviews.llvm.org/D53839 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345552 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Support direct split DWARF emission for FuchsiaPetr Hosek2018-10-151-0/+1
| | | | | | | | | This enables the driver support for direct split DWARF emission for Fuchsia in addition to Linux. Differential Revision: https://reviews.llvm.org/D53248 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344556 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Improved cmake configuration for Z3Enrico Steffinlongo2018-10-131-2/+25
| | | | | | | | | | | | | | | | | | | | | | Summary: Enhanced support for Z3 in the cmake configuration of clang; now it is possible to specify any arbitrary Z3 install prefix (CLANG_ANALYZER_Z3_PREFIX) to cmake with lib (or bin) and include folders. Before the patch only in cmake default locations were searched (https://cmake.org/cmake/help/v3.4/command/find_path.html). Specifying any CLANG_ANALYZER_Z3_PREFIX will force also CLANG_ANALYZER_BUILD_Z3 to ON. Removed also Z3 4.5 version requirement since it was not checked, and now Clang works with Z3 4.7 Reviewers: NoQ, george.karpenkov, mikhail.ramalho Reviewed By: george.karpenkov Subscribers: rnkovacs, NoQ, esteffin, george.karpenkov, delcypher, ddcc, mgorny, xazax.hun, szepet, a.sidorin, Szelethus Tags: #clang Differential Revision: https://reviews.llvm.org/D50818 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344464 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][Fuchsia] Use libc++ ABIv2 for Fuchsia toolchainPetr Hosek2018-10-031-0/+4
| | | | | | | | We don't need to provide stable ABI and hence we can use the v2. Differential Revision: https://reviews.llvm.org/D52660 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343652 91177308-0d34-0410-b5e6-96231b3b80d8
* Build clang-headers when building clang tools.Haojian Wu2018-10-011-0/+1
| | | | | | | | | | | | | | | | | Summary: clang tools require clang headers to work on real project, e.g. when we build clangd via `ninja clangd`, we expect the binary can run on real-world project (without running another command `ninja clang-headers`). Reviewers: sammccall Reviewed By: sammccall Subscribers: mgorny, ilya-biryukov, ioeric, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52714 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343459 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Use internal_linkage rather than always_inline for libc++Petr Hosek2018-09-231-0/+2
| | | | | | | | | | This is a workaround for PR39053 which was uncovered by D50652 when the default attribute has been changed from internal_linkage to always_inline. Differential Revision: https://reviews.llvm.org/D52402 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342833 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Link static libunwind and libc++abi into libc++ in Fuchsia toolchainPetr Hosek2018-07-251-0/+6
| | | | | | | | | | | When building libc++ for Fuchsia, we want to distribute shared libc++, libc++abi and libunwind as separate libraries, but for static versions we would like to link all of them into libc++ so -lc++ flag has the same effect whether shared or static library is being used. Differential Revision: https://reviews.llvm.org/D49628 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337877 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Use libc++ and compiler-rt for sanitizersPetr Hosek2018-07-151-1/+3
| | | | | | | | | When building runtimes for Linux as part of Fuchsia toolchain, use libc++ and compiler-rt for sanitizers. Differential Revision: https://reviews.llvm.org/D49331 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337117 91177308-0d34-0410-b5e6-96231b3b80d8