Skip to content

Commit

Permalink
fix(api,c-api,vm) Try passing --export-dynamic with a build.rs to…
Browse files Browse the repository at this point in the history
… the linker.
  • Loading branch information
Hywan committed Jul 20, 2021
1 parent 28079d8 commit 95fa38b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/api/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//! Pass `--export-dynamic` to the linker.
fn main() {
#[cfg(target_os = "linux")]
println!("cargo:rustc-cdylib-link-arg=--export-dynamic");
}
4 changes: 4 additions & 0 deletions lib/c-api/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! This build script aims at:
//!
//! * pass `--export-dynamic` to the linker,
//! * generating the C header files for the C API,
//! * setting `inline-c` up.
Expand Down Expand Up @@ -69,6 +70,9 @@ macro_rules! map_feature_as_c_define {
}

fn main() {
#[cfg(target_os = "linux")]
println!("cargo:rustc-cdylib-link-arg=--export-dynamic");

if !running_self() {
return;
}
Expand Down
6 changes: 5 additions & 1 deletion lib/vm/build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
//! Runtime build script compiles C code using setjmp for trap handling.
//! 1. Pass `--export-dynamic` to the linker.
//! 2. Runtime build script compiles C code using setjmp for trap handling.
use std::env;

fn main() {
#[cfg(target_os = "linux")]
println!("cargo:rustc-cdylib-link-arg=--export-dynamic");

println!("cargo:rerun-if-changed=src/trap/handlers.c");

cc::Build::new()
Expand Down

0 comments on commit 95fa38b

Please sign in to comment.