[uClibc]LFS on v850

Miles Bader miles at lsi.nec.co.jp
Fri Feb 22 03:13:21 UTC 2002


Well, after all the flaming about the case where DO_LFS=false, I'd
actually like to fix the problem that requires me to use that setting
for the v850.  [I think I sent email about this once before, but got no
reply.]

The only real problem is that the definition of truncate64 in
`libc/sysdeps/linux/common/syscalls.c':

   //#define __NR_truncate64         193
   #ifdef __UCLIBC_HAVE_LFS__
   #ifdef L_truncate64
   #include <unistd.h>
   _syscall2(int, truncate64, const char *, path, __off64_t, length);
   #endif
   #endif /* __UCLIBC_HAVE_LFS__ */

fails to compile on the v850.

This is because the definition of _syscall2 on the v850 only works with
arguments that fit in registers (i.e., are 32 bits or less).

I guess it would be trivial to define a v850-specific version of
truncate64 in the same way that the v850 port overrides the generic
linux definition of mmap -- except that since the generic version of
truncate64 gets an error (instead of merely being wrong), it cause the
compilation to barf.

So, it seems that I need some way to disable the standard definition of
truncate64, so I can avoid the compilation error.  Any suggestions on
the best way to do that?

Some possibilities that come to mind include --

 (1) A Config-file option that explicitly says `don't use the standard
     truncate64'.  Then I'd just turn it on and put my own version in
     sysdeps/linux/v850/.

 (2) More generally, a Config-file option that says `syscall args must
     be 32-bits', which would enable a generic solution for truncate64
     in this case (basically, you just have to split up the 64-bit
     argument into two 32-bit words, and pass those to _syscall...)

 (3) One of the two above solutions, but with v850 version of the linux
     header file <asm/unistd.h> changed to somehow communicate the
     situation, instead of a Config-file option.

 ... or ...?

[Fixing _syscall2 to work properly with 64-bit arguments is not easy.]

Thanks,

-Miles
-- 
`Life is a boundless sea of bitterness'



More information about the uClibc mailing list