source: general/prog/gcc-java.xml@ 8f64429

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 8f64429 was 2f8e65bc, checked in by Pierre Labastie <pieere@…>, 9 years ago

Tags

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

  • Property mode set to 100644
File size: 21.0 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-version;/gcc-&gcc-version;.tar.bz2">
8 <!ENTITY gcc-java-download-ftp "ftp://ftp.gnu.org/gnu/gcc/gcc-&gcc-version;/gcc-&gcc-version;.tar.bz2">
9 <!ENTITY gcc-java-md5sum "a51bcfeb3da7dd4c623e27207ed43467">
10 <!ENTITY gcc-java-size "91 MB">
11 <!ENTITY gcc-java-buildsize "3.3 GB">
12 <!ENTITY gcc-java-time "80 SBU (including 67 SBU for tests)">
13
14 <!ENTITY ecj-download-ftp "ftp://sourceware.org/pub/java/ecj-latest.jar">
15
16 <!ENTITY antlr-version "4.5">
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-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-version;</title>
29
30 <indexterm zone="gcc">
31 <primary sortas="a-gcc-java-5-0">GCC-Java-&gcc-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-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-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-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-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-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
347 libgij.so, and numerous other
348 run-time libraries and executables in
349 <filename class="directory">/usr/lib/gcc</filename> and
350 <filename class="directory">/usr/libexec/gcc</filename>
351 </seg>
352 <seg>
353 /usr/include/c++/&gcc-version;/{gcj,gnu,java,javax,org,sun},
354 /usr/lib/gcj-&gcc-version;-16, /usr/lib/jvm-exports,
355 /usr/lib/security, /opt/gcj and /usr/share/java
356 </seg>
357 </seglistitem>
358 </segmentedlist>
359
360 <para>
361 Some program and library names and descriptions are not listed here,
362 but can be found at
363 <ulink url="&lfs-root;/chapter06/gcc.html#contents-gcc"/> as they were
364 initially installed during the building of LFS.
365 </para>
366
367 <variablelist>
368 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
369 <?dbfo list-presentation="list"?>
370 <?dbhtml list-presentation="table"?>
371
372 <varlistentry id="aot-compile">
373 <term><command>aot-compile</command></term>
374 <listitem>
375 <para>
376 searches a directory for Java bytecode and uses
377 <command>gcj</command> to compile it to native code.
378 </para>
379 <indexterm zone="gcc aot-compile">
380 <primary sortas="b-aot-compile">aot-compile</primary>
381 </indexterm>
382 </listitem>
383 </varlistentry>
384
385 <varlistentry id="ecj">
386 <term><command>ecj</command></term>
387 <listitem>
388 <para>
389 is the eclipse compiler.
390 </para>
391 <indexterm zone="gcc ecj">
392 <primary sortas="b-ecj">ecj</primary>
393 </indexterm>
394 </listitem>
395 </varlistentry>
396
397 <varlistentry id="gappletviewer">
398 <term><command>gappletviewer</command></term>
399 <listitem>
400 <para>
401 loads and run a <application>Java</application> applet.
402 </para>
403 <indexterm zone="gcc gappletviewer">
404 <primary sortas="b-gappletviewer">gappletviewer</primary>
405 </indexterm>
406 </listitem>
407 </varlistentry>
408
409 <varlistentry id="gc-analyze">
410 <term><command>gc-analyze</command></term>
411 <listitem>
412 <para>
413 analyzes garbage collector (GC) memory dumps from
414 <application>Java</application> code.
415 </para>
416 <indexterm zone="gcc gc-analyze">
417 <primary sortas="b-gc-analyze">gc-analyze</primary>
418 </indexterm>
419 </listitem>
420 </varlistentry>
421
422 <varlistentry id="gcj">
423 <term><command>gcj</command></term>
424 <listitem>
425 <para>
426 is an ahead-of-time compiler for the <application>Java</application>
427 language.
428 </para>
429 <indexterm zone="gcc gcj">
430 <primary sortas="b-gcj">gcj</primary>
431 </indexterm>
432 </listitem>
433 </varlistentry>
434
435 <varlistentry id="gcj-dbtool">
436 <term><command>gcj-dbtool</command></term>
437 <listitem>
438 <para>
439 is a tool for creating and manipulating class file mapping databases.
440 </para>
441 <indexterm zone="gcc gcj-dbtool">
442 <primary sortas="b-gcj-dbtool">gcj-dbtool</primary>
443 </indexterm>
444 </listitem>
445 </varlistentry>
446
447 <varlistentry id="gcjh">
448 <term><command>gcjh</command></term>
449 <listitem>
450 <para>
451 generates header files from <application>Java</application> class files.
452 </para>
453 <indexterm zone="gcc gcjh">
454 <primary sortas="b-gcjh">gcjh</primary>
455 </indexterm>
456 </listitem>
457 </varlistentry>
458
459 <varlistentry id="gij">
460 <term><command>gij</command></term>
461 <listitem>
462 <para>
463 is the GNU interpreter for <application>Java</application> bytecode.
464 </para>
465 <indexterm zone="gcc gij">
466 <primary sortas="b-gij">gij</primary>
467 </indexterm>
468 </listitem>
469 </varlistentry>
470
471 <varlistentry id="gjar">
472 <term><command>gjar</command></term>
473 <listitem>
474 <para>
475 is an (partial) implementation of the <command>jar</command>
476 utility that comes with Sun's JDK.
477 </para>
478 <indexterm zone="gcc gjar">
479 <primary sortas="b-gjar">gjar</primary>
480 </indexterm>
481 </listitem>
482 </varlistentry>
483
484 <varlistentry id="gjarsigner">
485 <term><command>gjarsigner</command></term>
486 <listitem>
487 <para>
488 is a Java ARchive (JAR) file signing and verification tool.
489 </para>
490 <indexterm zone="gcc gjarsigner">
491 <primary sortas="b-gjarsigner">gjarsigner</primary>
492 </indexterm>
493 </listitem>
494 </varlistentry>
495
496 <varlistentry id="gjavah">
497 <term><command>gjavah</command></term>
498 <listitem>
499 <para>
500 generates header files from Java class files.
501 </para>
502 <indexterm zone="gcc gjavah">
503 <primary sortas="b-gjavah">gjavah</primary>
504 </indexterm>
505 </listitem>
506 </varlistentry>
507
508 <varlistentry id="gjdoc">
509 <term><command>gjdoc</command></term>
510 <listitem>
511 <para>
512 is a documentation tool similar to <command>javadoc</command>.
513 </para>
514 <indexterm zone="gcc gjdoc">
515 <primary sortas="b-gjdoc">gjdoc</primary>
516 </indexterm>
517 </listitem>
518 </varlistentry>
519
520 <varlistentry id="gkeytool">
521 <term><command>gkeytool</command></term>
522 <listitem>
523 <para>
524 manages private keys and public certificates in a
525 <application>Java</application> environment.
526 </para>
527 <indexterm zone="gcc gkeytool">
528 <primary sortas="b-gkeytool">gkeytool</primary>
529 </indexterm>
530 </listitem>
531 </varlistentry>
532
533 <varlistentry id="gnative2ascii">
534 <term><command>gnative2ascii</command></term>
535 <listitem>
536 <para>
537 is an encoding converter for <application>Java</application>.
538 </para>
539 <indexterm zone="gcc gnative2ascii">
540 <primary sortas="b-gnative2ascii">gnative2ascii</primary>
541 </indexterm>
542 </listitem>
543 </varlistentry>
544
545 <varlistentry id="gorbd">
546 <term><command>gorbd</command></term>
547 <listitem>
548 <para>
549 is an object request broker daemon.
550 </para>
551 <indexterm zone="gcc gorbd">
552 <primary sortas="b-gorbd">gorbd</primary>
553 </indexterm>
554 </listitem>
555 </varlistentry>
556
557 <varlistentry id="grmic-gcc">
558 <term><command>grmic</command></term>
559 <listitem>
560 <para>
561 generates stubs for Remote Method Invocation.
562 </para>
563 <indexterm zone="gcc grmic-gcc">
564 <primary sortas="b-grmic">grmic</primary>
565 </indexterm>
566 </listitem>
567 </varlistentry>
568
569 <varlistentry id="grmid-gcc">
570 <term><command>grmid</command></term>
571 <listitem>
572 <para>
573 RMI activation system daemon.
574 </para>
575 <indexterm zone="gcc grmid-gcc">
576 <primary sortas="b-grmid">grmid</primary>
577 </indexterm>
578 </listitem>
579 </varlistentry>
580
581 <varlistentry id="grmiregistry-gcc">
582 <term><command>grmiregistry</command></term>
583 <listitem>
584 <para>
585 starts a remote object registry on the current host.
586 </para>
587 <indexterm zone="gcc grmiregistry-gcc">
588 <primary sortas="b-grmiregistry">grmiregistry</primary>
589 </indexterm>
590 </listitem>
591 </varlistentry>
592
593 <varlistentry id="gserialver">
594 <term><command>gserialver</command></term>
595 <listitem>
596 <para>
597 prints the serialVersionUID of the specified class.
598 </para>
599 <indexterm zone="gcc gserialver">
600 <primary sortas="b-gserialver">gserialver</primary>
601 </indexterm>
602 </listitem>
603 </varlistentry>
604
605 <varlistentry id="gtnameserv">
606 <term><command>gtnameserv</command></term>
607 <listitem>
608 <para>
609 starts a naming service.
610 </para>
611 <indexterm zone="gcc gtnameserv">
612 <primary sortas="b-gtnameserv">gtnameserv</primary>
613 </indexterm>
614 </listitem>
615 </varlistentry>
616
617 <varlistentry id="jcf-dump">
618 <term><command>jcf-dump</command></term>
619 <listitem>
620 <para>
621 prints information about <application>Java</application>
622 class files.
623 </para>
624 <indexterm zone="gcc jcf-dump">
625 <primary sortas="b-jcf-dump">jcf-dump</primary>
626 </indexterm>
627 </listitem>
628 </varlistentry>
629
630 <varlistentry id="jv-convert">
631 <term><command>jv-convert</command></term>
632 <listitem>
633 <para>
634 converts files from one encoding to another.
635 </para>
636 <indexterm zone="gcc jv-convert">
637 <primary sortas="b-jv-convert">jv-convert</primary>
638 </indexterm>
639 </listitem>
640 </varlistentry>
641
642 <varlistentry id="rebuild-gcj-db">
643 <term><command>rebuild-gcj-db</command></term>
644 <listitem>
645 <para>
646 Merge the per-solib databases made by
647 <application>aot-compile</application> into one system-wide
648 database.
649 </para>
650 <indexterm zone="gcc rebuild-gcj-db">
651 <primary sortas="b-rebuild-gcj-db">rebuild-gcj-db</primary>
652 </indexterm>
653 </listitem>
654 </varlistentry>
655
656 </variablelist>
657
658 </sect2>
659
660</sect1>
Note: See TracBrowser for help on using the repository browser.