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

Commit 213b3f3

Browse files
committed
fix: ensure libunwind is linked on linux
1 parent d1beed1 commit 213b3f3

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

compiler/linker/src/lib.rs

+14-7
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,24 @@ impl ProjectInfo {
146146
.map(|t| t.dir.clone())
147147
.unwrap_or_else(|| options.host_tlib_path.dir.clone());
148148
let prefix = &options.target.options.staticlib_prefix;
149-
info.used_deps
150-
.push(match options.target.options.panic_strategy {
151-
PanicStrategy::Abort => Dependency {
149+
match options.target.options.panic_strategy {
150+
PanicStrategy::Abort => {
151+
info.used_deps.push(Dependency {
152152
name: Symbol::intern("panic_abort"),
153153
source: Some(fireflylib_dir.join(&format!("{}panic_abort.rlib", prefix))),
154-
},
155-
PanicStrategy::Unwind => Dependency {
154+
});
155+
}
156+
PanicStrategy::Unwind => {
157+
info.used_deps.push(Dependency {
156158
name: Symbol::intern("panic_unwind"),
157159
source: Some(fireflylib_dir.join(&format!("{}panic_unwind.rlib", prefix))),
158-
},
159-
});
160+
});
161+
info.used_deps.push(Dependency {
162+
name: Symbol::intern("unwind"),
163+
source: Some(fireflylib_dir.join(&format!("{}unwind.rlib", prefix))),
164+
});
165+
}
166+
}
160167
if options.target.options.is_like_wasm {
161168
info.used_deps.push(Dependency {
162169
name: Symbol::intern("firefly_emulator"),

tools/firefly-make/src/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ pub fn run(config: &Config) -> anyhow::Result<()> {
457457

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

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

0 commit comments

Comments
 (0)