Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Try #182:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] committed Mar 15, 2019
2 parents 3bf85b9 + 002dce0 commit db0172c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 11 deletions.
3 changes: 3 additions & 0 deletions assemble.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ ar crs bin/thumbv7em-none-eabihf.a bin/$crate.o
arm-none-eabi-as -march=armv8-m.base asm.s -o bin/$crate.o
ar crs bin/thumbv8m.base-none-eabi.a bin/$crate.o

arm-none-eabi-as -march=armv8-m.main asm.s -o bin/$crate.o
ar crs bin/thumbv8m.main-none-eabi.a bin/$crate.o

rm bin/$crate.o
Binary file modified bin/thumbv6m-none-eabi.a
Binary file not shown.
Binary file modified bin/thumbv7em-none-eabi.a
Binary file not shown.
Binary file modified bin/thumbv7em-none-eabihf.a
Binary file not shown.
Binary file modified bin/thumbv7m-none-eabi.a
Binary file not shown.
Binary file modified bin/thumbv8m.base-none-eabi.a
Binary file not shown.
Binary file added bin/thumbv8m.main-none-eabi.a
Binary file not shown.
30 changes: 19 additions & 11 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ fn main() {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());

has_fpu(&target);
let is_armv6m = is_armv6m(&target);

if target.starts_with("thumbv") {
fs::copy(
Expand Down Expand Up @@ -43,7 +42,21 @@ INCLUDE device.x"#
f
};

let max_int_handlers = if is_armv6m { 32 } else { 240 };
let max_int_handlers = if target.starts_with("thumbv6m-") {
println!("cargo:rustc-cfg=cortex_m");
println!("cargo:rustc-cfg=armv6m");
32
} else if target.starts_with("thumbv7m-") || target.starts_with("thumbv7em-") {
println!("cargo:rustc-cfg=cortex_m");
println!("cargo:rustc-cfg=armv7m");
240
} else if target.starts_with("thumbv8m") {
println!("cargo:rustc-cfg=cortex_m");
println!("cargo:rustc-cfg=armv8m");
240
} else {
panic!("Unexpected target {:?}", target);
};

// checking the size of the interrupts portion of the vector table is sub-architecture dependent
writeln!(
Expand All @@ -58,6 +71,10 @@ handlers.");
max_int_handlers
).unwrap();

if target.ends_with("-eabihf") {
println!("cargo:rustc-cfg=has_fpu");
}

println!("cargo:rustc-link-search={}", out.display());

println!("cargo:rerun-if-changed=build.rs");
Expand All @@ -69,12 +86,3 @@ fn has_fpu(target: &str) {
println!("cargo:rustc-cfg=has_fpu");
}
}

fn is_armv6m(target: &str) -> bool {
if target.starts_with("thumbv6m-") {
println!("cargo:rustc-cfg=armv6m");
true
} else {
false
}
}

0 comments on commit db0172c

Please sign in to comment.