java@gcc.gnu.org
[Top] [All Lists]

Re: custom libgcj

Subject: Re: custom libgcj
From: Andrew Haley
Date: Mon, 20 Apr 2009 14:41:00 +0100
Bryce McKinlay wrote:
> On Mon, Apr 20, 2009 at 12:41 PM, abhishek desai <abhi00@xxxxxxxxx> wrote:
> 
>> I want to customize libgcj compilation to include only the garbage
>> collector part and other required files for a simple java program to
>> compile and execute in native using gcj. Then I want to add my own
>> java files to libgcj. Is there some way this can be done? Which files
>> can I edit for this ?
> 
> This would certainly be a very useful feature. Unfortunately, there is
> no easy way to do it. You could edit Makefile.am files by hand to
> remove classes you don't want, but you're likely to get missing symbol
> errors at link time due to the way libgcj is compiled.

I agree.

I think the only way to do it is iterate.

1.  Link app statcially with libgcj and make sure it still works.

2.  Run app with -verbose:class to see what gets used.

3.  Remove stuff that isn't listed in -verbose:class.

4.  Fix link errors.

5.  If that isn't enough, start tracing through -verbose:class and edit
the library source to prune dependencies.

6.  Goto 4...

Andrew.

<Prev in Thread] Current Thread [Next in Thread>