Skip to content

Commit

Permalink
hack to 'fix' Issue #135 for acipher-rs TA
Browse files Browse the repository at this point in the history
  • Loading branch information
msgilligan committed May 30, 2024
1 parent 0f1f526 commit 13935f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion examples/acipher-rs/ta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ UUID ?= $(shell cat "../uuid.txt")
TARGET ?= aarch64-unknown-linux-gnu
CROSS_COMPILE ?= aarch64-linux-gnu-
OBJCOPY := $(CROSS_COMPILE)objcopy
LINKER_CFG := target.$(TARGET).linker=\"$(CROSS_COMPILE)ld.bfd\"
LINKER_CFG := target.$(TARGET).linker=\"$(CROSS_COMPILE)ld\"

TA_SIGN_KEY ?= $(TA_DEV_KIT_DIR)/keys/default_ta.pem
SIGN := $(TA_DEV_KIT_DIR)/scripts/sign_encrypt.py
Expand All @@ -29,6 +29,7 @@ OUT_DIR := $(CURDIR)/target/$(TARGET)/release
all: ta strip sign

ta:
@echo ${LINKER_CFG}
@cargo build --target $(TARGET) --release --config $(LINKER_CFG)

strip: ta
Expand Down
5 changes: 3 additions & 2 deletions examples/acipher-rs/ta/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,11 @@ fn main() -> std::io::Result<()> {
println!("cargo:rustc-link-arg=-e__ta_entry");
println!("cargo:rustc-link-arg=-pie");
println!("cargo:rustc-link-arg=-Os");
println!("cargo:rustc-link-arg=--sort-section=alignment");
//println!("cargo:rustc-link-arg=--sort-section=alignment");


let mut dyn_list = File::create(out.join("dyn_list"))?;
write!(dyn_list, "{{ __elf_phdr_info; trace_ext_prefix; trace_level; ta_head; }};\n")?;
println!("cargo:rustc-link-arg=--dynamic-list=dyn_list");
//println!("cargo:rustc-link-arg=--dynamic-list=dyn_list");
Ok(())
}

0 comments on commit 13935f6

Please sign in to comment.