[libc-commits] [libc] [libc] restored original no_stack_protector syntax (PR #94005)

via libc-commits libc-commits at lists.llvm.org
Fri May 31 11:36:48 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: None (RoseZhang03)

<details>
<summary>Changes</summary>

forward fix for #<!-- -->93620

-GCC doesn't recognize [[clang:: ']] prefix, so restored the original
__attribute__ syntax

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


1 Files Affected:

- (modified) libc/src/__support/OSUtil/linux/exit.cpp (+2-2) 


``````````diff
diff --git a/libc/src/__support/OSUtil/linux/exit.cpp b/libc/src/__support/OSUtil/linux/exit.cpp
index ee904155c537d..4a1d56a172a1a 100644
--- a/libc/src/__support/OSUtil/linux/exit.cpp
+++ b/libc/src/__support/OSUtil/linux/exit.cpp
@@ -15,9 +15,9 @@ namespace LIBC_NAMESPACE::internal {
 // mark as no_stack_protector for x86 since TLS can be torn down before calling
 // exit so that the stack protector canary cannot be loaded.
 #ifdef LIBC_TARGET_ARCH_IS_X86
-[[clang::no_stack_protector]]
+__attribute__((no_stack_protector))
 #endif
-[[noreturn]] void
+__attribute__((noreturn)) void
 exit(int status) {
   for (;;) {
     LIBC_NAMESPACE::syscall_impl<long>(SYS_exit_group, status);

``````````

</details>


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


More information about the libc-commits mailing list