-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[builtins][arm64] Build __init_cpu_features_resolver on Apple platforms #73685
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
jroelofs
merged 49 commits into
main
from
users/jroelofs/spr/builtinsarm64-build-__init_cpu_features_resolver-on-apple-platforms
Dec 14, 2023
Merged
Changes from 2 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
802e1c6
[𝘀𝗽𝗿] changes to main this commit is based on
jroelofs 24f8f63
[𝘀𝗽𝗿] initial version
jroelofs de74c62
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 413e538
rebase
jroelofs a34d63c
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 9c8c292
rebase
jroelofs e5f65ac
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 44935a8
rebase
jroelofs eafbe06
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs b6a5fe0
rebase
jroelofs 97e7926
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 63df438
review feedback
jroelofs b3ed2e9
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs ee558d7
rebase
jroelofs 603983e
add a note about the dispatch_once block
jroelofs cbb1611
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 9f6c80e
rebase
jroelofs 501007c
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 38823b5
rebase
jroelofs 672624d
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 7b66e1e
rebase
jroelofs 67574eb
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 628255e
rebase
jroelofs a2380ad
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 08024c3
review feedback
jroelofs 019fe15
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 2ff6200
rebase
jroelofs f9a3370
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 5611e8a
rebase
jroelofs 2899456
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 707c1a8
rebase
jroelofs c1d65d5
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs eb72f78
rebase
jroelofs 9995a6b
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs bd8f8ab
rebase
jroelofs a835c1a
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 106d60c
rebase
jroelofs d244734
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs cd9a7b8
rebase
jroelofs 6fec737
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs ec3f949
rebase
jroelofs 5f53abd
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs a19bab2
rebase
jroelofs 75b5c7a
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs e0759d1
rebase
jroelofs e2d5847
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs a9d0337
rebase
jroelofs eefbffb
[𝘀𝗽𝗿] changes introduced through rebase
jroelofs 310fe41
rebase
jroelofs 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
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
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
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.
I am not familiar with blocks. Does this introduce any dependency on libcalls? Can this reuse
if (__aarch64_cpu_features.features)
used by ELF?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.
The only dependencies from the block + the dispatch_once should be on things in compiler-rt and in libSystem (which we need anyway for the sysctls). I am not sure whether we can get away with doing the
if (__aarch64_cpu_features.features)
check that ELF does, since the resolvers that will be calling this will happen lazily at runtime on the Darwin implementation, and therefore potentially by separate threads (unlike ELF, which would run them at load time). This function is idempotent, but I don't think that is enough of an atomicity guarantee, especially if__aarch64_cpu_features
grows more fields.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.
Thanks for the explanation. If
__init_cpu_features_resolver
can be called concurrently, I think it is worth a comment, since the other__init_*
functions are guaranteed to be very early in the program startup sequence and is serial.