Skip to content

Commit

Permalink
hail: update to common build.rs
Browse files Browse the repository at this point in the history
This moves some flags from make to build.rs.
  • Loading branch information
bradjc committed Feb 18, 2022
1 parent d3a964b commit e207760
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
11 changes: 0 additions & 11 deletions boards/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,10 @@ TARGET_DIRECTORY ?= $(TOCK_ROOT_DIRECTORY)target/
# This will hopefully move into Cargo.toml (or Cargo.toml.local) eventually.
#
# - `relocation-model=static`: See https://github.com/tock/tock/pull/2853
# - `-nmagic`: lld by default uses a default page size to align program
# sections. Tock expects that program sections are set back-to-back. `-nmagic`
# instructs the linker to not page-align sections.
# - `-icf=all`: Identical Code Folding (ICF) set to all. This tells the linker
# to be more aggressive about removing duplicate code. The default is `safe`,
# and the downside to `all` is that different functions in the code can end up
# with the same address in the binary. However, it can save a fair bit of code
# size.
RUSTC_FLAGS ?= \
-C link-arg=-Tlayout.ld \
-C linker=rust-lld \
-C linker-flavor=ld.lld \
-C relocation-model=static \
-C link-arg=-nmagic \
-C link-arg=-icf=all \

# RISC-V-specific flags.
ifneq ($(findstring riscv32i, $(TARGET)),)
Expand Down
5 changes: 5 additions & 0 deletions boards/hail/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#[path = "../common_build.rs"]
mod common_build;

fn main() {
println!("cargo:rerun-if-changed=layout.ld");
println!("cargo:rerun-if-changed=chip_layout.ld");
println!("cargo:rerun-if-changed=../kernel_layout.ld");

common_build::tock_default_linker_args();
}

0 comments on commit e207760

Please sign in to comment.