diff options
author | Benjamin Barenblat <bbarenblat@gmail.com> | 2022-01-27 10:52:49 -0500 |
---|---|---|
committer | Benjamin Barenblat <bbarenblat@gmail.com> | 2022-01-27 10:52:49 -0500 |
commit | 05343baf08b09b06c0ff847e7a446e35b42cecaf (patch) | |
tree | 307e12b040bba16556db2f20cc99809199aa5ae0 /build.ninja | |
parent | 07c61498bd7fa6166029c1ab093a35f82d926667 (diff) |
Add some extra hardening flags
Diffstat (limited to 'build.ninja')
-rw-r--r-- | build.ninja | 7 |
1 files 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 |