source: general/prog/gcc-java.xml@ 57945e0

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.8 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 57945e0 was 718593a, checked in by Pierre Labastie <pieere@…>, 9 years ago

Tags

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