提交 1734a5a3 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!2 补充项目构建方法

Merge pull request !2 from 刘嘉健/master
......@@ -7,3 +7,23 @@
- other standard functions in C11 Annex K will be analyzed in the future and implemented in this organization if necessary.
- handles the release, update, and maintenance of bounds_checking_function.
#### Building methods
- compilation steps
1. Add all the .c files under /src to the source code listing for the build script.
2. In the build options, specify the header directory and the build options required for the project (for example, add
-Ipath_to_include -fstack-protector-strong -fPIC -Wall -D_FORTIFY_SOURCE=2 -O2 in CFLAGS).
3. Generate .o files for each .c file.
4. Generate static or shared libraries for .o files according to project requirements.
- compiling examples:
```
gcc -o memcpy_s.o -c -Iinclude -fstack-protector-strong -fPIC -Wall -D_FORTIFY_SOURCE=2 -O2 src/memcpy_s.c
```
......@@ -4,3 +4,21 @@
- 遵循C11 Annex K (Bounds-checking interfaces)的标准,选取并实现了常见的内存/字符串操作类的函数,如memcpy_s、strcpy_s等函数。
- 未来将分析C11 Annex K中的其他标准函数,如果有必要,将在该组织中实现。
- 处理边界检查函数的版本发布、更新以及维护。
#### 构建方法
- 编译步骤
1. 将src下的.c文件添加到构建脚本的源码清单中。
2. 在编译选项中指定头文件目录以及项目需要的编译选项(例如:在CFLAGS中添加 -Ipath_to_include -fstack-protector-strong -fPIC -Wall -D_FORTIFY_SOURCE=2 -O2)。
3. 为每个.c文件编译生成.o文件 。
4. 根据项目需要将.o文件生成静态库或共享库使用。
- 编译示例:
```
gcc -o memcpy_s.o -c -Iinclude -fstack-protector-strong -fPIC -Wall -D_FORTIFY_SOURCE=2 -O2 src/memcpy_s.c
```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册