[libcxx-commits] [libcxx] [libcxx] Disable invalid `__start/__stop` reference on NVPTX (PR #99381)
Joseph Huber via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jul 17 12:44:03 PDT 2024
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/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.
>From 48f54d91f82c4fd5e86537c011e793468cef5d96 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Wed, 17 Jul 2024 14:41:35 -0500
Subject: [PATCH] [libcxx] Disable invalid `__start/__stop` reference on NVPTX
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.
---
libcxx/src/include/overridable_function.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libcxx/src/include/overridable_function.h b/libcxx/src/include/overridable_function.h
index e71e4f104b290..e107e04ca4d06 100644
--- a/libcxx/src/include/overridable_function.h
+++ b/libcxx/src/include/overridable_function.h
@@ -96,7 +96,7 @@ _LIBCPP_HIDE_FROM_ABI bool __is_function_overridden(_Ret (*__fptr)(_Args...)) no
}
_LIBCPP_END_NAMESPACE_STD
-#elif defined(_LIBCPP_OBJECT_FORMAT_ELF)
+#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