Skip to content

Add target-feature neon #4010

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kani-driver/src/call_cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ pub fn cargo_config_args() -> Vec<OsString> {
// Propagate `--cfg=kani_host` to build scripts.
"-Zhost-config",
"-Ztarget-applies-to-host",
"-Ctarget-feature=+neon",
"--config=host.rustflags=[\"--cfg=kani_host\"]",
]
.map(OsString::from)
Expand Down
3 changes: 3 additions & 0 deletions kani-driver/src/call_single_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ impl KaniSession {
"--check-cfg=cfg(kani)",
// Do not invoke the linker since the compiler will not generate real object files
"-Clinker=echo",
"-Ctarget-feature=+neon",
]
.map(OsString::from),
);
Expand Down Expand Up @@ -230,6 +231,8 @@ pub fn base_rustc_flags(lib_config: LibConfig) -> Vec<OsString> {
"crate-attr=feature(register_tool)",
"-Z",
"crate-attr=register_tool(kanitool)",
"-C",
"target-feature=+neon",
]
.map(OsString::from)
.to_vec();
Expand Down
10 changes: 8 additions & 2 deletions tools/build-kani/src/sysroot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ pub fn build_lib(bin_folder: &Path) -> Result<()> {
fn build_verification_lib(compiler_path: &Path) -> Result<()> {
let extra_args =
["-Z", "build-std=panic_abort,std,test", "--config", "profile.dev.panic=\"abort\""];
let compiler_args = ["--kani-compiler", "-Cllvm-args=--ignore-global-asm --build-std"];
let compiler_args = [
"--kani-compiler",
"-Cllvm-args=--ignore-global-asm --build-std",
"-Ctarget-feature=+neon",
];
let packages = ["std", "kani", "kani_macros"];
let artifacts = build_kani_lib(compiler_path, &packages, &extra_args, &compiler_args)?;
copy_artifacts(&artifacts, &kani_sysroot_lib(), true)
Expand All @@ -97,7 +101,8 @@ fn build_playback_lib(compiler_path: &Path) -> Result<()> {
let extra_args =
["--features=std/concrete_playback,kani/concrete_playback", "-Z", "build-std=std,test"];
let packages = ["std", "kani", "kani_macros"];
let artifacts = build_kani_lib(compiler_path, &packages, &extra_args, &[])?;
let artifacts =
build_kani_lib(compiler_path, &packages, &extra_args, &["-Ctarget-feature=+neon"])?;
copy_artifacts(&artifacts, &kani_playback_lib(), true)
}

Expand Down Expand Up @@ -278,6 +283,7 @@ pub fn build_bin<T: AsRef<OsStr>>(extra_args: &[T]) -> Result<PathBuf> {
.arg("build")
.args(extra_args)
.args(args)
.env("CARGO_ENCODED_RUSTFLAGS", "-Ctarget-feature=+neon")
.run()
.or(Err(format_err!("Failed to build binaries.")))?;
Ok(out_dir)
Expand Down
Loading