Class GnuLinker

    • Constructor Detail

      • GnuLinker

        public GnuLinker​(Tool tool)
    • Method Detail

      • getScrubbers

        public com.google.common.collect.ImmutableList<FileScrubber> getScrubbers​(com.google.common.collect.ImmutableMap<Path,​Path> cellRootMap)
        Specified by:
        getScrubbers in interface Linker
        Parameters:
        cellRootMap - Replacement map for cell roots found in paths, to some suitably normalized form (such as a relative path from root cell).
      • incrementalThinLTOFlags

        public Iterable<Arg> incrementalThinLTOFlags​(Path output)
        Specified by:
        incrementalThinLTOFlags in interface HasIncrementalThinLTO
        Parameters:
        output - the path of the output index files
        Returns:
        the platform-specific way to generate intermediate build products for ThinLTO.
      • soname

        public Iterable<String> soname​(String arg)
        Specified by:
        soname in interface Linker
        Returns:
        the platform-specific way to specify that linker should use the given soname when linking a shared library.
      • fileList

        public Iterable<Arg> fileList​(Path fileListPath)
        Description copied from interface: Linker
        Specifies that the linker should link the files listed in file. This is an alternative to listing the files on the command line. The file names are listed one per line separated only by newlines. Spaces and tabs are assumed to be part of the file name.
        Specified by:
        fileList in interface Linker
        Parameters:
        fileListPath - the path to file which contains contents for file list to link
        Returns:
        the platform-specific way to support the feature. Empty list if feature is not supported.
      • origin

        public String origin()
        Specified by:
        origin in interface Linker
        Returns:
        the placeholder used by the dynamic loader for the directory containing the top-level executable.
      • libOrigin

        public String libOrigin()
        Specified by:
        libOrigin in interface Linker
        Returns:
        the placeholder used by the dynamic loader for the directory containing the top-level library (useful for e.g. plugins).
      • searchPathEnvVar

        public String searchPathEnvVar()
        Specified by:
        searchPathEnvVar in interface Linker
        Returns:
        the name of the environment variable for the shared library runtime search path.
      • preloadEnvVar

        public String preloadEnvVar()
        Specified by:
        preloadEnvVar in interface Linker
        Returns:
        the name of the environment variable for the shared library preload search path.
      • createUndefinedSymbolsLinkerArgs

        public com.google.common.collect.ImmutableList<Arg> createUndefinedSymbolsLinkerArgs​(ProjectFilesystem projectFilesystem,
                                                                                             BuildRuleParams baseParams,
                                                                                             ActionGraphBuilder graphBuilder,
                                                                                             BuildTarget target,
                                                                                             com.google.common.collect.ImmutableList<? extends SourcePath> symbolFiles)
        Write all undefined symbols given in symbolFiles into a linker script wrapped in `EXTERN` commands.
        Specified by:
        createUndefinedSymbolsLinkerArgs in interface Linker
        Parameters:
        target - the name given to the BuildRule which creates the linker script.
        symbolFiles -
        Returns:
        the list of arguments which pass the linker script containing the undefined symbols to link.
      • getNoAsNeededSharedLibsFlags

        public Iterable<String> getNoAsNeededSharedLibsFlags()
        Specified by:
        getNoAsNeededSharedLibsFlags in interface Linker
        Returns:
        arguments to pass to the linker to disable dropping runtime references to shared libs which do not resolve symbols as link-time.
      • getIgnoreUndefinedSymbolsFlags

        public Iterable<String> getIgnoreUndefinedSymbolsFlags()
        Specified by:
        getIgnoreUndefinedSymbolsFlags in interface Linker
        Returns:
        arguments to pass to the linker so that it ignores undefined symbols when linking.