Subject: Re: compat code restructuring status
To: None <current-users@netbsd.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: tech-kern
Date: 09/16/2005 03:07:45
On Tue, Sep 13, 2005 at 16:17:02 -0400, Christos Zoulas wrote:

> Last night I committed the bulk of the changes to the compat infrastructure.
> Here's what's changed...
> 
> christos
[...]
> The same holds for assembly source files, which should be moved to
> the compat arch-specific subdirectories (this is work in progress).
> 
> Currently i386 and sparc64 compile, but only the i386 arch specific
> code has been moved to the src/lib/libc/compat/arch/i386 directories.
> Even some of the i386 arch-specific files will be renamed eventually.
> It is better to fix the sources by moving the compat .S files in
> src/lib/libc/compat/arch rather than just adding <compat/sys/...>
> includes to make them compile.

For those who will be coverting other arches, this is a quick summary
of what I did for sh3:


Create subtree for your arch under compat/arch

Steal compat/arch/i386/Makefile.inc

Convert "sys" subdirectory:

. In lib/libc/sys/Makefile.inc there's a list of files under
  !defined(COMPATARCHDIR).

. Move each file $foo to compat/arch/$ARCH/sys/compat_$foo

. Adjust arch/$ARCH/sys/Makefile.inc accordingly

. Steal compat/arch/i386/sys/Makefile.inc


Convert "gen" subdirectory:

. Move setjmp.S sigsetjmp.S _setjmp.S to compat/arch/$ARCH/gen/compat_$foo

. Move __setjmp14.S -> setjmp.S

. Move __sigsetjmp14.S -> sigsetjmp.S

. Adjust arch/$ARCH/gen/Makefile.inc accordingly, droping the moved
  files from SRCS and lint stubs

. Steal compat/arch/i386/gen/Makefile.inc


This should be it.

If you are paranoid, save your old objdir before performing the move.
Then verify that the corresponding object files are identical, and
libc.so exports the same symbols.

Note that in sys we didn't renamed __vfork14.S yet (like we did
e.g. __setjmp14.S in gen).  Christos says he will take care about that
later, so for now omit that step for consistency between archs.


SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen