instance method
Gem::Ext::CargoBuilder#platform_specific_rustc_args
platform_specific_rustc_args(dest_dir, flags = [])
lib/rubygems/ext/cargo_builder.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/ext/cargo_builder.rb, line 135
def platform_specific_rustc_args(dest_dir, flags = [])
if mingw_target?
# On mingw platforms, mkmf adds libruby to the linker flags
flags += libruby_args(dest_dir)
# Make sure ALSR is used on mingw
# see https://github.com/rust-lang/rust/pull/75406/files
flags += ["-C", "link-arg=-Wl,--dynamicbase"]
flags += ["-C", "link-arg=-Wl,--disable-auto-image-base"]
# If the gem is installed on a host with build tools installed, but is
# 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
end
No documentation available
See also
#normalize_path
#rb_config_env
#mswin_link_args
#ruby_static?
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1