This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: a question
- From: Andrew Haley <aph at redhat dot com>
- To: mohammed hegazy <engmohheg at hotmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 10 Jul 2009 17:28:26 +0100
- Subject: Re: a question
- References: <SNT106-W596EEEC8B548B7E82D5241A3270@phx.gbl>
mohammed hegazy wrote:
i want to ask a question about gcj output binary ,is the binary
> depends on the jre
You'll still need libgcj, the Java runtime library, unless you
precompile everything and link the whole lot statically.
> or the jre can be removed , and about the CLASSPATH variable , is it
> must set? , and if the compilation is used with static linking if in
> this case , the dependent jar libraries could be removed or not ?.
They could be, yes, but it's trick and you'll end up with a very large
executable. The trick is to compile all the libraries into .a files
and then like them all together with --whole-archive. There are more
subtle ways to do it, but this will usually work.
Andrew.