5

I'm trying to cross-compile an SSH-server to port it on an home-made OS, using newlib (because the OS uses a lib which is based on newlib).

I got some troubles with the RedHat Newlib, and I was wondering if I can do my porting with another library (for example uclibc) ?

Is there differences between this 3 "libc" interfaces (libc, newlib, and uclibc) ?

Pierre
  • 1,162
  • 12
  • 29
  • It may be better to ask a question about implementing SSH on your particular target. An implementation with minimal system dependencies (i.e. one that does not assume that it is on an POSIX platform) would advised. However such a question may be off-topic for SO. – Clifford Dec 23 '15 at 11:11

2 Answers2

11

GNU libc (glibc) includes ISO C, POSIX, System V, and XPG interfaces. uClibc provides ISO C, POSIX and System V, while Newlib provides only ISO C.

While you might be able to port other libraries, they have specific OS dependencies. Unless your OS itself is POSIX compliant, it will probably be an unrealistic prospect.

Even with Newlib, it is your responsibility to implement the syscalls appropriately to support devices, file-systems and memory management.

Clifford
  • 88,407
  • 13
  • 85
  • 165
1

main difference is the size of the library, uclibc and newlib are focused on embedded systems so they want to be small and fast, while glibc is focused in full functionality.

so basically there might not be all functions in the embedded versions, but the standard c interfaces should be same in all c libraries. the datatypes might be different, especially names of fields in a structures are often not standardized.