summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-config
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [cmake] Teach the llvm-config program to respect LLVM_LIBDIR_SUFFIX.Chandler Carruth2014-12-293-4/+9
| | | | | | | | | | | | | | For this to work, we have to encode it in the build variables and use it from llvm-config.cpp. I've tried to do this reasonably cleanly, but the code for llvm-config.cpp is pretty strange. However, with this, llvm-config stops giving the wrong answer when using LLVM_LIBDIR_SUFFIX. Note that the configure+make build just sets this to an empty string as that build system has zero support for multilib of any form. I'm not planning to add support there either, but this should leave a path for anyone that wanted to. llvm-svn: 224921
* Enabling LLVM & Clang to be cross-compiled using CMake from a single ↵Chris Bieneman2014-09-031-0/+15
| | | | | | | | configuration command line The basic idea is similar to the existing cross compilation support. A directory must be configured to build host versions of tablegen tools and llvm-config. This directory can be user provided (and configured), or it can be created during the build. During a build the native build directory will be configured and built to supply the tablegen tools used during the build. A user could also explicitly provide the tablegen executables to run on the CMake command line. llvm-svn: 217105
* Change llvm-config --ldflags to report ${CMAKE_CXX_LINK_FLAGS}Reid Kleckner2014-04-251-1/+2
| | | | | | | | | | | | | Should fix PR19526. When Oscar added this code in the intial CMake build system port, he had a TODO saying that ${CMAKE_SHARED_LINKER_FLAGS} was probably wrong. I agree. I'm using ${CMAKE_CXX_LINK_FLAGS} to point LLVM at my custom installation of gcc 4.recent, so that seems more correct. With this change, I can build creduce against an installed clang, and it picks up the write flags from --ldflags. llvm-svn: 207171
* Windows: canonicalise the default windows tripleSaleem Abdulrasool2014-03-291-1/+2
| | | | | | | Canonicalise the default triple that is used on Windows. This should hopefully fix the MSVC buildbots. llvm-svn: 205070
* Don't emit a blank line when running llvm-config --system-libs.Richard Osborne2014-03-031-18/+20
| | | | | | | | | | | | | | | | | | | | | | | Summary: Previously llvm-config --system-libs would print something like: $ llvm-config --system-libs -lz -ltinfo -lrt -ldl -lm Now we don't emit blank line. Functionality is unchanged otherwise, in particular llvm-config --libs --system-libs still emits the LLVM libraries and the system libraries on different lines. Reviewers: chapuni Reviewed By: chapuni CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2901 llvm-svn: 202719
* Simplify linking to system librariesNAKAMURA Takumi2014-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The LLVMSupport library implementation consolidates all dependencies on system libraries. Move the logic gathering system libraries out of 'cmake/modules/LLVM-Config.cmake' and into 'lib/Support/CMakeLists.txt'. Use the target_link_libraries() command there to tell CMake about the link dependencies of the LLVMSupport implementation. CMake will automatically propagate this to all targets that link LLVMSupport directly or indirectly. We still need to build knowledge of system library dependencies into 'llvm-config'. Store the list of libraries needed in a property on LLVMSupport and teach 'tools/llvm-config/CMakeLists.txt' to retrieve it from there. Drop all calls to 'link_system_libs' and 'get_system_libs' from our CMake code. Replace their implementations with a warning that explains the calls are no longer necessary. Also drop from 'LLVMConfig.cmake' the HAVE_* and related variables that were published there only to allow 'get_system_libs' to run outside our build process. Contributed by Brad King. llvm-svn: 201969
* llvm-config: Fix typo in help message introduced with r197664.NAKAMURA Takumi2013-12-251-1/+1
| | | | | | Thanks, Vinson Lee! llvm-svn: 197996
* llvm-config: Show OBJROOT rather than OBJROOT/BUILD_MODE in MakefileStyle.NAKAMURA Takumi2013-12-201-0/+1
| | | | llvm-svn: 197818
* llvm-config: Use build_mode instead of LLVM_BUILDMODE. It should be ↵NAKAMURA Takumi2013-12-201-3/+3
| | | | | | equivalent in MakefileStyle. llvm-svn: 197817
* llvm-config: Don't show build tree with --obj-root for installed ↵NAKAMURA Takumi2013-12-191-1/+1
| | | | | | llvm-config. Show $(prefix) instead. llvm-svn: 197684
* llvm-config: Show build root instead of parent path in build tree with ↵NAKAMURA Takumi2013-12-191-0/+1
| | | | | | --obj-root for CMake multiconfig. llvm-svn: 197683
* llvm-config: Introduce --system-libs to print SYSTEM_LIBS, and deprecate ↵NAKAMURA Takumi2013-12-191-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | SYSTEM_LIBS in --ldflags. Although --system-libs is expected to use after --libs, it can be used alone. $ bin/llvm-config --ldflags -L/path/to/llvm/objroot/lib $ bin/llvm-config --libs object -lLLVMObject -lLLVMSupport $ bin/llvm-config --system-libs (Blank line. "all" is assumed but nothing is printed.) -lrt -ldl -ltinfo -lpthread -lz $ bin/llvm-config --ldflags --libs --system-libs object -L/path/to/llvm/objroot/lib -lLLVMObject -lLLVMSupport -lrt -ldl -ltinfo -lpthread -lz It is reimplementation of r197380, and workaround for PR3347 and PR8449. FIXME: Each LLVM component may have its dependent system libs. llvm-svn: 197664
* Revert r197380, "llvm-config: Print SYSTEM_LIBS with --libs, instead of ↵NAKAMURA Takumi2013-12-181-8/+2
| | | | | | | | --ldflags." I will introduce another flag, like --system-libs, later. llvm-svn: 197583
* llvm-config: Let directories aware of CMAKE_CFG_INTDIR.NAKAMURA Takumi2013-12-171-7/+9
| | | | | | | | | | | | | | | | | | With llvm-config.exe --bindir --libdir --build-mode, on Visual Studio 2010, In build tree: (OBJ_ROOT)/bin/MinSizeRel (OBJ_ROOT)/lib/MinSizeRel MinSizeRel In installed tree: (INSTALL_PREFIX)/bin (INSTALL_PREFIX)/lib MinSizeRel This is enhancements since r196283. llvm-svn: 197467
* llvm-config: Fixup r197380, tweak for cross compilation. SYSTEM_LIBS should ↵NAKAMURA Takumi2013-12-161-1/+9
| | | | | | | | | | | | | | | be --host's in BuildTools/llvm-config. FIXME: Host's llvm-config is not generated. It's for target's. Host tools, aka "BuildTools", in utils, do not require llvm-config to build. For example with --host=i686-pc-mingw32 --build=linux, $ BuildTools/Release+Asserts/bin/llvm-config --libs support -lLLVMSupport -lpthread -lshell32 -lpsapi -limagehlp -lm llvm-svn: 197382
* llvm-config: Print SYSTEM_LIBS with --libs, instead of --ldflags.NAKAMURA Takumi2013-12-161-2/+8
| | | | | | | | | | | | LLVM libs are printed in the first line, and system libs are printed in the next line. $ bin/llvm-config --libs object -lLLVMObject -lLLVMSupport -lrt -ldl -ltinfo -lpthread -lz It is workaround for PR3347 and PR8449. llvm-svn: 197380
* Correct word hyphenationsAlp Toker2013-12-051-2/+2
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. llvm-svn: 196471
* check-llvm: Ask llvm-config about assertion mode, instead of llc.NAKAMURA Takumi2013-12-031-0/+7
| | | | | | Add --assertion-mode to llvm-config. It emits ON or OFF according to NDEBUG. llvm-svn: 196329
* llvm-config: With --build-mode, show ${CMAKE_CFG_INTDIR} on multiconfig builder.NAKAMURA Takumi2013-12-032-1/+9
| | | | llvm-svn: 196283
* cmake: Prevent semicolon separated lists in llvm-config (PR17020)Hans Wennborg2013-08-281-1/+2
| | | | llvm-svn: 189491
* CMake: build llvm-config on Windows.Hans Wennborg2013-08-231-23/+11
| | | | | | | | | | | | It was previously not being built on Windows because the cmake file relied on a sed script to generate a .in file that llvm-config needs. By using cmake's configure_file function, we can get rid off the sed hack, and also have this work on Windows. Differential Revision: http://llvm-reviews.chandlerc.com/D1481 llvm-svn: 189125
* Remove unused includes.Rafael Espindola2013-06-261-1/+0
| | | | | | llvm itself is now PathV1 clean. llvm-svn: 184947
* Port GetMainExecutable over to PathV2.Rafael Espindola2013-06-261-3/+3
| | | | | | I will remove the V1 version as soon as I change clang in the next commit. llvm-svn: 184914
* Include PathV1.h in files that use it.Rafael Espindola2013-06-111-0/+1
| | | | | | This is preparation for replacing Path.h with PathV2.h. llvm-svn: 183782
* Re-enable support for --program-prefix.Jordan Rose2012-10-011-1/+1
| | | | | | | | | The Apple buildbots have been modified not to pass --target, so they shouldn't choke on a default program prefix anymore. Patch by Rick Foos! llvm-svn: 164956
* Revert "Add --program-prefix support to build"Jordan Rose2012-09-261-1/+1
| | | | | | | | | | | | | The Apple buildbots are set up to pass --target to configure for both cross- and non-cross-compile builds, and the standard autoconf response to this is to set the program prefix to '<target>-'. Until we can figure out the proper way to handle this (don't pass --target? pass an explicit --program-prefix=""? don't auto-populate program_prefix with target_alias?) it's more important to keep the buildbots running. This reverts r164633 / ba48ceb1a3802e20e781ef04ea2573ffae2ac414. llvm-svn: 164651
* Add --program-prefix support to buildSebastian Pop2012-09-251-1/+1
| | | | llvm-svn: 164633
* llvm-config: Use sys::fs::equivalent instead of string comparison.Daniel Dunbar2012-05-151-5/+6
| | | | | | - Hopefully fixes PR11600 (untested). llvm-svn: 156865
* llvm-build: Add support for non-installed libraries (e.g., gtest).Daniel Dunbar2012-05-151-5/+18
| | | | | | | - These libraries are only reported by llvm-config when run from a development tree. llvm-svn: 156838
* Do not install llvm-config-host for cross-builds of clang. rdar://11317847Bob Wilson2012-05-091-0/+8
| | | | | | | | | | My previous change to install llvm-config-host for cross-builds resulted in that file being installed even when the normal llvm-config was not installed, e.g., when building the install-clang target. Daniel suggested this alternative, which solves the immediate problem and also avoids the gunk in the top-level makefile. llvm-svn: 156448
* An easy case where GCC should really be able to work out that the value is onlyDuncan Sands2012-02-231-0/+1
| | | | | | used if IsInDevelopmentTree is 'true'. But it doesn't, so help it out. llvm-svn: 151244
* llvm-config: Add support for CMake build trees in which the buildPeter Collingbourne2012-01-261-7/+19
| | | | | | mode does not form part of the path. llvm-svn: 149010
* llvm-config: Fix --targets-built, I changed this to use the registry but wasn'tDaniel Dunbar2011-12-164-9/+5
| | | | | | | | properly initializing the target infos. I decided it wasn't worth linking them in for this, so just switched back to using the Makefile variable for now. We can reconsider later if we ever get pluggable targets. llvm-svn: 146711
* llvm-config: Update help text for removal of "backend" pseudo component.Daniel Dunbar2011-12-151-1/+0
| | | | llvm-svn: 146708
OpenPOWER on IntegriCloud