module L::LD::LinkerLD
Public Class Methods
available?()
click to toggle source
# File lib/rub/l/ld/linker/ld.rb, line 32 def self.available? !!find end
find()
click to toggle source
Find the linker command. @return [Pathname,nil] The command.
# File lib/rub/l/ld/linker/ld.rb, line 38 def self.find C.find_command 'ld' end
link_command(opt, files, libs, out, format)
click to toggle source
# File lib/rub/l/ld/linker/ld.rb, line 42 def self.link_command(opt, files, libs, out, format) files = R::Tool.make_set_paths files libs = R::Tool.make_set libs out = C.path out c = [find, "-o#{out}"] c << opt.args c << case format when :exe [] when :shared ['-shared'] else raise "Unknown/unsupported output #{format}." end c << case opt.optimize when :none '-O0' when :some '-O0' when :full '-O1' when :max '-O9' else raise "Invalid optimization level #{opt.optimize}." end c << if opt.static '-static' else [] end c << opt.library_dirs.map{|d| "-L#{d}"} #c << libs.map{|l| "-l#{l}" } c << libs.map{|l| "#{l}" } c << files.to_a c.flatten end
name()
click to toggle source
# File lib/rub/l/ld/linker/ld.rb, line 28 def self.name :ld end