source: general/prog/gcc-java.xml@ e935527

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 e935527 was e935527, checked in by Ken Moffat <ken@…>, 7 years ago

Longindex fixes for gcc ada and java - link to gcc-java for the package instead of to gcc, remove hard coded versions in sort-as.

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

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