[uClibc]Sparc port

Mathew Bosworth (MTI) mbosworth at metaflow.com
Tue Mar 27 23:27:20 UTC 2001


On Tue, 27 Mar 2001, David Schleef wrote:

> On Tue, Mar 06, 2001 at 05:48:30PM -0800, Matt Bosworth wrote:
> > 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
> ...
> > /* Now pull in libc's version of stat */
> > #define stat libc_stat
> > #include <sys/stat.h>
> > #undef stat
>
>
> I think this is the correct way to solve the problem.  An alternative
> is to include appropriatly modified copies of headers from the
> different kernels we support, but I'm not sure if that's a 12 oz
> can or the giant 128 oz can of worms.
>
> (And, by the way, this change is necessary for powerpc as well.)

Dave,

	Actually, I that error was a fluke -- RedHat 7.0 comes with a
development version of gcc, which I used to build my cross compiler.  Something
in that chain was broken. . .  I rebuilt the native and the cross compilers
from the new 2.95.3 source, and all the problems went away.

	If you look in <sys/stat.h> all the defines are wrapped to avoid
the redefinitions.  At least, that's how it looks in sparc.   Something like:

#ifndef dev_t
typedef __dev_t dev_t;
#  define dev_t dev_t
#endif

# ifndef gid_t
typedef __gid_t gid_t;
#  define gid_t gid_t
# endif

etc. . .

	As soon as I get some other stuff off my plate, I'm back to getting
all the sysdeps/sparc files to work correctly.  Then I'll start sending in some
patches.


-Matt
>
>
>
>
> dave...
>
>
>
> _______________________________________________
> uclibc mailing list
> uclibc at uclibc.org
> http://uclibc.org/mailman/listinfo/uclibc
>






More information about the uClibc mailing list