3.1.32. waf_tools.size

Section size reporting from compiled object and linked files using the size utility.

This waf tool runs the armsize utility on compiled object files and linked executables/libraries to produce section size reports (text, data, bss). The output is written to size.log files alongside the original artifacts. Size reporting is an optional post-processing step controlled by the --run-size command-line option.

The tool hooks into task generators with the c, cstlib, or cprogram features and creates a size task for each compiled object file and the final linked output.

3.1.32.1. Usage

  1. The tool is loaded and configured by waf_tools.ti_arm_cgt.find_armsize() and waf_tools.ti_arm_cgt.options():

    # in ti_arm_cgt.py
    @conf
    def find_armsize(ctx):
        ctx.load("size", tooldir=TOOL_DIR)
    
    # in ti_arm_cgt.py
    def options(opt):
        opt.load("size", tooldir=TOOL_DIR)
    
  2. Run the build with the --run-size flag to generate size reports:

    waf build_app_ti_arm_cgt --run-size
    
  3. Size report files are written next to their corresponding object or linked files with the suffix .size.log.

3.1.32.2. Dependencies

  • TI armsize utility (SIZE environment variable)

  • TI ARM CGT toolchain (CC_NAME == "armcl")

Functions

configure(ctx)

Configure the size section reporting tool.

make_size_task_objects(self)

Create size tasks for compiled object files and linked output files.

options(opt)

Register command-line options for the size tool.

Classes

size(*k, **kw)

Task that runs the SIZE tool on a single file and writes the report.