source: general/prog/gcc-java.xml@ 7e8964e

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules 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 7e8964e was e2c88e8, checked in by Pierre Labastie <pieere@…>, 8 years ago

Updates to gcc-java-5.3.0 and gcc-ada-5.3.0

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

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