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