[PATCH] D42702: Fix llvm-config --system-libs output on FreeBSD and NetBSD
Bryan Drewery via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 23 18:18:12 PST 2018
bdrewery added a comment.
In https://reviews.llvm.org/D42702#1018139, @krytarowski wrote:
> In https://reviews.llvm.org/D42702#1018130, @bdrewery wrote:
>
> > This fixes it for me in the spirit of other library lookups (in that it doesn't bother with `-L`, but that could easily be added in). Despite `Backtrace_LIBRARIES` being plural I don't think it ever will be looking over //FindBacktrace.cmake//.
> >
> > I have no clue about static linkage here.
> >
> > https://people.freebsd.org/~bdrewery/patches/cmake-libexecinfo.diff
> >
> > diff --git lib/Support/CMakeLists.txt lib/Support/CMakeLists.txt
> > index 5723f8fcf5b..dfbdd70701f 100644
> > --- lib/Support/CMakeLists.txt
> > +++ lib/Support/CMakeLists.txt
> > @@ -13,7 +13,9 @@ elseif( CMAKE_HOST_UNIX )
> > set(system_libs ${system_libs} ${CMAKE_DL_LIBS})
> > endif()
> > if( HAVE_BACKTRACE )
> > - set(system_libs ${system_libs} ${Backtrace_LIBRARIES})
> > + 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)
> >
>
>
> What's the result of:
>
> $ llvm-config --link-static --system-libs
>
I'm only testing from the bundled LLVM 6 in rust:
~/git/rust/rust # build/x86_64-unknown-freebsd/llvm/bin/llvm-config --system-libs
-lrt -lexecinfo -lpthread -lm
~/git/rust/rust # build/x86_64-unknown-freebsd/llvm/bin/llvm-config --link-static --system-libs
-lrt -lexecinfo -lpthread -lm
~/git/rust/rust # uname -sr
FreeBSD 12.0-CURRENT
Repository:
rL LLVM
https://reviews.llvm.org/D42702
More information about the llvm-commits
mailing list