[uClibc]Sparc port

Matt Bosworth m_bosworth at yahoo.com
Wed Mar 7 01:48:30 UTC 2001


Eric,

	First, thanks for the header files, that got rid of several
errors. . .

	However, there are still some symbol redefinitions caused 
by statfix.c.  statfix.c includes both <asm/stat.h> and <sys/stat.h>, 
but both of them define several types (fd_set, dev_t, ino_t, pid_t,
etc.)  The only way I could think of to fix this is an ugly hack : 

/* Pull in whatever this particular arch's kernel thinks the kernel
version of
 * struct stat should look like.  It turns out that each arch has a
different
 * opinion on the subject, and different kernel revs use different
names... */

#define fd_set _K_fd_set
#define dev_t _K_dev_t
#define ino_t _K_ino_t
#define mode_t _K_mode_t
#define nlink_t _K_nlink_t
#define off_t _K_off_t
#define pid_t _K_pid_t
#define gid_t _K_gid_t
#define uid_t _K_uid_t
#define daddr_t _K_daddr_t

#define stat kernel_stat
#define new_stat kernel_stat
#include <asm/stat.h> 
#undef new_stat
#undef stat

/* There are quite a few things <linux/types.h> defines, which we don't
want */
#undef fd_set
#undef dev_t
#undef ino_t
#undef mode_t
#undef nlink_t
#undef off_t
#undef pid_t
#undef gid_t
#undef uid_t
#undef daddr_t


/* Now pull in libc's version of stat */
#define stat libc_stat
#include <sys/stat.h>
#undef stat

It works, but I can't say that I like it.

There's another compiler error that occurs when trying to build
mount.o:

syscalls.c: In function `mount':
syscalls.c:189: matching constraint references invalid operand number
syscalls.c:189: warning: `__res' might be used uninitialized in this
function

This appears to be a bug in include/asm/unistd.h ! That's where the 
_syscall macro definitions are, and syscall5 (which is what mount uses)
looks different from the others.  I tried changing it to the same
format as syscall4(), but then I get 
syscalls.c:189:  more than 10 operands in 'asm'
which I suppose is why it looks different from all the others in the 
first place :)  

Any suggestions?


-Matt


Thanks,
Matt

Beyond that, I get the following error in building mount.o



__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/





More information about the uClibc mailing list