lxcfs: add secure compile options

Signed-off-by: zhangsong34 <zhangsong34@huawei.com>
This commit is contained in:
zhangsong34 2020-02-03 20:49:09 +08:00 committed by Grooooot
parent f980a81bec
commit 2b40522fc0
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,13 @@
diff --git a/Makefile.am b/Makefile.am
index ac6066d..f85646a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,6 +10,8 @@ AM_LDFLAGS = $(FUSE_LIBS) -pthread
#AM_CFLAGS += -DDEBUG
AM_CFLAGS += -DRUNTIME_PATH=\"$(RUNTIME_PATH)\"
+AM_CFLAGS += -Wl,-z,now -fPIE
+AM_LDFLAGS += -Wl,-z,now -pie
liblxcfs_la_SOURCES = macro.h bindings.c cpuset.c bindings.h
liblxcfs_la_CFLAGS = $(AM_CFLAGS)

View File

@ -31,6 +31,7 @@ Patch9018: 0018-lxcfs-add-proc-partitions.patch
Patch9019: 0019-use-bitwise-operators-only-on-unsigned.patch
Patch9020: 0020-lxcfs-proc_diskstats_read-func-obtain-data-from-blki.patch
Patch9021: 0021-remove-securec-functions.patch
Patch9022: 0022-add-secure-compile-option-in-Makefile.patch
#Dependency
BuildRequires: autoconf automake libtool help2man