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

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.6 7.7 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 krejzi/svn 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 8ddc247 was 8ddc247, checked in by Pierre Labastie <pieere@…>, 10 years ago

Add upstream fixes patch to GCC pages and tag them

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

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