diff --git a/README.en.md b/README.en.md index c905d57e51b80b9109123ed33c48157616e7eae2..6cec6c3d9ae353c8eb135ec21e9531db24611d5d 100644 --- a/README.en.md +++ b/README.en.md @@ -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 +``` + + diff --git a/README.md b/README.md index 4cb88ea74afd61d685d37206a940c8b0979631c3..967b974e8619b0790b11049451f371811261ca66 100644 --- a/README.md +++ b/README.md @@ -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