source: general/prog/gcc-java.xml@ 98c91f4c

systemd-13485
Last change on this file since 98c91f4c was d7bee48, checked in by Douglas R. Reno <renodr@…>, 8 years ago

Sync to trunk r17332

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

  • Property mode set to 100644
File size: 21.1 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 "8fb6cb98b8459f5863328380fbf06bd1">
10 <!ENTITY gcc-java-size "95 MB">
11 <!ENTITY gcc-java-buildsize "5 GB">
12 <!ENTITY gcc-java-time "29 SBU (with tests and parallelism=4)">
13
14 <!ENTITY ecj-download-ftp "ftp://sourceware.org/pub/java/ecj-4.9.jar">
15
16 <!ENTITY antlr-version "4.5.1">
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-java-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-java-version;</title>
29
30 <indexterm zone="gcc">
31 <primary sortas="a-gcc-java-5-0">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 &lfs78_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>sed -i 's/\(install.*:\) install-.*recursive/\1/' libffi/Makefile.in &amp;&amp;
158sed -i 's/\(install-data-am:\).*/\1/' libffi/include/Makefile.in &amp;&amp;
159sed -i 's/absolute/file normalize/' libjava/testsuite/lib/libjava.exp &amp;&amp;
160sed -i 's/major.*1000.*minor/major/' gcc/java/decl.c &amp;&amp;
161
162cp ../ecj-4.9.jar ./ecj.jar &amp;&amp;
163
164mkdir build &amp;&amp;
165cd build &amp;&amp;
166
167../configure \
168 --prefix=/usr \
169 --disable-multilib \
170 --with-system-zlib \
171 --disable-bootstrap \
172 --enable-java-home \
173 --with-jvm-root-dir=/opt/gcj \
174 --with-antlr-jar=$(pwd)/../../antlr-&antlr-version;-complete.jar \
175 --enable-languages=java &amp;&amp;
176make</userinput></screen>
177
178 <para>
179 If you have installed additional packages such as
180 <application>Valgrind</application> and <application>GDB</application>,
181 the <application>GCC</application> part of the testsuite will run more
182 tests than in LFS. Some of those will report FAIL and others XPASS
183 (pass when expected to FAIL). To run the tests, issue:
184 </para>
185
186<screen><userinput>ulimit -s 32768 &amp;&amp;
187make -k check</userinput></screen>
188<!-- The command above may error out, so using && may prevent the summary
189to be run. -->
190
191 <para>
192 The tests are very long, and the results may be hard to find in the
193 logs, specially if you use job control with make. You can get a summary
194 of the tests with:
195 </para>
196
197<screen><userinput>../contrib/test_summary</userinput></screen>
198
199 <para>
200 Now, as the <systemitem class="username">root</systemitem> user:
201 </para>
202
203<screen role="root"><userinput>make install &amp;&amp;
204
205mkdir -pv /usr/share/gdb/auto-load/usr/lib &amp;&amp;
206mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib &amp;&amp;
207
208chown -v -R root:root \
209 /usr/lib/gcc/*linux-gnu/&gcc-java-version;/include{,-fixed} &amp;&amp;
210
211gcj -o ecj ../../ecj-4.9.jar \
212 --main=org.eclipse.jdt.internal.compiler.batch.Main &amp;&amp;
213mv ecj /usr/bin &amp;&amp;
214ln -sfv ../../../usr/bin/ecj /opt/gcj/bin/javac</userinput></screen>
215
216 </sect2>
217
218 <sect2 role="commands">
219 <title>Command Explanations</title>
220
221 <para>
222 The first two <command>sed</command> commands prevent the
223 installation of the <application>libffi</application> library bundled
224 with <application>GCC</application>, since it is outdated compared to
225 <xref linkend="libffi"/>.
226 </para>
227
228 <para>
229 The next two <command>sed</command> commands implement upstream fixes
230 to the <application>GCC Java</application> compiler and tests.
231 </para>
232
233 <para>
234 <command>mkdir build; cd build</command>: The
235 <application>GCC</application> documentation recommends
236 building the package in a dedicated build directory.
237 </para>
238
239 <para>
240 <parameter>--disable-multilib</parameter>: This parameter ensures
241 that files are created for the specific architecture of your computer.
242 </para>
243
244 <para>
245 <parameter>--with-system-zlib</parameter>: Uses the system
246 <application>zlib</application> instead of the bundled one.
247 </para>
248
249 <para>
250 <parameter>--disable-bootstrap</parameter>: Prevents the C and C++
251 compilers to recompile themselves. You should use this switch only
252 if the installed C and C++ compilers are the same version as the
253 ones you install.
254 </para>
255
256 <para>
257 <parameter>--enable-java-home</parameter>: Creates a directory
258 layout similar to that of a JVM.
259 </para>
260
261 <para>
262 <parameter>--with-jvm-root-dir=/opt/gcj</parameter>: Installs
263 the JVM in the specified location.
264 </para>
265
266 <para>
267 <parameter>--with-antlr-jar=...</parameter>: Specifies the location of
268 <application>ANTLR</application>, which is needed to build
269 <command>gjdoc</command>. Remove if you have not downloaded antlr.
270 </para>
271
272 <para>
273 <parameter>--enable-languages=java</parameter>:
274 This command identifies which language to build. Note it is unavoidable
275 that the <application>C</application> and <application>C++</application>
276 compilers be built too.
277 </para>
278
279 <para>
280 <option>--enable-java-awt=gtk</option>: Allows to build the Java AWT
281 <application>GTK+2</application> peer. Needed to have a fully functional
282 JVM.
283 </para>
284
285 <para>
286 <command>ulimit -s 32768</command>: This command prevents several
287 tests from running out of stack space.
288 </para>
289
290 <para>
291 <command>make -k check</command>: This command runs the test suite
292 without stopping if any errors are encountered.
293 </para>
294
295 <para>
296 <command>../contrib/test_summary</command>: This
297 command will produce a summary of the test suite results. You can append
298 <command>| grep -A7 Summ</command> to the command to produce an even more
299 condensed version of the summary. You may also wish to redirect the output
300 to a file for review and comparison later on.
301 </para>
302
303 <para>
304 <command>chown -v -R root:root
305 /usr/lib/gcc/*linux-gnu/...</command>:
306 If the package is built by a user other than root, the ownership of the
307 installed <filename class="directory">include</filename> directory (and
308 its content) will be incorrect. This command changes the ownership to
309 the <systemitem class="username">root</systemitem> user and group.
310 </para>
311
312 <para>
313 <command>gcj -o ecj ...</command>: compiles the eclipse compiler to
314 native code, which is much faster than bytecode. This compiler is
315 then used as a <command>javac</command> replacement in the JVM.
316 </para>
317
318 </sect2>
319
320 <sect2 role="configuration">
321 <title>Configuring GCC-Java</title>
322
323 <sect3>
324 <title>Configuration Information</title>
325
326 <para>
327 The configuration is the same as <xref linkend="ojdk-conf"/>,
328 replacing <filename class="directory">/opt/jdk</filename> with
329 <filename class="directory">/opt/gcj</filename>.
330 </para>
331
332 </sect3>
333
334 </sect2>
335
336 <sect2 role="content">
337 <title>Contents</title>
338
339 <segmentedlist>
340 <segtitle>Installed Programs</segtitle>
341 <segtitle>Installed Libraries</segtitle>
342 <segtitle>Installed Directories</segtitle>
343
344 <seglistitem>
345 <seg>
346 aot-compile, ecj, gappletviewer, gc-analyze, gcj, gcj-dbtool,
347 gcjh, gij, gjar, gjarsigner, gjavah, gjdoc, gkeytool, gnative2ascii,
348 gorbd, grmic, grmid, grmiregistry, gserialver, gtnameserv, jcf-dump,
349 jv-convert, rebuild-gcj-db. Symbolic links to these files are located
350 in <filename class="directory">/opt/gcj/bin</filename>
351 </seg>
352 <seg>
353 libgcj_bc.so, libgcj.so, libgcj-tools.so, and libgij.so
354 </seg>
355 <seg>
356 /usr/include/c++/&gcc-java-version;/{gcj,gnu,java,javax,org,sun},
357 /usr/lib/gcj-&gcc-java-version;-16, /usr/lib/jvm-exports,
358 /usr/lib/security, /opt/gcj, and /usr/share/java
359 </seg>
360 </seglistitem>
361 </segmentedlist>
362
363 <para>
364 Some programs, libraries, and descriptions are not listed here,
365 but can be found at
366 <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
367 initially installed during the building of LFS.
368 </para>
369
370 <variablelist>
371 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
372 <?dbfo list-presentation="list"?>
373 <?dbhtml list-presentation="table"?>
374
375 <varlistentry id="aot-compile">
376 <term><command>aot-compile</command></term>
377 <listitem>
378 <para>
379 searches a directory for Java bytecode and uses
380 <command>gcj</command> to compile it to native code.
381 </para>
382 <indexterm zone="gcc aot-compile">
383 <primary sortas="b-aot-compile">aot-compile</primary>
384 </indexterm>
385 </listitem>
386 </varlistentry>
387
388 <varlistentry id="ecj">
389 <term><command>ecj</command></term>
390 <listitem>
391 <para>
392 is the Eclipse Java compiler.
393 </para>
394 <indexterm zone="gcc ecj">
395 <primary sortas="b-ecj">ecj</primary>
396 </indexterm>
397 </listitem>
398 </varlistentry>
399
400 <varlistentry id="gappletviewer">
401 <term><command>gappletviewer</command></term>
402 <listitem>
403 <para>
404 loads and run a <application>Java</application> applet.
405 </para>
406 <indexterm zone="gcc gappletviewer">
407 <primary sortas="b-gappletviewer">gappletviewer</primary>
408 </indexterm>
409 </listitem>
410 </varlistentry>
411
412 <varlistentry id="gc-analyze">
413 <term><command>gc-analyze</command></term>
414 <listitem>
415 <para>
416 analyzes garbage collector (GC) memory dumps from
417 <application>Java</application> code.
418 </para>
419 <indexterm zone="gcc gc-analyze">
420 <primary sortas="b-gc-analyze">gc-analyze</primary>
421 </indexterm>
422 </listitem>
423 </varlistentry>
424
425 <varlistentry id="gcj">
426 <term><command>gcj</command></term>
427 <listitem>
428 <para>
429 is an ahead-of-time compiler for the <application>Java</application>
430 language.
431 </para>
432 <indexterm zone="gcc gcj">
433 <primary sortas="b-gcj">gcj</primary>
434 </indexterm>
435 </listitem>
436 </varlistentry>
437
438 <varlistentry id="gcj-dbtool">
439 <term><command>gcj-dbtool</command></term>
440 <listitem>
441 <para>
442 is a tool for creating and manipulating class file mapping databases.
443 </para>
444 <indexterm zone="gcc gcj-dbtool">
445 <primary sortas="b-gcj-dbtool">gcj-dbtool</primary>
446 </indexterm>
447 </listitem>
448 </varlistentry>
449
450 <varlistentry id="gcjh">
451 <term><command>gcjh</command></term>
452 <listitem>
453 <para>
454 generates header files from <application>Java</application> class files.
455 </para>
456 <indexterm zone="gcc gcjh">
457 <primary sortas="b-gcjh">gcjh</primary>
458 </indexterm>
459 </listitem>
460 </varlistentry>
461
462 <varlistentry id="gij">
463 <term><command>gij</command></term>
464 <listitem>
465 <para>
466 is the GNU interpreter for <application>Java</application> bytecode.
467 </para>
468 <indexterm zone="gcc gij">
469 <primary sortas="b-gij">gij</primary>
470 </indexterm>
471 </listitem>
472 </varlistentry>
473
474 <varlistentry id="gjar">
475 <term><command>gjar</command></term>
476 <listitem>
477 <para>
478 is an (partial) implementation of the <command>jar</command>
479 utility that comes with Sun's JDK.
480 </para>
481 <indexterm zone="gcc gjar">
482 <primary sortas="b-gjar">gjar</primary>
483 </indexterm>
484 </listitem>
485 </varlistentry>
486
487 <varlistentry id="gjarsigner">
488 <term><command>gjarsigner</command></term>
489 <listitem>
490 <para>
491 is a Java ARchive (JAR) file signing and verification tool.
492 </para>
493 <indexterm zone="gcc gjarsigner">
494 <primary sortas="b-gjarsigner">gjarsigner</primary>
495 </indexterm>
496 </listitem>
497 </varlistentry>
498
499 <varlistentry id="gjavah">
500 <term><command>gjavah</command></term>
501 <listitem>
502 <para>
503 generates header files from Java class files.
504 </para>
505 <indexterm zone="gcc gjavah">
506 <primary sortas="b-gjavah">gjavah</primary>
507 </indexterm>
508 </listitem>
509 </varlistentry>
510
511 <varlistentry id="gjdoc">
512 <term><command>gjdoc</command></term>
513 <listitem>
514 <para>
515 is a documentation tool similar to <command>javadoc</command>.
516 </para>
517 <indexterm zone="gcc gjdoc">
518 <primary sortas="b-gjdoc">gjdoc</primary>
519 </indexterm>
520 </listitem>
521 </varlistentry>
522
523 <varlistentry id="gkeytool">
524 <term><command>gkeytool</command></term>
525 <listitem>
526 <para>
527 manages private keys and public certificates in a
528 <application>Java</application> environment.
529 </para>
530 <indexterm zone="gcc gkeytool">
531 <primary sortas="b-gkeytool">gkeytool</primary>
532 </indexterm>
533 </listitem>
534 </varlistentry>
535
536 <varlistentry id="gnative2ascii">
537 <term><command>gnative2ascii</command></term>
538 <listitem>
539 <para>
540 is an encoding converter for <application>Java</application>.
541 </para>
542 <indexterm zone="gcc gnative2ascii">
543 <primary sortas="b-gnative2ascii">gnative2ascii</primary>
544 </indexterm>
545 </listitem>
546 </varlistentry>
547
548 <varlistentry id="gorbd">
549 <term><command>gorbd</command></term>
550 <listitem>
551 <para>
552 is an object request broker daemon.
553 </para>
554 <indexterm zone="gcc gorbd">
555 <primary sortas="b-gorbd">gorbd</primary>
556 </indexterm>
557 </listitem>
558 </varlistentry>
559
560 <varlistentry id="grmic-gcc">
561 <term><command>grmic</command></term>
562 <listitem>
563 <para>
564 generates stubs for Remote Method Invocation.
565 </para>
566 <indexterm zone="gcc grmic-gcc">
567 <primary sortas="b-grmic">grmic</primary>
568 </indexterm>
569 </listitem>
570 </varlistentry>
571
572 <varlistentry id="grmid-gcc">
573 <term><command>grmid</command></term>
574 <listitem>
575 <para>
576 RMI activation system daemon.
577 </para>
578 <indexterm zone="gcc grmid-gcc">
579 <primary sortas="b-grmid">grmid</primary>
580 </indexterm>
581 </listitem>
582 </varlistentry>
583
584 <varlistentry id="grmiregistry-gcc">
585 <term><command>grmiregistry</command></term>
586 <listitem>
587 <para>
588 starts a remote object registry on the current host.
589 </para>
590 <indexterm zone="gcc grmiregistry-gcc">
591 <primary sortas="b-grmiregistry">grmiregistry</primary>
592 </indexterm>
593 </listitem>
594 </varlistentry>
595
596 <varlistentry id="gserialver">
597 <term><command>gserialver</command></term>
598 <listitem>
599 <para>
600 prints the serialVersionUID of the specified class.
601 </para>
602 <indexterm zone="gcc gserialver">
603 <primary sortas="b-gserialver">gserialver</primary>
604 </indexterm>
605 </listitem>
606 </varlistentry>
607
608 <varlistentry id="gtnameserv">
609 <term><command>gtnameserv</command></term>
610 <listitem>
611 <para>
612 starts a naming service.
613 </para>
614 <indexterm zone="gcc gtnameserv">
615 <primary sortas="b-gtnameserv">gtnameserv</primary>
616 </indexterm>
617 </listitem>
618 </varlistentry>
619
620 <varlistentry id="jcf-dump">
621 <term><command>jcf-dump</command></term>
622 <listitem>
623 <para>
624 prints information about <application>Java</application>
625 class files.
626 </para>
627 <indexterm zone="gcc jcf-dump">
628 <primary sortas="b-jcf-dump">jcf-dump</primary>
629 </indexterm>
630 </listitem>
631 </varlistentry>
632
633 <varlistentry id="jv-convert">
634 <term><command>jv-convert</command></term>
635 <listitem>
636 <para>
637 converts files from one encoding to another.
638 </para>
639 <indexterm zone="gcc jv-convert">
640 <primary sortas="b-jv-convert">jv-convert</primary>
641 </indexterm>
642 </listitem>
643 </varlistentry>
644
645 <varlistentry id="rebuild-gcj-db">
646 <term><command>rebuild-gcj-db</command></term>
647 <listitem>
648 <para>
649 Merge the per-solib databases made by
650 <application>aot-compile</application> into one system-wide
651 database.
652 </para>
653 <indexterm zone="gcc rebuild-gcj-db">
654 <primary sortas="b-rebuild-gcj-db">rebuild-gcj-db</primary>
655 </indexterm>
656 </listitem>
657 </varlistentry>
658
659 </variablelist>
660
661 </sect2>
662
663</sect1>
Note: See TracBrowser for help on using the repository browser.