From b53c81faf19ffe3c6b6c72c16b17eaffc8521bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E5=81=A5?= Date: Thu, 2 Apr 2020 11:12:08 +0800 Subject: [PATCH 1/5] update README.md. --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index 4cb88ea..585ee48 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,39 @@ - 遵循C11 Annex K (Bounds-checking interfaces)的标准,选取并实现了常见的内存/字符串操作类的函数,如memcpy_s、strcpy_s等函数。 - 未来将分析C11 Annex K中的其他标准函数,如果有必要,将在该组织中实现。 - 处理边界检查函数的版本发布、更新以及维护。 + + +####构建方法 + +- 编译步骤 + +1. 调整项目的构建脚本,将src下的.c文件作为新的编译单元参加编译。 + +2. 在编译选项中指定头文件目录(例如:在CFLAGS中添加 -Ipath_to_include); + +3. 根据实际使用场景编译生成静态库或共享库使用。 + +- 编译示例: +``` +gcc -o memcpy_s.o src/memcpy_s.c -Iinclude +``` + + + + + + + + + + + + + + + + + + + + -- Gitee From 4111e619ce877ccb3b7548e2975a6e6b7b32d562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E5=81=A5?= Date: Thu, 2 Apr 2020 11:24:14 +0800 Subject: [PATCH 2/5] =?UTF-8?q?update=20README.md.=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=9E=84=E5=BB=BA=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 585ee48..2b22b8f 100644 --- a/README.md +++ b/README.md @@ -6,19 +6,21 @@ - 处理边界检查函数的版本发布、更新以及维护。 -####构建方法 +#### 构建方法 - 编译步骤 -1. 调整项目的构建脚本,将src下的.c文件作为新的编译单元参加编译。 +1. 将src下的.c文件添加到构建脚本的源码清单中。 -2. 在编译选项中指定头文件目录(例如:在CFLAGS中添加 -Ipath_to_include); +2. 在编译选项中指定头文件目录以及项目需要的编译选项(例如:在CFLAGS中添加 -Ipath_to_include -fstack-protector-strong -fPIC -Wall -D_FORTIFY_SOURCE=2 -O2)。 -3. 根据实际使用场景编译生成静态库或共享库使用。 +3. 为每个.c文件编译生成.o文件 。 + +4. 根据项目需要将.o文件生成静态库或共享库使用。 - 编译示例: ``` -gcc -o memcpy_s.o src/memcpy_s.c -Iinclude +gcc -o memcpy_s.o -c -Iinclude -fstack-protector-strong -fPIC -Wall -D_FORTIFY_SOURCE=2 -O2 src/memcpy_s.c ``` -- Gitee From deed13f24b4b4ce407f13b0f9523567b1ccdc64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E5=81=A5?= Date: Thu, 2 Apr 2020 11:38:12 +0800 Subject: [PATCH 3/5] update README.en.md. add Building methods --- README.en.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.en.md b/README.en.md index c905d57..d5b410d 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 +``` + + -- Gitee From 047cc733e10f128ef821714ac9f5cddc371e9229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E5=81=A5?= Date: Thu, 2 Apr 2020 11:38:50 +0800 Subject: [PATCH 4/5] update README.en.md. --- README.en.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.en.md b/README.en.md index d5b410d..6cec6c3 100644 --- a/README.en.md +++ b/README.en.md @@ -10,7 +10,7 @@ #### Building methods --compilation steps +- compilation steps 1. Add all the .c files under /src to the source code listing for the build script. @@ -21,7 +21,7 @@ 4. Generate static or shared libraries for .o files according to project requirements. --compiling examples: +- compiling examples: ``` gcc -o memcpy_s.o -c -Iinclude -fstack-protector-strong -fPIC -Wall -D_FORTIFY_SOURCE=2 -O2 src/memcpy_s.c ``` -- Gitee From fcfbe3cc2e192077b03f3c79b962629618842be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E5=81=A5?= Date: Thu, 2 Apr 2020 11:40:33 +0800 Subject: [PATCH 5/5] update README.md. --- README.md | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/README.md b/README.md index 2b22b8f..967b974 100644 --- a/README.md +++ b/README.md @@ -21,24 +21,4 @@ - 编译示例: ``` 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 -- Gitee