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>
)
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})