lxcfs/0011-add-secure-compile-option-in-meson.patch

50 lines
1.0 KiB
Diff
Raw Normal View History

From cd4988df0a9f7140758c0429485322dc6d9467d5 Mon Sep 17 00:00:00 2001
From: vegbir <yangjiaqi16@huawei.com>
Date: Fri, 14 Jul 2023 07:54:27 +0000
Subject: [PATCH 11/15] add secure compile option in meson
Signed-off-by: vegbir <yangjiaqi16@huawei.com>
---
Makefile | 2 +-
meson.build | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 94f2021..38fbe04 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@
.PHONY: all
all: meson
- ninja -C build
+ ninja -v -C build
.PHONY: meson
meson:
diff --git a/meson.build b/meson.build
index a0289ad..7eb1f06 100644
--- a/meson.build
+++ b/meson.build
@@ -12,6 +12,7 @@ project(
'b_pie=true',
'c_std=gnu11',
'warning_level=2',
+ 'optimization=2',
],
meson_version: '>= 0.50')
@@ -109,6 +110,9 @@ possible_cc_flags = [
'-Wreturn-local-addr',
'-fsanitize=cfi',
'-Wstringop-overflow',
+ '-ftrapv',
+ '-fPIC',
+ '-D_FORTIFY_SOURCE=2',
]
possible_link_flags = [
--
2.41.0