Query regarding newlib and glibc
Jeff Johnston
jjohnstn@redhat.com
Wed Oct 20 08:58:00 GMT 2004
N.S.Neelakantan wrote:
> Hi all,
> I am planning to integrate glibc's Linux threading Library and Newlib.So can anyone who has enough exposure to both these libraries send out your remarks,suggesstions and comments.
> I need to know how complex is it to integrate these two libraries so that we get the advantages of both.
>
> With grace,
> N.S.Neelakantan
>
>
>
The x86-linux port (libc/sys/linux) already has glibc linuxthreads ported to it.
At the time I did it, nptl was still too young.
The newlib vanilla syscall layer is too restricted to support glibc's thread
code, however, some ports, like the linux port of newlib, do have a robust
syscall set.
If you look in libc/sys/linux and libc/sys/linux/linuxthreads you will note that
there is a machine subdirectory containing an i386 subdirectory. In these
directories you will find x86-specific code. Glibc has a different directory
mechanism for overriding files, but glibc has a much more robust OS set to
cover. Essentially, I tried to unravel what linux/machine code would be needed
for the x86.
Now, for any other linux platform, the machine subdirectories must be enhanced
to provide platform-specific glibc code. The most basic thing needed is the
assembler syscall mechanism.
It has been suggested that the libpth library might be integrated into newlib
for the non-linux situation. I had prototyped such a solution and abandoned it
because it could not fulfill the needs of the EL/IX standard due to the fact
that the threading model is non-preemptive. With all the recent requests for
threading, I need to dig this code out, provided it still exists. A number of
changes were required, but I can't think of them off-hand; it was a while ago.
-- Jeff J.
More information about the Newlib
mailing list