classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing the TARGET_* layer or not ?


From: Michael Koch
Subject: Re: Removing the TARGET_* layer or not ?
Date: Tue, 3 Aug 2004 16:39:28 +0200
User-agent: KMail/1.6.2

Am Dienstag, 3. August 2004 15:39 schrieb Ingo Prötel:
> Hi Michael,
>
> Michael Koch wrote:
> > Hi list, hi Ingo,
> >
> >
> >
> > I just started porting/testing GNU classpath to solaris (2.6).
> > Its not really different to other unices (we currently support
> > linux and *BSD) but some things are. When I wanted to do the
> > needed changes I stumbled over the TARGET_* layer which adds (in
> > my eyes) some unneeded complexity. It makes it more hard to read
> > the code and all the stuff seem to be implemented either in
> > target/generic or target/Linux with no real rule what have to go
> > where. It's just difficult to understand. In fact I try to
> > understand it since a long time and always fail because of its
> > "indirectness". Personally I think some AUTOCONF checks would be
> > more appropriate and would make the code much more readable and
> > bugfixable. There are some known bugs in it but noone attacked
> > them because none understands the code it seems.
> >
> > Ingo: Now my question are you really using the TARGET_* system or
> > is it only rotting around in GNU classpath ? I really wonder if
> > some AUTOCONF macros would be more helpful for you ?
>
> Yes, the TARGET-layer is in active use here.
>
> The TARGET-layer has two advantages:
> 1. It makes JNI-code more readable,
> 2. It makes porting simple.
>
> It makes JNI-code more readable because whenever a native function
> is called there is only one macro call. The other possibility would
> be that one has ifdefs for every system (possibly for every
> system+architecture) that one wants to support with this code. This
> would make the JNI-code difficult to read.
>
> It makes porting easier in that one can reuse generic macros and
> only needs to override specific macros that differ for a given new
> system. And this all can happen without modifing the actual
> JNI-code. So the main step in porting is creating a new
> subdirectory in tartget name it Solaris. Copy over all the files in
> the Linux target. Add this to the include path. Then just work on
> the error that the compiler will find and where necessary create
> Solaris specific macros.
>
> If there is interest we could provide our Solaris, Darwin, and
> MinGW TARGET-layer. This would probably help to understand how this
> layer is helpful. In any case we can help if anyone needs help
> understanding the code.

Another thing unmentioned yet is that if you fix a bug in one 
TARGET-layer you need to check all other too to be sure the bug is 
totally fixed. If all is in one base you need to fix a bug only once. 
With more care but only once.


Michael




reply via email to

[Prev in Thread] Current Thread [Next in Thread]