Subject: port-mips/20246: libposix broken on MIPS (at least)
To: None <firstname.lastname@example.org>
From: None <email@example.com>
Date: 02/07/2003 17:26:15
>Synopsis: libposix broken on MIPS (at least)
>Arrival-Date: Fri Feb 07 17:27:00 PST 2003
>Originator: Chris Demetriou
>Release: 1.6N as of 2003-02-05 00:00 UTC.
NetBSD 1.6N sbmips
w/ a GENERIC kernel.
libposix on NetBSD MIPS ports is broken.
in the case of errors, __cerror is used... but __cerror
is in libc and for dynamically-linked executables
(the default), the first time each libposix fn gets
an error it has to bind __cerror. doing that corrupts
the register (v0 on MIPS) used to indicate errno!
PR marked as high priority because it causes MIPS ports
to fail the existing regression tests.
run the regress/lib/libposix/prn1 test on mips.
i came to the hypothesis above by modifying the test code to
do the rename of no/such/file/or/dir twice, with printouts
between them. In that case, only the first failing rename
produces a bogus errno!
unknown. Possibilities include:
* making libposix include its own copy of __cerror.
I don't know what's involved in this one...
* making ld.so not clobber v0 on mips.
If this is done, other ports should be checked to
make sure they don't suffer the same problem.
* making libposix implement its syscalls via syscall().
This would be fine, but adds a level of indirection.
I don't know if we care about the absolute performance
of POSIX chosk(), fchown(), lchown() and rename().
* making libposix implement its syscalls via the underlying __posix_*
Again fine, and probably another level of indirection unless
it used linker/symbol magic (that i am not sure exists.)