[llvm-dev] Failed to configure LLVM for use with Musl

Saleem Abdulrasool via llvm-dev llvm-dev at lists.llvm.org
Fri Dec 2 21:10:49 PST 2016


On Fri, Dec 2, 2016 at 1:28 PM, Vedant Kumar <vsk at apple.com> wrote:

>
> > On Dec 2, 2016, at 4:57 AM, Dmitry Golovin via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
> >
> > I want to build LLVM-based toolchain with Musl, I have LLVM sources with
> clang and lld (under `tools` directory) and libunwind, compiler-rt, libcxx
> and libcxxabi (under `projects` directory). All are the latest versions
> cloned from GitHub mirror, branch `master`.
> >
> > I'm trying to configure with the following options:
> >    CLANG_DEFAULT_CXX_STDLIB = libc++
> >    CLANG_DEFAULT_RTLIB = compiler-rt
> >    LIBCXX_CXX_ABI = libcxxabi
> >    LLVM_DEFAULT_TARGET_TRIPLE = x86_64-pc-linux-musl
> >    LIBCXXABI_TARGET_TRIPLE = x86_64-pc-linux-musl
> >    LIBUNWIND_TARGET_TRIPLE = x86_64-pc-linux-musl
> >    DEFAULT_SYSROOT = /path/to/musl
> >    GCC_INSTALL_PREFIX = /path/to/gcc-stub
> >    LLVM_TARGETS_TO_BUILD = X86
> >    LIBCXXABI_USE_COMPILER_RT = ON
> >    LIBCXXABI_USE_LLVM_UNWINDER = ON
> >    LIBCXX_HAS_MUSL_LIBC = ON
> >    LIBCXX_USE_COMPILER_RT = ON
> >    LLVM_ENABLE_LIBCXX = ON
> >    LLVM_ENABLE_LLD = ON
> >
> > When I try to configure, I get the following error messages:
> >
> > CMake Warning at cmake/modules/HandleLLVMStdlib.cmake:24 (message):
> >   Can't specify libc++ with '-stdlib='
> > Call Stack (most recent call first):
> >   cmake/config-ix.cmake:15 (include)
> >   CMakeLists.txt:566 (include)
>
> ^ This seems harmless. You'll probably end up building with libstdc++.
>
> >
> > CMake Error at projects/libunwind/src/CMakeLists.txt:70 (message):
> >   Compiler doesn't support generation of unwind tables if exception
> support
> >   is disabled.  Building libunwind DSO with runtime dependency on C++ ABI
> >   library is not supported.
>
> It looks like your host compiler doesn't support -funwind-tables.
>

Hmm, so we try to generate unwind tables without exceptions as we don't
want to use exceptions in the unwinding code path itself.

It sounds like your compiler might not support `-fno-exceptions
-funwind-tables` together although it supports them together.  What target
are you building libunwind for?  Linux x86, x86_64 use a DWARF-esque
encoding in eh_frame.  However, other targets need unwind tables with
custom information.  Perhaps we are being too stringent here.  At least
libitm uses both these flags together with gcc, so it and clang should
support this.


> Try building with clang?
>

That should work.

I've CC'd Saleem who might know more about this.
>
> best,
> vedant
>
> >
> > I'm probably doing something wrong, but I can't figure out what exactly.
> If I omit some of the flags, I get different errors, but I never get
> successful configuration.
> >
> > I'm on Ubuntu 16.04 (if it is important) and have not yet tried on other
> machines, but I'm pretty sure it is possible to reproduce it.
> >
> > Regards,
> > Dmitry Golovin
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>


-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161202/81bf7610/attachment.html>


More information about the llvm-dev mailing list