summaryrefslogtreecommitdiffstats
path: root/llvm/cmake
Commit message (Collapse)AuthorAgeFilesLines
...
* [CMake] Export the LLVM_LINK_LLVM_DYLIB settingPhilip Pfaffe2018-07-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When building out-of-tree tools, there are several macros available to automate linking against llvm. An examples is `add_llvm_executable`, or the clang variant of this. These macros use the LLVM_LINK_LLVM_DYLIB option to decide whether to link against libraries defined by setting LLVM_LINK_COMPONENTS or to link against libLLVM instead. Currently this is problematic in out-of-tree targets, because they cannot identify whether this option is required or even available. If the option was enabled in LLVM's own build, the clang libraries are built against libLLVM, so a client linking against those must link against it too. On the other hand the client can't just always link against it, because it might not be available. This is related to D44391, but that change assumed the client knew whether they wanted the dylib or not. Reviewers: mgorny, beanz, labath Reviewed By: mgorny Subscribers: bollu, llvm-commits Differential Revision: https://reviews.llvm.org/D49193 llvm-svn: 337366
* [CMake] Pass CMAKE_INSTALL_DO_STRIP to external projectsPetr Hosek2018-07-151-1/+1
| | | | | | | | | This is necessary to make install-<target>-stripped work for external projects such as runtimes. Differential Revision: https://reviews.llvm.org/D49335 llvm-svn: 337115
* [CMake] Teach the build system to codesign built productsJustin Bogner2018-07-102-0/+49
| | | | | | | | | | | Automatically codesign all executables and dynamic libraries if a codesigning identity is given (via LLVM_CODESIGNING_IDENTITY). This option is darwin only for now. Also update platforms/iOS.cmake to pick up the right versions of codesign and codesign_allocate. llvm-svn: 336708
* [cmake] Change WIN32 test to CMAKE_HOST_WIN32Filipe Cabecinhas2018-06-291-1/+1
| | | | | | | | | The test is about what can be run on the host, not the cmake target. When cross-compiling (compiler-rt at least) on Windows, we end up with lit being unable to run llvm-lit because it can't find the llvm-lit module. llvm-svn: 335961
* [CMake] Respect CMAKE_STRIP and CMAKE_DSYMUTIL on apple platformsJustin Bogner2018-06-282-2/+35
| | | | | | | | This allows overriding the strip and dsymutil tools, and updates iOS.cmake to do so. I've also added libtool to iOS.cmake, but it was already respecting CMAKE_LIBTOOL if set. llvm-svn: 335900
* [CMake] Use variables rather than ":" delimitersPetr Hosek2018-06-271-8/+5
| | | | | | | | This is a more idiomatic CMake. Differential Revision: https://reviews.llvm.org/D37644 llvm-svn: 335703
* [CMake] Do not use --gc-sections on OpenBSDBrad Smith2018-06-231-1/+1
| | | | llvm-svn: 335425
* [cmake] Change ON/OFF to YES/NO. NFCShoaib Meenai2018-06-141-9/+9
| | | | | | compnerd pointed out that the latter reads better over here. llvm-svn: 334781
* [cmake] Add linker detection for Apple platformsShoaib Meenai2018-06-141-1/+14
| | | | | | | | | | | | | | | | LLVM currently assumes that Apple platforms will always use ld64. In the future, LLD Mach-O might also be supported, so add the beginnings of linker detection support. ld64 is currently the only detected linker, since `ld64.lld -v` doesn't yield any useful version output, but we can add that detection later, and in the meantime it's still useful to have the ld64 identification. Switch clang's order file check to use this new detection rather than just checking for the presence of an ld64 executable. Differential Revision: https://reviews.llvm.org/D48201 llvm-svn: 334780
* [CMAKE] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2Bruno Cardoso Lopes2018-06-141-1/+5
| | | | | | | | | | | | | On MacOS, if CMAKE_OSX_SYSROOT is used and the user has command line tools installed, we currently get the include path for libxml2 as /usr/include/libxml2, instead of ${CMAKE_OSX_SYSROOT}/usr/include/libxml2. Make it consistent on MacOS by prefixing ${CMAKE_OSX_SYSROOT} when possible. rdar://problem/41103601 llvm-svn: 334746
* [CMake] Pass additional CMake tools to external projectsPetr Hosek2018-06-061-2/+22
| | | | | | | | | This is needed when the external projects try to use other tools besides just the compiler and the linker. Differential Revision: https://reviews.llvm.org/D47833 llvm-svn: 334136
* [cmake] fix a typo in llvm_config macroPavel Labath2018-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: The macro parses out the USE_SHARED option out of the argument list, but then ignores it and accesses the variable with the same name instead. It seems the intention here was to check the argument value. Technically, this is NFC, because the only in-tree usage (add_llvm_executable) of USE_SHARED sets both the variable and the argument when calling llvm_config, but it makes the usage of this macro for out-of-tree users more sensible. Reviewers: mgorny, beanz Reviewed By: mgorny Subscribers: foutrelis, llvm-commits Differential Revision: https://reviews.llvm.org/D44420 llvm-svn: 334082
* Use -Wextra spelling instead of -WNico Weber2018-05-311-1/+1
| | | | | | | No difference in behavior, but a bit easier to search for. https://reviews.llvm.org/D47490 llvm-svn: 333651
* Remove CMake workaround for LLD PR24476 which is no longer neededReid Kleckner2018-05-211-8/+0
| | | | llvm-svn: 332880
* Revert 332750, llvm part (see comment on D46910).Nico Weber2018-05-201-4/+4
| | | | llvm-svn: 332823
* [cmake] Add a switch to enable/disable bindings.Vassil Vassilev2018-05-201-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D42026 llvm-svn: 332816
* Enable colored diagnostics in ninja builds when building with gcc 4.9+.Nico Weber2018-05-191-4/+6
| | | | | | | | GCC has supported -fdiagnostics-color since 4.9. https://reviews.llvm.org/D47083 llvm-svn: 332793
* [Support] Avoid normalization in sys::getDefaultTargetTriplePetr Hosek2018-05-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | The return value of sys::getDefaultTargetTriple, which is derived from -DLLVM_DEFAULT_TRIPLE, is used to construct tool names, default target, and in the future also to control the search path directly; as such it should be used textually, without interpretation by LLVM. Normalization of this value may lead to unexpected results, for example if we configure LLVM with -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-linux-gnu, normalization will transform that value to x86_64--linux-gnu. Driver will use that value to search for tools prefixed with x86_64--linux-gnu- which may be confusing. This is also inconsistent with the behavior of the --target flag which is taken as-is without any normalization and overrides the value of LLVM_DEFAULT_TARGET_TRIPLE. Users of sys::getDefaultTargetTriple already perform their own normalization as needed, so this change shouldn't impact existing logic. Differential Revision: https://reviews.llvm.org/D46910 llvm-svn: 332750
* [CMake] Make optimizing sanitizer builds optionalChris Bieneman2018-05-171-1/+1
| | | | | | This behavior has been the default for a long time, so the default value is On, however this can make it difficult to debug sanitizer failures, so we should have an option to turn it off. llvm-svn: 332628
* [CMake] Use CMAKE_OBJCOPY and CMAKE_STRIP to externalize debug infoPetr Hosek2018-05-091-3/+3
| | | | | | | | | | Don't hardcode objcopy and strip names, rather use CMAKE_OBJCOPY and CMAKE_STRIP variables which allows users to override the tools used such as using llvm-objcopy and llvm-strip instead of binutils versions. Differential Revision: https://reviews.llvm.org/D46611 llvm-svn: 331827
* Revert r330742: Let TableGen write output only if it changed, instead of ↵Chandler Carruth2018-05-071-4/+16
| | | | | | | | | | | | | | | | | | | | doing so in cmake. This change causes us to re-run tablegen for every single target on every single build. This is much, much worse than the problem being fixed AFAICT. On my system, it makes a clean rebuild of `llc` with nothing changed go from .5s to over 8s. On systems with less parallelism, slower file systems, or high process startup overhead this will be even more extreme. The only way I see this could be a win is in clean builds where we churn the filesystem. But I think incremental rebuild is more important, and so if we want to re-instate this, it needs to be done in a way that doesn't trigger constant re-runs of tablegen. llvm-svn: 331702
* [Support] Support building LLVM for FuchsiaPetr Hosek2018-05-031-3/+3
| | | | | | | | | | These are necessary changes to support building LLVM for Fuchsia. While these are not sufficient to run on Fuchsia, they are still useful when cross-compiling LLVM libraries and runtimes for Fuchsia. Differential Revision: https://reviews.llvm.org/D46345 llvm-svn: 331423
* Stop setting LLVM_ON_WIN32 in config.h and llvm-config.h.Nico Weber2018-04-301-1/+0
| | | | | | | | | | | | | | See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. I replaced all uses of LLVM_ON_WIN32 with _WIN32 in r331127 (llvm), r331069 (clang), r329697 (lldb), r329696 (lld), r329696 (clang-tools-extra). If your out-of-tree program used LLVM_ON_WIN32, just use _WIN32 instead, which is set at exactly the same time to exactly the same value. https://reviews.llvm.org/D46264 llvm-svn: 331224
* [cmake] Make linker detection take flags into accountShoaib Meenai2018-04-261-1/+2
| | | | | | | | | | | | LLVM might be compiled using a toolchain file which controls the linker to use via flags (e.g. `-B` or `-fuse-ld=`). Take these flags into account for linker detection. We can also correct the detection by manually passing LLVM_USE_LINKER, of course, but it seems more convenient to have the detection take flags into account. Differential Revision: https://reviews.llvm.org/D45464 llvm-svn: 330924
* Rename Attributes.gen, Intrinsics.gen to Attributes.inc, Intrinsics.incNico Weber2018-04-251-3/+3
| | | | | | | | | Virtually all other tablegen outputs are called .inc, not .gen, so rename these two too for consistency. No behavior change. https://reviews.llvm.org/D46058 llvm-svn: 330843
* [cmake] Fix libc++ detectionShoaib Meenai2018-04-241-2/+4
| | | | | | | | | | | -stdlib=libc++ is added to both the compilation and the link flags, but the logic for adding it was only checking if it was supported during compilation and not linking. This could lead to false positives, for example when using clang with libstdc++ (where the compiler would support -stdlib=libc++ but then linking would fail because of libc++ actually being unavailable). llvm-svn: 330761
* Let TableGen write output only if it changed, instead of doing so in cmake.Nico Weber2018-04-241-16/+4
| | | | | | | | | | | Removes one subprocess and one temp file from the build for each tablegen invocation. No intended behavior change. https://reviews.llvm.org/D45899 llvm-svn: 330742
* [cmake] Improve pthread_[gs]etname_np detection codePavel Labath2018-04-181-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Due to some android peculiarities, in some build configurations (statically linked executables targeting older releases) we could detect the presence of these functions (because they are present in libc.a, where check_library_exists searches), but then fail to build because the headers did not include the definition. This attempts to remedy that by upgrading the check_library_exists to check_symbol_exists, which will check that the function is declared too. I am hoping that a more thorough check will make the messy #ifdef we have accumulated in the code obsolete, so I optimistically try to remove them. Reviewers: zturner, kparzysz, danalbert Subscribers: srhines, mgorny, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D45359 llvm-svn: 330251
* Revert "build: reserve `--color-diagnostics` for lld"Saleem Abdulrasool2018-04-161-1/+1
| | | | | | | | | | | | This reverts SVN r330158. Seems that there was a change to linker flags handling in SVN r316972. That would alter the behaviour to correct the linker flag handling in CMake (requiring CMake 3.4.3+). Since that is already the minimum version required for LLVM, hard coding the knowledge of the linker is not required, which is a strictly better solution. llvm-svn: 330161
* build: reserve `--color-diagnostics` for lldSaleem Abdulrasool2018-04-161-1/+1
| | | | | | | | | | When building out-of-tree compilers (e.g. swift), the linker check here may yield incorrect values. Ensure that we are using lld before we attempt to use `--color-diagnostics` for the linker. Other linkers (i.e bfd, gold) do not support this flag and the test can pass in some cases and then fail subsequently when building. llvm-svn: 330158
* [Build][NFC] Split off libpfm detection to a separate module.Clement Courbet2018-04-112-11/+24
| | | | llvm-svn: 329783
* [llvm-exegesis] Add a flag to disable libpfm even if present.Clement Courbet2018-04-111-7/+9
| | | | | | | | | | | | Summary: Fixes PR37053. Reviewers: uabelho, gchatelet Subscribers: mgorny, tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D45436 llvm-svn: 329781
* [llvm-exegesis] Check for libpfm headers.Clement Courbet2018-04-051-1/+11
| | | | | | HAVE_LIBPFM is only defined if the libpfm headers are present. llvm-svn: 329261
* Re-land r329156 "Add llvm-exegesis tool."Clement Courbet2018-04-041-0/+1
| | | | | | Fixed to depend on and initialize the native target instead of X86. llvm-svn: 329169
* Revert r329156 "Add llvm-exegesis tool."Clement Courbet2018-04-041-1/+0
| | | | | | Breaks a bunch of bots. llvm-svn: 329157
* Add llvm-exegesis tool.Clement Courbet2018-04-041-0/+1
| | | | | | | | | | | | | | | | | Summary: [llvm-exegesis][RFC] Automatic Measurement of Instruction Latency/Uops This is the code corresponding to the RFC "llvm-exegesis Automatic Measurement of Instruction Latency/Uops". The RFC is available on the LLVM mailing lists as well as the following document for easier reading: https://docs.google.com/document/d/1QidaJMJUyQdRrFKD66vE1_N55whe0coQ3h1GpFzz27M/edit?usp=sharing Subscribers: mgorny, gchatelet, orwant, llvm-commits Differential Revision: https://reviews.llvm.org/D44519 llvm-svn: 329156
* Remove some unused cmake standard library includes.Nico Weber2018-04-021-3/+0
| | | | llvm-svn: 328996
* Remove more feature test macros that became unused after r328989.Nico Weber2018-04-021-3/+0
| | | | llvm-svn: 328995
* Remove HAVE_LIBPSAPI, HAVE_SHELL32.Nico Weber2018-04-021-7/+0
| | | | | | | | | | These used to be set in the old autoconf build, but the cmake build has had a "TODO: actually check for these" comment since it was checked in, and they were set to 1 on mingw unconditionally. It seems safe to say that they always exist under mingw, so just remove them and assume they're set exactly when on mingw (with msvc, we use `pragma comment` instead of linking these via flags). llvm-svn: 328992
* Remove HAVE_DIRENT_H.Nico Weber2018-04-021-1/+0
| | | | | | | The autoconf manual: "This macro is obsolescent, as all current systems with directory libraries have <dirent.h>. New programs need not use this macro." llvm-svn: 328989
* Remove stro(u?)ll() config checks. Those were needed pre-MSVC2013, but we ↵Nico Weber2018-04-021-11/+0
| | | | | | require 2015 nowadays. llvm-svn: 328979
* Remove HAVE_WRITEV that's unused after r255837.Nico Weber2018-04-021-4/+0
| | | | llvm-svn: 328977
* Assume existence of inttypes.h and stdint.h in DataTypes.h.Nico Weber2018-04-021-34/+0
| | | | | | | | | | | | | These should exist in all toolchains LLVM supports nowadays. Enables making DataTypes.h a regular header instead of a .h.cmake file and allows deleting a bunch of cmake goop (which should also speed up cmake configure time a bit). All the code this removes is 9+ years old. https://reviews.llvm.org/D45155 llvm-svn: 328970
* Remove a few unreferenced config.h defines.Nico Weber2018-04-021-5/+0
| | | | | | | | | | | | Found by looking through the output of for f in $(grep -o '\bHAVE_[A-Z0-9_]*\b' llvm/cmake/config-ix.cmake); do echo $f $(git grep $f '*' | wc -l); done in the monorepo. llvm-svn: 328957
* Rename llvm library from libLLVM-X.Y to libLLVM-XSylvestre Ledru2018-03-291-3/+3
| | | | | | | | | | | | | | | | | | Summary: As we are only doing X.0.Z releases (not using the minor version), there is no need to keep -X.Y in the version. Like patch https://reviews.llvm.org/D41808, I propose that we rename libLLVM-7.0svn.so to libLLVM-7svn.so This patch will also rename downstream libraries like liblldb-7.0 to liblldb-7 Reviewers: axw, beanz, dim, hans Reviewed By: dim, hans Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D41869 llvm-svn: 328768
* Accept any filepath in llvm_check_source_file_listSerge Guelton2018-03-191-4/+14
| | | | | | | | | | | Cmake function llvm_check_source_file_list currently only accepts paths relative to current CMAKE_SOURCE_DIR or relative to argument SOURCE_DIR. Extend it to accept any path, including absolute ones. Differential revision: https://reviews.llvm.org/D44625 llvm-svn: 327912
* Export LLVM_DYLIB_COMPONENTS in LLVMConfig.cmakePavel Labath2018-03-141-0/+2
| | | | | | | | | | | | | | | | | Summary: This is needed so that external projects (e.g. a standalone build of lldb) can link to the LLVM shared library via the USE_SHARED argument of llvm_config. Without this, llvm_config would add LLVM to the link list, but then also add the constituent static libraries, resulting in multiply defined symbols. Reviewers: beanz, mgorny Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44391 llvm-svn: 327484
* Build system changes for RISCVAzharuddin Mohammed2018-03-131-0/+4
| | | | | | | | | | | | | | Summary: Build system changes for RISCV. Makes it possible to build just the RISCV target alone. Reviewers: asb, apazos, mgrang, beanz Reviewed By: asb Subscribers: mgorny, kito-cheng, shiva0217, llvm-commits Differential Revision: https://reviews.llvm.org/D44153 llvm-svn: 327423
* [cmake] Append -Wl,-rpath-link conditionally to GNULDMichal Gorny2018-03-081-1/+2
| | | | | | | | | | | | | | | Append -Wl,-rpath-link conditionally to whether GNU ld.bfd is used rather than the Linux+!gold conditionals. Also move it out of 'else' branch of *BSD handling. This fixes build failures with ld.bfd on Gentoo/FreeBSD, and should cause no harm on other systems using ld.bfd. This patch improves the original logic by reusing results of linker detection introduced in r307852. Differential Revision: https://reviews.llvm.org/D43751 llvm-svn: 327007
* Fix cmake's multi-config generators after r326738Daniel Sanders2018-03-071-3/+1
| | | | | | | LLVM_ENABLE_STATS isn't known at configure-time in these generators so we must defer it to build-time. llvm-svn: 326936
OpenPOWER on IntegriCloud