[libcxx-commits] [PATCH] D116689: [libunwind][libcxxabi] Use object libraries in the build

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 9 23:59:39 PDT 2022


mstorsjo added a comment.

In D116689#3502026 <https://reviews.llvm.org/D116689#3502026>, @phosek wrote:

> In D116689#3500263 <https://reviews.llvm.org/D116689#3500263>, @mstorsjo wrote:
>
>> This version breaks things for me; I'm building with `LIBCXX_ENABLE_STATIC_ABI_LIBRARY` and `LIBCXXABI_USE_LLVM_UNWINDER` but not `LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY`. In this case, there's no shared libcxxabi (I build with `LIBCXXABI_ENABLE_SHARED=OFF`), so libcxx would need to retain the code to link against the libunwind cmake target, it can't be carried transitively via libcxxabi (cxxabi_shared_objects). I.e. this case gets lost:
>>
>>   if(LIBCXXABI_USE_LLVM_UNWINDER AND NOT LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY)
>>      target_link_libraries(cxxabi_shared PUBLIC unwind_shared)
>>    endif() 
>
> The part I don't like is referring to `LIBCXXABI_USE_LLVM_UNWINDER` from within the libcxx build.

Yep. But apparently it does work to pass such dependencies along for an object library, within cmake, like this:

  if(LIBCXXABI_USE_LLVM_UNWINDER AND NOT LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY)
    target_link_libraries(cxxabi_shared_objects PUBLIC unwind_shared)
  endif()



>> I.e. I need to build `cxxabi_shared_objects` (as those are needed to be merged into `cxx_shared`) but I can't build `cxxabi_shared` (because that's impossible to link when Windows shared libraries can't have undefined references).
>
> I wonder if we could simplify things by always building `cxxabi_static_objects` and `cxxabi_shared_objects` but marking them as `EXCLUDE_FROM_ALL`?

That's probably the best solution for that - thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116689/new/

https://reviews.llvm.org/D116689



More information about the libcxx-commits mailing list