summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens2023-10-30 20:39:26 +0000
committerHauke Mehrtens2023-10-31 11:45:22 +0000
commit44365eb1e1165f2a44cb31f404b04cf85031718e (patch)
treecd5ab732b5651fc56837ba9dd01e8572d4d3a17e
parent7aefb47be57df0467d97d539f7fe9e23e607a3b4 (diff)
downloadurngd-44365eb1e1165f2a44cb31f404b04cf85031718e.tar.gz
Deactivate _FORTIFY_SOURCE in jitterentropy-base.c
This fixes compilation with glibc. _FORTIFY_SOURCE only works with compiler optimizations activated. We have to deactivate it when we set -O0. This fixes the following error message with glibc: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp] musl libc does not show an error message in this case, but has the same internal problems. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--CMakeLists.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a1ee0c1..f415f87 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,8 +22,11 @@ ADD_EXECUTABLE(urngd
)
TARGET_LINK_LIBRARIES(urngd ${ubox})
-# jitter RNG must not be compiled with optimizations
-SET_SOURCE_FILES_PROPERTIES(${JTEN_DIR}/jitterentropy-base.c PROPERTIES COMPILE_FLAGS -O0)
+# jitter RNG must not be compiled with optimizations, _FORTIFY_SOURCE needs optimizations
+SET_PROPERTY(
+ SOURCE ${JTEN_DIR}/jitterentropy-base.c
+ APPEND PROPERTY COMPILE_OPTIONS -U_FORTIFY_SOURCE -O0
+)
INSTALL(TARGETS urngd RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})