[libcxx-commits] [libcxx] [libc++] Update a comment about -nostdlib++ (PR #67429)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 26 06:33:28 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

<details>
<summary>Changes</summary>

GCC added support for the flag in gcc 13.1.

No behavior change.

---
Full diff: https://github.com/llvm/llvm-project/pull/67429.diff


1 Files Affected:

- (modified) libcxx/CMakeLists.txt (+4-2) 


``````````diff
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index b9d0ed51be26033..c42337fa83062f7 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -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()

``````````

</details>


https://github.com/llvm/llvm-project/pull/67429


More information about the libcxx-commits mailing list