1 2 3 4 5 6 7 8 9 10 11
12 13 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: "cl6x",
32 opts: "--abi=eabi -z"
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 ];
98
99 final override readonly config string sectMap[string] = [
100 [".text", "code"],
101 [".ti.decompress", "code"],
102 [".stack", "stack"],
103 [".bss", "data"],
104 [".cinit", "data"],
105 [".pinit", "data"],
106 [".init_array", "data"],
107 [".const", "data"],
108 [".data", "data"],
109 [".rodata", "data"],
110 [".neardata", "data"],
111 [".fardata", "data"],
112 [".switch", "data"],
113 [".sysmem", "data"],
114 [".far", "data"],
115 [".args", "data"],
116 [".cio", "data"],
117 [".ti.handler_table", "data"],
118 [".c6xabi.exidx", "data"],
119 [".c6xabi.extab", "data"],
120 ];
121
122 override readonly config Bool splitMap[string] = [
123 [".text", true],
124 [".pinit", true],
125 [".const", true],
126 [".data", true],
127 [".fardata", true],
128 [".switch", true],
129 [".far", true],
130 [".args", true],
131 [".cio", true],
132 [".c6xabi.extab", true]
133 ];
134
135 override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
136 t_IArg : { size: 4, align: 4 },
137 t_Char : { size: 1, align: 1 },
138 t_Double : { size: 8, align: 8 },
139 t_Float : { size: 4, align: 4 },
140 t_Fxn : { size: 4, align: 4 },
141 t_Int : { size: 4, align: 4 },
142 t_Int8 : { size: 1, align: 1 },
143 t_Int16 : { size: 2, align: 2 },
144 t_Int32 : { size: 4, align: 4 },
145 t_Int64 : { size: 8, align: 8 },
146 t_Long : { size: 4, align: 4 },
147 t_LDouble : { size: 8, align: 8 },
148 t_LLong : { size: 8, align: 8 },
149 t_Ptr : { size: 4, align: 4 },
150 t_Short : { size: 2, align: 2 },
151 t_Size : { size: 4, align: 4 },
152 };
153
154 override config String includeOpts = "-I$(rootDir)/include";
155
156 override config String stdInclude = "ti/targets/elf/std.h";
157
158 override config String binaryParser = "ti.targets.omf.elf.Elf32";
159 }
160 161 162 163
164