source: archive/gcc-java.xml@ ccded7e

11.0 11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since ccded7e was 9562b375, checked in by Pierre Labastie <pieere@…>, 7 years ago

GCC-7.1.0; archive gcc-java, since
it is not anymore in the GCC sources

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@18694 af4574ff-66df-0310-9fd7-8a98e5e911e0

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