source: general/prog/gcc-java.xml@ 65336f2

systemd-13485
Last change on this file since 65336f2 was 65336f2, checked in by Christopher Gregory <cjg@…>, 10 years ago

Merged gcc and imagemagic updates from trunk.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@15008 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 20.7 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY gcc-java-download-http "http://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
8 <!ENTITY gcc-java-download-ftp "ftp://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
9 <!ENTITY gcc-java-md5sum "4df8ee253b7f3863ad0b86359cd39c43">
10 <!ENTITY gcc-java-size "86 MB">
11 <!ENTITY gcc-java-buildsize "3.0 GB">
12 <!ENTITY gcc-java-time "84 SBU (including 70 SBU for tests)">
13
14 <!ENTITY ecj-download-ftp "ftp://sourceware.org/pub/java/ecj-latest.jar">
15
16 <!ENTITY antlr-version "4.2.2">
17 <!ENTITY antlr-download-http "http://www.antlr.org/download/antlr-&antlr-version;-complete.jar">
18]>
19
20<sect1 id="gcc-java" xreflabel="GCC-Java-&gcc-version;">
21 <?dbhtml filename="gcc-java.html" ?>
22
23 <sect1info>
24 <othername>$LastChangedBy$</othername>
25 <date>$Date$</date>
26 </sect1info>
27
28 <title>GCC-Java-&gcc-version;</title>
29
30 <indexterm zone="gcc">
31 <primary sortas="a-gcc-java-4-0">GCC-Java-&gcc-version;</primary>
32 </indexterm>
33
34 <sect2 role="package">
35 <title>Introduction to GCC-Java</title>
36
37 <para>See the introduction to the Java language and system at
38 <xref linkend="java"/>. The GNU Compiler Collection (GCC) contains
39 a Java compiler to native code. Together with the
40 <application>ecj</application> Java compiler from Eclipse (to bytecode),
41 it provides a way to build an acceptable JVM from source. However, since
42 the release of <application>OpenJDK</application>, the development
43 of GCC-Java has almost stopped, and the built JVM is an old version.
44 One reason to build
45 this system is that it can be used to bootstrap <xref linkend="openjdk"/>,
46 without the need for downloading a Java binary.</para>
47
48 &lfs76_checked;
49
50 <caution>
51 <para>Using the instructions on this page will have the effect that
52 the C and C++ compiler and libraries will be reinstalled, overwriting
53 the ones on your system. This may lead to some issues. Please read the
54 note and caution on the <xref linkend="gcc"/> page.</para>
55 </caution>
56
57 <bridgehead renderas="sect3">Package Information</bridgehead>
58 <itemizedlist spacing="compact">
59 <listitem>
60 <para>Download (HTTP): <ulink url="&gcc-java-download-http;"/></para>
61 </listitem>
62 <listitem>
63 <para>Download (FTP): <ulink url="&gcc-java-download-ftp;"/></para>
64 </listitem>
65 <listitem>
66 <para>Download MD5 sum: &gcc-java-md5sum;</para>
67 </listitem>
68 <listitem>
69 <para>Download size: &gcc-java-size;</para>
70 </listitem>
71 <listitem>
72 <para>Estimated disk space required: &gcc-java-buildsize;</para>
73 </listitem>
74 <listitem>
75 <para>Estimated build time: &gcc-java-time;</para>
76 </listitem>
77 </itemizedlist>
78
79 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
80 <itemizedlist spacing="compact">
81 <listitem>
82 <para>
83 Eclipse Java compiler:
84 <ulink url="&ecj-download-ftp;"/>
85 </para>
86 </listitem>
87 <listitem>
88 <para>
89 ANTLR binary, for building <command>gjdoc</command> (optional):
90 <ulink url="&antlr-download-http;"/>
91 </para>
92 </listitem>
93<!-- <listitem>
94 <para>
95 Required patch:
96 <ulink url="&patch-root;/gcc-&gcc-version;-upstream_fixes-1.patch"/>
97 </para>
98 </listitem>-->
99 </itemizedlist>
100
101 <bridgehead renderas="sect3">GCC Dependencies</bridgehead>
102
103 <bridgehead renderas="sect4">Required</bridgehead>
104 <para role="required">
105 <xref linkend="zip"/>,
106 <xref linkend="unzip"/>, and
107 <xref linkend="which"/>
108 </para>
109
110 <bridgehead renderas="sect4">Recommended</bridgehead>
111 <para role="recommended">
112 <xref linkend="dejagnu"/>, for tests
113 </para>
114
115 <bridgehead renderas="sect4">Optional</bridgehead>
116 <para role="optional">
117 <xref linkend="gtk2"/> and
118 <ulink url="https://download.gnome.org/sources/libart_lgpl/">
119 Libart
120 </ulink> for building the AWT peer
121 </para>
122
123 <para condition="html" role="usernotes">User Notes:
124 <ulink url="&blfs-wiki;/gcc-java"/></para>
125
126 </sect2>
127
128 <sect2 role="installation">
129 <title>Installation of GCC Java</title>
130
131 <para>The instructions below assume that the C and C++ compilers have
132 the same version as the one you are installing, so that a
133 <quote>bootstrap</quote> is not necessary. If you are upgrading
134 the GCC version, then remove the <option>--disable-bootstrap</option> from
135 the <command>./configure</command> options below.</para>
136<!--
137 <para>As in LFS, fix a problem identified upstream:</para>
138
139<screen><userinput>sed -i 's/if \((code.*))\)/if (\1 \&amp;\&amp; \!DEBUG_INSN_P (insn))/' gcc/sched-deps.c</userinput></screen>
140-->
141
142 <para>Install <application>GCC Java</application> by running the
143 following commands:</para>
144
145<screen><userinput>sed -i 's/\(install.*:\) install-.*recursive/\1/' libffi/Makefile.in &amp;&amp;
146sed -i 's/\(install-data-am:\).*/\1/' libffi/include/Makefile.in &amp;&amp;
147<!--
148patch -Np1 -i ../gcc-&gcc-version;-upstream_fixes-1.patch &amp;&amp;
149-->
150
151cp ../ecj-latest.jar ./ecj.jar &amp;&amp;
152
153mkdir ../gcc-build &amp;&amp;
154cd ../gcc-build &amp;&amp;
155
156../gcc-&gcc-version;/configure \
157 --prefix=/usr \
158 --disable-multilib \
159 --with-system-zlib \
160 --disable-bootstrap \
161 --enable-java-home \
162 --with-jvm-root-dir=/opt/gcj \
163 --with-antlr-jar=$(pwd)/../antlr-&antlr-version;-complete.jar \
164 --enable-languages=java &amp;&amp;
165make</userinput></screen>
166
167 <para>If you have installed additional packages such as
168 <application>Valgrind</application> and <application>GDB</application>,
169 the <application>GCC</application> part of the testsuite will run more
170 tests than in LFS. Some of those will report FAIL and others XPASS
171 (pass when expected to FAIL). To run the tests, issue:</para>
172
173<screen><userinput>ulimit -s 32768 &amp;&amp;
174make -k check</userinput></screen>
175<!-- The command above may error out, so using && may prevent the summary
176to be run. -->
177
178 <para>The tests are very long, and the results may be hard to find in the
179 logs, specially if you use job control with make. You can get a summary
180 of the tests with:</para>
181
182<screen><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen>
183
184 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
185
186<screen role="root"><userinput>make install &amp;&amp;
187
188mkdir -pv /usr/share/gdb/auto-load/usr/lib &amp;&amp;
189mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib &amp;&amp;
190
191chown -v -R root:root \
192 /usr/lib/gcc/*linux-gnu/&gcc-version;/include{,-fixed} &amp;&amp;
193
194gcj -o ecj ../ecj-latest.jar \
195 --main=org.eclipse.jdt.internal.compiler.batch.Main &amp;&amp;
196mv ecj /usr/bin &amp;&amp;
197ln -sfv ../../../usr/bin/ecj /opt/gcj/bin/javac</userinput></screen>
198
199 </sect2>
200
201 <sect2 role="commands">
202 <title>Command Explanations</title>
203
204 <para>The two <command>sed</command> commands prevent the
205 installation of the <application>libffi</application> library bundled
206 with <application>GCC</application>, since it is outdated compared to
207 <xref linkend="libffi"/>.</para>
208<!--
209 <para>
210 <command>patch ... gcc-&gcc-version;-upstream_fixes-1.patch</command>:
211 This patch corrects bugs in the C++ compiler, which lead to
212 segmentation faults in some cases.
213 </para>
214-->
215
216 <para><command>mkdir ../gcc-build; cd ../gcc-build</command>: The
217 <application>GCC</application> documentation recommends
218 building the package in a dedicated build directory.</para>
219
220 <para><parameter>--disable-multilib</parameter>: This parameter ensures
221 that files are created for the specific architecture of your computer.</para>
222
223 <para>
224 <parameter>--with-system-zlib</parameter>: Uses the system
225 <application>zlib</application> instead of the bundled one.
226 </para>
227
228 <para>
229 <parameter>--disable-bootstrap</parameter>: Prevents the C and C++
230 compilers to recompile themselves. You should use this switch only
231 if the installed C and C++ compilers are the same version as the
232 ones you install.
233 </para>
234
235 <para>
236 <parameter>--enable-java-home</parameter>: Creates a directory
237 layout similar to that of a JVM.
238 </para>
239
240 <para>
241 <parameter>--with-jvm-root-dir=/opt/gcj</parameter>: Installs
242 the JVM in the specified location.
243 </para>
244
245 <para>
246 <parameter>--with-antlr-jar=...</parameter>: Specifies the location of
247 <application>ANTLR</application>, which is needed to build
248 <command>gjdoc</command>. Remove if you have not downloaded antlr.
249 </para>
250
251 <para>
252 <parameter>--enable-languages=java</parameter>:
253 This command identifies which language to build. Note it is unavoidable
254 that the <application>C</application> and <application>C++</application>
255 compilers be built too.</para>
256
257 <para>
258 <option>--enable-java-awt=gtk</option>: Allows to build the Java AWT
259 <application>GTK+2</application> peer. Needed to have a fully functional
260 JVM.
261 </para>
262
263 <para><command>ulimit -s 32768</command>: This command prevents several
264 tests from running out of stack space.</para>
265
266 <para><command>make -k check</command>: This command runs the test suite
267 without stopping if any errors are encountered.</para>
268
269 <para><command>../gcc-&gcc-version;/contrib/test_summary</command>: This
270 command will produce a summary of the test suite results. You can append
271 <command>| grep -A7 Summ</command> to the command to produce an even more
272 condensed version of the summary. You may also wish to redirect the output
273 to a file for review and comparison later on.</para>
274
275 <para><command>chown -v -R root:root
276 /usr/lib/gcc/*linux-gnu/...</command>:
277 If the package is built by a user other than root, the ownership of the
278 installed <filename class="directory">include</filename> directory (and its
279 content) will be incorrect. This commands changes the ownership to the
280 <systemitem class="username">root</systemitem> user and group.</para>
281
282 <para>
283 <command>gcj -o ecj ...</command>: compiles the eclipse compiler to
284 native code, which is much faster than bytecode. This compiler is
285 then used as a <command>javac</command> replacement in the JVM.
286 </para>
287
288 </sect2>
289
290 <sect2 role="configuration">
291 <title>Configuring GCC-Java</title>
292
293 <sect3>
294 <title>Configuration Information</title>
295
296 <para>
297 The configuration is the same as for <xref linkend="openjdk"/>,
298 replacing <filename class="directory">/opt/jdk</filename> with
299 <filename class="directory">/opt/gcj</filename>.
300 </para>
301
302 </sect3>
303
304 </sect2>
305
306 <sect2 role="content">
307 <title>Contents</title>
308
309 <segmentedlist>
310 <segtitle>Installed Programs</segtitle>
311 <segtitle>Installed Libraries</segtitle>
312 <segtitle>Installed Directories</segtitle>
313
314 <seglistitem>
315 <seg>
316 aot-compile, ecj, gappletviewer, gc-analyze, gcj, gcj-dbtool,
317 gcjh, gij, gjar, gjarsigner, gjavah, gjdoc, gkeytool, gnative2ascii,
318 gorbd, grmic, grmid, grmiregistry, gserialver, gtnameserv, jcf-dump,
319 jv-convert, rebuild-gcj-db. Symbolic links to these files are located
320 in <filename class="directory">/opt/gcj/bin</filename>
321 </seg>
322 <seg>
323 libgcj_bc.so, libgcj.so, libgcj-tools.so
324 libgij.so, and numerous other
325 run-time libraries and executables in
326 <filename class="directory">/usr/lib/gcc</filename> and
327 <filename class="directory">/usr/libexec/gcc</filename>
328 </seg>
329 <seg>
330 /usr/include/c++/&gcc-version;/{gcj,gnu,java,javax,org,sun},
331 /usr/lib/gcj-&gcc-version;-15,
332 /usr/lib/security, /opt/gcj/{bin,jre,include,lib} and
333 /usr/share/java
334 </seg>
335 </seglistitem>
336 </segmentedlist>
337
338 <para>Some program and library names and descriptions are not listed here,
339 but can be found at
340 <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
341 initially installed during the building of LFS.</para>
342
343 <variablelist>
344 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
345 <?dbfo list-presentation="list"?>
346 <?dbhtml list-presentation="table"?>
347
348 <varlistentry id="aot-compile">
349 <term><command>aot-compile</command></term>
350 <listitem>
351 <para>searches a directory for Java bytecode and uses
352 <command>gcj</command> to compile it to native code.</para>
353 <indexterm zone="gcc aot-compile">
354 <primary sortas="b-aot-compile">aot-compile</primary>
355 </indexterm>
356 </listitem>
357 </varlistentry>
358
359 <varlistentry id="ecj">
360 <term><command>ecj</command></term>
361 <listitem>
362 <para>is the eclipse compiler.</para>
363 <indexterm zone="gcc ecj">
364 <primary sortas="b-ecj">ecj</primary>
365 </indexterm>
366 </listitem>
367 </varlistentry>
368
369 <varlistentry id="gappletviewer">
370 <term><command>gappletviewer</command></term>
371 <listitem>
372 <para>loads and run a <application>Java</application> applet.</para>
373 <indexterm zone="gcc gappletviewer">
374 <primary sortas="b-gappletviewer">gappletviewer</primary>
375 </indexterm>
376 </listitem>
377 </varlistentry>
378
379 <varlistentry id="gc-analyze">
380 <term><command>gc-analyze</command></term>
381 <listitem>
382 <para>analyzes garbage collector (GC) memory dumps from
383 <application>Java</application> code.</para>
384 <indexterm zone="gcc gc-analyze">
385 <primary sortas="b-gc-analyze">gc-analyze</primary>
386 </indexterm>
387 </listitem>
388 </varlistentry>
389
390 <varlistentry id="gcj">
391 <term><command>gcj</command></term>
392 <listitem>
393 <para>is an ahead-of-time compiler for the
394 <application>Java</application> language.</para>
395 <indexterm zone="gcc gcj">
396 <primary sortas="b-gcj">gcj</primary>
397 </indexterm>
398 </listitem>
399 </varlistentry>
400
401 <varlistentry id="gcj-dbtool">
402 <term><command>gcj-dbtool</command></term>
403 <listitem>
404 <para>is a tool for creating and manipulating class file mapping
405 databases.</para>
406 <indexterm zone="gcc gcj-dbtool">
407 <primary sortas="b-gcj-dbtool">gcj-dbtool</primary>
408 </indexterm>
409 </listitem>
410 </varlistentry>
411
412 <varlistentry id="gcjh">
413 <term><command>gcjh</command></term>
414 <listitem>
415 <para>generates header files from <application>Java</application>
416 class files.</para>
417 <indexterm zone="gcc gcjh">
418 <primary sortas="b-gcjh">gcjh</primary>
419 </indexterm>
420 </listitem>
421 </varlistentry>
422
423 <varlistentry id="gij">
424 <term><command>gij</command></term>
425 <listitem>
426 <para>is the GNU interpreter for <application>Java</application>
427 bytecode.</para>
428 <indexterm zone="gcc gij">
429 <primary sortas="b-gij">gij</primary>
430 </indexterm>
431 </listitem>
432 </varlistentry>
433
434 <varlistentry id="gjar">
435 <term><command>gjar</command></term>
436 <listitem>
437 <para>is an (partial) implementation of the <command>jar</command>
438 utility that comes with Sun's JDK.</para>
439 <indexterm zone="gcc gjar">
440 <primary sortas="b-gjar">gjar</primary>
441 </indexterm>
442 </listitem>
443 </varlistentry>
444
445 <varlistentry id="gjarsigner">
446 <term><command>gjarsigner</command></term>
447 <listitem>
448 <para>is a Java ARchive (JAR) file signing and verification
449 tool.</para>
450 <indexterm zone="gcc gjarsigner">
451 <primary sortas="b-gjarsigner">gjarsigner</primary>
452 </indexterm>
453 </listitem>
454 </varlistentry>
455
456 <varlistentry id="gjavah">
457 <term><command>gjavah</command></term>
458 <listitem>
459 <para>generates header files from Java class files.</para>
460 <indexterm zone="gcc gjavah">
461 <primary sortas="b-gjavah">gjavah</primary>
462 </indexterm>
463 </listitem>
464 </varlistentry>
465
466 <varlistentry id="gjdoc">
467 <term><command>gjdoc</command></term>
468 <listitem>
469 <para>is a documentation tool similar to <command>javadoc</command>.
470 </para>
471 <indexterm zone="gcc gjdoc">
472 <primary sortas="b-gjdoc">gjdoc</primary>
473 </indexterm>
474 </listitem>
475 </varlistentry>
476
477 <varlistentry id="gkeytool">
478 <term><command>gkeytool</command></term>
479 <listitem>
480 <para>manages private keys and public certificates in a
481 <application>Java</application> environment.</para>
482 <indexterm zone="gcc gkeytool">
483 <primary sortas="b-gkeytool">gkeytool</primary>
484 </indexterm>
485 </listitem>
486 </varlistentry>
487
488 <varlistentry id="gnative2ascii">
489 <term><command>gnative2ascii</command></term>
490 <listitem>
491 <para>is an encoding converter for <application>Java</application>.</para>
492 <indexterm zone="gcc gnative2ascii">
493 <primary sortas="b-gnative2ascii">gnative2ascii</primary>
494 </indexterm>
495 </listitem>
496 </varlistentry>
497
498 <varlistentry id="gorbd">
499 <term><command>gorbd</command></term>
500 <listitem>
501 <para>is an object request broker daemon.</para>
502 <indexterm zone="gcc gorbd">
503 <primary sortas="b-gorbd">gorbd</primary>
504 </indexterm>
505 </listitem>
506 </varlistentry>
507
508 <varlistentry id="grmic-gcc">
509 <term><command>grmic</command></term>
510 <listitem>
511 <para>generates stubs for Remote Method Invocation.</para>
512 <indexterm zone="gcc grmic-gcc">
513 <primary sortas="b-grmic">grmic</primary>
514 </indexterm>
515 </listitem>
516 </varlistentry>
517
518 <varlistentry id="grmid-gcc">
519 <term><command>grmid</command></term>
520 <listitem>
521 <para>RMI activation system daemon.</para>
522 <indexterm zone="gcc grmid-gcc">
523 <primary sortas="b-grmid">grmid</primary>
524 </indexterm>
525 </listitem>
526 </varlistentry>
527
528 <varlistentry id="grmiregistry-gcc">
529 <term><command>grmiregistry</command></term>
530 <listitem>
531 <para> starts a remote object registry on the current host.</para>
532 <indexterm zone="gcc grmiregistry-gcc">
533 <primary sortas="b-grmiregistry">grmiregistry</primary>
534 </indexterm>
535 </listitem>
536 </varlistentry>
537
538 <varlistentry id="gserialver">
539 <term><command>gserialver</command></term>
540 <listitem>
541 <para> prints the serialVersionUID of the specified class.</para>
542 <indexterm zone="gcc gserialver">
543 <primary sortas="b-gserialver">gserialver</primary>
544 </indexterm>
545 </listitem>
546 </varlistentry>
547
548 <varlistentry id="gtnameserv">
549 <term><command>gtnameserv</command></term>
550 <listitem>
551 <para> starts a naming service.</para>
552 <indexterm zone="gcc gtnameserv">
553 <primary sortas="b-gtnameserv">gtnameserv</primary>
554 </indexterm>
555 </listitem>
556 </varlistentry>
557
558 <varlistentry id="jcf-dump">
559 <term><command>jcf-dump</command></term>
560 <listitem>
561 <para>prints information about <application>Java</application>
562 class files.</para>
563 <indexterm zone="gcc jcf-dump">
564 <primary sortas="b-jcf-dump">jcf-dump</primary>
565 </indexterm>
566 </listitem>
567 </varlistentry>
568
569 <varlistentry id="jv-convert">
570 <term><command>jv-convert</command></term>
571 <listitem>
572 <para>converts files from one encoding to another.</para>
573 <indexterm zone="gcc jv-convert">
574 <primary sortas="b-jv-convert">jv-convert</primary>
575 </indexterm>
576 </listitem>
577 </varlistentry>
578
579 <varlistentry id="rebuild-gcj-db">
580 <term><command>rebuild-gcj-db</command></term>
581 <listitem>
582 <para>Merge the per-solib databases made by
583 <application>aot-compile</application> into one system-wide
584 database.</para>
585 <indexterm zone="gcc rebuild-gcj-db">
586 <primary sortas="b-rebuild-gcj-db">rebuild-gcj-db</primary>
587 </indexterm>
588 </listitem>
589 </varlistentry>
590
591 </variablelist>
592
593 </sect2>
594
595</sect1>
Note: See TracBrowser for help on using the repository browser.