source: archive/gcc-java.xml@ fa91d2e

11.0 ken/refactor-virt lazarus qt5new trunk
Last change on this file since fa91d2e was 45ab6c7, checked in by Xi Ruoyao <xry111@…>, 5 months ago

more SVN prop clean up

Remove "$LastChanged$" everywhere, and also some unused $Date$

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