[libcxx-commits] [libcxx] 23617f2 - [libcxx] Disable invalid `__start/__stop` reference on NVPTX (#99381)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Aug 14 11:40:51 PDT 2024
Author: Joseph Huber
Date: 2024-08-14T13:40:48-05:00
New Revision: 23617f2dc094e3f960d9e0aedaa87a0866e8dc2d
URL: https://github.com/llvm/llvm-project/commit/23617f2dc094e3f960d9e0aedaa87a0866e8dc2d
DIFF: https://github.com/llvm/llvm-project/commit/23617f2dc094e3f960d9e0aedaa87a0866e8dc2d.diff
LOG: [libcxx] Disable invalid `__start/__stop` reference on NVPTX (#99381)
Summary:
The logic for this `__is_function_overridden` check requires accessing a
runtime array normally created by the linker. The NVPTX target is an
`__ELF__` target, however it does not support emitting the
`__start/__stop` symbols for C-identifier named sections. This needs to
be disabled explicitly so that the user can compile this with anything.
Added:
Modified:
libcxx/src/include/overridable_function.h
Removed:
################################################################################
diff --git a/libcxx/src/include/overridable_function.h b/libcxx/src/include/overridable_function.h
index c7639f56eee26f..e83ca7be7befaf 100644
--- a/libcxx/src/include/overridable_function.h
+++ b/libcxx/src/include/overridable_function.h
@@ -96,7 +96,8 @@ _LIBCPP_HIDE_FROM_ABI bool __is_function_overridden(_Ret (*__fptr)(_Args...)) no
}
_LIBCPP_END_NAMESPACE_STD
-#elif defined(_LIBCPP_OBJECT_FORMAT_ELF)
+// The NVPTX linker cannot create '__start/__stop' sections.
+#elif defined(_LIBCPP_OBJECT_FORMAT_ELF) && !defined(__NVPTX__)
# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 1
# define _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE __attribute__((__section__("__lcxx_override")))
More information about the libcxx-commits
mailing list