Skip to content

Commit

Permalink
Always build with -fhardened if the compiler supports it
Browse files Browse the repository at this point in the history
This enables all manner of highly useful safety checks that we generally
want enabled.
  • Loading branch information
pmatilai authored and dmnks committed Nov 14, 2024
1 parent 69306a9 commit 7713b8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ if (ENABLE_ASAN OR ENABLE_UBSAN)
add_compile_options(-fno-omit-frame-pointer)
endif()

# try to ensure some compiler sanity
foreach (flag -fno-strict-overflow -fno-delete-null-pointer-checks)
# try to ensure some compiler sanity and hardening options where supported
foreach (flag -fno-strict-overflow -fno-delete-null-pointer-checks -fhardened)
check_c_compiler_flag(${flag} found)
if (found)
add_compile_options(${flag})
Expand Down

0 comments on commit 7713b8f

Please sign in to comment.