summaryrefslogtreecommitdiff
path: root/lib/rubygems/ext/cargo_builder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/ext/cargo_builder.rb')
-rw-r--r--lib/rubygems/ext/cargo_builder.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rubygems/ext/cargo_builder.rb b/lib/rubygems/ext/cargo_builder.rb
index e33b07a8a2..24c1d3ae6e 100644
--- a/lib/rubygems/ext/cargo_builder.rb
+++ b/lib/rubygems/ext/cargo_builder.rb
@@ -37,6 +37,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
def build_env
build_env = rb_config_env
build_env["RUBY_STATIC"] = "true" if ruby_static? && ENV.key?("RUBY_STATIC")
+ build_env["RUSTFLAGS"] = "#{ENV["RUSTFLAGS"]} --cfg=rb_sys_gem".strip
build_env
end
@@ -92,6 +93,9 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
# run on one that isn't the missing libraries will cause the extension
# to fail on start.
flags += ["-C", "link-arg=-static-libgcc"]
+ elsif darwin_target?
+ # Ventura does not always have this flag enabled
+ flags += ["-C", "link-arg=-Wl,-undefined,dynamic_lookup"]
end
flags