source: archive/gcc-java.xml

trunk
Last change on this file was 3f2db3a6, checked in by Pierre Labastie <pierre.labastie@…>, 17 months ago

Remove sect1info tags

They only contain a date tag that is nowhere used.

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