-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc++] Don't build against libcxxrt by default on FreeBSD #84484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The libc++ CMake build aims to provide a general-purpose configuration that matches the canonical LLVM setup (libc++ / libc++abi / libunwind), not the configuration used for compatibility on any given system. For these "compatibility" configurations, we use CMake caches like Apple.cmake and FreeBSD.cmake. Defaulting to libcxxrt on FreeBSD makes it look as though we're trying to build the system compatible configuration on FreeBSD, which isn't really correct and causes confusion more than anything else. Fixes llvm#84476
@llvm/pr-subscribers-libcxx Author: Louis Dionne (ldionne) ChangesThe libc++ CMake build aims to provide a general-purpose configuration that matches the canonical LLVM setup (libc++ / libc++abi / libunwind), not the configuration used for compatibility on any given system. For these "compatibility" configurations, we use CMake caches like Apple.cmake and FreeBSD.cmake. Defaulting to libcxxrt on FreeBSD makes it look as though we're trying to build the system compatible configuration on FreeBSD, which isn't really correct and causes confusion more than anything else. Fixes #84476 Full diff: https://github.com/llvm/llvm-project/pull/84484.diff 1 Files Affected:
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index d392e95077ac57..e565c47c76687a 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -229,8 +229,6 @@ option(LIBCXX_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF)
# ABI Library options ---------------------------------------------------------
if (MSVC)
set(LIBCXX_DEFAULT_ABI_LIBRARY "vcruntime")
-elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
- set(LIBCXX_DEFAULT_ABI_LIBRARY "libcxxrt")
else()
set(LIBCXX_DEFAULT_ABI_LIBRARY "libcxxabi")
endif()
|
@DimitryAndric Are you OK with this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is fine. As long as you can still override LIBCXX_DEFAULT_ABI_LIBRARY from the CMake command line, and it keeps working. :)
Merging since this passed the FreeBSD CI, which is what matters. We're having CI issues in the rest of our Actions builders. |
Unfortunately, this patch only traded one failure mode for another: I've done a 2-stage build on x86_64-pc-freebsd14.4 and (as expected) that failed in stage 2:
This is no wonder given that FreeBSD doesn't deliver GCC is way more diligent in this regard:
|
That problem is vastly different though, this has to do with how the build of LLVM / Clang is set up (apparently incorrectly). I believe we are now doing the right thing on FreeBSD from the point of view of libc++. I believe the best course of action here would be to open a bug report against LLVM so this can be investigated without confusing the two issues together. |
Yes, I have seen this problem before when doing a multi-stage build. The intermediate tblgen binaries are linked against the freshly produced |
I'll leave this to others then: it doesn't concern me on my primary platform (Solaris, which has no |
The libc++ CMake build aims to provide a general-purpose configuration that matches the canonical LLVM setup (libc++ / libc++abi / libunwind), not the configuration used for compatibility on any given system. For these "compatibility" configurations, we use CMake caches like Apple.cmake and FreeBSD.cmake.
Defaulting to libcxxrt on FreeBSD makes it look as though we're trying to build the system compatible configuration on FreeBSD, which isn't really correct and causes confusion more than anything else.
Fixes #84476