[libcxx] r294553 - [libcxx][CMake] Support in-tree libunwind when building as part of runtimes

Asiri Rathnayake via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 9 01:13:39 PST 2017


Hi Petr,

This is breaking static builds of the libraries, cmake complaints with:

"CMake Error at projects/libcxxabi/src/CMakeLists.txt:134
(target_link_libraries):
  Target "unwind" of type UTILITY may not be linked into another target.
One
  may link only to STATIC or SHARED libraries, or to executables with the
  ENABLE_EXPORTS property set."

Our build config is:

 -DLLVM_ENABLE_ASSERTIONS=ON -DLIBCXX_ENABLE_ASSERTIONS=ON
-DLIBCXXABI_USE_LLVM_UNWINDER=ON  -DLIBCXX_ENABLE_SHARED=OFF
-DLIBCXXABI_ENABLE_SHARED=OFF -DLIBUNWIND_ENABLE_SHARED=OFF

/ Asiri


On Thu, Feb 9, 2017 at 2:19 AM, Petr Hosek via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: phosek
> Date: Wed Feb  8 20:19:43 2017
> New Revision: 294553
>
> URL: http://llvm.org/viewvc/llvm-project?rev=294553&view=rev
> Log:
> [libcxx][CMake] Support in-tree libunwind when building as part of runtimes
>
> When building as part of runtimes, there is no predefined order in
> which the runtimes are loaded, so the targets from other projects
> might not be available. We need to rely on HAVE_<name> variables
> instead in that case.
>
> Differential Revision: https://reviews.llvm.org/D29575
>
> Modified:
>     libcxx/trunk/CMakeLists.txt
>     libcxx/trunk/lib/CMakeLists.txt
>
> Modified: libcxx/trunk/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/
> CMakeLists.txt?rev=294553&r1=294552&r2=294553&view=diff
> ============================================================
> ==================
> --- libcxx/trunk/CMakeLists.txt (original)
> +++ libcxx/trunk/CMakeLists.txt Wed Feb  8 20:19:43 2017
> @@ -158,6 +158,7 @@ option(LIBCXX_ENABLE_ABI_LINKER_SCRIPT
>  # Build libc++abi with libunwind. We need this option to determine
> whether to
>  # link with libunwind or libgcc_s while running the test cases.
>  option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder."
> OFF)
> +option(LIBCXXABI_ENABLE_STATIC_UNWINDER "Statically link the LLVM
> unwinder." OFF)
>
>  # Target options ------------------------------
> --------------------------------
>  option(LIBCXX_BUILD_32_BITS "Build 32 bit libc++." ${LLVM_BUILD_32_BITS})
>
> Modified: libcxx/trunk/lib/CMakeLists.txt
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/
> CMakeLists.txt?rev=294553&r1=294552&r2=294553&view=diff
> ============================================================
> ==================
> --- libcxx/trunk/lib/CMakeLists.txt (original)
> +++ libcxx/trunk/lib/CMakeLists.txt Wed Feb  8 20:19:43 2017
> @@ -89,9 +89,9 @@ add_library_flags_if(LIBCXX_HAVE_CXX_ATO
>
>  # Add the unwinder library.
>  if (LIBCXXABI_USE_LLVM_UNWINDER)
> -  if (TARGET unwind_shared)
> +  if (NOT LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_shared OR
> HAVE_LIBUNWIND))
>      add_interface_library(unwind_shared)
> -  elseif (TARGET unwind_static)
> +  elseif (LIBCXXABI_ENABLE_STATIC_UNWINDER AND (TARGET unwind_static OR
> HAVE_LIBUNWIND))
>      add_interface_library(unwind_static)
>    else()
>      add_interface_library(unwind)
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170209/86fa5f39/attachment-0001.html>


More information about the cfe-commits mailing list