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 * ======== gnu.targets.arm.ITarget ========
40 * Interface to GCC compatible Arm compilers
41 */
42 @TargetHeader("xdc/bld/stddefs.xdt")
43 metaonly interface ITarget inherits xdc.bld.ITarget3 {
44
45 /*!
46 * ======== GCCVERS ========
47 * Version number of the GCC compiler; e.g., "3.2".
48 *
49 * This string can be supplied by the user, otherwise it is obtained
50 * by running "gcc -dumpversion".
51 */
52 config string GCCVERS = null;
53
54 /*!
55 * ======== BINVERS ========
56 * Version number of binutils used with the compiler; e.g., "2.19".
57 *
58 * This string can be supplied by the user, otherwise it is obtained
59 * by running "ld -v".
60 */
61 config string BINVERS = null;
62
63 /*!
64 * ======== GCCTARG ========
65 * The name of the platform executing programs produced by this target
66 *
67 * This string can be supplied by the user, otherwise is is obtained
68 * from the compiler and follows the GNU standard format
69 * (<cpu>-<manufacturer>-<os> or <cpu>-<manufacturer>-<kernel>-<os>);
70 * e.g., "arm-none-eabi" or "x86_64-unknown-linux-gnu".
71 *
72 * When building a GCC compiler, there are three different execution
73 * platforms to consider: the platform used to "build" the compiler, the
74 * "host" platform that runs the compiler, and the "target" platform
75 * that runs the executables produced by the compiler. All three
76 * platforms are identified using a
77 * {@link http://sources.redhat.com/autobook/autobook/autobook_17.html configuration name}
78 * defined by GNU Autotools. `GCCTARG` is the name of the "target"
79 * platform.
80 */
81 config string GCCTARG = null;
82
83 /*!
84 * ======== LONGNAME ========
85 * @_nodoc
86 * The "long name" of the gcc compiler
87 *
88 * This name is used (in conjunction with rootDir) to find the compiler
89 * and linker for this target. The format of `LONGNAME` is always
90 * "/bin/<machine>-gcc". For majority of the targets, the default value
91 * for `LONGNAME` does not ever need to be changed. But, there are
92 * targets where the different but compatible compilers may have
93 * different `LONGNAME` parameters. For such targets and compilers,
94 * `LONGNAME` can be set in `config.bld`.
95 *
96 * @a(Example)
97 * If a version 2010q1 of the CodeSourcery GNU toolchain for Arm is
98 * installed in C:/CodeSourcery/arm-2010q1, the following settings in
99 * `config.bld` configure `gnu.targets.arm.GCArmv6` target to use that
100 * toolchain:
101 * @p(code)
102 * var GCArmv6 = xdc.module("gnu.targets.arm.GCArmv6");
103 * GCArmv6.rootDir = "C:/CodeSourcery/arm-2010q1";
104 * GCArmv6.LONGNAME = "bin/arm-none-linux-gnueabi-gcc";
105 * @p
106 *
107 */
108 config string LONGNAME = null;
109
110 /*!
111 * ======== remoteHost ========
112 * Remote host used to run compiler, linker, and archiver tools
113 *
114 * If `remoteHost` is `null` (or `undefined`), the configured compiler
115 * is run locally; otherwise, `remoteHost` is taken to be the host name
116 * of the machine that that should be used to run the specified compiler.
117 *
118 * All target commands are prefixed with a command that uses `rsh` to run
119 * the commands on the specified host. Thus, in order to use this
120 * setting, the remote machine must be support `rsh` and the user must
121 * have permission to run commands from the local machine on the remote
122 * host named `remoteHost`. This usually involves adding a line to the
123 * user's `~/.rhosts` file on the remote machine of the form:
124 * @p(code)
125 * local-machine-name user-name
126 * @p
127 * where `local-machine-name` is the name of the local machine and
128 * `user-name` is the user's login name on the local machine.
129 */
130 config string remoteHost;
131
132 /*!
133 * ======== ar ========
134 * The command used to create an archive
135 */
136 override readonly config xdc.bld.ITarget2.Command ar = {
137 cmd: "$(rootDir)/bin/$(GCCTARG)-ar",
138 opts: "cr"
139 };
140
141 /*!
142 * ======== lnk ========
143 * The command used to link executables.
144 */
145 override readonly config xdc.bld.ITarget2.Command lnk = {
146 cmd: "$(rootDir)/bin/$(GCCTARG)-gcc",
147 opts: ""
148 };
149
150 /*!
151 * ======== cc ========
152 * The command used to compile C/C++ source files into object files
153 */
154 override readonly config xdc.bld.ITarget2.Command cc = {
155 cmd: "$(rootDir)/bin/$(GCCTARG)-gcc -c -MD -MF $@.dep",
156 opts: ""
157 };
158
159 /*!
160 * ======== asm ========
161 * The command used to assembles assembly source files into object files
162 */
163 override readonly config xdc.bld.ITarget2.Command asm = {
164 cmd: "$(rootDir)/bin/$(GCCTARG)-gcc -c -x assembler",
165 opts: ""
166 };
167
168 169 170 171 172 173 174 175
176 override config xdc.bld.ITarget.OptionSet profiles[string] = [
177 ["debug", {
178 compileOpts: {
179 copts: "-g",
180 defs: "-D_DEBUG_=1",
181 },
182 linkOpts: "-g",
183 }],
184
185 ["release", {
186 compileOpts: {
187 copts: "-O2 -ffunction-sections",
188 },
189 linkOpts: "-Wl,--gc-sections",
190 }],
191
192 ["profile", {
193 compileOpts: {
194 copts: "-g -pg",
195 },
196 linkOpts: "-pg"
197 }],
198
199 ["coverage", {
200 compileOpts: {
201 copts: "-fprofile-arcs -ftest-coverage",
202 },
203 linkOpts: "-fprofile-arcs -ftest-coverage",
204 }],
205 ];
206
207 /*!
208 * ======== includeOpts ========
209 * Additional user configurable target-specific include path options
210 */
211 override config string includeOpts = "";
212
213 override config String binaryParser = "xdc.targets.omf.Elf";
214
215 /*!
216 * ======== bspLib ========
217 * bspLib is assigned the name of the BSP library. The specified library
218 * is included on the link line.
219 */
220 config string bspLib = null;
221
222 223 224 225
226 String initVers();
227
228 /*!
229 * ======== asmName ========
230 * The function that converts a C name into an assembly name
231 */
232 String asmName(String CName);
233 }
234 235 236 237
238