Skip to content

Commit

Permalink
Add default C++ ABI libname and include paths for FreeBSD
Browse files Browse the repository at this point in the history
Summary:
As noted in a discussion about testing the LLVM 6.0.0 release candidates
(with libc++) for FreeBSD, many tests turned out to fail with
"exception_ptr not yet implemented".  This was because libc++ did not
choose the correct C++ ABI library, and therefore it fell back to the
`exception_fallback.ipp` header.

Since FreeBSD 10.x, we have been using libcxxrt as our C++ ABI library,
and its headers have always been installed in /usr/include/c++/v1,
together with the (system) libc++ headers.  (Older versions of FreeBSD
used GNU libsupc++ by default, but these are now unsupported.)

Therefore, if we are building libc++ for FreeBSD, set:
* `LIBCXX_CXX_ABI_LIBNAME` to "libcxxrt"
* `LIBCXX_CXX_ABI_INCLUDE_PATHS` to "/usr/include/c++/v1"
by default.

Reviewers: emaste, EricWF, mclow.lists

Reviewed By: EricWF

Subscribers: mgorny, cfe-commits, krytarowski

Differential Revision: https://reviews.llvm.org/D43166

llvm-svn: 324855
  • Loading branch information
DimitryAndric committed Feb 11, 2018
1 parent d3e7d19 commit 35479ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ if (LIBCXX_CXX_ABI STREQUAL "default")
elseif (APPLE)
set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
set(LIBCXX_CXX_ABI_SYSTEM 1)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(LIBCXX_CXX_ABI_LIBNAME "libcxxrt")
set(LIBCXX_CXX_ABI_INCLUDE_PATHS "/usr/include/c++/v1")
else()
set(LIBCXX_CXX_ABI_LIBNAME "default")
endif()
Expand Down

0 comments on commit 35479ff

Please sign in to comment.