About removing libc wrapper

Joerg Sonnenberger joerg at britannica.bec.de
Tue Dec 4 06:45:27 PST 2007


On Tue, Dec 04, 2007 at 12:03:41AM -0200, pcpa at mandriva.com.br wrote:
>   If modules depends only on libc, libm and libdl (and vendor
> provided libraries) there should not exist problems, but if modules
> start depending on external apis that change frequently, things can
> become a mess, and this is already somewhat true now that we
> don't have a single tree and single "make World".

It is not even as easy as that. libdl is a problem, because it doesn't
exist on the BSDs. libc has a lot of functions and many don't provide an
identical ABI on various platforms. Just to name a few things:
- you can't use ctype.h without undefining all macros
- you can't use stat(2) and friends
- you can't even use read(2) and write(2) without care (32bit vs 64bit)
- ...

If anyone would ever want to make a binary userland driver, it should
follow the approach used by Nvidia or Atheros for the kernel module.
Provide a blob and a stub wrapper. Compile / modify the wrapper to match
the target system and export a well defined ABI from it for the blob.

Joerg



More information about the xorg mailing list