Skip to content
 
fab 1.0.dev0 documentation fab.steps.link module
Type to start searching
    • fab 1.0.dev0 documentation
    • fab
    • fab package
    • fab.steps package
    • Contents:
    • Installing Fab
    • Environment
    • Introduction to Configuration
    • How to Write a Build Config
    • Advanced Configuration
    • Features
    • Api Reference
    • Developer’s guide
    • Glossary
    • Index
    • Python Module Index
    • fab.steps.link module
      • DefaultLinkerSource
      • call_linker()
      • link_exe()
      • link_shared_object()
    • Show Source

    fab.steps.link module¶

    Link an executable.

    class fab.steps.link.DefaultLinkerSource¶

    Bases: ArtefactsGetter

    A source getter specifically for linking. Looks for the default output from archiving objects, falls back to default compiler output. This allows a link step to work with or without a preceding object archive step.

    fab.steps.link.call_linker(linker, flags, filename, objects)¶
    fab.steps.link.link_exe(config, linker=None, flags=None, source=None)¶

    Link object files into an executable for every build target.

    Expects one or more build targets from its artefact getter, of the form Dict[name, object_files].

    The default artefact getter, DefaultLinkerSource, looks for any output from an ArchiveObjects step, and falls back to using output from compiler steps.

    Parameters:
    • config – The fab.build_config.BuildConfig object where we can read settings such as the project workspace folder or the multiprocessing flag.

    • linker (Optional[str]) – (default: None) E.g ‘gcc’ or ‘ld’.

    • flags – (default: None) A list of flags to pass to the linker.

    • source (Optional[ArtefactsGetter]) – (default: None) An optional ArtefactsGetter. Typically not required, as there is a sensible default.

    fab.steps.link.link_shared_object(config, output_fpath, linker=None, flags=None, source=None)¶

    Produce a shared object (.so) file from the given build target.

    Expects a single build target from its artefact getter, of the form Dict[None, object_files]. We can assume the list of object files is the entire project source, compiled.

    Params are as for LinkerBase, with the addition of:

    Parameters:
    • config – The fab.build_config.BuildConfig object where we can read settings such as the project workspace folder or the multiprocessing flag.

    • output_fpath (str) – File path of the shared object to create.

    • linker (Optional[str]) – (default: None) E.g ‘gcc’ or ‘ld’.

    • flags – (default: None) A list of flags to pass to the linker.

    • source (Optional[ArtefactsGetter]) – (default: None) An optional ArtefactsGetter. Typically not required, as there is a sensible default.

    Previous fab.steps.find_source_files module
    Next fab.steps.preprocess module
    © Copyright 2023.
    Created using Sphinx 6.1.3. and Material for Sphinx