当前位置: 首页 > 工具软件 > musl > 使用案例 >

musl Reference Manual

简意
2023-12-01

musl is an implementation of the C standard library built on top of the Linux system call API, including interfaces defined in the base language standard, POSIX, and widely agreed-upon extensions. musl is lightweight, fast, simple, free, and strives to be correct in the sense of standards-conformance and safety.

doc

https://musl.libc.org/

RISC-V (riscv64[-sp|-sf])

The default ABI is hard-float; soft-float and single-precision-only FPU variants are also available but experimental.
Only 64-bit is supported.

x86_64 / AMD64 (x86_64, x32)

Both the standard LP64 ABI and the “x32” ILP32 ABI are supported, but the latter is experimental.

ARM (arm[eb][hf])

All ARM targets use the EABI, which requires armv4t or later. The default target is little-endian and uses the standard EABI where floating point arguments are passed in general-purpose registers. Hard-float ABI and big-endian variants are also supported.

AArch64 (aarch64[_be])

The default AArch64 target is little-endian. A big-endian variant is also supported. This target is experimental.

Filesystem Layout Dependencies

/dev/null - device node, required by POSIX
/dev/tty - device node, required by POSIX
/tmp - required by POSIX to exist as a directory, and used by various temporary file creation functions.
/bin/sh - an executable file providing a POSIX-conforming shell
/proc - must be a mount point for Linux procfs or a symlink to such. Several functions such as realpath, fexecve, and a number of the “at” functions added in POSIX 2008 need access to /proc to function correctly.
( s y s l i b d i r ) / l d − m u s l − (syslibdir)/ld-musl- (syslibdir)/ldmusl(ARCH).so.1 - must resolve to the musl dynamic linker/libc.so binary in order for dynamic-linked programs to run. For static-linked programs it is unnecessary

Additional Files Used

/dev/log
/dev/shm
/dev/ptmx and /dev/pts
/etc/passwd and /etc/group
/var/run/nscd/socket -
/etc/shadow
/etc/tcb/user/shadow
/etc/resolv.conf
/etc/hosts
/etc/services
/etc/shells
/usr/share/zoneinfo
/etc/localtime
…/etc/ld-musl-$(ARCH).path, default path of “/lib:/usr/local/lib:/usr/lib” will be used. Not used by static-linked programs.

Environment Variables

PATH - Used by execvp, execlp, and posix_spawnp as specified in POSIX. If unset, a default search path of “/usr/local/bin:/bin:/usr/bin” is used.
PWD - Used by the nonstandard get_current_dir_name function; if it matches the actual current directory, it is returned instead of using getcwd to obtain the canonical pathname.
LOGNAME - The getlogin function simply returns the value of the LOGNAME variable.
LD_PRELOAD - Colon-separated list of shared libraries that will be preloaded by the dynamic linker before processing the application’s dependency list. Components can be absolute or relative pathnames or filenames in the default library search path. This variable is completely ignored in programs invoked setuid, setgid, or with other elevated capabilities.
LD_LIBRARY_PATH - Colon-separated list of pathnames that will be searched for shared libraries requested without an explicit pathname. This path is searched prior to the default path (which is specified in ( s y s l i b d i r ) / . . / e t c . l d − m u s l − (syslibdir)/../etc.ld-musl- (syslibdir)/../etc.ldmusl(ARCH).path with built-in default fallback if this file is missing). This variable is completely ignored in programs invoked setuid, setgid, or with other elevated capabilities.
LC_ALL, LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, and LANG - Used by setlocale and newlocale to determine a locale name to use when a zero-length string is passed. The precedence rules follow POSIX: LC_ALL overrides category-specific variables, and LANG provides a default for any category not set.
MUSL_LOCPATH - Colon-separated list of paths that will be searched for locale definitions. The requested locale name string will used as a filename and searched in each path component. If unset, locale files are not loaded and only the “C” locale is available. This variable is completely ignored in programs invoked setuid, setgid, or with other elevated capabilities.

 类似资料:

相关阅读

相关文章

相关问答