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

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 a1f2d184 was 03c74688, checked in by Pierre Labastie <pieere@…>, 10 years ago

Update to GCC-4.9.1

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

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