source: general/prog/gcc-java.xml@ 0c13b97d

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 0c13b97d was 0c13b97d, checked in by Pierre Labastie <pieere@…>, 10 years ago

Commit forgotten files for GCC split

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

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