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

7.6-blfs 7.6-systemd kde5-14269 kde5-14686 systemd-13485
Last change on this file since a68f149 was a68f149, checked in by Krejzi <krejzi@…>, 10 years ago

Mirror gcc instructions from LFS. Mark gcj as built for 7.6. Add upstream fix to gcj and gnat pages too.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@13996 af4574ff-66df-0310-9fd7-8a98e5e911e0

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