summaryrefslogtreecommitdiffstats
path: root/llvm/cmake
Commit message (Collapse)AuthorAgeFilesLines
...
* [CMake] Split -gx strip flag into -g -xPetr Hosek2018-08-141-1/+1
| | | | | | | | | llvm-strip doesn't handle -gx spelling, so we need to split these as two separate flags. Differential Revision: https://reviews.llvm.org/D50684 llvm-svn: 339639
* [CMake] Use normalized Windows target triplesPetr Hosek2018-08-091-4/+4
| | | | | | | | | | | Changes the default Windows target triple returned by GetHostTriple.cmake from the old environment names (which we wanted to move away from) to newer, normalized ones. This also requires updating all tests to use the new systems names in constraints. Differential Revision: https://reviews.llvm.org/D47381 llvm-svn: 339307
* [cmake] Append LLVM_VERSION_SUFFIX to SOVERSIONMichal Gorny2018-08-081-1/+1
| | | | | | | | | | | | | | | | | Append LLVM_VERSION_SUFFIX to SOVERSION. This makes it possible to use the suffix to differentiate binary-incompatible versions of LLVM built via BUILD_SHARED_LIBS. We are planning to use this to temporarily preserve ABI-incompatible variants of LLVM while switching the system between them, e.g. when rebuilding the system to use libc++. Normally this would mean that once LLVM is rebuilt using libc++ all the reverse dependencies become immediately broken. Using a distinct SOVERSION allows us to preserve the ABI compatibility before all the packages are rebuilt. Differential Revision: https://reviews.llvm.org/D39939 llvm-svn: 339286
* cmake: Store LLVM_VERSION_SUFFIX in LLVMConfig.cmakeMichal Gorny2018-08-081-0/+1
| | | | | | | | | | | | | | | | Store LLVM_VERSION_SUFFIX along with other version components in LLVMConfig.cmake. This fixes preserving the suffix set while building LLVM to stand-alone builds of other components, e.g. clang, and therefore improves uniformity between the two build models. Given that there is no apparent reason to omit this part of version, that it is distributed to subprojects when building as part of LLVM and that it is included in LLVM_PACKAGE_VERSION, I think it was omitted accidentally rather than done on purpose. Differential Revision: https://reviews.llvm.org/D43701 llvm-svn: 339285
* Add llvm-rc to LLVM_TOOLCHAIN_TOOLS (PR38386)Hans Wennborg2018-08-011-0/+1
| | | | | | | This means it will be installed also in builds configured with LLVM_INSTALL_TOOLCHAIN_ONLY, such as the Windows packages. llvm-svn: 338495
* [CMake] Followup for r337366: Only export LLVM_LINK_LLVM_DYLIB if it's set to ONPhilip Pfaffe2018-07-272-1/+7
| | | | | | | | | | | | | | | | | | Summary: As it was, always exporting LLVM_LINK_LLVM_DYLIB caused out-of-tree clients to lose the ability to link against the dylib, even if in-tree tools did not. By only exporting the setting if it is enabled, out-of-tree clients get the correct default, but may still choose if they can. Reviewers: mgorny, beanz, labath, bogner, chandlerc Reviewed By: bogner, chandlerc Subscribers: bollu, llvm-commits Differential Revision: https://reviews.llvm.org/D49843 llvm-svn: 338119
* [UBSan] Also use blacklist for 'Address; Undefined' settingFlorian Hahn2018-07-201-5/+7
| | | | | | | | | | | | | | | It looks like currently the UBSan blacklist is only applied when "Undefined" is selected. This patch updates the cmake file to apply it whenever Undefined is selected (e.g. 'Address; Undefined' ). This allows us to use the workaround added in rL335525 when using AddressSan and UBSan together. Reviewers: eugenis, vitalybuka Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D49558 llvm-svn: 337539
* Disable GCC's -Wclass-memaccess warningReid Kleckner2018-07-191-0/+5
| | | | | | | | | | | | It fires on things like SmallVector<std::pair<int, int>>, where we intentionally use memcpy instead of calling the assignment operator. This warning fires in practically every LLVM TU, so we have to do something about it, even if we aren't interested in being 100% warning clean with GCC. Reported as PR37337 llvm-svn: 337492
* [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
OpenPOWER on IntegriCloud