End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::Ext::CargoBuilder#linker_args
linker_args
lib/rubygems/ext/cargo_builder.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/rubygems/ext/cargo_builder.rb, line 106
def linker_args
# Have to handle CC="cl /nologo" on mswin
cc_flag = Shellwords.split(makefile_config("CC"))
linker = cc_flag.shift
link_args = cc_flag.flat_map {|a| ["-C", "link-arg=#{a}"] }
["-C", "linker=#{linker}", *link_args]
end
We want to use the same linker that Ruby uses, so that the linker flags from mkmf work properly.
See also
#libruby_args
#makefile_config
#ldflag_to_link_modifier
#maybe_resolve_ldflag_variable
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2