diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-06-27 19:14:09 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-06-27 19:14:09 +0000 |
commit | eb1edd4d5902fdc561fd68fa70400fbd11127998 (patch) | |
tree | 0b10ccde4b5d3acf243966db54f4f3afef10cf93 /lib/Support | |
parent | 2ed8710148a921286717212737771dd31c518fb7 (diff) |
Notes
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/CMakeLists.txt | 9 | ||||
-rw-r--r-- | lib/Support/Host.cpp | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt index d968688911eb9..6439d16a2a3fa 100644 --- a/lib/Support/CMakeLists.txt +++ b/lib/Support/CMakeLists.txt @@ -13,8 +13,13 @@ elseif( CMAKE_HOST_UNIX ) if( HAVE_LIBDL ) set(system_libs ${system_libs} ${CMAKE_DL_LIBS}) endif() - if( HAVE_BACKTRACE ) - set(system_libs ${system_libs} ${Backtrace_LIBRARIES}) + if( HAVE_BACKTRACE AND NOT "${Backtrace_LIBRARIES}" STREQUAL "" ) + # On BSDs, CMake returns a fully qualified path to the backtrace library. + # We need to remove the path and the 'lib' prefix, to make it look like a + # regular short library name, suitable for appending to a -l link flag. + get_filename_component(Backtrace_LIBFILE ${Backtrace_LIBRARIES} NAME_WE) + STRING(REGEX REPLACE "^lib" "" Backtrace_LIBFILE ${Backtrace_LIBFILE}) + set(system_libs ${system_libs} ${Backtrace_LIBFILE}) endif() if(LLVM_ENABLE_TERMINFO) if(HAVE_TERMINFO) diff --git a/lib/Support/Host.cpp b/lib/Support/Host.cpp index 3dc67ad782af5..6e65b5e6c8075 100644 --- a/lib/Support/Host.cpp +++ b/lib/Support/Host.cpp @@ -1009,7 +1009,7 @@ StringRef sys::getHostCPUName() { #include "llvm/Support/X86TargetParser.def" // Now check types. -#define X86_CPU_SUBTYPE(ARCHNAME, ENUM) \ +#define X86_CPU_TYPE(ARCHNAME, ENUM) \ if (Type == X86::ENUM) \ return ARCHNAME; #include "llvm/Support/X86TargetParser.def" |