Skip to content

Commit

Permalink
Enable lazy linking for truffle on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ianks committed Nov 18, 2024
1 parent 330e37e commit 50e0121
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/rb-sys-test-helpers/src/ruby_test_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub unsafe fn setup_ruby_unguarded() {
let mut argv: [*mut i8; 3] = [
"ruby\0".as_ptr() as _,
"-e\0".as_ptr() as _,
"\0".as_ptr() as _,
"nil\0".as_ptr() as _,
];

ruby_process_options(argv.len() as _, argv.as_mut_ptr() as _) as _
Expand Down
3 changes: 3 additions & 0 deletions gem/lib/rb_sys/cargo_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ def platform_specific_rustc_args(dest_dir, flags = [])
# See https://github.com/oxidize-rb/rb-sys/issues/88
dl_flag = "-Wl,-undefined,dynamic_lookup"
flags += ["-C", "link-arg=#{dl_flag}"] unless makefile_config("DLDFLAGS")&.include?(dl_flag)
elsif RUBY_ENGINE == "truffleruby"
dl_flag = "-Wl,-z,lazy"
flags += ["-C", "link-arg=#{dl_flag}"] unless makefile_config("DLDFLAGS")&.include?(dl_flag)
end

if musl?
Expand Down

0 comments on commit 50e0121

Please sign in to comment.