[libcxx-commits] [libcxx] 5659471 - [libc++] Fix build failure with libdispatch backend (#141606)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 28 07:20:52 PDT 2025


Author: Louis Dionne
Date: 2025-05-28T10:20:48-04:00
New Revision: 56594710c7ffdaf82e07b1ff63f01226c117b2ce

URL: https://github.com/llvm/llvm-project/commit/56594710c7ffdaf82e07b1ff63f01226c117b2ce
DIFF: https://github.com/llvm/llvm-project/commit/56594710c7ffdaf82e07b1ff63f01226c117b2ce.diff

LOG: [libc++] Fix build failure with libdispatch backend (#141606)

We get an error "cannot add 'abi_tag' attribute in a redeclaration"
because functions like `__dispatch_apply` are first declared without an
ABI tag due to `_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS` inside the
header, and then redeclared with an ABI tag in the .cpp file.

Added: 
    

Modified: 
    libcxx/src/pstl/libdispatch.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/src/pstl/libdispatch.cpp b/libcxx/src/pstl/libdispatch.cpp
index 3dca702341c85..528018358eeb0 100644
--- a/libcxx/src/pstl/libdispatch.cpp
+++ b/libcxx/src/pstl/libdispatch.cpp
@@ -12,6 +12,7 @@
 #include <dispatch/dispatch.h>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
+_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
 namespace __pstl::__libdispatch {
 
 void __dispatch_apply(size_t chunk_count, void* context, void (*func)(void* context, size_t chunk)) noexcept {
@@ -29,4 +30,5 @@ __chunk_partitions __partition_chunks(ptr
diff _t element_count) noexcept {
 }
 
 } // namespace __pstl::__libdispatch
+_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
 _LIBCPP_END_NAMESPACE_STD


        


More information about the libcxx-commits mailing list