summaryrefslogtreecommitdiffstats
path: root/llvm/cmake
Commit message (Collapse)AuthorAgeFilesLines
...
* [cmake] With utils disabled, don't build tblgen in cross modeKeno Fischer2019-07-011-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | Summary: In cross mode, we build a separate NATIVE tblgen that runs on the host and is used during the build. Separately, we have a flag that disables building all executables in utils/. Of course generally, this doesn't turn off tblgen, since we need that during the build. In cross mode, however, that tblegen is useless since we never actually use it. Furthermore, it can be actively problematic if the cross toolchain doesn't like building executables for whatever reason. And even if building executables works fine, we can at least save compile time by omitting it from the target build. There's two changes needed to make this happen: - Stop creating a dependency from the native tool to the target tool. No such dependency is required for a correct build, so I'm not entirely sure why it was there in the first place. - If utils were disabled on the CMake command line and we're in cross mode, respect that by excluding it from the install target (using EXCLUDE_FROM_ALL). Reviewers: smeenai Differential Revision: https://reviews.llvm.org/D64032 llvm-svn: 364872
* [cmake] Allow config.guess to be run with MSYS on WindowsPengxuan Zheng2019-06-261-1/+1
| | | | | | | | | | | | | | | | | | Summary: With r363420, config.guess can no longer be run with MSYS on Windows and this patch should be able to fix this particular case. Reviewers: compnerd Reviewed By: compnerd Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63834 llvm-svn: 364485
* Add llvm-symbolizer to LLVM_TOOLCHAIN_TOOLS (PR40152)Hans Wennborg2019-06-251-0/+1
| | | | | | So that it gets installed in LLVM_INSTALL_TOOLCHAIN_ONLY builds. llvm-svn: 364277
* [LLVM-C] Add LLVM-C.dll to Windows installer packageHans Wennborg2019-06-251-1/+3
| | | | | | | | | | | | This is a follow up to D56781, D56774 and D35077 to makes the LLVM-C.dll file and LLVM-C.lib be installed on Windows, just like LTO.dll and LTO.lib are. Patch by Jakob Bornecrantz! Differential revision: https://reviews.llvm.org/D63717 llvm-svn: 364275
* Remove flag for no longer supported MSVC versionNico Weber2019-06-241-4/+0
| | | | llvm-svn: 364218
* Specify log level for CMake messages (less stderr)Stefan Granitz2019-06-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* build: extract LLVM distribution target handlingSaleem Abdulrasool2019-06-141-0/+36
| | | | | | | | | This extracts the LLVM distribution target handling into a support module. Extraction will enable us to restructure the builds to support multiple distribution configurations (e.g. developer and user) to permit us to build the development package and the user package at once. llvm-svn: 363440
* build: don't attempt to run config.guess on WindowsSaleem Abdulrasool2019-06-141-10/+14
| | | | | | | | | | | When cross-compiling LLVM to android from Windows (for LLVMSupport), we would attempt to execute `config.guess` to determine the host triple since `CMAKE_SYSTEM_NAME` is not Windows and `CMAKE_C_COMPILER` will be set to GNU or Clang. This will fail as `config.guess` is a shell script which cannot be executed on Windows. Simply log a warning instead. The user can specify the value for this instead in those cases. llvm-svn: 363420
* Build with _XOPEN_SOURCE defined on AIXDavid Tenty2019-06-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It is useful to build with _XOPEN_SOURCE defined on AIX, enabling X/Open and POSIX compatibility mode, to work around stray macros and other bugs in the headers provided by the system and build compiler. This patch adds the config to cmake to build with _XOPEN_SOURCE defined on AIX with a few exceptions. Google Test internals require access to platform specific thread info constructs on AIX so in that case we build with _ALL_SOURCE defined instead. Libclang also uses header which needs _ALL_SOURCE on AIX so we leave that as is as well. We also add building on AIX with the large file API and doing CMake header checks with X/OPEN definitions so the results are consistent with the environment that will be present in the build. Reviewers: hubert.reinterpretcast, xingxue, andusy Reviewed By: hubert.reinterpretcast Subscribers: mgorny, jsji, cfe-commits, llvm-commits Tags: #llvm, #clang Differential Revision: https://reviews.llvm.org/D62533 llvm-svn: 362808
* [CMake] Export CMAKE_CONFIGURATION_TYPES for the LLVM build-treeStefan Granitz2019-06-051-0/+1
| | | | | | | | | | | | | | Summary: Useful info for standalone builds of subprojects. If a multi-configuration generator was used for the provided LLVM build-tree, standalone builds should consider actual subdirectories per configuration in `find_program()` (e.g. looking for `llvm-lit` or `llvm-tblgen`). Reviewers: labath, beanz, mgorny Subscribers: lldb-commits, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62878 llvm-svn: 362588
* [HWASAN][CMake] Allow instrumenting LLVM/clangEugene Leviant2019-06-041-0/+3
| | | | | | Differential revision: https://reviews.llvm.org/D62813 llvm-svn: 362474
* tools: add `llvm-nm` and `llvm-objcopy` to toolsSaleem Abdulrasool2019-06-031-0/+2
| | | | | | | | | Add `nm` and `objcopy` to the default value for the tools that we install now that they are sufficiently feature complete to replace bintuils' implementation. Patch by Jiang Yi! llvm-svn: 362425
* [test] Fix plugin testsDon Hinton2019-06-021-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recommit of r361790 that was temporarily reverted in r361793 due to bot breakage. Summary: The following changes were required to fix these tests: 1) Change LLVM_ENABLE_PLUGINS to an option and move it to llvm/CMakeLists.txt with an appropriate default -- which matches the original default behavior. 2) Move the plugins directory from clang/test/Analysis clang/lib/Analysis. It's not enough to add an exclude to the lit.local.cfg file because add_lit_testsuites recurses the tree and automatically adds the appropriate `check-` targets, which don't make sense for the plugins because they aren't tests and don't have `RUN` statements. Here's a list of the `clang-check-anlysis*` targets with this change: ``` $ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | grep clang-analysis check-clang-analysis check-clang-analysis-checkers check-clang-analysis-copypaste check-clang-analysis-diagnostics check-clang-analysis-engine check-clang-analysis-exploration_order check-clang-analysis-html_diagnostics check-clang-analysis-html_diagnostics-relevant_lines check-clang-analysis-inlining check-clang-analysis-objc check-clang-analysis-unified-sources check-clang-analysis-z3 ``` 3) Simplify the logic and only include the subdirectories under clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set. Reviewed By: NoQ Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D62445 llvm-svn: 362328
* [CMake] Use libtool for runtimes when building for Apple platformPetr Hosek2019-06-021-0/+50
| | | | | | | | | | | | LLVM CMake build already uses libtool instead of ar when building for Apple platform and we should be using the same when building runtimes. To do so, this change extracts the logic for finding libtool into a separate file and then uses it from both the LLVM build as well as the LLVM runtimes build. Differential Revision: https://reviews.llvm.org/D62769 llvm-svn: 362313
* [CMake] Feed BUNDLE_PATH through llvm target wrappersChris Bieneman2019-05-311-4/+4
| | | | | | This feeds the new llvm_codsign BUNDLE_PATH option through from the llvm target wrapper functions, so that you can specify the BUNDLE_PATH on the target's codesign. llvm-svn: 362248
* [CMake] Provide an option to use relative paths in debug infoPetr Hosek2019-05-312-0/+18
| | | | | | | | | | | | | | | | | CMake always uses absolute file paths in the generated compiler invocation which results in absolute file paths being embedded in debug info. This is undesirable when building a toolchain e.g. on bots as the debug info may embed the bot source checkout path which is meaningless anywhere else. This change introduces the LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO which uses -fdebug-prefix-map (where supported) options to rewrite paths embedded into debug info with relative ones. Additionally, LLVM_SOURCE_PREFIX can be used to override the path to source directory with a different one. Differential Revision: https://reviews.llvm.org/D62622 llvm-svn: 362185
* Support codesigning bundles and forcingChris Bieneman2019-05-301-3/+11
| | | | | | | | | | | | | | | | | | | | | | | Summary: Clangd's framework is assembled by copying binaries from the lib and bin directories into a bundle shape. This results in an invalid bundle code signature because the signature only applies to the binaries not the resources. This patch adds two new options to `llvm_codesign` to enable re-signing the library and XPC service as bundles. The `BUNDLE_PATH` option allow specifying an explicit path to codesign, which enables signing bundles which aren't generated using CMake's `FRAMEWORK` or `BUNDLE` target properties. The `FORCE` option allows re-signing binaries that have already been signed. This is required for how clangd exposes the clangd library and tools as both XPC and non-XPC services using the same binary. Reviewers: jkorous, bogner Reviewed By: bogner Subscribers: mgorny, ilya-biryukov, dexonsmith, arphaman, kadircet, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D62693 llvm-svn: 362169
* Revert r361826, as it still breaks LLDB.Alexandre Ganea2019-05-282-33/+1
| | | | llvm-svn: 361837
* [CMake] Default options for faster executables on MSVCAlexandre Ganea2019-05-282-1/+33
| | | | | | Differential Revision: https://reviews.llvm.org/D55056 llvm-svn: 361826
* Revert [test] Fix plugin testsDon Hinton2019-05-281-0/+8
| | | | | | | | This reverts r361790 (git commit fe5eaab2b5b4523886bd63aebcfea8cfce586fa1) It's causing buildbot breakage, so reverting while I investigate. llvm-svn: 361793
* [test] Fix plugin testsDon Hinton2019-05-281-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The following changes were required to fix these tests: 1) Change LLVM_ENABLE_PLUGINS to an option and move it to llvm/CMakeLists.txt with an appropriate default -- which matches the original default behavior. 2) Move the plugins directory from clang/test/Analysis clang/lib/Analysis. It's not enough to add an exclude to the lit.local.cfg file because add_lit_testsuites recurses the tree and automatically adds the appropriate `check-` targets, which don't make sense for the plugins because they aren't tests and don't have `RUN` statements. Here's a list of the `clang-check-anlysis*` targets with this change: ``` $ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | grep clang-analysis check-clang-analysis check-clang-analysis-checkers check-clang-analysis-copypaste check-clang-analysis-diagnostics check-clang-analysis-engine check-clang-analysis-exploration_order check-clang-analysis-html_diagnostics check-clang-analysis-html_diagnostics-relevant_lines check-clang-analysis-inlining check-clang-analysis-objc check-clang-analysis-unified-sources check-clang-analysis-z3 ``` 3) Simplify the logic and only include the subdirectories under clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set. Reviewed By: NoQ Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D62445 llvm-svn: 361790
* Revert "[Analysis] Link library dependencies to Analysis plugins"Akira Hatanaka2019-05-251-7/+3
| | | | | | | | | | | This reverts commit r361340. The following builder has been broken for the past few days because of this commit: http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/ Also revert r361399, which was committed to fix r361340. llvm-svn: 361685
* Fix BUILD_SHARED_LIBS builds after r361567Daniel Sanders2019-05-241-1/+1
| | | | | | Also fixed a comment I noticed while debugging this build llvm-svn: 361591
* Break false dependencies on target librariesDaniel Sanders2019-05-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For the most part this consists of replacing ${LLVM_TARGETS_TO_BUILD} with some combination of AllTargets* so that they depend on specific components of a target backend rather than all of it. The overall effect of this is that, for example, tools like opt no longer falsely depend on the disassembler, while tools like llvm-ar no longer depend on the code generator. There's a couple quirks to point out here: * AllTargetsCodeGens is a bit more prevalent than expected. Tools like dsymutil seem to need it which I was surprised by. * llvm-xray linked to all the backends but doesn't seem to need any of them. It builds and passes the tests so that seems to be correct. * I left gold out as it's not built when binutils is not available so I'm unable to test it Reviewers: bogner, JDevlieghere Reviewed By: bogner Subscribers: mehdi_amini, mgorny, steven_wu, dexonsmith, rupprecht, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62331 llvm-svn: 361567
* [cmake] When getting Ninja version, don't include CMakeNinjaFindMakeDon Hinton2019-05-231-8/+5
| | | | | | | | | | | which doesn't play well with passing CMAKE_MAKE_PROGRAM from the commandline without a path. Fixes a bug introduced in r361280. Thanks to Mikael Holmén for reporting this! llvm-svn: 361501
* Unbreak non-PIC builds after r361340/D62174David Zarzycki2019-05-221-1/+1
| | | | llvm-svn: 361399
* [Analysis] Link library dependencies to Analysis pluginsPetr Hosek2019-05-221-3/+7
| | | | | | | | | These are needed to avoid undefined symbols which aren't satisfied by Clang itself. Differential Revision: https://reviews.llvm.org/D62174 llvm-svn: 361340
* [cmake] Don't use VERSION_GREATER_EQUAL in cmake versions prior to 3.72.Don Hinton2019-05-211-1/+2
| | | | llvm-svn: 361291
* [cmake] Try to make cmake happy and fix bots.Don Hinton2019-05-211-1/+1
| | | | llvm-svn: 361286
* [cmake] Bug in r361281: make include optional and fix typo which might make ↵Don Hinton2019-05-211-1/+1
| | | | | | a difference on some systems. llvm-svn: 361282
* [cmake] Add custom command to touch archives on Darwin so ninja won't ↵Don Hinton2019-05-212-0/+28
| | | | | | | | | | | | | | | | | | | | rebuild them. Summary: clang and newer versions of ninja use high-resolutions timestamps, but older versions of libtool on Darwin don't, so the archive will often get an older timestamp than the last object that was added or updated. To fix this, we add a custom command to touch the archive after it's been built so that ninja won't rebuild it unnecessarily the next time it's run. Reviewed By: beanz Tags: #llvm Differential Revision: https://reviews.llvm.org/D62172 llvm-svn: 361280
* [CMake] Specify component for all target typesPetr Hosek2019-05-211-4/+3
| | | | | | | | | | This addresses an issue introduced in r360230 which broke existing use cases of LLVM_DISTRIBUTION_COMPONENTS since ARCHIVE and LIBRARY target types are no longer handled as components. Differential Revision: https://reviews.llvm.org/D62176 llvm-svn: 361223
* Tweaks for setting CMAKE_LINKER to lld-linkNico Weber2019-05-211-8/+2
| | | | | | | | | | | | | | | - Just look for "lld-link", not "lld-link.exe". llvm/cmake/platforms/WinMsvc.cmake for example sets CMAKE_LINKER to lld-link without .exe - Stop passing -gwarf to the compiler in sanitizer options when lld is enabled -- there's no reason to use different debug information keyed off the linker. (If this was for MinGW, we should check for that instead.) Differential Revision: https://reviews.llvm.org/D62111 llvm-svn: 361214
* build: use clang-cl for runtimes when targeting WindowsSaleem Abdulrasool2019-05-171-3/+18
| | | | | | | | When targeting Windows and building a runtime (subproject) prefer to use `clang-cl` rather than the `clang` driver. This allows us to cross-compile runtimes for the Windows environment from Linux. llvm-svn: 361072
* [Analysis] Only run plugins tests if plugins are actually enabledPetr Hosek2019-05-171-7/+3
| | | | | | | | | | | | | | When plugins aren't enabled, don't try to run plugins tests. Don't enable plugins unconditionally based on the platform, instead check if LLVM shared library is actually being built which may not be the case for every host configuration, even if the host itself supports plugins. This addresses test failures introduced by r360891/D59464. Differential Revision: https://reviews.llvm.org/D62050 llvm-svn: 360991
* [cmake] Remove MSVC C4800 overrideSimon Pilgrim2019-05-101-1/+0
| | | | | | | | | | Remove C4800 : ''type' : forcing value to bool 'true' or 'false' (performance warning)' from the list of forced disabled warnings. I'm not seeing any regressions in VS2017/VS2019 llvm/clang builds from removing this. Differential Revision: https://reviews.llvm.org/D61730 llvm-svn: 360417
* [cmake] Remove MSVC C4355 overrideSimon Pilgrim2019-05-101-1/+0
| | | | | | | | | | Remove C4355 : ''this' : used in base member initializer list' from the list of forced disabled warnings. I'm not seeing any regressions in VS2017/VS2019 llvm/clang builds from removing this. Differential Revision: https://reviews.llvm.org/D61757 llvm-svn: 360413
* Fix whitespace mismatches. NFCI.Simon Pilgrim2019-05-081-5/+5
| | | | | | Tabs are not our friends. llvm-svn: 360248
* [CMake] Install import librariesMartin Storsjo2019-05-081-16/+3
| | | | | | | | | | | | Simplify the cmake logic to install both runtime and import libraries (treated as ARCHIVE), as the later are needed to link against llvm. Patch by Julien Schueller! Differential Revision: https://reviews.llvm.org/D61425 llvm-svn: 360230
* [CMake] Detecting python modules should be cachedChris Bieneman2019-05-071-2/+5
| | | | | | | | | | | | | | Summary: This requres exec-ing python, which in a trace I ran of the CMake re-configure time took ~2% of the reconfigure time. Reviewers: phosek, smeenai, compnerd Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61402 llvm-svn: 360196
* Add libc++ to link XRay test cases if libc++ is used to build CLANGXing Xue2019-05-061-0/+2
| | | | | | | | | | | | | | Summary: When libc++ is used to build CLANG, its XRay libraries libclang_rt.xray-*.a have dependencies on libc++. Therefore, libc++ is needed to link and run XRay test cases. For Linux -rpath is also needed to specify where to load libc++. This change sets macro LLVM_LIBCXX_USED to 1 if libc++ is actually used in the build. XRay tests then check the flag and add -L<llvm_shlib_dir> -lc++ and -Wl,-rpath=<llvm_shlib_dir> if needed. Reviewers: hubert.reinterpretcast, amyk, dberris, jasonliu, sfertile, EricWF Subscribers: dberris, mgorny, jsji, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61016 llvm-svn: 360060
* Fix CMake Invalid Escape SequenceAlexandre Ganea2019-05-061-1/+1
| | | | | | | | Patch by xoviat Differential Revision: https://reviews.llvm.org/D60658 llvm-svn: 360045
* build: add option to disable unwind tablesSaleem Abdulrasool2019-05-021-0/+4
| | | | | | | | | The unwind tables (`.eh_frame`, `.arm.extab`) add a significant chunk of data to the final binaries. These should not be needed normally, particularly when exceptions are disabled. This enables shrinking `lldb-server` by ~18% (3 MiB) when built with gold. llvm-svn: 359819
* Add llvm-profdata to LLVM_TOOLCHAIN_TOOLSRussell Gallop2019-04-301-0/+1
| | | | | | | | | | This is required for using PGO on Windows but isn't in the Windows release packages. Windows packages are built with LLVM_INSTALL_TOOLCHAIN_ONLY so only includes llvm "tools" listed here. Differential Revision: https://reviews.llvm.org/D61317 llvm-svn: 359569
* [cmake] Fix error message on simulated VS version checkRussell Gallop2019-04-301-1/+1
| | | | | | | | | | | | | | For clang-cl self hosts in VS2015 environment this was reporting: "Host Clang must have at least -fms-compatibility-version=19.00.24213.1, your version is 9.0.0". This check fires as CMake detects the simulated environment as _MSC_VER 1900, which is truncated. This makes it less than the required 19.00.24213.1. Differential revision: https://reviews.llvm.org/D61188 llvm-svn: 359556
* [cmake] Disable a GCC optimization when building LLVM for MIPSSimon Atanasyan2019-04-271-0/+5
| | | | | | | | | | | | | | | GCC when compiling LLVM for MIPS can introduce a jump to an uninitialized value when shrink wrapping is enabled. As shrink wrapping is enabled in GCC at all optimization levels, it must be disabled. This bug exists for all versions of GCC since 4.9.2. This partially resolves PR37701 / GCC PR target/86069. Patch by Simon Dardis. Differential Revision: https://reviews.llvm.org/D48069 llvm-svn: 359376
* [CMake][PowerPC] Recognize LLVM_NATIVE_TARGET="ppc64le" as PowerPCKeno Fischer2019-04-251-0/+2
| | | | | | | | | | | | Summary: This value is derived from the host triple, which on the machine I'm currently using is `ppc64le-linux-redhat`. This change makes LLVM compile. Reviewers: nemanjai Differential Revision: https://reviews.llvm.org/D57118 llvm-svn: 359242
* [CMake] Use add_dependencies in add_llvm_install_targetsAlex Langford2019-04-231-2/+16
| | | | | | | | | | | Summary: The CMake documentation says that the `DEPENDS` field of add_custom_target is for files and output of custom commands. Adding a dependency on a target should be done with `add_dependency`. Differential Revision: https://reviews.llvm.org/D60879 llvm-svn: 359042
* [cmake] Fix bug in r358779 - [CMake] Pass monorepo build settings in cross ↵Don Hinton2019-04-211-2/+7
| | | | | | | | | compile Escape semicolons in the targets list so that cmake doesn't expand them to spaces. llvm-svn: 358859
* [CMake] Pass monorepo build settings in cross compileChris Bieneman2019-04-191-0/+2
| | | | | | | | This allows the cross compiled build targets to configure the LLVM tools and sub-projects that are part of the main build. This is needed for generating native non llvm *-tablegen tools when cross compiling clang in the monorepo build environment. llvm-svn: 358779
OpenPOWER on IntegriCloud