Skip to content

[libc++] Update a comment about -nostdlib++ #67429

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions libcxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -624,9 +624,11 @@ function(cxx_link_system_libraries target)

# In order to remove just libc++ from the link step
# we need to use -nostdlib++ whenever it is supported.
# Unfortunately this cannot be used universally because for example g++ supports
# only -nodefaultlibs in which case all libraries will be removed and
# Unfortunately this cannot be used universally because g++ does not support
# -nostdlib++ before gcc 13 (https://gcc.gnu.org/gcc-13/changes.html) and needs
# to use -nodefaultlibs in which case all libraries will be removed and
# all libraries but c++ have to be added in manually.
# Once libc++ requires gcc 13+, this can be simplified.
if (CXX_SUPPORTS_NOSTDLIBXX_FLAG)
target_add_link_flags_if_supported(${target} PRIVATE "-nostdlib++")
else()
Expand Down