create the collect2 utility for cross toolchain
[platform/upstream/gcc48.git] / INSTALL / test.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- Copyright (C) 1988-2013 Free Software Foundation, Inc.
4
5 Permission is granted to copy, distribute and/or modify this document
6 under the terms of the GNU Free Documentation License, Version 1.3 or
7 any later version published by the Free Software Foundation; with no
8 Invariant Sections, the Front-Cover texts being (a) (see below), and
9 with the Back-Cover Texts being (b) (see below).  A copy of the
10 license is included in the section entitled "GNU
11 Free Documentation License".
12
13 (a) The FSF's Front-Cover Text is:
14
15 A GNU Manual
16
17 (b) The FSF's Back-Cover Text is:
18
19 You have freedom to copy and modify this GNU Manual, like GNU
20      software.  Copies published by the Free Software Foundation raise
21      funds for GNU development. -->
22 <!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
23 <head>
24 <title>Installing GCC</title>
25
26 <meta name="description" content="Installing GCC">
27 <meta name="keywords" content="Installing GCC">
28 <meta name="resource-type" content="document">
29 <meta name="distribution" content="global">
30 <meta name="Generator" content="makeinfo">
31 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
32 <style type="text/css">
33 <!--
34 a.summary-letter {text-decoration: none}
35 blockquote.smallquotation {font-size: smaller}
36 div.display {margin-left: 3.2em}
37 div.example {margin-left: 3.2em}
38 div.indentedblock {margin-left: 3.2em}
39 div.lisp {margin-left: 3.2em}
40 div.smalldisplay {margin-left: 3.2em}
41 div.smallexample {margin-left: 3.2em}
42 div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
43 div.smalllisp {margin-left: 3.2em}
44 kbd {font-style:oblique}
45 pre.display {font-family: inherit}
46 pre.format {font-family: inherit}
47 pre.menu-comment {font-family: serif}
48 pre.menu-preformatted {font-family: serif}
49 pre.smalldisplay {font-family: inherit; font-size: smaller}
50 pre.smallexample {font-size: smaller}
51 pre.smallformat {font-family: inherit; font-size: smaller}
52 pre.smalllisp {font-size: smaller}
53 span.nocodebreak {white-space:nowrap}
54 span.nolinebreak {white-space:nowrap}
55 span.roman {font-family:serif; font-weight:normal}
56 span.sansserif {font-family:sans-serif; font-weight:normal}
57 ul.no-bullet {list-style: none}
58 -->
59 </style>
60
61
62 </head>
63
64 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
65 <h1 class="settitle" align="center">Installing GCC</h1>
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87 <a name="index-Testing"></a>
88 <a name="index-Installing-GCC_003a-Testing"></a>
89 <a name="index-Testsuite"></a>
90
91 <p>Before you install GCC, we encourage you to run the testsuites and to
92 compare your results with results from a similar configuration that have
93 been submitted to the
94 <a href="http://gcc.gnu.org/ml/gcc-testresults/">gcc-testresults mailing list</a>.
95 Some of these archived results are linked from the build status lists
96 at <a href="http://gcc.gnu.org/buildstat.html">http://gcc.gnu.org/buildstat.html</a>, although not everyone who
97 reports a successful build runs the testsuites and submits the results.
98 This step is optional and may require you to download additional software,
99 but it can give you confidence in your new GCC installation or point out
100 problems before you install and start using your new GCC.
101 </p>
102 <p>First, you must have <a href="download.html">downloaded the testsuites</a>.
103 These are part of the full distribution, but if you downloaded the
104 &ldquo;core&rdquo; compiler plus any front ends, you must download the testsuites
105 separately.
106 </p>
107 <p>Second, you must have the testing tools installed.  This includes
108 <a href="http://www.gnu.org/software/dejagnu/">DejaGnu</a>, Tcl, and Expect;
109 the DejaGnu site has links to these.
110 </p>
111 <p>If the directories where <code>runtest</code> and <code>expect</code> were
112 installed are not in the <code>PATH</code>, you may need to set the following
113 environment variables appropriately, as in the following example (which
114 assumes that DejaGnu has been installed under <samp>/usr/local</samp>):
115 </p>
116 <div class="smallexample">
117 <pre class="smallexample">TCL_LIBRARY = /usr/local/share/tcl8.0
118 DEJAGNULIBS = /usr/local/share/dejagnu
119 </pre></div>
120
121 <p>(On systems such as Cygwin, these paths are required to be actual
122 paths, not mounts or links; presumably this is due to some lack of
123 portability in the DejaGnu code.)
124 </p>
125
126 <p>Finally, you can run the testsuite (which may take a long time):
127 </p><div class="smallexample">
128 <pre class="smallexample">cd <var>objdir</var>; make -k check
129 </pre></div>
130
131 <p>This will test various components of GCC, such as compiler
132 front ends and runtime libraries.  While running the testsuite, DejaGnu
133 might emit some harmless messages resembling
134 &lsquo;<samp>WARNING: Couldn't find the global config file.</samp>&rsquo; or
135 &lsquo;<samp>WARNING: Couldn't find tool init file</samp>&rsquo; that can be ignored.
136 </p>
137 <p>If you are testing a cross-compiler, you may want to run the testsuite
138 on a simulator as described at <a href="http://gcc.gnu.org/simtest-howto.html">http://gcc.gnu.org/simtest-howto.html</a>.
139 </p>
140 <a name="How-can-you-run-the-testsuite-on-selected-tests_003f"></a>
141 <h3 class="section">How can you run the testsuite on selected tests?</h3>
142
143 <p>In order to run sets of tests selectively, there are targets
144 &lsquo;<samp>make check-gcc</samp>&rsquo; and language specific &lsquo;<samp>make check-c</samp>&rsquo;,
145 &lsquo;<samp>make check-c++</samp>&rsquo;, &lsquo;<samp>make check-fortran</samp>&rsquo;, &lsquo;<samp>make check-java</samp>&rsquo;,
146 &lsquo;<samp>make check-ada</samp>&rsquo;, &lsquo;<samp>make check-objc</samp>&rsquo;, &lsquo;<samp>make check-obj-c++</samp>&rsquo;,
147 &lsquo;<samp>make check-lto</samp>&rsquo;
148 in the <samp>gcc</samp> subdirectory of the object directory.  You can also
149 just run &lsquo;<samp>make check</samp>&rsquo; in a subdirectory of the object directory.
150 </p>
151
152 <p>A more selective way to just run all <code>gcc</code> execute tests in the
153 testsuite is to use
154 </p>
155 <div class="smallexample">
156 <pre class="smallexample">make check-gcc RUNTESTFLAGS=&quot;execute.exp <var>other-options</var>&quot;
157 </pre></div>
158
159 <p>Likewise, in order to run only the <code>g++</code> &ldquo;old-deja&rdquo; tests in
160 the testsuite with filenames matching &lsquo;<samp>9805*</samp>&rsquo;, you would use
161 </p>
162 <div class="smallexample">
163 <pre class="smallexample">make check-g++ RUNTESTFLAGS=&quot;old-deja.exp=9805* <var>other-options</var>&quot;
164 </pre></div>
165
166 <p>The <samp>*.exp</samp> files are located in the testsuite directories of the GCC
167 source, the most important ones being <samp>compile.exp</samp>,
168 <samp>execute.exp</samp>, <samp>dg.exp</samp> and <samp>old-deja.exp</samp>.
169 To get a list of the possible <samp>*.exp</samp> files, pipe the
170 output of &lsquo;<samp>make check</samp>&rsquo; into a file and look at the
171 &lsquo;<samp>Running &hellip;  .exp</samp>&rsquo; lines.
172 </p>
173 <a name="Passing-options-and-running-multiple-testsuites"></a>
174 <h3 class="section">Passing options and running multiple testsuites</h3>
175
176 <p>You can pass multiple options to the testsuite using the
177 &lsquo;<samp>--target_board</samp>&rsquo; option of DejaGNU, either passed as part of
178 &lsquo;<samp>RUNTESTFLAGS</samp>&rsquo;, or directly to <code>runtest</code> if you prefer to
179 work outside the makefiles.  For example,
180 </p>
181 <div class="smallexample">
182 <pre class="smallexample">make check-g++ RUNTESTFLAGS=&quot;--target_board=unix/-O3/-fmerge-constants&quot;
183 </pre></div>
184
185 <p>will run the standard <code>g++</code> testsuites (&ldquo;unix&rdquo; is the target name
186 for a standard native testsuite situation), passing
187 &lsquo;<samp>-O3 -fmerge-constants</samp>&rsquo; to the compiler on every test, i.e.,
188 slashes separate options.
189 </p>
190 <p>You can run the testsuites multiple times using combinations of options
191 with a syntax similar to the brace expansion of popular shells:
192 </p>
193 <div class="smallexample">
194 <pre class="smallexample">&hellip;&quot;--target_board=arm-sim\{-mhard-float,-msoft-float\}\{-O1,-O2,-O3,\}&quot;
195 </pre></div>
196
197 <p>(Note the empty option caused by the trailing comma in the final group.)
198 The following will run each testsuite eight times using the &lsquo;<samp>arm-sim</samp>&rsquo;
199 target, as if you had specified all possible combinations yourself:
200 </p>
201 <div class="smallexample">
202 <pre class="smallexample">--target_board='arm-sim/-mhard-float/-O1 \
203                 arm-sim/-mhard-float/-O2 \
204                 arm-sim/-mhard-float/-O3 \
205                 arm-sim/-mhard-float \
206                 arm-sim/-msoft-float/-O1 \
207                 arm-sim/-msoft-float/-O2 \
208                 arm-sim/-msoft-float/-O3 \
209                 arm-sim/-msoft-float'
210 </pre></div>
211
212 <p>They can be combined as many times as you wish, in arbitrary ways.  This
213 list:
214 </p>
215 <div class="smallexample">
216 <pre class="smallexample">&hellip;&quot;--target_board=unix/-Wextra\{-O3,-fno-strength\}\{-fomit-frame,\}&quot;
217 </pre></div>
218
219 <p>will generate four combinations, all involving &lsquo;<samp>-Wextra</samp>&rsquo;.
220 </p>
221 <p>The disadvantage to this method is that the testsuites are run in serial,
222 which is a waste on multiprocessor systems.  For users with GNU Make and
223 a shell which performs brace expansion, you can run the testsuites in
224 parallel by having the shell perform the combinations and <code>make</code>
225 do the parallel runs.  Instead of using &lsquo;<samp>--target_board</samp>&rsquo;, use a
226 special makefile target:
227 </p>
228 <div class="smallexample">
229 <pre class="smallexample">make -j<var>N</var> check-<var>testsuite</var>//<var>test-target</var>/<var>option1</var>/<var>option2</var>/&hellip;
230 </pre></div>
231
232 <p>For example,
233 </p>
234 <div class="smallexample">
235 <pre class="smallexample">make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
236 </pre></div>
237
238 <p>will run three concurrent &ldquo;make-gcc&rdquo; testsuites, eventually testing all
239 ten combinations as described above.  Note that this is currently only
240 supported in the <samp>gcc</samp> subdirectory.  (To see how this works, try
241 typing <code>echo</code> before the example given here.)
242 </p>
243
244 <a name="Additional-testing-for-Java-Class-Libraries"></a>
245 <h3 class="section">Additional testing for Java Class Libraries</h3>
246
247 <p>The Java runtime tests can be executed via &lsquo;<samp>make check</samp>&rsquo;
248 in the <samp><var>target</var>/libjava/testsuite</samp> directory in
249 the build tree.
250 </p>
251 <p>The <a href="http://sourceware.org/mauve/">Mauve Project</a> provides
252 a suite of tests for the Java Class Libraries.  This suite can be run
253 as part of libgcj testing by placing the Mauve tree within the libjava
254 testsuite at <samp>libjava/testsuite/libjava.mauve/mauve</samp>, or by
255 specifying the location of that tree when invoking &lsquo;<samp>make</samp>&rsquo;, as in
256 &lsquo;<samp>make MAUVEDIR=~/mauve check</samp>&rsquo;.
257 </p>
258 <a name="How-to-interpret-test-results"></a>
259 <h3 class="section">How to interpret test results</h3>
260
261 <p>The result of running the testsuite are various <samp>*.sum</samp> and <samp>*.log</samp>
262 files in the testsuite subdirectories.  The <samp>*.log</samp> files contain a
263 detailed log of the compiler invocations and the corresponding
264 results, the <samp>*.sum</samp> files summarize the results.  These summaries
265 contain status codes for all tests:
266 </p>
267 <ul>
268 <li> PASS: the test passed as expected
269 </li><li> XPASS: the test unexpectedly passed
270 </li><li> FAIL: the test unexpectedly failed
271 </li><li> XFAIL: the test failed as expected
272 </li><li> UNSUPPORTED: the test is not supported on this platform
273 </li><li> ERROR: the testsuite detected an error
274 </li><li> WARNING: the testsuite detected a possible problem
275 </li></ul>
276
277 <p>It is normal for some tests to report unexpected failures.  At the
278 current time the testing harness does not allow fine grained control
279 over whether or not a test is expected to fail.  This problem should
280 be fixed in future releases.
281 </p>
282
283 <a name="Submitting-test-results"></a>
284 <h3 class="section">Submitting test results</h3>
285
286 <p>If you want to report the results to the GCC project, use the
287 <samp>contrib/test_summary</samp> shell script.  Start it in the <var>objdir</var> with
288 </p>
289 <div class="smallexample">
290 <pre class="smallexample"><var>srcdir</var>/contrib/test_summary -p your_commentary.txt \
291     -m gcc-testresults@gcc.gnu.org |sh
292 </pre></div>
293
294 <p>This script uses the <code>Mail</code> program to send the results, so
295 make sure it is in your <code>PATH</code>.  The file <samp>your_commentary.txt</samp> is
296 prepended to the testsuite summary and should contain any special
297 remarks you have on your results or your build environment.  Please
298 do not edit the testsuite result block or the subject line, as these
299 messages may be automatically processed.
300 </p>
301 <hr />
302 <p><p><a href="./index.html">Return to the GCC Installation page</a>
303 </p>
304
305
306
307
308
309
310 <hr>
311
312
313
314 </body>
315 </html>