From 83e59b98454f678150c24a0a7095dfc4418ad270 Mon Sep 17 00:00:00 2001 From: Starg Date: Sun, 19 Mar 2023 21:28:55 +0900 Subject: [PATCH] Enable stack protection --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 569d79d6..b775687c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -272,7 +272,8 @@ if(MSVC) -DSTDOUT_FILENO=1 ) else() - add_compile_options(-Wall -Wextra -Wno-missing-braces -ffast-math) + add_compile_definitions(_FORTIFY_SOURCE=2) + add_compile_options(-Wall -Wextra -Wno-missing-braces -ffast-math -fstack-protector-strong) if("${TIM41_GCC_WITH_LIBICONV}") add_compile_options(-finput-charset=cp932 -fexec-charset=cp932) -- 2.11.0