diff --git a/OSDK.toml b/OSDK.toml index 0c3190ae5..ad9838b0f 100644 --- a/OSDK.toml +++ b/OSDK.toml @@ -91,4 +91,4 @@ args = [ "-device virtio-net-device,netdev=net01", "-device virtio-serial-device", "-device virtconsole,chardev=mux", -] \ No newline at end of file +] diff --git a/osdk/src/commands/build/mod.rs b/osdk/src/commands/build/mod.rs index be6cdd09b..cb465437d 100644 --- a/osdk/src/commands/build/mod.rs +++ b/osdk/src/commands/build/mod.rs @@ -133,6 +133,9 @@ fn build_kernel_elf( "-C code-model=kernel", "-C relocation-model=static", "-Z relro-level=off", + // We do not really allow unwinding except for kernel testing. However, we need to specify + // this to show backtraces when panicking. + "-C panic=unwind", ]); let mut command = cargo(); diff --git a/osdk/src/commands/test.rs b/osdk/src/commands/test.rs index dd5489f2d..bbaa9e665 100644 --- a/osdk/src/commands/test.rs +++ b/osdk/src/commands/test.rs @@ -66,7 +66,7 @@ pub static KTEST_CRATE_WHITELIST: Option<&[&str]> = Some(&{:#?}); &osdk_target_directory, &ws_target_directory, &required_build_config, - &["--cfg ktest", "-C panic=unwind"], + &["--cfg ktest"], ); std::env::remove_var("RUSTFLAGS"); std::env::set_current_dir(original_dir).unwrap();