module L::LD
Linker
Library
#
This software is provided ‘as-is’, without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. #
#
Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: #
#
-
The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software in # a product, an acknowledgment in the product documentation would be # appreciated but is not required. #
#
-
Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. #
#
-
This notice may not be removed or altered from any source distribution. #
#
#
This software is provided ‘as-is’, without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. #
#
Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: #
#
-
The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software in # a product, an acknowledgment in the product documentation would be # appreciated but is not required. #
#
-
Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. #
#
-
This notice may not be removed or altered from any source distribution. #
#
#
This software is provided ‘as-is’, without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this software. #
#
Permission is granted to anyone to use this software for any purpose, # including commercial applications, and to alter it and redistribute it # freely, subject to the following restrictions: #
#
-
The origin of this software must not be misrepresented; you must not # claim that you wrote the original software. If you use this software in # a product, an acknowledgment in the product documentation would be # appreciated but is not required. #
#
-
Altered source versions must be plainly marked as such, and must not be # misrepresented as being the original software. #
#
-
This notice may not be removed or altered from any source distribution. #
#
Constants
- LinkerClang
- LinkerGCC
- LinkerLD
Public Class Methods
# File lib/rub/l/ld.rb, line 249 def self.initialize_copy(s) super self.library_dirs = s.library_dirs.dup end
Link object files.
@param src [Set<Pathname,String>,Array<Pathname,String>,Pathname,String]
The object files to link.
@param libs [Set<String>,Array<String>,String] Libraries to link with. @param name [Pathname,String] The basename of the output file. @param format [Symbol] The type of output to produce.
One of: [+:exe+] An executable binary. [+:shared+] A shared library.
@param linker [Symbol] The linker to use. If nil, use the default. @return [Pathname] The output file.
# File lib/rub/l/ld.rb, line 235 def self.link(src, libs, name, format: :exe) src = R::Tool.make_set_paths src libs = R::Tool.make_set libs libfs = libs.map {|l| linker.find_lib(self, l) or raise "Can't find library #{l}."} out = linker.full_name name, format out = R::Env.out_dir + 'l/ld/' + C.unique_segment(src, libs, self) + out C::generator(src+libfs, linker.link_command(self, src, libs, out, format), out) out end
# File lib/rub/l/ld.rb, line 92 def self.set_linker(name) self.linker = linkers[name] end