| .\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05) |
| .\" |
| .\" Standard preamble: |
| .\" ======================================================================== |
| .de Sh \" Subsection heading |
| .br |
| .if t .Sp |
| .ne 5 |
| .PP |
| \fB\\$1\fR |
| .PP |
| .. |
| .de Sp \" Vertical space (when we can't use .PP) |
| .if t .sp .5v |
| .if n .sp |
| .. |
| .de Vb \" Begin verbatim text |
| .ft CW |
| .nf |
| .ne \\$1 |
| .. |
| .de Ve \" End verbatim text |
| .ft R |
| .fi |
| .. |
| .\" Set up some character translations and predefined strings. \*(-- will |
| .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left |
| .\" double quote, and \*(R" will give a right double quote. \*(C+ will |
| .\" give a nicer C++. Capital omega is used to do unbreakable dashes and |
| .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, |
| .\" nothing in troff, for use with C<>. |
| .tr \(*W- |
| .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' |
| .ie n \{\ |
| . ds -- \(*W- |
| . ds PI pi |
| . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch |
| . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch |
| . ds L" "" |
| . ds R" "" |
| . ds C` "" |
| . ds C' "" |
| 'br\} |
| .el\{\ |
| . ds -- \|\(em\| |
| . ds PI \(*p |
| . ds L" `` |
| . ds R" '' |
| 'br\} |
| .\" |
| .\" Escape single quotes in literal strings from groff's Unicode transform. |
| .ie \n(.g .ds Aq \(aq |
| .el .ds Aq ' |
| .\" |
| .\" If the F register is turned on, we'll generate index entries on stderr for |
| .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index |
| .\" entries marked with X<> in POD. Of course, you'll have to process the |
| .\" output yourself in some meaningful fashion. |
| .ie \nF \{\ |
| . de IX |
| . tm Index:\\$1\t\\n%\t"\\$2" |
| .. |
| . nr % 0 |
| . rr F |
| .\} |
| .el \{\ |
| . de IX |
| .. |
| .\} |
| .\" |
| .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). |
| .\" Fear. Run. Save yourself. No user-serviceable parts. |
| . \" fudge factors for nroff and troff |
| .if n \{\ |
| . ds #H 0 |
| . ds #V .8m |
| . ds #F .3m |
| . ds #[ \f1 |
| . ds #] \fP |
| .\} |
| .if t \{\ |
| . ds #H ((1u-(\\\\n(.fu%2u))*.13m) |
| . ds #V .6m |
| . ds #F 0 |
| . ds #[ \& |
| . ds #] \& |
| .\} |
| . \" simple accents for nroff and troff |
| .if n \{\ |
| . ds ' \& |
| . ds ` \& |
| . ds ^ \& |
| . ds , \& |
| . ds ~ ~ |
| . ds / |
| .\} |
| .if t \{\ |
| . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" |
| . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' |
| . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' |
| . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' |
| . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' |
| . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' |
| .\} |
| . \" troff and (daisy-wheel) nroff accents |
| .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' |
| .ds 8 \h'\*(#H'\(*b\h'-\*(#H' |
| .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] |
| .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' |
| .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' |
| .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] |
| .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] |
| .ds ae a\h'-(\w'a'u*4/10)'e |
| .ds Ae A\h'-(\w'A'u*4/10)'E |
| . \" corrections for vroff |
| .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' |
| .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' |
| . \" for low resolution devices (crt and lpr) |
| .if \n(.H>23 .if \n(.V>19 \ |
| \{\ |
| . ds : e |
| . ds 8 ss |
| . ds o a |
| . ds d- d\h'-1'\(ga |
| . ds D- D\h'-1'\(hy |
| . ds th \o'bp' |
| . ds Th \o'LP' |
| . ds ae ae |
| . ds Ae AE |
| .\} |
| .rm #[ #] #H #V #F C |
| .\" ======================================================================== |
| .\" |
| .IX Title "GCJ 1" |
| .TH GCJ 1 "2011-04-28" "gcc-4.5.3" "GNU" |
| .\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| .\" way too many mistakes in technical documents. |
| .if n .ad l |
| .nh |
| .SH "NAME" |
| gcj \- Ahead\-of\-time compiler for the Java language |
| .SH "SYNOPSIS" |
| .IX Header "SYNOPSIS" |
| gcj [\fB\-I\fR\fIdir\fR...] [\fB\-d\fR \fIdir\fR...] |
| [\fB\-\-CLASSPATH\fR=\fIpath\fR] [\fB\-\-classpath\fR=\fIpath\fR] |
| [\fB\-f\fR\fIoption\fR...] [\fB\-\-encoding\fR=\fIname\fR] |
| [\fB\-\-main\fR=\fIclassname\fR] [\fB\-D\fR\fIname\fR[=\fIvalue\fR]...] |
| [\fB\-C\fR] [\fB\-\-resource\fR \fIresource-name\fR] [\fB\-d\fR \fIdirectory\fR] |
| [\fB\-W\fR\fIwarn\fR...] |
| \fIsourcefile\fR... |
| .SH "DESCRIPTION" |
| .IX Header "DESCRIPTION" |
| As \fBgcj\fR is just another front end to \fBgcc\fR, it supports many |
| of the same options as gcc. This manual only documents the |
| options specific to \fBgcj\fR. |
| .SH "OPTIONS" |
| .IX Header "OPTIONS" |
| .Sh "Input and output files" |
| .IX Subsection "Input and output files" |
| A \fBgcj\fR command is like a \fBgcc\fR command, in that it |
| consists of a number of options and file names. The following kinds |
| of input file names are supported: |
| .IP "\fIfile\fR\fB.java\fR" 4 |
| .IX Item "file.java" |
| Java source files. |
| .IP "\fIfile\fR\fB.class\fR" 4 |
| .IX Item "file.class" |
| Java bytecode files. |
| .IP "\fIfile\fR\fB.zip\fR" 4 |
| .IX Item "file.zip" |
| .PD 0 |
| .IP "\fIfile\fR\fB.jar\fR" 4 |
| .IX Item "file.jar" |
| .PD |
| An archive containing one or more \f(CW\*(C`.class\*(C'\fR files, all of |
| which are compiled. The archive may be compressed. Files in |
| an archive which don't end with \fB.class\fR are treated as |
| resource files; they are compiled into the resulting object file |
| as \fBcore:\fR URLs. |
| .IP "\fB@\fR\fIfile\fR" 4 |
| .IX Item "@file" |
| A file containing a whitespace-separated list of input file names. |
| (Currently, these must all be \f(CW\*(C`.java\*(C'\fR source files, but that |
| may change.) |
| Each named file is compiled, just as if it had been on the command line. |
| .IP "\fIlibrary\fR\fB.a\fR" 4 |
| .IX Item "library.a" |
| .PD 0 |
| .IP "\fIlibrary\fR\fB.so\fR" 4 |
| .IX Item "library.so" |
| .IP "\fB\-l\fR\fIlibname\fR" 4 |
| .IX Item "-llibname" |
| .PD |
| Libraries to use when linking. See the \fBgcc\fR manual. |
| .PP |
| You can specify more than one input file on the \fBgcj\fR command line, |
| in which case they will all be compiled. If you specify a |
| \&\f(CW\*(C`\-o \f(CIFILENAME\f(CW\*(C'\fR |
| option, all the input files will be compiled together, producing a |
| single output file, named \fI\s-1FILENAME\s0\fR. |
| This is allowed even when using \f(CW\*(C`\-S\*(C'\fR or \f(CW\*(C`\-c\*(C'\fR, |
| but not when using \f(CW\*(C`\-C\*(C'\fR or \f(CW\*(C`\-\-resource\*(C'\fR. |
| (This is an extension beyond the what plain \fBgcc\fR allows.) |
| (If more than one input file is specified, all must currently |
| be \f(CW\*(C`.java\*(C'\fR files, though we hope to fix this.) |
| .Sh "Input Options" |
| .IX Subsection "Input Options" |
| \&\fBgcj\fR has options to control where it looks to find files it needs. |
| For instance, \fBgcj\fR might need to load a class that is referenced |
| by the file it has been asked to compile. Like other compilers for the |
| Java language, \fBgcj\fR has a notion of a \fIclass path\fR. There are |
| several options and environment variables which can be used to |
| manipulate the class path. When \fBgcj\fR looks for a given class, it |
| searches the class path looking for matching \fI.class\fR or |
| \&\fI.java\fR file. \fBgcj\fR comes with a built-in class path which |
| points at the installed \fIlibgcj.jar\fR, a file which contains all the |
| standard classes. |
| .PP |
| In the text below, a directory or path component can refer either to an |
| actual directory on the filesystem, or to a \fI.zip\fR or \fI.jar\fR |
| file, which \fBgcj\fR will search as if it is a directory. |
| .IP "\fB\-I\fR\fIdir\fR" 4 |
| .IX Item "-Idir" |
| All directories specified by \f(CW\*(C`\-I\*(C'\fR are kept in order and prepended |
| to the class path constructed from all the other options. Unless |
| compatibility with tools like \f(CW\*(C`javac\*(C'\fR is important, we recommend |
| always using \f(CW\*(C`\-I\*(C'\fR instead of the other options for manipulating the |
| class path. |
| .IP "\fB\-\-classpath=\fR\fIpath\fR" 4 |
| .IX Item "--classpath=path" |
| This sets the class path to \fIpath\fR, a colon-separated list of paths |
| (on Windows-based systems, a semicolon-separate list of paths). |
| This does not override the builtin (\*(L"boot\*(R") search path. |
| .IP "\fB\-\-CLASSPATH=\fR\fIpath\fR" 4 |
| .IX Item "--CLASSPATH=path" |
| Deprecated synonym for \f(CW\*(C`\-\-classpath\*(C'\fR. |
| .IP "\fB\-\-bootclasspath=\fR\fIpath\fR" 4 |
| .IX Item "--bootclasspath=path" |
| Where to find the standard builtin classes, such as \f(CW\*(C`java.lang.String\*(C'\fR. |
| .IP "\fB\-\-extdirs=\fR\fIpath\fR" 4 |
| .IX Item "--extdirs=path" |
| For each directory in the \fIpath\fR, place the contents of that |
| directory at the end of the class path. |
| .IP "\fB\s-1CLASSPATH\s0\fR" 4 |
| .IX Item "CLASSPATH" |
| This is an environment variable which holds a list of paths. |
| .PP |
| The final class path is constructed like so: |
| .IP "\(bu" 4 |
| First come all directories specified via \f(CW\*(C`\-I\*(C'\fR. |
| .IP "\(bu" 4 |
| If \fB\-\-classpath\fR is specified, its value is appended. |
| Otherwise, if the \f(CW\*(C`CLASSPATH\*(C'\fR environment variable is specified, |
| then its value is appended. |
| Otherwise, the current directory (\f(CW"."\fR) is appended. |
| .IP "\(bu" 4 |
| If \f(CW\*(C`\-\-bootclasspath\*(C'\fR was specified, append its value. |
| Otherwise, append the built-in system directory, \fIlibgcj.jar\fR. |
| .IP "\(bu" 4 |
| Finally, if \f(CW\*(C`\-\-extdirs\*(C'\fR was specified, append the contents of the |
| specified directories at the end of the class path. Otherwise, append |
| the contents of the built-in extdirs at \f(CW\*(C`$(prefix)/share/java/ext\*(C'\fR. |
| .PP |
| The classfile built by \fBgcj\fR for the class \f(CW\*(C`java.lang.Object\*(C'\fR |
| (and placed in \f(CW\*(C`libgcj.jar\*(C'\fR) contains a special zero length |
| attribute \f(CW\*(C`gnu.gcj.gcj\-compiled\*(C'\fR. The compiler looks for this |
| attribute when loading \f(CW\*(C`java.lang.Object\*(C'\fR and will report an error |
| if it isn't found, unless it compiles to bytecode (the option |
| \&\f(CW\*(C`\-fforce\-classes\-archive\-check\*(C'\fR can be used to override this |
| behavior in this particular case.) |
| .IP "\fB\-fforce\-classes\-archive\-check\fR" 4 |
| .IX Item "-fforce-classes-archive-check" |
| This forces the compiler to always check for the special zero length |
| attribute \f(CW\*(C`gnu.gcj.gcj\-compiled\*(C'\fR in \f(CW\*(C`java.lang.Object\*(C'\fR and |
| issue an error if it isn't found. |
| .IP "\fB\-fsource=\fR\fI\s-1VERSION\s0\fR" 4 |
| .IX Item "-fsource=VERSION" |
| This option is used to choose the source version accepted by |
| \&\fBgcj\fR. The default is \fB1.5\fR. |
| .Sh "Encodings" |
| .IX Subsection "Encodings" |
| The Java programming language uses Unicode throughout. In an effort to |
| integrate well with other locales, \fBgcj\fR allows \fI.java\fR files |
| to be written using almost any encoding. \fBgcj\fR knows how to |
| convert these encodings into its internal encoding at compile time. |
| .PP |
| You can use the \f(CW\*(C`\-\-encoding=\f(CINAME\f(CW\*(C'\fR option to specify an |
| encoding (of a particular character set) to use for source files. If |
| this is not specified, the default encoding comes from your current |
| locale. If your host system has insufficient locale support, then |
| \&\fBgcj\fR assumes the default encoding to be the \fB\s-1UTF\-8\s0\fR encoding |
| of Unicode. |
| .PP |
| To implement \f(CW\*(C`\-\-encoding\*(C'\fR, \fBgcj\fR simply uses the host |
| platform's \f(CW\*(C`iconv\*(C'\fR conversion routine. This means that in practice |
| \&\fBgcj\fR is limited by the capabilities of the host platform. |
| .PP |
| The names allowed for the argument \f(CW\*(C`\-\-encoding\*(C'\fR vary from platform |
| to platform (since they are not standardized anywhere). However, |
| \&\fBgcj\fR implements the encoding named \fB\s-1UTF\-8\s0\fR internally, so if |
| you choose to use this for your source files you can be assured that it |
| will work on every host. |
| .Sh "Warnings" |
| .IX Subsection "Warnings" |
| \&\fBgcj\fR implements several warnings. As with other generic |
| \&\fBgcc\fR warnings, if an option of the form \f(CW\*(C`\-Wfoo\*(C'\fR enables a |
| warning, then \f(CW\*(C`\-Wno\-foo\*(C'\fR will disable it. Here we've chosen to |
| document the form of the warning which will have an effect \*(-- the |
| default being the opposite of what is listed. |
| .IP "\fB\-Wredundant\-modifiers\fR" 4 |
| .IX Item "-Wredundant-modifiers" |
| With this flag, \fBgcj\fR will warn about redundant modifiers. For |
| instance, it will warn if an interface method is declared \f(CW\*(C`public\*(C'\fR. |
| .IP "\fB\-Wextraneous\-semicolon\fR" 4 |
| .IX Item "-Wextraneous-semicolon" |
| This causes \fBgcj\fR to warn about empty statements. Empty statements |
| have been deprecated. |
| .IP "\fB\-Wno\-out\-of\-date\fR" 4 |
| .IX Item "-Wno-out-of-date" |
| This option will cause \fBgcj\fR not to warn when a source file is |
| newer than its matching class file. By default \fBgcj\fR will warn |
| about this. |
| .IP "\fB\-Wno\-deprecated\fR" 4 |
| .IX Item "-Wno-deprecated" |
| Warn if a deprecated class, method, or field is referred to. |
| .IP "\fB\-Wunused\fR" 4 |
| .IX Item "-Wunused" |
| This is the same as \fBgcc\fR's \f(CW\*(C`\-Wunused\*(C'\fR. |
| .IP "\fB\-Wall\fR" 4 |
| .IX Item "-Wall" |
| This is the same as \f(CW\*(C`\-Wredundant\-modifiers \-Wextraneous\-semicolon |
| \&\-Wunused\*(C'\fR. |
| .Sh "Linking" |
| .IX Subsection "Linking" |
| To turn a Java application into an executable program, |
| you need to link it with the needed libraries, just as for C or \*(C+. |
| The linker by default looks for a global function named \f(CW\*(C`main\*(C'\fR. |
| Since Java does not have global functions, and a |
| collection of Java classes may have more than one class with a |
| \&\f(CW\*(C`main\*(C'\fR method, you need to let the linker know which of those |
| \&\f(CW\*(C`main\*(C'\fR methods it should invoke when starting the application. |
| You can do that in any of these ways: |
| .IP "\(bu" 4 |
| Specify the class containing the desired \f(CW\*(C`main\*(C'\fR method |
| when you link the application, using the \f(CW\*(C`\-\-main\*(C'\fR flag, |
| described below. |
| .IP "\(bu" 4 |
| Link the Java package(s) into a shared library (dll) rather than an |
| executable. Then invoke the application using the \f(CW\*(C`gij\*(C'\fR program, |
| making sure that \f(CW\*(C`gij\*(C'\fR can find the libraries it needs. |
| .IP "\(bu" 4 |
| Link the Java packages(s) with the flag \f(CW\*(C`\-lgij\*(C'\fR, which links |
| in the \f(CW\*(C`main\*(C'\fR routine from the \f(CW\*(C`gij\*(C'\fR command. |
| This allows you to select the class whose \f(CW\*(C`main\*(C'\fR method you |
| want to run when you run the application. You can also use |
| other \f(CW\*(C`gij\*(C'\fR flags, such as \f(CW\*(C`\-D\*(C'\fR flags to set properties. |
| Using the \f(CW\*(C`\-lgij\*(C'\fR library (rather than the \f(CW\*(C`gij\*(C'\fR program |
| of the previous mechanism) has some advantages: it is compatible with |
| static linking, and does not require configuring or installing libraries. |
| .PP |
| These \f(CW\*(C`gij\*(C'\fR options relate to linking an executable: |
| .IP "\fB\-\-main=\fR\fI\s-1CLASSNAME\s0\fR" 4 |
| .IX Item "--main=CLASSNAME" |
| This option is used when linking to specify the name of the class whose |
| \&\f(CW\*(C`main\*(C'\fR method should be invoked when the resulting executable is |
| run. |
| .IP "\fB\-D\fR\fIname\fR\fB[=\fR\fIvalue\fR\fB]\fR" 4 |
| .IX Item "-Dname[=value]" |
| This option can only be used with \f(CW\*(C`\-\-main\*(C'\fR. It defines a system |
| property named \fIname\fR with value \fIvalue\fR. If \fIvalue\fR is not |
| specified then it defaults to the empty string. These system properties |
| are initialized at the program's startup and can be retrieved at runtime |
| using the \f(CW\*(C`java.lang.System.getProperty\*(C'\fR method. |
| .IP "\fB\-lgij\fR" 4 |
| .IX Item "-lgij" |
| Create an application whose command-line processing is that |
| of the \f(CW\*(C`gij\*(C'\fR command. |
| .Sp |
| This option is an alternative to using \f(CW\*(C`\-\-main\*(C'\fR; you cannot use both. |
| .IP "\fB\-static\-libgcj\fR" 4 |
| .IX Item "-static-libgcj" |
| This option causes linking to be done against a static version of the |
| libgcj runtime library. This option is only available if |
| corresponding linker support exists. |
| .Sp |
| \&\fBCaution:\fR Static linking of libgcj may cause essential parts |
| of libgcj to be omitted. Some parts of libgcj use reflection to load |
| classes at runtime. Since the linker does not see these references at |
| link time, it can omit the referred to classes. The result is usually |
| (but not always) a \f(CW\*(C`ClassNotFoundException\*(C'\fR being thrown at |
| runtime. Caution must be used when using this option. For more |
| details see: |
| <\fBhttp://gcc.gnu.org/wiki/Statically%20linking%20libgcj\fR> |
| .Sh "Code Generation" |
| .IX Subsection "Code Generation" |
| In addition to the many \fBgcc\fR options controlling code generation, |
| \&\fBgcj\fR has several options specific to itself. |
| .IP "\fB\-C\fR" 4 |
| .IX Item "-C" |
| This option is used to tell \fBgcj\fR to generate bytecode |
| (\fI.class\fR files) rather than object code. |
| .IP "\fB\-\-resource\fR \fIresource-name\fR" 4 |
| .IX Item "--resource resource-name" |
| This option is used to tell \fBgcj\fR to compile the contents of a |
| given file to object code so it may be accessed at runtime with the core |
| protocol handler as \fBcore:/\fR\fIresource-name\fR. Note that |
| \&\fIresource-name\fR is the name of the resource as found at runtime; for |
| instance, it could be used in a call to \f(CW\*(C`ResourceBundle.getBundle\*(C'\fR. |
| The actual file name to be compiled this way must be specified |
| separately. |
| .IP "\fB\-ftarget=\fR\fI\s-1VERSION\s0\fR" 4 |
| .IX Item "-ftarget=VERSION" |
| This can be used with \fB\-C\fR to choose the version of bytecode |
| emitted by \fBgcj\fR. The default is \fB1.5\fR. When not |
| generating bytecode, this option has no effect. |
| .IP "\fB\-d\fR \fIdirectory\fR" 4 |
| .IX Item "-d directory" |
| When used with \f(CW\*(C`\-C\*(C'\fR, this causes all generated \fI.class\fR files |
| to be put in the appropriate subdirectory of \fIdirectory\fR. By |
| default they will be put in subdirectories of the current working |
| directory. |
| .IP "\fB\-fno\-bounds\-check\fR" 4 |
| .IX Item "-fno-bounds-check" |
| By default, \fBgcj\fR generates code which checks the bounds of all |
| array indexing operations. With this option, these checks are omitted, which |
| can improve performance for code that uses arrays extensively. Note that this |
| can result in unpredictable behavior if the code in question actually does |
| violate array bounds constraints. It is safe to use this option if you are |
| sure that your code will never throw an \f(CW\*(C`ArrayIndexOutOfBoundsException\*(C'\fR. |
| .IP "\fB\-fno\-store\-check\fR" 4 |
| .IX Item "-fno-store-check" |
| Don't generate array store checks. When storing objects into arrays, a runtime |
| check is normally generated in order to ensure that the object is assignment |
| compatible with the component type of the array (which may not be known |
| at compile-time). With this option, these checks are omitted. This can |
| improve performance for code which stores objects into arrays frequently. |
| It is safe to use this option if you are sure your code will never throw an |
| \&\f(CW\*(C`ArrayStoreException\*(C'\fR. |
| .IP "\fB\-fjni\fR" 4 |
| .IX Item "-fjni" |
| With \fBgcj\fR there are two options for writing native methods: \s-1CNI\s0 |
| and \s-1JNI\s0. By default \fBgcj\fR assumes you are using \s-1CNI\s0. If you are |
| compiling a class with native methods, and these methods are implemented |
| using \s-1JNI\s0, then you must use \f(CW\*(C`\-fjni\*(C'\fR. This option causes |
| \&\fBgcj\fR to generate stubs which will invoke the underlying \s-1JNI\s0 |
| methods. |
| .IP "\fB\-fno\-assert\fR" 4 |
| .IX Item "-fno-assert" |
| Don't recognize the \f(CW\*(C`assert\*(C'\fR keyword. This is for compatibility |
| with older versions of the language specification. |
| .IP "\fB\-fno\-optimize\-static\-class\-initialization\fR" 4 |
| .IX Item "-fno-optimize-static-class-initialization" |
| When the optimization level is greater or equal to \f(CW\*(C`\-O2\*(C'\fR, |
| \&\fBgcj\fR will try to optimize the way calls into the runtime are made |
| to initialize static classes upon their first use (this optimization |
| isn't carried out if \f(CW\*(C`\-C\*(C'\fR was specified.) When compiling to native |
| code, \f(CW\*(C`\-fno\-optimize\-static\-class\-initialization\*(C'\fR will turn this |
| optimization off, regardless of the optimization level in use. |
| .IP "\fB\-\-disable\-assertions[=\fR\fIclass-or-package\fR\fB]\fR" 4 |
| .IX Item "--disable-assertions[=class-or-package]" |
| Don't include code for checking assertions in the compiled code. |
| If \f(CW\*(C`=\f(CIclass\-or\-package\f(CW\*(C'\fR is missing disables assertion code |
| generation for all classes, unless overridden by a more |
| specific \f(CW\*(C`\-\-enable\-assertions\*(C'\fR flag. |
| If \fIclass-or-package\fR is a class name, only disables generating |
| assertion checks within the named class or its inner classes. |
| If \fIclass-or-package\fR is a package name, disables generating |
| assertion checks within the named package or a subpackage. |
| .Sp |
| By default, assertions are enabled when generating class files |
| or when not optimizing, and disabled when generating optimized binaries. |
| .IP "\fB\-\-enable\-assertions[=\fR\fIclass-or-package\fR\fB]\fR" 4 |
| .IX Item "--enable-assertions[=class-or-package]" |
| Generates code to check assertions. The option is perhaps misnamed, |
| as you still need to turn on assertion checking at run-time, |
| and we don't support any easy way to do that. |
| So this flag isn't very useful yet, except to partially override |
| \&\f(CW\*(C`\-\-disable\-assertions\*(C'\fR. |
| .IP "\fB\-findirect\-dispatch\fR" 4 |
| .IX Item "-findirect-dispatch" |
| \&\fBgcj\fR has a special binary compatibility \s-1ABI\s0, which is enabled |
| by the \f(CW\*(C`\-findirect\-dispatch\*(C'\fR option. In this mode, the code |
| generated by \fBgcj\fR honors the binary compatibility guarantees |
| in the Java Language Specification, and the resulting object files do |
| not need to be directly linked against their dependencies. Instead, |
| all dependencies are looked up at runtime. This allows free mixing of |
| interpreted and compiled code. |
| .Sp |
| Note that, at present, \f(CW\*(C`\-findirect\-dispatch\*(C'\fR can only be used |
| when compiling \fI.class\fR files. It will not work when compiling |
| from source. \s-1CNI\s0 also does not yet work with the binary compatibility |
| \&\s-1ABI\s0. These restrictions will be lifted in some future release. |
| .Sp |
| However, if you compile \s-1CNI\s0 code with the standard \s-1ABI\s0, you can call |
| it from code built with the binary compatibility \s-1ABI\s0. |
| .IP "\fB\-fbootstrap\-classes\fR" 4 |
| .IX Item "-fbootstrap-classes" |
| This option can be use to tell \f(CW\*(C`libgcj\*(C'\fR that the compiled classes |
| should be loaded by the bootstrap loader, not the system class loader. |
| By default, if you compile a class and link it into an executable, it |
| will be treated as if it was loaded using the system class loader. |
| This is convenient, as it means that things like |
| \&\f(CW\*(C`Class.forName()\*(C'\fR will search \fB\s-1CLASSPATH\s0\fR to find the |
| desired class. |
| .IP "\fB\-freduced\-reflection\fR" 4 |
| .IX Item "-freduced-reflection" |
| This option causes the code generated by \fBgcj\fR to contain a |
| reduced amount of the class meta-data used to support runtime |
| reflection. The cost of this savings is the loss of |
| the ability to use certain reflection capabilities of the standard |
| Java runtime environment. When set all meta-data except for that |
| which is needed to obtain correct runtime semantics is eliminated. |
| .Sp |
| For code that does not use reflection (i.e. serialization, \s-1RMI\s0, \s-1CORBA\s0 |
| or call methods in the \f(CW\*(C`java.lang.reflect\*(C'\fR package), |
| \&\f(CW\*(C`\-freduced\-reflection\*(C'\fR will result in proper operation with a |
| savings in executable code size. |
| .Sp |
| \&\s-1JNI\s0 (\f(CW\*(C`\-fjni\*(C'\fR) and the binary compatibility \s-1ABI\s0 |
| (\f(CW\*(C`\-findirect\-dispatch\*(C'\fR) do not work properly without full |
| reflection meta-data. Because of this, it is an error to use these options |
| with \f(CW\*(C`\-freduced\-reflection\*(C'\fR. |
| .Sp |
| \&\fBCaution:\fR If there is no reflection meta-data, code that uses |
| a \f(CW\*(C`SecurityManager\*(C'\fR may not work properly. Also calling |
| \&\f(CW\*(C`Class.forName()\*(C'\fR may fail if the calling method has no |
| reflection meta-data. |
| .Sh "Configure-time Options" |
| .IX Subsection "Configure-time Options" |
| Some \fBgcj\fR code generations options affect the resulting \s-1ABI\s0, and |
| so can only be meaningfully given when \f(CW\*(C`libgcj\*(C'\fR, the runtime |
| package, is configured. \f(CW\*(C`libgcj\*(C'\fR puts the appropriate options from |
| this group into a \fBspec\fR file which is read by \fBgcj\fR. These |
| options are listed here for completeness; if you are using \f(CW\*(C`libgcj\*(C'\fR |
| then you won't want to touch these options. |
| .IP "\fB\-fuse\-boehm\-gc\fR" 4 |
| .IX Item "-fuse-boehm-gc" |
| This enables the use of the Boehm \s-1GC\s0 bitmap marking code. In particular |
| this causes \fBgcj\fR to put an object marking descriptor into each |
| vtable. |
| .IP "\fB\-fhash\-synchronization\fR" 4 |
| .IX Item "-fhash-synchronization" |
| By default, synchronization data (the data used for \f(CW\*(C`synchronize\*(C'\fR, |
| \&\f(CW\*(C`wait\*(C'\fR, and \f(CW\*(C`notify\*(C'\fR) is pointed to by a word in each object. |
| With this option \fBgcj\fR assumes that this information is stored in a |
| hash table and not in the object itself. |
| .IP "\fB\-fuse\-divide\-subroutine\fR" 4 |
| .IX Item "-fuse-divide-subroutine" |
| On some systems, a library routine is called to perform integer |
| division. This is required to get exception handling correct when |
| dividing by zero. |
| .IP "\fB\-fcheck\-references\fR" 4 |
| .IX Item "-fcheck-references" |
| On some systems it's necessary to insert inline checks whenever |
| accessing an object via a reference. On other systems you won't need |
| this because null pointer accesses are caught automatically by the |
| processor. |
| .IP "\fB\-fuse\-atomic\-builtins\fR" 4 |
| .IX Item "-fuse-atomic-builtins" |
| On some systems, gcc can generate code for built-in atomic operations. |
| Use this option to force gcj to use these builtins when compiling Java |
| code. Where this capability is present it should be automatically |
| detected, so you won't usually need to use this option. |
| .SH "SEE ALSO" |
| .IX Header "SEE ALSO" |
| \&\fIgcc\fR\|(1), \fIgcjh\fR\|(1), \fIgjnih\fR\|(1), \fIgij\fR\|(1), \fIjcf\-dump\fR\|(1), \fIgfdl\fR\|(7), |
| and the Info entries for \fIgcj\fR and \fIgcc\fR. |
| .SH "COPYRIGHT" |
| .IX Header "COPYRIGHT" |
| Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
| .PP |
| Permission is granted to copy, distribute and/or modify this document |
| under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.2 or |
| any later version published by the Free Software Foundation; with no |
| Invariant Sections, the Front-Cover Texts being (a) (see below), and |
| with the Back-Cover Texts being (b) (see below). |
| A copy of the license is included in the |
| man page \fIgfdl\fR\|(7). |
| .PP |
| (a) The \s-1FSF\s0's Front-Cover Text is: |
| .PP |
| .Vb 1 |
| \& A GNU Manual |
| .Ve |
| .PP |
| (b) The \s-1FSF\s0's Back-Cover Text is: |
| .PP |
| .Vb 3 |
| \& You have freedom to copy and modify this GNU Manual, like GNU |
| \& software. Copies published by the Free Software Foundation raise |
| \& funds for GNU development. |
| .Ve |