gcj problem with -static option

Andrew Haley aph@redhat.com
Thu Mar 16 10:57:00 GMT 2006


FERANDELLE Pascal writes:
 > I have build gcj compiler from the the GCC 3.4.4 distribution, on a
 > PC running Linux RedHat. When I compile and run a simple java
 > HelloWorld application, no problem. But, as my future target is an
 > embedded application, I use the -static option of gcj, to build a
 > new HelloWorld application, which doesn't need any shared lib on
 > execution. The build seems correct, despite the fact that my
 > simple HelloWorld executable has a size of 13MB ... But, when I
 > try to run it, I have a "segmentation fault (core dumped)". With
 > gdb 6.4, I can see the problem occurs in the _Jv_FindClass
 > function, during the call to sys->loadClass.
It's hard to know the real cause of your problem unless we can
duplicate it.
Certainly, statically building HelloWorld does work. But it is very
unlikely that any maintainer of gcj is going to work on such an old
version. gcj 3.4.3 dates from Fri 5 Nov 2004.
 > Has anyone already met this problem ?
Statically linking Java programs does not, in general, work correctly.
However, if you write your programs in such a way that they do not use
the language's dynamic features it can be a useful option.
Your best option is to try a more recent gcj release. 4.1 would be a
good idea.
Andrew.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /