2025-01-22 16:18:30 +01:00

2.9 KiB
Executable File

Linker

Generally one linker is run per target to build a static library, dynamic library or exe. The 'id' attribute of the linker specifies whch type of linking is performed.

  • exe - Overwrite the exe command for this linker.

    <exe name="command" />
    
  • flag - Add a single link flag.

    <flag value="flag"/>
    
  • ext - Default extension for generated files - if not overridden by target.

    <ext value=".ext"/>
    
    • value = extension, including "."
  • outflag - Flag for specifying linker output name.

    <outflag value="-o"/>
    
    • value = linker flag. Note that it should contain a space character if the actual name should be a separate argument, like "-o ", or "-o"/"-out:" if it does not.
  • section - Group items - usually sharing common condition

    <section > </section>
    
  • libdir - A temp directory name to build into. This will capture the extra files the compiler generates, and then the desired file will be copied to the correct location.

    <libdir name="name"/>
    
  • lib - Add a library to the link line.

    <lib (name|hxbase|base)="libName" />
    
    • name = the complete name is specified
    • base = the name without compiler-specific extension (.a/.lib) is specified
    • hxbase = the name without extension and architecture (-v7/.iphoinesim) is specified
  • prefix - Prefix for generated files.

    <prefix value="lib"/>
    
    • value = prefix. This will usually be "lib" or nothing.
  • ranlib - Whether ranlib needs to be run, and what command to use. Usually only for unix-style static libraries

    <ranlib name="ranlib command"/>
    
  • libpathflag - Flag used for adding library paths to command line. It will be combined with lib entries.

    <libpathflag value="-L"/>
    
  • recreate - Whether to delete the target file before re-running link command. The archive "ar" command likes to add obj files to existing archives, so deleting first can help.

    <recreate value="true"/>
    
  • expandAr - Whether to extract the individual obj files from an archive and add these, rather than add the archive as a single library. Can solve some link-order and static-initialization issues, but may make final exe bigger.

    <expandAr value="true"/>
    
  • fromfile - If the linker supports taking a list of objs in a file, then this is flag for specifying the file.

    <fromfile value="flag" needsQuotes="true" />
    
    • value = flag for specifying file. If the filename should be a separate argument, then the flag should end with a space. Usually @ or -filelist . Use empty to disable.
    • needsQuotes = is whether to quote the obj names in the file