scripts/cfg_files.py
def write_cfg_files(cfg: config.Config, lib_spec: config.LibrarySpec) -> None:
    """Create target-specific configuration files for a single library
       variant."""
    target = lib_spec.target
    base_cfg_lines = [
        '--target={}'.format(target),
        lib_spec.flags,
        '-fuse-ld=lld',
        '-fno-exceptions -fno-rtti',
        '--sysroot $@/../lib/clang-runtimes/{}'.format(lib_spec.name)
    ]

    # No semihosting and no linker script
    nosys_lines = base_cfg_lines + [
        '$@/../lib/clang-runtimes/{}/lib/crt0.o'.format(lib_spec.name),
        '-lnosys',
    ]
    # Semihosting and linker script provided
    rdimon_lines = base_cfg_lines + [
        '-Wl,-T$@/../lib/clang-runtimes/{}/base.ld'.format(lib_spec.name),
        '$@/../lib/clang-runtimes/{}/lib/rdimon-crt0.o'.format(lib_spec.name),
        '-lrdimon',
    ]
    # Semihosting, but no linker script, e.g. to use with QEMU Arm System
    # emulator
    rdimon_baremetal_lines = base_cfg_lines + [
        '$@/../lib/clang-runtimes/{}/lib/rdimon-crt0.o'.format(lib_spec.name),
        '-lrdimon',
    ]

    cfg_files = [
        ('nosys', nosys_lines),
        ('rdimon', rdimon_lines),
        ('rdimon_baremetal', rdimon_baremetal_lines),
    ]

    for name, lines in cfg_files:
        file_name = '{}_{}.cfg'.format(lib_spec.name, name)
        file_path = os.path.join(cfg.target_llvm_bin_dir, file_name)
        if cfg.verbose:
            logging.info('Writing %s', file_path)
        util.write_lines(lines, file_path)
Create target-specific configuration files for a single library
       variant.
Create target-specific configuration files for a single library
variant.
Create target - specific configuration files for a single library variant .
def write_cfg_files(cfg: config.Config, lib_spec: config.LibrarySpec) -> None:
    target = lib_spec.target
    base_cfg_lines = [
        '--target={}'.format(target),
        lib_spec.flags,
        '-fuse-ld=lld',
        '-fno-exceptions -fno-rtti',
        '--sysroot $@/../lib/clang-runtimes/{}'.format(lib_spec.name)
    ]
    nosys_lines = base_cfg_lines + [
        '$@/../lib/clang-runtimes/{}/lib/crt0.o'.format(lib_spec.name),
        '-lnosys',
    ]
    rdimon_lines = base_cfg_lines + [
        '-Wl,-T$@/../lib/clang-runtimes/{}/base.ld'.format(lib_spec.name),
        '$@/../lib/clang-runtimes/{}/lib/rdimon-crt0.o'.format(lib_spec.name),
        '-lrdimon',
    ]
    rdimon_baremetal_lines = base_cfg_lines + [
        '$@/../lib/clang-runtimes/{}/lib/rdimon-crt0.o'.format(lib_spec.name),
        '-lrdimon',
    ]
    cfg_files = [
        ('nosys', nosys_lines),
        ('rdimon', rdimon_lines),
        ('rdimon_baremetal', rdimon_baremetal_lines),
    ]
    for name, lines in cfg_files:
        file_name = '{}_{}.cfg'.format(lib_spec.name, name)
        file_path = os.path.join(cfg.target_llvm_bin_dir, file_name)
        if cfg.verbose:
            logging.info('Writing %s', file_path)
        util.write_lines(lines, file_path)
def write_cfg_files ( cfg : config . Config , lib_spec : config . LibrarySpec ) -> None : target = lib_spec . target base_cfg_lines = [ '--target={}' . format ( target ) , lib_spec . flags , '-fuse-ld=lld' , '-fno-exceptions -fno-rtti' , '--sysroot $@/../lib/clang-runtimes/{}' . format ( lib_spec . name ) ] nosys_lines = base_cfg_lines + [ '$@/../lib/clang-runtimes/{}/lib/crt0.o' . format ( lib_spec . name ) , '-lnosys' , ] rdimon_lines = base_cfg_lines + [ '-Wl,-T$@/../lib/clang-runtimes/{}/base.ld' . format ( lib_spec . name ) , '$@/../lib/clang-runtimes/{}/lib/rdimon-crt0.o' . format ( lib_spec . name ) , '-lrdimon' , ] rdimon_baremetal_lines = base_cfg_lines + [ '$@/../lib/clang-runtimes/{}/lib/rdimon-crt0.o' . format ( lib_spec . name ) , '-lrdimon' , ] cfg_files = [ ( 'nosys' , nosys_lines ) , ( 'rdimon' , rdimon_lines ) , ( 'rdimon_baremetal' , rdimon_baremetal_lines ) , ] for name , lines in cfg_files : file_name = '{}_{}.cfg' . format ( lib_spec . name , name ) file_path = os . path . join ( cfg . target_llvm_bin_dir , file_name ) if cfg . verbose : logging . info ( 'Writing %s' , file_path ) util . write_lines ( lines , file_path )
Create target-specific configuration files for a single library
variant.
Create target - specific configuration files for a single library variant .
"""Create target-specific configuration files for a single library
       variant.""" # No semihosting and no linker script # Semihosting and linker script provided # Semihosting, but no linker script, e.g. to use with QEMU Arm System # emulator
cfg
config.Config
lib_spec
config.LibrarySpec