Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
fix: ensure libunwind is linked on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwalker committed Feb 27, 2023
1 parent d1beed1 commit 213b3f3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
21 changes: 14 additions & 7 deletions compiler/linker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,24 @@ impl ProjectInfo {
.map(|t| t.dir.clone())
.unwrap_or_else(|| options.host_tlib_path.dir.clone());
let prefix = &options.target.options.staticlib_prefix;
info.used_deps
.push(match options.target.options.panic_strategy {
PanicStrategy::Abort => Dependency {
match options.target.options.panic_strategy {
PanicStrategy::Abort => {
info.used_deps.push(Dependency {
name: Symbol::intern("panic_abort"),
source: Some(fireflylib_dir.join(&format!("{}panic_abort.rlib", prefix))),
},
PanicStrategy::Unwind => Dependency {
});
}
PanicStrategy::Unwind => {
info.used_deps.push(Dependency {
name: Symbol::intern("panic_unwind"),
source: Some(fireflylib_dir.join(&format!("{}panic_unwind.rlib", prefix))),
},
});
});
info.used_deps.push(Dependency {
name: Symbol::intern("unwind"),
source: Some(fireflylib_dir.join(&format!("{}unwind.rlib", prefix))),
});
}
}
if options.target.options.is_like_wasm {
info.used_deps.push(Dependency {
name: Symbol::intern("firefly_emulator"),
Expand Down
2 changes: 1 addition & 1 deletion tools/firefly-make/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ pub fn run(config: &Config) -> anyhow::Result<()> {

println!("Installing runtime dependencies..");

let rustlibs = &["libpanic_abort", "libpanic_unwind"];
let rustlibs = &["libpanic_abort", "libpanic_unwind", "libunwind"];
let walker = WalkDir::new(config.toolchain_target_dir().join("lib")).into_iter();
for entry in walker.filter_entry(|e| is_dir_or_matching_rlib(e, rustlibs)) {
let entry = entry.unwrap();
Expand Down

0 comments on commit 213b3f3

Please sign in to comment.