Skip to content

Commit

Permalink
droplet: enable compiler hardening
Browse files Browse the repository at this point in the history
  • Loading branch information
GarboMuffin committed Jul 7, 2024
1 parent 329a05b commit 328c4c9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions droplet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ project(droplet LANGUAGES C)

add_subdirectory(libwebsockets)

set(CMAKE_C_FLAGS_DEBUG "-g -Wall -pedantic ${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_RELEASE "-g -Wall -pedantic -O3 -march=native ${CMAKE_C_FLAGS_RELEASE}")
# we want -fhardened but we are using too old GCC
set(CMAKE_C_FLAGS_DEBUG "-g -Wall -pedantic -fsanitize=address -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -ftrivial-auto-var-init=zero -fPIE -pie -Wl,-z,relro,-z,now -fstack-protector-strong -fstack-clash-protection -fcf-protection=full ${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_RELEASE "-g -Wall -pedantic -O3 -march=native -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -ftrivial-auto-var-init=zero -fPIE -pie -Wl,-z,relro,-z,now -fstack-protector-strong -fstack-clash-protection -fcf-protection=full ${CMAKE_C_FLAGS_RELEASE}")

add_executable(
droplet
Expand Down

0 comments on commit 328c4c9

Please sign in to comment.