Skip to content

Commit 23617f2

Browse files
authored
[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.
1 parent 3b7b2f2 commit 23617f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libcxx/src/include/overridable_function.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ _LIBCPP_HIDE_FROM_ABI bool __is_function_overridden(_Ret (*__fptr)(_Args...)) no
9696
}
9797
_LIBCPP_END_NAMESPACE_STD
9898

99-
#elif defined(_LIBCPP_OBJECT_FORMAT_ELF)
99+
// The NVPTX linker cannot create '__start/__stop' sections.
100+
#elif defined(_LIBCPP_OBJECT_FORMAT_ELF) && !defined(__NVPTX__)
100101

101102
# define _LIBCPP_CAN_DETECT_OVERRIDDEN_FUNCTION 1
102103
# define _LIBCPP_MAKE_OVERRIDABLE_FUNCTION_DETECTABLE __attribute__((__section__("__lcxx_override")))

0 commit comments

Comments
 (0)