From 05343baf08b09b06c0ff847e7a446e35b42cecaf Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Thu, 27 Jan 2022 10:52:49 -0500 Subject: Add some extra hardening flags --- build.ninja | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build.ninja b/build.ninja index e63787f..0a1e30b 100644 --- a/build.ninja +++ b/build.ninja @@ -17,15 +17,16 @@ ninja_required_version = 1.3 rule cxx command = g++ -MD -MT $out -MF $out.d -pipe -std=c++20 -Wall -Wextra $ -Wno-sign-compare -fdiagnostics-show-template-tree -O3 -flto $ - -fstack-protector-strong -Wformat -Werror=format-security -DNDEBUG $ - -ffunction-sections -fdata-sections -c $in -o $out + -fstack-protector-strong -Wformat -Werror=format-security $ + -D_FORTIFY_SOURCE=2 -DNDEBUG -ffunction-sections -fdata-sections -c $in -o $ + $out description = Compiling $out depfile = $out.d deps = gcc rule link command = g++ -fuse-ld=gold -flto -Wl,-O2 -Wl,--gc-sections -Wl,--as-needed $ - -o $out $in && strip $out + -Wl,-z,relro -o $out $in && strip $out description = Linking $out rule re2c -- cgit v1.2.3