[cfe-dev] [PATCH] Support building libc++ using an in-tree libc++abi

Dan Albert danalbert at google.com
Thu Jul 24 11:41:51 PDT 2014


This has been a change I've been meaning to make for a while. I think a
better approach would be to still use 'libcxxabi' for LIBCXX_CXX_ABI, but
automatically use the headers in projects/libcxxabi/include in the case of
an in-tree build. I might even go as far as saying that libcxxabi is the
the default cxx abi for an in-tree build. As it is now, libc++ defaults to
cxxabi=none, which means you can't run the tests iirc. As a side note,
LIT_EXECUTABLE should also be picked up automatically for an in-tree build.

https://github.com/llvm-mirror/libcxxabi/blob/master/CMakeLists.txt#L118
shows how I tackled the reverse of this (automatically finding libc++
headers for libc++abi). Essentially, take the first available of the user
defined path, the in tree path, or the system headers
(the ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBCXX_INCLUDES} bit is to ensure that
the user provided path works as an abspath or a relative path).


On Thu, Jul 24, 2014 at 11:09 AM, <eatnumber1 at google.com> wrote:

> From: Russell Harmon <eatnumber1 at google.com>
>
> This adds a new LIBCXX_CXX_ABI called "libcxxabi-in-tree", which will add
> "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include" to
> LIBCXX_LIBCXXABI_INCLUDE_PATHS and will add "cxxabi" as a proper
> dependency.
> ---
>  CMakeLists.txt | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index c20e5d1..fd3e808 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -44,7 +44,7 @@ option(LIBCXX_ENABLE_CXX0X "Enable -std=c++0x and use of
> c++0x language features
>  option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
>  option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers."
> ON)
>
> -set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++)
> +set(CXXABIS none libcxxabi libcxxrt libstdc++ libsupc++ libcxxabi-in-tree)
>  if (NOT DEFINED LIBCXX_CXX_ABI)
>    set(LIBCXX_CXX_ABI "none")
>  endif()
> @@ -149,6 +149,12 @@ elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi")
>    setup_abi_lib("LIBCXX_LIBCXXABI_INCLUDE_PATHS" ""
>      "c++abi" "cxxabi.h" ""
>      )
> +elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxabi-in-tree")
> +  set(LIBCXX_LIBCXXABI_INCLUDE_PATHS
> "${CMAKE_SOURCE_DIR}/projects/libcxxabi/include")
> +  setup_abi_lib("LIBCXX_LIBCXXABI_INCLUDE_PATHS" ""
> +    "cxxabi" "cxxabi.h" ""
> +    )
> +  add_dependencies(LIBCXX_CXX_ABI_DEPS cxxabi)
>  elseif ("${LIBCXX_CXX_ABI}" STREQUAL "libcxxrt")
>    setup_abi_lib("LIBCXX_LIBCXXRT_INCLUDE_PATHS" "-DLIBCXXRT"
>      "cxxrt" "cxxabi.h;unwind.h;unwind-arm.h;unwind-itanium.h" ""
> --
> 2.0.0.526.g5318336
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140724/9cc84b19/attachment.html>


More information about the cfe-dev mailing list