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 * IAR ARM extension to the base `xdc.bld.ITarget3` interface.
41 */
42 @TargetHeader("xdc/bld/stddefs.xdt")
43 metaonly interface ITarget inherits xdc.bld.ITarget3 {
44
45 override readonly config String rts = "iar.targets.arm.rts";
46
47 override config string stdInclude = "iar/targets/arm/std.h";
48
49 50 51 52
53 config string binDir = "$(rootDir)/bin/";
54
55 /*!
56 * ======== model ========
57 * Little endian, thumb2 model
58 */
59 override readonly config xdc.bld.ITarget.Model model = {
60 endian: "little",
61 codeModel: "thumb2",
62 shortEnums: true
63 };
64
65 /*!
66 * ======== ccOpts ========
67 * User configurable compiler options.
68 */
69 override config Options ccOpts = {
70 prefix: "--silent",
71 suffix: ""
72 };
73
74 /*!
75 * ======== asmOpts ========
76 * User configurable assembler options.
77 */
78 override config Options asmOpts = {
79 prefix: "-S",
80 suffix: ""
81 };
82
83 /*!
84 * ======== ar ========
85 * The command used to create an archive
86 */
87 override readonly config Command ar = {
88 cmd: "iarchive",
89 opts: ""
90 };
91
92 /*!
93 * ======== arOpts ========
94 * User configurable archiver options.
95 */
96 override config Options arOpts = {
97 prefix: "--silent",
98 suffix: ""
99 };
100
101 /*!
102 * ======== lnkOpts ========
103 * User configurable linker options.
104 */
105 override config xdc.bld.ITarget2.Options lnkOpts = {
106 prefix: "--silent",
107 suffix: "--map $(XDCCFGDIR)/$@.map --redirect _Printf=_PrintfSmall --redirect _Scanf=_ScanfSmall ",
108 };
109
110 /*!
111 * ======== vers ========
112 * The command used to get the tool-chain to return a version number.
113 */
114 readonly config Command vers = {
115 cmd: "iccarm",
116 opts: "-v"
117 };
118
119 /*!
120 * ======== extension ========
121 * The IAR assembly file extension recognised by this target.
122 */
123 override config Extension extensions[string] = [
124 [".asm", {suf: ".asm", typ: "asm"}],
125 [".c", {suf: ".c", typ: "c" }],
126 [".cpp", {suf: ".cpp", typ: "cpp"}],
127 [".cxx", {suf: ".cxx", typ: "cpp"}],
128 [".C", {suf: ".C", typ: "cpp"}],
129 [".cc", {suf: ".cc", typ: "cpp"}],
130 [".s", {suf: ".s", typ: "asm"}],
131 [".sv6M", {suf: ".sv6M",typ: "asm"}],
132 [".sv7M", {suf: ".sv7M",typ: "asm"}],
133 [".sv8M", {suf: ".sv8M",typ: "asm"}],
134 ];
135
136 /*!
137 * ======== includeOpts ========
138 * Additional user configurable target-specific include path options
139 */
140 override config String includeOpts = "";
141
142 /*!
143 * ======== cmdPrefix ========
144 * Prefix to put in front of each command
145 *
146 * This string is put in front of every Command before being passed to
147 * the shell for execution. This string can be used to run the compiler
148 * in emulation environments.
149 *
150 * LC_ALL=C must be set for code gen to run on SUSE
151 */
152 config String cmdPrefix = "LC_ALL=C ";
153
154 /*!
155 * ======== alignDirectiveSupported ========
156 * The compiler supports an align directive.
157 */
158 override readonly config Bool alignDirectiveSupported = true;
159
160 /*!
161 * ======== stdTypes ========
162 * Size and alignment for standard base types
163 */
164 override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
165 t_IArg : { size: 4, align: 4 },
166 t_Char : { size: 1, align: 1 },
167 t_Double : { size: 8, align: 8 },
168 t_Float : { size: 4, align: 4 },
169 t_Fxn : { size: 4, align: 4 },
170 t_Int : { size: 4, align: 4 },
171 t_Int8 : { size: 1, align: 1 },
172 t_Int16 : { size: 2, align: 2 },
173 t_Int32 : { size: 4, align: 4 },
174 t_Long : { size: 4, align: 4 },
175 t_LDouble : { size: 8, align: 8 },
176 t_LLong : { size: 8, align: 8 },
177 t_Ptr : { size: 4, align: 4 },
178 t_Short : { size: 2, align: 2 },
179 t_Size : { size: 4, align: 4 },
180 t_Int64 : { size: 8, align: 8 },
181 };
182
183 /*!
184 * ======== profiles ========
185 * Standard options profiles.
186 */
187 override config xdc.bld.ITarget.OptionSet profiles[string] = [
188 ["debug", {
189 compileOpts: {
190 copts: "--debug --dlib_config $(rootDir)/inc/c/DLib_Config_Normal.h",
191 },
192 linkOpts: "--semihosting=iar_breakpoint",
193 }],
194 ["release", {
195 compileOpts: {
196 copts: "--debug -Ohs --dlib_config $(rootDir)/inc/c/DLib_Config_Normal.h",
197 },
198 linkOpts: "--semihosting=iar_breakpoint",
199 }],
200 ["debug_full", {
201 compileOpts: {
202 copts: "--debug --dlib_config $(rootDir)/inc/c/DLib_Config_Full.h",
203 },
204 linkOpts: "--semihosting=iar_breakpoint",
205 }],
206 ["release_full", {
207 compileOpts: {
208 copts: "--debug -Ohs --dlib_config $(rootDir)/inc/c/DLib_Config_Full.h",
209 },
210 linkOpts: "--semihosting=iar_breakpoint",
211 }],
212 ];
213
214 override config String binaryParser = "xdc.targets.omf.Elf";
215 }
216 217 218 219
220