Add arbitrary “late link” args defined by the target spec. FIXME: Determine where exactly these args need to be inserted.
Add sysroot and other globally set directories to the directory search list.
Add a link script embedded in the target, if applicable.
Add a synthetic object file that contains reference to all symbols that we want to expose to the linker.
Add object files for allocator code linked once for the whole crate tree.
Add object files containing metadata for the current crate.
Add object files containing code from the current crate.
Native library linking
Add arbitrary “post-link” args defined by the target spec. FIXME: Determine where exactly these args need to be inserted.
Add post-link object files defined by the target spec.
Add arbitrary “pre-link” args defined by the target spec or from command line. FIXME: Determine where exactly these args need to be inserted.
Add pre-link object files defined by the target spec.
Add options making relocation sections in the produced ELF files read-only and suppressing lazy binding.
Add library search paths used at runtime by dynamic linkers.
Link in all of our upstream crates’ native dependencies. Remember that all of these upstream native dependencies are all non-static dependencies. We’ve got two cases then:
Linking Rust crates and their non-bundled static libraries
Add arbitrary “user defined” args defined from command line. FIXME: Determine where exactly these args need to be inserted.
Extract all symbols defined in raw-dylib libraries, collated by library name.
Returns a boolean indicating whether the specified crate should be ignored during LTO.
Performs the linkage portion of the compilation phase. This will generate all of the requested outputs for this compilation session.
thorin (rust implementation of a dwarf packaging utility) to link DWARF objects into a
Create a dynamic library or executable.
Create an ‘rlib’.
Create a static archive.
Produce the linker command line containing linker path and arguments.
Returns a pair of boolean indicating whether we should preserve the object and dwarf object files on the filesystem for their debug information. This is often useful with split-dwarf like schemes.
Various toolchain components used during linking are used from rustc distribution instead of being found somewhere on the host system. We only provide such support for a very limited number of targets.