1    /* 
     2     *  Copyright (c) 2008 Texas Instruments and others.
     3     *  All rights reserved. This program and the accompanying materials
     4     *  are made available under the terms of the Eclipse Public License v1.0
     5     *  which accompanies this distribution, and is available at
     6     *  http://www.eclipse.org/legal/epl-v10.html
     7     * 
     8     *  Contributors:
     9     *      Texas Instruments - initial implementation
    10     * 
    11     * */
    12    /*
    13     *  ======== ITarget.xdc ========
    14     *
    15     */
    16    
    17    /*!
    18     *  ======== ITarget ========
    19     *  An ELF extension to the `ti.targets.ITarget` interface.
    20     */
    21    metaonly interface ITarget inherits ti.targets.ITarget {
    22    
    23        override readonly config string rts = "ti.targets.rts6000";
    24    
    25        override readonly config xdc.bld.ITarget2.Command ar = {
    26            cmd: "ar6x",
    27            opts: "rq"
    28        };
    29    
    30        override readonly config xdc.bld.ITarget2.Command lnk = {
    31            cmd: "lnk6x",
    32            opts: "--abi=eabi"
    33        };
    34        
    35        override readonly config xdc.bld.ITarget2.Command vers = {
    36            cmd: "cl6x",
    37            opts: "--compiler_revision"
    38        };
    39    
    40        /*!
    41         *  ======== asmOpts ========
    42         *  User configurable assembler options.
    43         *
    44         *  Defaults:
    45         *  @p(dlist)
    46         *      -`-qq`
    47         *          super quiet mode
    48         */
    49        override config xdc.bld.ITarget2.Options asmOpts = {
    50            prefix: "-qq",
    51            suffix: ""
    52        };
    53    
    54        /*!
    55         *  ======== ccOpts ========
    56         *  User configurable compiler options.
    57         *
    58         *  Defaults:
    59         *  @p(dlist)
    60         *      -`-qq`
    61         *          super quiet mode
    62         *      -`-pdsw225`
    63         *          generate a warning for implicitly declared functions; i.e.,
    64         *          functions without prototypes
    65         */
    66        override config xdc.bld.ITarget2.Options ccOpts = {
    67            prefix: "-qq -pdsw225",
    68            suffix: ""
    69        };
    70    
    71        /*!
    72         *  ======== ccConfigOpts ========
    73         *  User configurable compiler options for the generated config C file.
    74         *
    75         *  -mo places all functions into subsections
    76         *  --no_compress helps with compile time with no real difference in
    77         *  code size since the generated config.c is mostly data and small
    78         *  function stubs.
    79         */
    80        override config xdc.bld.ITarget2.Options ccConfigOpts = {
    81            prefix: "$(ccOpts.prefix) -mo",
    82            suffix: "$(ccOpts.suffix)"
    83        };
    84    
    85        override config xdc.bld.ITarget.OptionSet profiles[string] = [
    86            ["debug", {
    87                compileOpts: {
    88                    copts: "--symdebug:dwarf",
    89                    defs:  "-D_DEBUG_=1",
    90                }
    91            }],
    92            ["release", {
    93                compileOpts: {
    94                    copts: "-O2",
    95                },
    96            }],
    97            ["whole_program", {
    98                compileOpts: {
    99                    copts: "-oe -O2 -mo",
   100                },
   101            }],
   102            ["whole_program_debug", {
   103                compileOpts: {
   104                    copts: "-oe --symdebug:dwarf -mo",
   105                },
   106            }],
   107        ];
   108    
   109        final override readonly config string sectMap[string] = [
   110            [".text", "code"],
   111            [".ti.decompress", "code"],
   112            [".stack", "stack"],
   113            [".bss", "data"],
   114            [".cinit", "data"],
   115            [".pinit", "data"],
   116            [".init_array", "data"],
   117            [".const", "data"],
   118            [".data", "data"],
   119            [".rodata", "data"],
   120            [".neardata", "data"],
   121            [".fardata", "data"],
   122            [".switch", "data"],
   123            [".sysmem", "data"],
   124            [".far", "data"],
   125            [".args", "data"],
   126            [".cio", "data"],
   127            [".ti.handler_table", "data"],
   128            [".c6xabi.exidx", "data"],
   129            [".c6xabi.extab", "data"],
   130        ];
   131    
   132        override readonly config Bool splitMap[string] = [
   133            [".text", true],
   134            [".pinit", true],
   135            [".const", true],
   136            [".data", true],
   137            [".fardata", true],
   138            [".switch", true],
   139            [".far", true],
   140            [".args", true],
   141            [".cio", true],
   142            [".c6xabi.extab", true]
   143        ];
   144        override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
   145            t_IArg          : { size: 4, align: 4 },
   146            t_Char          : { size: 1, align: 1 },
   147            t_Double        : { size: 8, align: 8 },
   148            t_Float         : { size: 4, align: 4 },
   149            t_Fxn           : { size: 4, align: 4 },
   150            t_Int           : { size: 4, align: 4 },
   151            t_Int8          : { size: 1, align: 1 },
   152            t_Int16         : { size: 2, align: 2 },
   153            t_Int32         : { size: 4, align: 4 },
   154            t_Int64         : { size: 8, align: 8 },
   155            t_Long          : { size: 4, align: 4 },
   156            t_LDouble       : { size: 8, align: 8 },
   157            t_LLong         : { size: 8, align: 8 },
   158            t_Ptr           : { size: 4, align: 4 },
   159            t_Short         : { size: 2, align: 2 },
   160            t_Size          : { size: 4, align: 4 },
   161        };
   162        
   163        override config String includeOpts = "-I$(rootDir)/include";
   164    
   165        override config String stdInclude = "ti/targets/elf/std.h";
   166    
   167        override config String binaryParser = "ti.targets.omf.elf.Elf32";
   168    }
   169    /*
   170     *  @(#) ti.targets.elf; 1, 0, 0,436; 3-17-2014 16:50:28; /db/ztree/library/trees/xdctargets/xdctargets-h18x/src/ xlibrary
   171    
   172     */
   173