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 7a7b02a commit a6a14cb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
1 change: 1 addition & 0 deletions firefly/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ log.workspace = true
[build-dependencies]
firefly_crt = { path = "../runtimes/crt" }
firefly_emulator = { path = "../runtimes/emulator" }
unwind = { path = "../compiler/unwind" }
2 changes: 1 addition & 1 deletion tools/firefly-make/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ pub fn run(config: &Config) -> anyhow::Result<()> {

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

let firefly_libs = &["firefly_emulator"];
let firefly_libs = &["firefly_emulator", "unwind"];
for lib in firefly_libs.iter().copied() {
if let Some(files) = deps.get(lib) {
for file in files.iter() {
Expand Down

0 comments on commit a6a14cb

Please sign in to comment.