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 [".sv7M", {suf: ".sv7M",typ: "asm"}],
132 [".sv8M", {suf: ".sv8M",typ: "asm"}],
133 ];
134
135 /*!
136 * ======== includeOpts ========
137 * Additional user configurable target-specific include path options
138 */
139 override config String includeOpts = "";
140
141 /*!
142 * ======== cmdPrefix ========
143 * Prefix to put in front of each command
144 *
145 * This string is put in front of every Command before being passed to
146 * the shell for execution. This string can be used to run the compiler
147 * in emulation environments.
148 *
149 * LC_ALL=C must be set for code gen to run on SUSE
150 */
151 config String cmdPrefix = "LC_ALL=C ";
152
153 /*!
154 * ======== alignDirectiveSupported ========
155 * The compiler supports an align directive.
156 */
157 override readonly config Bool alignDirectiveSupported = true;
158
159 /*!
160 * ======== stdTypes ========
161 * Size and alignment for standard base types
162 */
163 override readonly config xdc.bld.ITarget.StdTypes stdTypes = {
164 t_IArg : { size: 4, align: 4 },
165 t_Char : { size: 1, align: 1 },
166 t_Double : { size: 8, align: 8 },
167 t_Float : { size: 4, align: 4 },
168 t_Fxn : { size: 4, align: 4 },
169 t_Int : { size: 4, align: 4 },
170 t_Int8 : { size: 1, align: 1 },
171 t_Int16 : { size: 2, align: 2 },
172 t_Int32 : { size: 4, align: 4 },
173 t_Long : { size: 4, align: 4 },
174 t_LDouble : { size: 8, align: 8 },
175 t_LLong : { size: 8, align: 8 },
176 t_Ptr : { size: 4, align: 4 },
177 t_Short : { size: 2, align: 2 },
178 t_Size : { size: 4, align: 4 },
179 t_Int64 : { size: 8, align: 8 },
180 };
181
182 /*!
183 * ======== profiles ========
184 * Standard options profiles.
185 */
186 override config xdc.bld.ITarget.OptionSet profiles[string] = [
187 ["debug", {
188 compileOpts: {
189 copts: "--debug --dlib_config $(rootDir)/inc/c/DLib_Config_Normal.h",
190 },
191 linkOpts: "--semihosting=iar_breakpoint",
192 }],
193 ["release", {
194 compileOpts: {
195 copts: "-Ohs --dlib_config $(rootDir)/inc/c/DLib_Config_Normal.h",
196 },
197 linkOpts: "--semihosting=iar_breakpoint",
198 }],
199 ["debug_full", {
200 compileOpts: {
201 copts: "--debug --dlib_config $(rootDir)/inc/c/DLib_Config_Full.h",
202 },
203 linkOpts: "--semihosting=iar_breakpoint",
204 }],
205 ["release_full", {
206 compileOpts: {
207 copts: "-Ohs --dlib_config $(rootDir)/inc/c/DLib_Config_Full.h",
208 },
209 linkOpts: "--semihosting=iar_breakpoint",
210 }],
211 ];
212
213 override config String binaryParser = "xdc.targets.omf.Elf";
214 }
215 216 217 218
219