[libc-commits] [libc] [libc] quick fix for aarch64 jmpbuf build (PR #101357)

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Wed Jul 31 09:16:56 PDT 2024


https://github.com/SchrodingerZhu created https://github.com/llvm/llvm-project/pull/101357

None

>From 0a0be9c20fd18e48ecf2fbceaeb8db812364b811 Mon Sep 17 00:00:00 2001
From: Yifan Zhu <yifzhu at nvidia.com>
Date: Wed, 31 Jul 2024 09:16:33 -0700
Subject: [PATCH] [libc] quick fix for aarch64 jmpbuf build

---
 libc/src/setjmp/aarch64/longjmp.cpp | 4 +++-
 libc/src/setjmp/aarch64/setjmp.cpp  | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libc/src/setjmp/aarch64/longjmp.cpp b/libc/src/setjmp/aarch64/longjmp.cpp
index 3207cf40368c4..fbb86524e3951 100644
--- a/libc/src/setjmp/aarch64/longjmp.cpp
+++ b/libc/src/setjmp/aarch64/longjmp.cpp
@@ -22,7 +22,9 @@ namespace LIBC_NAMESPACE_DECL {
 // supports the MTE instructions, not whether the compiler is configured to use
 // them.)
 
-[[gnu::naked]] LLVM_LIBC_FUNCTION(void, longjmp, (__jmp_buf * buf, int val)) {
+[[gnu::naked]] LLVM_LIBC_FUNCTION(void, longjmp,
+                                  ([[maybe_unused]] __jmp_buf * buf,
+                                   [[maybe_unused]] int val)) {
   // If BTI branch protection is in use, the compiler will automatically insert
   // a BTI here, so we don't need to make any extra effort to do so.
 
diff --git a/libc/src/setjmp/aarch64/setjmp.cpp b/libc/src/setjmp/aarch64/setjmp.cpp
index ba4dd645eaaa3..90e49be49a8fc 100644
--- a/libc/src/setjmp/aarch64/setjmp.cpp
+++ b/libc/src/setjmp/aarch64/setjmp.cpp
@@ -12,7 +12,8 @@
 
 namespace LIBC_NAMESPACE_DECL {
 
-[[gnu::naked]] LLVM_LIBC_FUNCTION(int, setjmp, (__jmp_buf * buf)) {
+[[gnu::naked]] LLVM_LIBC_FUNCTION(int, setjmp,
+                                  ([[maybe_unused]] __jmp_buf * buf)) {
   // If BTI branch protection is in use, the compiler will automatically insert
   // a BTI here, so we don't need to make any extra effort to do so.
 



More information about the libc-commits mailing list