-
Notifications
You must be signed in to change notification settings - Fork 674
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
Fix macos #1980
Merged
Merged
Fix macos #1980
Conversation
This file contains 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
utzig
reviewed
Jun 20, 2024
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.
There's a typo in the last commit message: conflicing
-> conflicting
.
This struct was having addresses taken of fields within it, and then being returned. It is platform-specific whether this causes a move. It seems to be working on x86_64, but causes a segfault on aarch64. Box the struct so that it isn't moved after being initialized. Signed-off-by: David Brown <[email protected]>
Since there are references to this struct passed to C code, put it into an Rc so that it won't move around when the data is moved. Signed-off-by: David Brown <[email protected]>
The symbols injected here cause some kind of poor interaction with the linker on MacOS, which results in most of the code becoming hopelessly corrupt. For now, just disable these symbols on this target. Signed-off-by: David Brown <[email protected]>
Many of these extern functions are missing the "C". It doesn't seem to matter on any of our targets, but this does make the code more correct, and might be a problem in the future. Signed-off-by: David Brown <[email protected]>
Cargo prints a warning about conflicting resolvers being used. Fix this by explicitly setting the resolver in the project file. Signed-off-by: David Brown <[email protected]>
Increase the size of the jmpbuf to accomodate other architectures. Unfortunately, the size of this is not available in the libc crate. Increase this so encompass any platforms we wish to support, including aarch64 on both Linux and MacOS. Increasing an array beyond 32 means there is no default offered, so implement this manually. Signed-off-by: David Brown <[email protected]>
utzig
approved these changes
Jun 26, 2024
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.
LGTM
de-nordic
approved these changes
Jun 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Several fixes to allow the simulator to run on MacOS (aarch64). Several of these are actual problems with taking addresses of stack variables, or values that are later moved.
There is also a problem with the LLVM linker and the way the FIH_LABEL labels are added, which results in large blocks of code being discarded, and resulting in nonsensical code flow. For now, disable these labels on Apple targets, but as Rust is moving to the LLVM linker on other targets, this is likely to be more important.
Fixes #1979.