Is the GNU C Library usable on non-GNU (or POSIX) platforms?

谁说胖子不能爱 提交于 2019-12-06 06:09:46

问题


Just wondering, is the GNU C Library (glibc) usable on non-GNU and/or non-POSIX platforms such as Microsoft Windows?


回答1:


Yes, its possible in theory, but not really worth it in practice. You would need to port the syscall interface, dynamic linker, and other parts to Windows or your platform of choice, and Glibc is not an ideal candidate for this.

If you really need a self contained C library, I would consider newlib or uClibc (or FreeBSD's/OpenBSD's libc) over glibc. Glibc is a complex beast, the alternatives are much smaller and easier to understand.




回答2:


It is provided that glibc has been ported to the kernel in question. It may however be easier to use Gnulib instead as a wrapper around the native API.



来源:https://stackoverflow.com/questions/4207585/is-the-gnu-c-library-usable-on-non-gnu-or-posix-platforms

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!