[libcxx-commits] [libcxx] [libcxx] Disable invalid `__start/__stop` reference on NVPTX (PR #99381)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 17 12:44:34 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Joseph Huber (jhuber6)

<details>
<summary>Changes</summary>

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.


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


1 Files Affected:

- (modified) libcxx/src/include/overridable_function.h (+1-1) 


``````````diff
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")))

``````````

</details>


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


More information about the libcxx-commits mailing list