-
Notifications
You must be signed in to change notification settings - Fork 97
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
Get Kani to run on Apple M1 #1323
Conversation
* Modified check_target() in compiler_interface.rs to accept 'arm64-apple-*', * machine_model_from_session() in goto_ctx.rs to use the parameters for this target * added a small cpp in tools/sizeofs/main.cpp to generate these) * fixed a few tests that had hardcoded assumes on type sizes and alignements.
Added copyright header to tools/sizeofs/main.cpp
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.
Awesome, thanks!
I think I want to change some things, but they're more appropriate for a refactoring followup after I add arm64 linux as well...
let is_x86_64_darwin_target = session.target.llvm_target.starts_with("x86_64-apple-"); | ||
// looking for `arm64-apple-*` | ||
let is_arm64_darwin_target = session.target.llvm_target.starts_with("arm64-apple-"); |
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.
This isn't your change, but ew. I wonder if there's a convenient way to look at the Rust target name here, not the LLVM one, because Rust-side this should be "darwin" consistently, I think.
Note to self for a refactoring follow-up...
long_double_width, | ||
long_int_width, | ||
long_long_int_width, | ||
memory_operand_size: int_width / 8, |
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.
Good change.
#[cfg(target_arch = "aarch64")] | ||
assert_eq!(align_of_val(t), 16); |
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.
Hmm, note to self: wonder if this will be different on linux arm64.
Description of changes:
Kani was building on M1 but refusing to perform verifications with the following error: error: Kani requires the target platform to be
x86_64-unknown-linux-gnu
orx86_64-apple-darwin
, but it is arm64-apple-macosx11.0.0error: aborting due to previous error.
Modified check_target() in compiler_interface.rs to accept 'arm64-apple-*', machine_model_from_session() in goto_ctx.rs to use the parameters for this target (added a small cpp in tools/sizeofs/main.cpp to generate these), and fixed a few tests that had hardcoded assumes on type sizes and alignements.
Resolved issues:
Resolves #1167
Call-outs:
Not covering any CI aspects.
Testing:
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.