From 8acb39f31f3d86f658312f227606d70bc0a6c868 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Wed, 22 Sep 2021 15:00:32 +0800 Subject: [PATCH] fix parallel compilation --- nac3standalone/demo/run_demo.sh | 2 +- nac3standalone/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nac3standalone/demo/run_demo.sh b/nac3standalone/demo/run_demo.sh index c3e606a4..77d6decf 100755 --- a/nac3standalone/demo/run_demo.sh +++ b/nac3standalone/demo/run_demo.sh @@ -8,5 +8,5 @@ if [ -z "$1" ]; then fi ../../target/release/nac3standalone $1 -clang -Wall -O2 -o $1.elf demo.c $1.o +clang -Wall -O2 -o $1.elf demo.c module*.o ./$1.elf diff --git a/nac3standalone/src/main.rs b/nac3standalone/src/main.rs index 5f4eae66..a9a36ce4 100644 --- a/nac3standalone/src/main.rs +++ b/nac3standalone/src/main.rs @@ -141,7 +141,7 @@ fn main() { ) .expect("couldn't create target machine"); target_machine - .write_to_file(module, FileType::Object, Path::new(&(demo_name.to_owned() + ".o"))) + .write_to_file(module, FileType::Object, Path::new(&format!("{}.o", module.get_name().to_str().unwrap()))) .expect("couldn't write module to file"); // println!("IR:\n{}", module.print_to_string().to_str().unwrap());