[libc-commits] [libc] [libc] fix architecture guarding for 32bit sigsetjmp (PR #164923)

Shreeyash Pandey via libc-commits libc-commits at lists.llvm.org
Thu Oct 23 20:47:10 PDT 2025


https://github.com/bojle created https://github.com/llvm/llvm-project/pull/164923

Fixes: https://github.com/llvm/llvm-project/issues/164653

>From 0e88d3c20ab0c4f418b46b4ca193ec7d2034f9f8 Mon Sep 17 00:00:00 2001
From: Shreeyash Pandey <shreeyash335 at gmail.com>
Date: Fri, 24 Oct 2025 09:14:45 +0530
Subject: [PATCH] [libc] fix architecture guarding for 32bit sigsetjmp

Signed-off-by: Shreeyash Pandey <shreeyash335 at gmail.com>
---
 libc/src/setjmp/x86_64/sigsetjmp.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libc/src/setjmp/x86_64/sigsetjmp.cpp b/libc/src/setjmp/x86_64/sigsetjmp.cpp
index 4c97a01822679..2bad053c166ee 100644
--- a/libc/src/setjmp/x86_64/sigsetjmp.cpp
+++ b/libc/src/setjmp/x86_64/sigsetjmp.cpp
@@ -41,7 +41,7 @@ LLVM_LIBC_FUNCTION(int, sigsetjmp, (sigjmp_buf buf)) {
       [epilogue] "X"(sigsetjmp_epilogue)
       : "eax", "ebx", "ecx");
 }
-#endif
+#else
 [[gnu::naked]]
 LLVM_LIBC_FUNCTION(int, sigsetjmp, (sigjmp_buf, int)) {
   asm(R"(
@@ -64,5 +64,6 @@ LLVM_LIBC_FUNCTION(int, sigsetjmp, (sigjmp_buf, int)) {
       [epilogue] "X"(sigsetjmp_epilogue)
       : "rax", "rbx");
 }
+#endif
 
 } // namespace LIBC_NAMESPACE_DECL



More information about the libc-commits mailing list