6

I recently had a conversation with a friend who is a highly skill software engineer, and he showed me some articles outlining the fact libc was much better than glibc.

I wonder if its possible to use libc instead, and what kind of problems would I come up against if I went this route?

3
  • 5
    That's kinda meaningless; "libc" is not a single thing, it's a family (of which glibc is a member). Whose libc? FreeBSD's?
    – geekosaur
    Apr 11, 2012 at 20:12
  • yeah i think he was being specific about freebsd when he was making the reference, my knowledge in this area is limited!
    – yakamok
    Apr 11, 2012 at 20:21
  • Quite meaningless is an understatement. He said it was "much better" in what way? Such statements are useless without elaboration. May 20, 2017 at 16:35

3 Answers 3

8

Context: assuming from above comments that a BSDish libc is meant.

I think it's been looked into, but libc tends to be tightly tied to a given kernel (glibc has an abstraction layer, which allows it some portability but causes the usual problems that an abstraction layer causes) and making BSD libc work with a Linux kernel would require a near complete rewrite. key system services are very different between the two systems (one example: BSD libc assumes that there are no pipes/FIFOs, because BSD uses socketpairs instead; conversely, Linux doesn't support pipe-compatible socketpairs).

Going the other direction (Debian has an experimental Linux userspace on a FreeBSD kernel, I think) is possible due to glibc's portability layer.

0
5

There are many libc implementations. It is possible and quite commmon to build a system using uClibc or EGLIBC. It's not even particularly difficult: try Buildroot.

2
  • fantastic recommendation, i am looking into this now
    – yakamok
    Apr 11, 2012 at 20:41
  • 1
    eglibc is virtually equivalent to glibc, for the purposes of this question.
    – jmtd
    Apr 12, 2012 at 13:09
0

Many software depends on glibc itself or glibc macroses or just glibc style so build fails. You can fix any software easy if you know glibc from inside. For example we can see here linux headers for musl. Headers are not finished but you can checkout commits and see how this work looks like.

Every developer tests its software using glibc based system. It is not possible to fix all live software development and make it compatible with other libc using right solution like pull request. So general purpose systems like gentoo can't be build using alternative libc without infinite pain.

Embedded developers (from openwrt for example) are fixing software versions and making a heavy work around it. So embedded system (like openwrt) only can provide a source that can be build with alternative libc like musl or uclibc.

The only painless and right way to replace glibc with other libc is to implement special wrapper that simulates all glibc behaviours using other libc. There is no such project today.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .