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

Commit a6a14cb

Browse files
committed
fix: ensure libunwind is linked on linux
1 parent 7a7b02a commit a6a14cb

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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"),

firefly/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ log.workspace = true
2929
[build-dependencies]
3030
firefly_crt = { path = "../runtimes/crt" }
3131
firefly_emulator = { path = "../runtimes/emulator" }
32+
unwind = { path = "../compiler/unwind" }

tools/firefly-make/src/build.rs

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

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

479-
let firefly_libs = &["firefly_emulator"];
479+
let firefly_libs = &["firefly_emulator", "unwind"];
480480
for lib in firefly_libs.iter().copied() {
481481
if let Some(files) = deps.get(lib) {
482482
for file in files.iter() {

0 commit comments

Comments
 (0)