-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Implement sigsetjmp and siglongjmp for darwin/aarch64
#139555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
SchrodingerZhu
merged 20 commits into
llvm:main
from
AlyElashram:darwin-sigsetjmp-siglongjmp
Jun 19, 2025
Merged
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
fa372f9
Add setjmp longjmp and sigsetjmp.cpp
AlyElashram 317cd19
Add setjmp to entrypoints and headers in darwin
AlyElashram 99b1423
Add the sigsetjmp epilogue for darwin aarch64
AlyElashram 9cf9994
Formatting
AlyElashram 3b369bc
cmake file for darwin aarch64
AlyElashram b940c7c
cmake file formatting
AlyElashram 5ae8994
Remove setjmp and longjmp ,and reuse the aarch64 implementation with …
AlyElashram c3274e8
Update CMakeLists.txt to include the darwin/aarch64 directory.
AlyElashram 7a4c69b
Reuse the aarch64 implementation when building setjmp for darwin aarch64
AlyElashram c417a63
Update adding the subdirectory for darwin/aarch64
AlyElashram 872220b
Update Cmake Lists
AlyElashram 45565c7
Update Cmake and remove sigsetjmp as it's not needed
AlyElashram cbbf625
Update CMake and remove the aarch64 directory
AlyElashram 627d4ec
Update CMake formatting and hdr path
AlyElashram ea98156
Process AArch64 first before target os
AlyElashram 6f3f6a1
Only add targets if the full build flag is on.
AlyElashram 7a02945
Formatting changes
AlyElashram 01fd9e4
Remove Status Message
AlyElashram d55777c
Updatye test cmake to include setjmp
AlyElashram 11aa648
Fix missing line
AlyElashram File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "setjmp": { | ||
| "LIBC_CONF_SETJMP_AARCH64_RESTORE_PLATFORM_REGISTER": { | ||
| "value": false, | ||
| "doc": "Avoid setjmp saving the value of x18, and longjmp restoring it. The Apple AArch64 ABI specifies that this register is reserved and should not be used" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| add_object_library( | ||
| sigsetjmp_epilogue | ||
| HDRS | ||
| ../sigsetjmp_epilogue.h | ||
| SRCS | ||
| sigsetjmp_epilogue.cpp | ||
| DEPENDS | ||
| libc.src.__support.common | ||
| libc.src.__support.OSUtil.osutil | ||
| libc.hdr.types.jmp_buf | ||
| libc.hdr.types.sigset_t | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| //===-- Implementation of sigsetjmp_epilogue ------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include "src/setjmp/sigsetjmp_epilogue.h" | ||
| #include "src/__support/OSUtil/syscall.h" | ||
| #include "src/__support/common.h" | ||
| #include "src/signal/sigprocmask.h" | ||
|
|
||
| namespace LIBC_NAMESPACE_DECL { | ||
| [[gnu::returns_twice]] int sigsetjmp_epilogue(jmp_buf buffer, int retval) { | ||
| syscall_impl<long>(sigprocmask, SIG_SETMASK, | ||
| /* set= */ retval ? &buffer->sigmask : nullptr, | ||
| /* old_set= */ retval ? nullptr : &buffer->sigmask); | ||
| return retval; | ||
| } | ||
| } // namespace LIBC_NAMESPACE_DECL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: fix missing newline