summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-config
Commit message (Collapse)AuthorAgeFilesLines
* [llvm-config] Use WithColor for printing errors.Jonas Devlieghere2018-06-231-7/+9
| | | | | | Use the WithColor helper from support to print errors. llvm-svn: 335417
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-011-4/+4
| | | | | | | | | | | | | | | | We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46290 llvm-svn: 331272
* [tools] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches. Reviewers: JDevlieghere, zturner, echristo, dberris, friss Reviewed By: echristo Subscribers: gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D45141 llvm-svn: 328943
* Rename llvm library from libLLVM-X.Y to libLLVM-XSylvestre Ledru2018-03-291-1/+1
| | | | | | | | | | | | | | | | | | 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
* CMake: Make libxml2 show up in --system-libs (PR36660)Hans Wennborg2018-03-091-2/+3
| | | | | | | | | | lib/WindowsManifest/CMakeLists.txt adds it to LLVM_SYSTEM_LIBS on that target, but it was never getting picked up in tools/llvm-config/CMakeLists.txt. Differential Revision: https://reviews.llvm.org/D44302 llvm-svn: 327135
* [cmake] Don't build Native llvm-config when cross compiling if passed by user.Don Hinton2018-01-211-8/+7
| | | | | | | | | | | | Summary: Rename LLVM_CONFIG_EXE to LLVM_CONFIG_PATH, and avoid building it if passed in by user. This is the same way CLANG_TABLEGEN and LLVM_TABLEGEN are handled, e.g., when -DLLVM_OPTIMIZED_TABLEGEN=ON is passed. Differential Revision: https://reviews.llvm.org/D41806 llvm-svn: 323053
* [GlobalISel] Make GlobalISel a non-optional library.Quentin Colombet2017-08-031-5/+1
| | | | | | | | With this change, the GlobalISel library gets always built. In particular, this is not possible to opt GlobalISel out of the build using the LLVM_BUILD_GLOBAL_ISEL variable any more. llvm-svn: 309990
* [Modules] llvm-config: Exclude CMAKE_CFG_INTDIR. It isn't used in headers.NAKAMURA Takumi2017-07-311-0/+6
| | | | | | This is part of https://reviews.llvm.org/D35559 llvm-svn: 309552
* [llvm-config] Don't use PATH_MAXKeno Fischer2017-06-011-1/+1
| | | | | | | | It doesn't exist on Windows. The number we use here doesn't really matter, the storage will expand automatically but 256 seems like a reasonable default. Should fix windows buildbots that complained about rL304458. llvm-svn: 304468
* [llvm-config] Report --bindir based on LLVM_TOOLS_INSTALL_DIRKeno Fischer2017-06-012-1/+4
| | | | | | | | | | | | | | | | | | | Summary: `LLVM_TOOLS_INSTALL_DIR` was introduced in r272200 in order to override the directory name into which to install LLVM's executable. However, `llvm-config --bindir` still reported `$PREFIX/bin` independent of what LLVM_TOOLS_INSTALL_DIR was set to. This fixes the out-of-tree clang standalone build for me. Reviewers: beanz, tstellar Reviewed By: tstellar Subscribers: chapuni, tstellar, llvm-commits Differential Revision: https://reviews.llvm.org/D22499 llvm-svn: 304458
* [CMake] Use variable interpolation instead of string concatenationSerge Pavlov2017-03-221-3/+3
| | | | | | | String concatenation used in r298336 allowed to get rid of extra spaces but also resulted in lost delimiter spaces, so use previous method. llvm-svn: 298498
* Fix evaluation of LLVM_DEFINITIONSSerge Pavlov2017-03-211-3/+3
| | | | | | | | | | | | | | | | CMake variable LLVM_DEFINITIONS collects preprocessor definitions provided for host compiler that builds llvm components. A function add_llvm_definitions was introduced in AddLLVMDefinitions.cmake to keep track of these definitions and was intended to be a replacement for CMake command add_definitions. Actually in many cases add_definitions is still used and the content of LLVM_DEFINITIONS is not actual now. On the other hand the current version of CMake allows getting set of definitions in a more convenient way. This fix implements evaluation of the variable by reading corresponding cmake property. Differential Revision: https://reviews.llvm.org/D31125 llvm-svn: 298336
* [llvm-config] Fix obviously wrong code in parsing DyLib components.Marcello Maggioni2017-01-121-1/+1
| | | | | | | | | | | | | | The code parsing the string was using the offset returned from StringRef::find() wrong, assuming it was relative to the staring offset that is passed to the function, but the returned offset is always relative to the beginning of the line. This causes odd behaviour while parsing the component string. Spotted thanks to the newly added test: tools/llvm-config/booleans.test llvm-svn: 291803
* [llvm-config] Canonicalize CMake booleans to 0/1Michal Gorny2017-01-103-16/+17
| | | | | | | | | | | | | | | | | | | | Following the similar change to lit configuration, ensure that all CMake booleans are canonicalized to 0/1 when being passed to llvm-config. This fixes the incorrect interpretation of values when user passes another value than the ON/OFF, and simplifies the code by removing unnecessary string matching. Furthermore, the code for --has-rtti and --has-global-isel has been modified to print consistent values indepdently of the boolean used by passed by the user to CMake. Sadly, the code already implicitly used different values for the two (YES/NO for --has-rtti, ON/OFF for --has-global-isel). Include tests for all booleans and multi-value options in llvm-config. Differential Revision: https://reviews.llvm.org/D28366 llvm-svn: 291593
* [llvm-config] Print --system-libs only when static linkingMichal Gorny2017-01-061-2/+6
| | | | | | | | | | | | | | | Modify the --system-libs option in llvm-config to print system libs only when using static linking. The system libraries are irrelevant when linking to a shared library since the library has appropriate library dependencies embedded. Modify the --system-libs test appropriately to force static linking, and disable it if static libs are not available (i.e. BUILD_SHARED_LIBS is enabled). Differential Revision: https://reviews.llvm.org/D27805 llvm-svn: 291285
* [llvm-config] Add --cmakedir to obtain CMake module locationMichal Gorny2017-01-061-1/+9
| | | | | | | | | | | | Add a --cmakedir option to llvm-config that returns the correct path to built/installed CMake modules (i.e. lib/cmake/llvm). This is mostly intended as a convenience option for stand-alone builds of other LLVM projects that frequently reconstruct LLVM_CMAKE_PATH after querying llvm-config. Differential Revision: https://reviews.llvm.org/D26894 llvm-svn: 291218
* cmake: Don't build llvm-config and tblgen concurrently in cross buildsJustin Bogner2016-12-211-1/+2
| | | | | | | | | | | | | This sets USES_TERMINAL for the native llvm-config build, so that it doesn't run at the same time as builds of other native tools (namely, tablegen). Without this, if you're very unlucky with the timing it's possible to be relinking libSupport as one of the tools is linking, causing a spurious failure. The tablegen build adopted USES_TERMINAL for this same reason in r280748. llvm-svn: 290271
* [llvm-config] Fixing one check where shared libs implied dylibChris Bieneman2016-12-131-2/+2
| | | | | | We shouldn't print the dylib if LinkDylib is false. llvm-svn: 289609
* llvm-config: Set LinkMode in addition to LinkDyLib when using --ignore-llvmDerek Schuff2016-12-131-2/+3
| | | | | | | | | | | | | | | Summary: LinkDyLib is only used (before arg processing) to set up the default for LinkMode. So reset LinkMode as well, and process before --link-shared or --link-static to allow those flags to continue to override it. Reviewers: beanz Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27736 llvm-svn: 289608
* [llvm-config] Add --ignore-libllvmChris Bieneman2016-12-131-0/+3
| | | | | | This flag forces off linking libLLVM. This should resolve some issues reported on llvm-commits. llvm-svn: 289605
* [llvm-config] Fix bug where `--libfiles` and `--names` would produceDan Liew2016-12-121-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | incorrect output when LLVM is built with `LLVM_BUILD_LLVM_DYLIB`. `llvm-config` previously produced output like this ``` $ llvm-config --libfiles /usr/lib/liblibLLVM-4.0svn.so.so $ llvm-config --libnames liblibLLVM-4.0svn.so.so ``` The library prefix and shared library extension were added to the library name twice which was wrong. I wanted to write a test cases for this but it looks like **all** `llvm-config` tests were disabled by r260386 so I'll leave this for now. Subscribers: llvm-commits, tstellarAMD Reviewers: beanz, DiamondLovesYou, axw Differential Revision: https://reviews.llvm.org/D27393 llvm-svn: 289488
* Replace a few more "fall through" comments with LLVM_FALLTHROUGHJustin Bogner2016-08-171-1/+1
| | | | | | Follow up to r278902. I had missed "fall through", with a space. llvm-svn: 278970
* [llvm-config][GlobalISel] Canonicalize LLVM_HAS_GLOBAL_ISEL on ON/OFF.Quentin Colombet2016-07-211-1/+5
| | | | | | | | | | | Previously LLVM_HAS_GLOBAL_ISEL would directly get the value of LLVM_BUILD_GLOBAL_ISEL. This could be any integer value and not just ON and OFF. The problem is that lit.cfg was checking for ON to define that global-isel was supported, thus if we were setting LLVM_BUILD_GLOBAL_ISEL with an integer value, say 1, this test would fail whereas we do build global-isel and want to test it. llvm-svn: 276307
* [build] Make sure to link main executable with pthreadsArtem Belevich2016-06-211-1/+7
| | | | | | | | | | Otherwise it gets linked in by one of the dependencies of shared libraries which may be too late and we end up with weird crashes in std::call_once(). Differential Revision: http://reviews.llvm.org/D21478 llvm-svn: 273302
* llvm-config: fix --libs on LinuxReid Kleckner2016-03-141-7/+9
| | | | | | | | | | | | | | | | | | | | Summary: llvm-config --libs does not produce correct output since commit r260263 (llvm-config: Add preliminary Windows support) changed naming format of the libraries. This patch updates llvm-config to recognize new naming format and output correct linker flags. Ref: https://llvm.org/bugs/show_bug.cgi?id=26581 Patch by Vedran Miletić Reviewers: ehsan, rnk, pxli168 Subscribers: pxli168 Differential Revision: http://reviews.llvm.org/D17300 llvm-svn: 263497
* [llvm-config] Get rid of code related to the Makefile buildsFilipe Cabecinhas2016-03-081-32/+5
| | | | | | | | | | | | Summary: I left --build-system for backwards compat, in case there are scripts using it. Feel free to ask for its removal too. Reviewers: chapuni, tstellarAMD Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17886 llvm-svn: 262924
* [llvm-config] Teach llvm-config about global-isel.Quentin Colombet2016-03-083-0/+5
| | | | | | | | llvm-config can know tell whether or not a build has been configured to support global-isel. Use '--has-global-isel' for that. llvm-svn: 262877
* llvm-config: replace assertions with a helpful error messageMehdi Amini2016-02-121-0/+8
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 260700
* llvm-config: Fix DLL prefix on cygming.NAKAMURA Takumi2016-02-101-1/+1
| | | | | | For example, LLVMSupport takes the form of LLVMSupport.dll, not libLLVMSupport.dll. llvm-svn: 260351
* llvm-config: Quick fix for cross compilation. Don't be confsed between host ↵NAKAMURA Takumi2016-02-101-1/+1
| | | | | | | and target. It has been there since r252532. FIXME: The clause may use conditions of host compiler, not HOST_TRIPLE. llvm-svn: 260343
* llvm-config: Add preliminary Windows supportEhsan Akhgari2016-02-092-34/+59
| | | | | | | | | | | | | | | | | Summary: This patch adds Windows support for a few of the llvm-config commands, including cflags, ldflags, libs, and system-libs. Currently llvm-config is untested, so this patch adds tests for the commands that it fixes as well. Reviewers: rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16762 llvm-svn: 260263
* Remove autoconf supportChris Bieneman2016-01-261-99/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* tools/llvm-config: improve shared library supportAndrew Wilkins2016-01-204-41/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a re-commit of r257003, which was reverted, along with the fixes from http://reviews.llvm.org/D15986. r252532 added support for reporting the monolithic library when LLVM_BUILD_LLVM_DYLIB is used. This would only be done if the individual components were not found, and the dynamic library is found. This diff extends this as follows: - If LLVM_LINK_LLVM_DYLIB is set, then prefer the shared library, even if all component libraries exist. - Two flags, --link-shared and --link-static are introduced to provide explicit guidance. If --link-shared is passed and the shared library does not exist, an error results. Additionally, changed the expected shared library names from (e.g.) LLVM-3.8.0 to LLVM-3.8. The former exists only in an installation (and then only in CMake builds I think?), and not in the build tree; this breaks usage of llvm-config during builds, e.g. by llvm-go. Reviewers: DiamondLovesYou, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15986 llvm-svn: 258283
* Revert r257003Andrew Wilkins2016-01-124-94/+25
| | | | | | | | This revision breaks llvm-config if you set BUILD_SHARED_LIBS=on in a CMake build. Backing out until the fix is ready to land. llvm-svn: 257457
* tools/llvm-config: improve shared library supportAndrew Wilkins2016-01-074-25/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: r252532 added support for reporting the monolithic library when LLVM_BUILD_LLVM_DYLIB is used. This would only be done if the individual components were not found, and the dynamic library is found. This diff extends this as follows: - If LLVM_LINK_LLVM_DYLIB is set, then prefer the shared library, even if all component libraries exist. - Two flags, --link-shared and --link-static are introduced to provide explicit guidance. If --link-shared is passed and the shared library does not exist, an error results. Additionally, changed the expected shared library names from (e.g.) LLVM-3.8.0 to LLVM-3.8. The former exists only in an installation (and then only in CMake builds I think?), and not in the build tree; this breaks usage of llvm-config during builds, e.g. by llvm-go. Reviewers: DiamondLovesYou, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15033 llvm-svn: 257003
* Fix a use-after-free in `llvm-config`.Richard Diamond2015-11-251-10/+10
| | | | | | | | | | | | | | | Summary: This could happen if `GetComponentNames` is true, because `Name` from `VisitComponent` would reference a stack instance of `std::string` in `ComputeLibsForComponents`. Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14913 llvm-svn: 254108
* llvm-config.cpp: Prune an obsolete \param. [-Wdocumentation]NAKAMURA Takumi2015-11-111-2/+0
| | | | llvm-svn: 252762
* Fix mingw targets. Bandaid for r252532's buildbot brakage.Richard Diamond2015-11-101-1/+1
| | | | | | | | | | Reviewers: brad.king, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14523 llvm-svn: 252576
* Simplify some APIs I was cleaning up while fixing -Wpessimizing-move warningDavid Blaikie2015-11-091-27/+25
| | | | | | (Reid fixed the original error, but this seems nice to do in any case) llvm-svn: 252548
* Fix -Wpessimizing-move warning in llvm-config.cppReid Kleckner2015-11-091-1/+1
| | | | llvm-svn: 252542
* Fix `llvm-config` to adapt to the install environment.Richard Diamond2015-11-094-22/+259
| | | | | | | | | | | | | | | | | | | | | Summary: This patch does a couple of things: - Adds a new argument `--shared-mode` which accepts a list of components and prints whether or not the provided components need to be linked statically or shared. - Fixes `--libnames` when CMake BUILD_SHARED_LIBS is used. - Fixes `--libnames`, `--libs`, and `--libfiles` for dylib when static components aren't installed. - Fixes `--libnames`, `--libs`, `--libfiles`, and `--components` to use LLVM_DYLIB_COMPONENTS as the component manifest for dylib linking. - Uses the host platform's usual convention for filename extensions and such, instead of always defaulting to Unix-izms. Because I don't own a Mac, I am not able to test the Mac platform dependent stuff locally. If someone would be willing to run a build for me on their machine (unless there's a better option), I'd appreciate it. Reviewers: jfb, brad.king, whitequark, beanz Subscribers: beanz, jauhien, llvm-commits Differential Revision: http://reviews.llvm.org/D13198 llvm-svn: 252532
* llvm-config: Add --has-rtti optionTom Stellard2015-11-044-0/+13
| | | | | | | | | | | | | | | | | | | | | | Summary: This prints NO if LLVM was built with -fno-rtti or an equivalent flag and YES otherwise. The reasons to add -has-rtti rather than adding -fno-rtti to --cxxflags are: 1. Building LLVM with -fno-rtti does not always mean that client applications need this flag. 2. Some compilers have a different flag for disabling rtti, and the compiler being used to build LLVM may not be the compiler being used to build the application. Reviewers: echristo, chandlerc, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11849 llvm-svn: 252075
* llvm-config: Add --build-system optionTom Stellard2015-09-094-0/+8
| | | | | | | | | | | | | | | Summary: This can be used for distinguishing between cmake and autoconf builds. Users may need this in order to handle inconsistencies between the outputs of the two build systems. Reviewers: echristo, chandlerc, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11838 llvm-svn: 247159
* [CMake] Fix PR14200, llvm-config output misses -fno-rttiChris Bieneman2015-08-141-6/+9
| | | | | | | | This change adds RTTI and Exception flags to llvm-config's cxxflags. This solution is a minimal patch to solve the issue, and is recommended for the 3.7 release branch. Tom Stellard's outstanding work is the longer term solution. Patch By: David Wiberg llvm-svn: 245064
* Revert "Fix `llvm-config` to emit the linker flag for the combined shared ↵Richard Diamond2015-08-054-50/+2
| | | | | | | | | | object built by autoconfig/make instead of the individual components." It seems I was wrong thinking `autoconf`/`make` only installed shared libraries if configured with `--enable-shared`, even if `--disable-static` is present. I'll re-address with a followup patch. This reverts commit r243297 for causing PR#24154. llvm-svn: 244108
* Fix `llvm-config` to emit the linker flag for the combined shared object ↵JF Bastien2015-07-274-2/+50
| | | | | | | | | | | | | | | | | | | built by autoconfig/make instead of the individual components. Summary: When LLVM is configured to build shared libraries, CMake builds each component as it's own shared object, while autoconfig/make builds them statically and then links them all together to create a single shared object. This change adds compile time config flags to `llvm-config` so it can know whether LLVM's components are separated or not and act accordingly. This fixes `llvm-config` instead of fixing the makefiles to behave like CMake because, AIUI, LLVM's autoconfig/make build system is on the way out anyway. This change only affects `llvm-config` from builds that use autoconfig/make. Reviewers: jfb Subscribers: echristo, dschuff, llvm-commits Differential Revision: http://reviews.llvm.org/D11392 llvm-svn: 243297
* Revert "Fix `llvm-config` to emit the linker flag for the combined shared ↵JF Bastien2015-07-144-50/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | object built by autoconfig/make instead of the individual components." This reverts commit 01446706b4c0a86bb64768f307079cab5c514aa3. Causes breakage, seems to be related to 'svn' in the file's name: CC=gcc CXX=g++ \ ../llvm/configure \ --prefix=/usr \ --sysconfdir=/etc \ --enable-shared \ --enable-libffi \ --enable-targets=all \ --disable-assertions \ --with-python=/usr/bin/python2 \ --enable-optimized make REQUIRES_RTTI=1 ENABLE_PIC=1 results: llvm[2]: Linking Release unit test Support (without symbols) llvm[2]: ======= Finished Linking Release Unit test Support (without symbols) make[3]: Entering directory '/build/llvm-svn/src/build/bindings/ocaml/llvm' make[3]: *** No rule to make target '/build/llvm- svn/src/build/Release/lib/ocaml/libLLVM-3.7.0svn.so', needed by 'build- deplibs'. Stop. make[3]: *** Waiting for unfinished jobs.... llvm[3]: Compiling llvm_ocaml.c for Release build make[3]: Leaving directory '/build/llvm-svn/src/build/bindings/ocaml/llvm' /build/llvm-svn/src/llvm/Makefile.rules:880: recipe for target 'all' failed /build/llvm-svn/src/llvm/Makefile.rules:965: recipe for target 'all' failed Differential Revision: http://reviews.llvm.org/D10716 llvm-svn: 242152
* Fix `llvm-config` to emit the linker flag for the combined shared object ↵JF Bastien2015-07-104-2/+50
| | | | | | | | | | | | | | | | | built by autoconfig/make instead of the individual components. Summary: This fixes `llvm-config` instead of fixing the makefiles because, AIUI, LLVM's autoconfig/make build system is on the way out anyway. This change only affects builds that use autoconfig/make. Reviewers: jfb Subscribers: echristo, dschuff, llvm-commits Differential Revision: http://reviews.llvm.org/D10716 llvm-svn: 241938
* Refactoring CMake CrossCompile module.Chris Bieneman2015-03-121-1/+1
| | | | | | | | | * put most of the cross-compiling support into a function llvm_create_cross_target_internal. * when CrossCompile is included it still generates a NATIVE target. * llvm_create_cross_target function takes a target_name which should match a toolchain. * llvm_create_cross_target can now be used to target more than one cross-compilation target. llvm-svn: 232067
* Make helper functions static.Benjamin Kramer2015-03-091-4/+4
| | | | | | Found by -Wmissing-prototypes. NFC. llvm-svn: 231664
OpenPOWER on IntegriCloud