source: general/prog/gcc-java.xml@ 11fc0a30

systemd-13485
Last change on this file since 11fc0a30 was 57105fd, checked in by Christopher Gregory <cjg@…>, 10 years ago

Merge updates from trunk.

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