- 论坛徽章:
- 0
|
如题,libc不就是c写的供调用的函数吗?为什么同是linux glibc不一样?为什么机器不同(比如:mips IA64 ARM)glibc也不同?是不是glibc中大部分是与这些无关的?
glibc porting的说法:
All the machine-dependent and operating system-dependent files in the library are in the subdirectory sysdeps under the top-level library source directory. This directory contains a hierarchy of subdirectories (see Hierarchy Conventions).
Each subdirectory of sysdeps contains source files for a particular machine or operating system, or for a class of machine or operating system (for example, systems by a particular vendor, or all machines that use IEEE 754 floating-point format). A configuration specifies an ordered list of these subdirectories. Each subdirectory implicitly appends its parent directory to the list. For example, specifying the list unix/bsd/vax is equivalent to specifying the list unix/bsd/vax unix/bsd unix. A subdirectory can also specify that it implies other subdirectories which are not directly above it in the directory hierarchy. If the file Implies exists in a subdirectory, it lists other subdirectories of sysdeps which are appended to the list, appearing after the subdirectory containing the Implies file. Lines in an Implies file that begin with a ‘#’ character are ignored as comments. For example, unix/bsd/Implies contains:
# BSD has Internet-related things.
unix/inet
and unix/Implies contains:
posix
So the final list is unix/bsd/vax unix/bsd unix/inet unix posix.
sysdeps has a “special” subdirectory called generic. It is always implicitly appended to the list of subdirectories, so you needn't put it in an Implies file, and you should not create any subdirectories under it intended to be new specific categories. generic serves two purposes. First, the makefiles do not bother to look for a system-dependent version of a file that's not in generic. This means that any system-dependent source file must have an analogue in generic, even if the routines defined by that file are not implemented on other platforms. Second, the generic version of a system-dependent file is used if the makefiles do not find a version specific to the system you're compiling for.
///////////////////////////////////////////////////////////////////
支持的操作系统和机器:
Version 2 currently supports only GNU systems (both Hurd-based and Linux-based). The list of supported architectures is
GNU/Hurd. We believe all platforms the Hurd runs on are also supported by GNU libc.
GNU/Linux. GNU libc works with the Linux kernel, version 2.0.10 or later, on the following architectures:
Intel ix86
Motorola 680x0
DEC Alpha
PowerPC (32 and 64 bit)
Sparc
Sparc64
ARM
MIPS (Kernels > 2.2.15)
Intel IA64 (Kernels > 2.4.0)
IBM S/390 (32 and 64 bit)
SH
CRIS
AMD x86-64 |
|