linux下的各种c库

一:起源

Bloat comparisonmusluClibcdietlibcglibc
Complete .a set426k500k120k2.0M †
Complete .so set527k560k185k7.9M †
Smallest static C program1.8k5k0.2k662k
Static hello (using printf)13k70k6k662k
Dynamic overhead (min. dirty)20k40k40k48k
Static overhead (min. dirty)8k12k8k28k
Static stdio overhead (min. dirty)8k24k16k36k
Configurable featuresetnoyesminimalminimal
Behavior on resource exhaustionmusluClibcdietlibcglibc
Thread-local storagereports failureabortsn/aaborts
SIGEV_THREAD timersno failuren/an/alost overruns
pthread_cancelno failureabortsn/aaborts
regcomp and regexecreports failurecrashesreports failurecrashes
fnmatchno failureunknownno failurereports failure
printf familyno failureno failureno failurereports failure
strtol familyno failureno failureno failureno failure
Performance comparisonmusluClibcdietlibcglibc
Tiny allocation & free0.0050.0040.0130.002
Big allocation & free0.0270.0180.0230.016
Allocation contention, local0.0480.1340.3930.041
Allocation contention, shared0.0500.1320.3940.062
Zero-fill (memset)0.0230.0480.0550.012
String length (strlen)0.0810.0980.1610.048
Byte search (strchr)0.1420.2430.1980.028
Substring (strstr)0.0571.2731.0300.088
Thread creation/joining0.2480.12645.7610.142
Mutex lock/unlock0.0420.0550.7850.046
UTF-8 decode buffered0.0730.1400.2570.351
UTF-8 decode byte-by-byte0.1530.3950.2360.563
Stdio putc/getc0.2700.8087.7910.497
Stdio putc/getc unlocked0.2000.2820.2690.144
Regex compile0.0580.0410.0140.039
Regex search (a{25}b)0.1880.1880.9670.137
Self-exec (static linked)234µs245µs272µs457µs
Self-exec (dynamic linked)446µs590µs675µs864µs
ABI and versioning comparisonmusluClibcdietlibcglibc
Stable ABIyesnounofficiallyyes
LSB-compatible ABIincompletenonoyes
Backwards compatibilityyesnounofficiallyyes
Forwards compatibilityyesnounofficiallyno
Atomic upgradesyesnonono
Symbol versioningnononoyes
Algorithms comparisonmusluClibcdietlibcglibc
Substring search (strstr)twowaynaivenaivetwoway
Regular expressionsdfadfabacktrackingdfa
Sorting (qsort)smoothsortshellsortnaive quicksortintrosort
Allocator (malloc)musl-nativedlmallocdiet-nativeptmalloc
Features comparisonmusluClibcdietlibcglibc
Conformant printfyesyesnoyes
Exact floating point printingyesnonoyes
C99 math libraryyespartialnoyes
C11 threads APIyesnonono
C11 thread-local storageyesyesnoyes
GCC libstdc++ compatibilityyesyesnoyes
POSIX threadsyesyes, on most archsbrokenyes
POSIX process schedulingstubincorrectnoincorrect
POSIX thread priority schedulingyesyesnoyes
POSIX localedefnononoyes
Wide character interfacesyesyesminimalyes
Legacy 8-bit codepagesnoyesminimalslow, via gconv
Legacy CJK encodingsnononoslow, via gconv
UTF-8 multibytenative; 100% conformantnative; nonconformantdangerously nonconformantslow, via gconv; nonconformant
Iconv character conversionsmost major encodingsmainly UTFsnothe kitchen sink
Iconv transliteration extensionnononoyes
Openwall-style TCB shadowyesnonono
Sun RPC, NISnoyesyesyes
Zoneinfo (advanced timezones)yesnoyesyes
Gmon profilingnonoyesyes
Debugging featuresnononoyes
Various Linux extensionsyesyespartialyes
Target architectures comparisonmusluClibcdietlibcglibc
i386yesyesyesyes
x86_64yesyesyesyes
x86_64 x32 ABI (ILP32)experimentalnononon-conforming
ARMyesyesyesyes
Aarch64 (64-bit ARM)yesnonoyes
MIPSyesyesyesyes
SuperHyesyesnoyes
Microblazeyespartialnoyes
PowerPC (32- and 64-bit)yesyesyesyes
Sparcnoyesyesyes
Alphanoyesyesyes
S/390 (32-bit)nonoyesyes
S/390x (64-bit)yesnoyesyes
OpenRISC 1000 (or1k)yesnononot upstream
Motorola 680x0 (m68k)yesyesnoyes
MMU-less microcontrollersyes, elf/fdpicyes, bfltnono
Build environment comparisonmusluClibcdietlibcglibc
Legacy-code-friendly headerspartialyesnoyes
Lightweight headersyesnoyesno
Usable without native toolchainyesnoyesno
Respect for C namespaceyesLFS64 problemsnoLFS64 problems
Respect for POSIX namespaceyesLFS64 problemsnoLFS64 problems
Security/hardening comparisonmusluClibcdietlibcglibc
Attention to corner casesyesyesnotoo much malloc
Safe UTF-8 decoderyesyesnoyes
Avoids superlinear big-O'syessometimesnoyes
Stack smashing protectionyesyesnoyes
Heap corruption detectionyesnonoyes
Misc. comparisonsmusluClibcdietlibcglibc
LicenseMITLGPL 2.1GPL 2LGPL 2.1+ w/exceptions

 

 

 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值