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

via libc-commits libc-commits at lists.llvm.org
Wed Jul 31 09:26:54 PDT 2024


Author: Schrodinger ZHU Yifan
Date: 2024-07-31T09:26:49-07:00
New Revision: 3715035797a8b07ddaf2e2eff08fedc535891e15

URL: https://github.com/llvm/llvm-project/commit/3715035797a8b07ddaf2e2eff08fedc535891e15
DIFF: https://github.com/llvm/llvm-project/commit/3715035797a8b07ddaf2e2eff08fedc535891e15.diff

LOG: [libc] quick fix for aarch64 jmpbuf build (#101357)

Added: 
    

Modified: 
    libc/src/setjmp/aarch64/longjmp.cpp
    libc/src/setjmp/aarch64/setjmp.cpp

Removed: 
    


################################################################################
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