• Home
Name Date Size #Lines LOC

..--

Benchmark/22-Mar-2025-10,6688,838

arch/22-Mar-2025-22,07620,060

compat/time32/22-Mar-2025-1,105934

config/22-Mar-2025-435339

crt/22-Mar-2025-470370

dist/22-Mar-2025-3725

docs/22-Mar-2025-199161

etc/22-Mar-2025-4641

fuzztest/22-Mar-2025-169103

include/22-Mar-2025-20,21815,963

ldso/22-Mar-2025-11,96210,018

libc-test/22-Mar-2025-300,160244,099

porting/22-Mar-2025-202,800163,965

scripts/22-Mar-2025-1,9671,577

src/22-Mar-2025-101,60780,305

third_party/22-Mar-2025-349198

tools/22-Mar-2025-1,071835

.gitignoreD22-Mar-202561 98

.mailmapD22-Mar-202554 21

BUILD.gnD22-Mar-202514 KiB503437

COPYRIGHTD22-Mar-20256.1 KiB194170

INSTALLD22-Mar-20256.7 KiB197146

MakefileD22-Mar-20257.3 KiB238159

OAT.xmlD22-Mar-20256.9 KiB9342

README.OpenSourceD22-Mar-20251.5 KiB3129

README.mdD22-Mar-20251,020 2217

README_zh.mdD22-Mar-20255.5 KiB10991

VERSIOND22-Mar-20256 21

WHATSNEWD22-Mar-202593.7 KiB2,4411,931

bundle.jsonD22-Mar-20251.7 KiB6564

configureD22-Mar-202525.8 KiB844588

dynamic.listD22-Mar-2025508 5442

libc.map.txtD22-Mar-202533.4 KiB2,0442,042

musl_config.gniD22-Mar-20254.3 KiB154138

musl_src.gniD22-Mar-202569.1 KiB2,5242,497

musl_template.gniD22-Mar-202532.7 KiB1,1841,057

README.OpenSource

1[
2    {
3        "Name"                  : "musl",
4        "License"               : "MIT License",
5        "License File"          : "COPYRIGHT",
6        "Version Number"        : "1.2.5",
7        "Owner"                 : "zhaoxinyuan9@huawei.com",
8        "Upstream URL"          : "https://musl.libc.org",
9        "Description"           : "musl is an MIT-licensed implementation of the standard C library"
10    },
11    {
12        "Name"                  : "OpenBSD",
13        "License"               : "BSD License",
14        "License File"          : "LICENSE",
15        "Version Number"        : "7.4",
16        "Owner"                 : "fangting12@huawei.com",
17        "Upstream URL"          : "https://cvsweb.openbsd.org/src/lib/libc/string/",
18        "Description"           : "The OpenBSD project produces a FREE, multi-platform 4.4BSD-based UNIX-like operating system. We introduce some basic interface files to improve the interface performance of Musl"
19    },
20    {
21        "Name"                  : "NetBSD",
22        "License"               : "BSD License",
23        "License File"          : "LICEMSE",
24        "Version Number"        : "9.0",
25        "Owner"                 : "fangting12@huawei.com",
26        "Upstream URL"          : "https://github.com/NetBSD/src/tree/netbsd-9",
27        "Description"           : "NetBSD is a free, fast, secure, and highly portable Unix-like Open Source operating system. We introduce some basic interface files to improve the interface performance of Musl"
28    }
29]
30
31

README.md

1# musl libc
2
3musl, pronounced like the word "mussel", is an MIT-licensed
4implementation of the standard C library targetting the Linux syscall
5API, suitable for use in a wide range of deployment environments. musl
6offers efficient static and dynamic linking support, lightweight code
7and low runtime overhead, strong fail-safe guarantees under correct
8usage, and correctness in the sense of standards conformance and
9safety. musl is built on the principle that these goals are best
10achieved through simple code that is easy to understand and maintain.
11
12The 1.1 release series for musl features coverage for all interfaces
13defined in ISO C99 and POSIX 2008 base, along with a number of
14non-standardized interfaces for compatibility with Linux, BSD, and
15glibc functionality.
16
17For basic installation instructions, see the included INSTALL file.
18Information on full musl-targeted compiler toolchains, system
19bootstrapping, and Linux distributions built on musl can be found on
20the project website:http://www.musl-libc.org/
21
22

README_zh.md

1# Musl libc
2
3musl,是MIT授权的针对Linux系统调用的API的标准C库实现,适用于广泛的部署环境。musl提供了高效的静态和动态链接支持, 为轻量级代码并且运行时开销低,在正确使用时具有强大的故障安全保证,以及标准一致性意义上的正确性和安全性。musl建立的原则是使用便于理解和维护的简单代码来实现目标。
4
5musl的1.1版本系列涵盖了所有在ISO C99和POSIX 2008基础中定义的接口,以及一些非标准的为了与Linux、BSD和glibc功能兼容的接口。
6
7## 目录结构
8
9```
10README_zh.md            #中文说明
11include					#musl头文件
12ldso					#动态链接器
13libc-test				#关于musl的测试用例
14ndk_musl_include		#生成ndk版本的头文件
15ndk_script				#生成ndk版本的脚本
16porting                 #linux liteos平台对musl适配文件
17src						#musl文件源
18scripts					#测试用脚本
19```
20
21## Openharmony对于musl的适配
22
23musl编译框架时编译,使用BUILD.gn进行配置编译。
24
25基于openharmony的需求,为musl新增的特性:
26
27-  加载器地址随机化,RELRO共享机制
28-  提供加载器namespace机制
29-  OHOS容器中能够运行依赖bionic的库
30-  musl全球化接口适配locale数据能力
31-  mallocng堆内存分配器安全增强,默认开启meta指针混淆。地址随机化通过MALLOC_SECURE_ALL宏开关。可在编译命令中增加--gn-args="musl_secure_level=3"开启
32
33等。在新增特性基础上,也进行了对于musl接口功能的完善与错误的修复。
34
35## ICONV支持的字符集编码格式
36
37musl支持的字符集编码格式,以及受支持的别名。
38> **注意**
39>
40> 在进行字符集编码格式转换时,请使用正确的源字符集编码格式,且目标字符集编码格式必须支持这些受转换的字符,否则转换失败。
41> 在musl里不支持将源字符集编码格式转换成这五种目标字符集编码格式:gb18030,gbk,gb2312,big5和euckr。
42
43| 编码格式 | 别名                   | musl支持情况|
44|:--      |    :--                   |  :--:  |
45|utf8     |                          |  支持   |
46|wchart   |                          |  支持   |
47|ucs2be   |                          |  支持   |
48|ucs2le   |                          |  支持   |
49|utf16be  |                          |  支持   |
50|utf16le  |                          |  支持   |
51|ucs4be   |utf32be                   |  支持   |
52|ucs4le   |utf32le                   |  支持   |
53|ascii    |usascii, iso646, iso646us |  支持   |
54|utf16    |                          |  支持   |
55|ucs4     |utf32                     |  支持   |
56|ucs2     |                          |  支持   |
57|eucjp    |                          |  支持   |
58|shiftjis |sjis, cp932               |  支持   |
59|iso2022jp|                          |  支持   |
60|gb18030  |                          |  支持   |
61|gbk      |                          |  支持   |
62|gb2312   |                          |  支持   |
63|big5     |bigfive, cp950, big5hkscs |  支持   |
64|euckr    |ksc5601, ksx1001, cp949   |  支持   |
65|iso88591 |latin1                    |  支持   |
66|iso88592 |                          |  支持   |
67|iso88593 |                          |  支持   |
68|iso88594 |                          |  支持   |
69|iso88595 |                          |  支持   |
70|iso88596 |                          |  支持   |
71|iso88597 |                          |  支持   |
72|iso88598 |                          |  支持   |
73|iso88599 |                          |  支持   |
74|iso885910|                          |  支持   |
75|iso885911|tis620                    |  支持   |
76|iso885913|                          |  支持   |
77|iso885914|                          |  支持   |
78|iso885915|latin9                    |  支持   |
79|iso885916|                          |  支持   |
80|cp1250   |windows1250               |  支持   |
81|cp1251   |windows1251               |  支持   |
82|cp1252   |windows1252               |  支持   |
83|cp1253   |windows1253               |  支持   |
84|cp1254   |windows1254               |  支持   |
85|cp1255   |windows1255               |  支持   |
86|cp1256   |windows1256               |  支持   |
87|cp1257   |windows1257               |  支持   |
88|cp1258   |windows1258               |  支持   |
89|koi8r    |                          |  支持   |
90|koi8u    |                          |  支持   |
91|cp437    |                          |  支持   |
92|cp850    |                          |  支持   |
93|cp866    |                          |  支持   |
94|cp1047   |ibm1047                   |  支持   |
95
96## locale数据能力支持的接口
97
98|                 函数                 |               用途              |         返回值        |        支持的字符集       |
99| :--------------------------------: | :---------------------------: | :----------------: | :-----------------: |
100| int isalnum\_l(int c, locale\_t l) | 根据locale设置判断字符是否是数字或字母(包括大小写) | 参数c是数字或字符返回1,否则返回0 | zh\_CN、zh\_CN.UTF-8 |
101|                                    |                               |                    |                     |
102
103## Musl使用文档
104
105有关完整musl目标编译器工具链、系统的信息bootstrapping和基于musl构建的Linux发行版可以在官方网站上找到:http://www.musl-libc.org/
106
107有关基本安装说明,请参阅附带的[INSTALL](https://gitee.com/openharmony/third_party_musl/blob/master/INSTALL)文件。
108
109musl参考手册:https://musl.libc.org/doc/1.1.24/manual.html