From 5d6c7548fc66c0813905a8a69944ace21321e706 Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Mon, 30 Nov 2020 10:33:01 +0800 Subject: [PATCH] Release mode applications worked on ch3-coop. --- os/build.rs | 2 +- user/Makefile | 2 +- user/build.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/os/build.rs b/os/build.rs index 4a996053..eb553e5b 100644 --- a/os/build.rs +++ b/os/build.rs @@ -6,7 +6,7 @@ fn main() { insert_app_data().unwrap(); } -static TARGET_PATH: &str = "../user/target/riscv64gc-unknown-none-elf/debug/"; +static TARGET_PATH: &str = "../user/target/riscv64gc-unknown-none-elf/release/"; fn insert_app_data() -> Result<()> { let mut f = File::create("src/link_app.S").unwrap(); diff --git a/user/Makefile b/user/Makefile index eabb4b27..5ca334ea 100644 --- a/user/Makefile +++ b/user/Makefile @@ -1,5 +1,5 @@ TARGET := riscv64gc-unknown-none-elf -MODE := debug +MODE := release APP_DIR := src/bin TARGET_DIR := target/$(TARGET)/$(MODE) APPS := $(wildcard $(APP_DIR)/*.rs) diff --git a/user/build.py b/user/build.py index 1a220881..b558177a 100644 --- a/user/build.py +++ b/user/build.py @@ -18,7 +18,7 @@ for app in apps: lines.append(line) with open(linker, 'w+') as f: f.writelines(lines) - os.system('cargo build --bin %s' % app) + os.system('cargo build --bin %s --release' % app) print('[build.py] application %s start with address %s' %(app, hex(base_address+step*app_id))) with open(linker, 'w+') as f: f.writelines(lines_before)