From 7e4d8189d853da0434d1596a7985e770c0d1457f Mon Sep 17 00:00:00 2001 From: Martijn van Beurden Date: Mon, 16 May 2022 21:35:12 +0200 Subject: [PATCH] [CMake] Remove _FORTIFY_SOURCE=1 on not having libssp Based on some information somewhere on the internet, CMakeLists.txt sets _FORTIFY_SOURCE=2 when its runtime functions are available and _FORTIFY_SOURCE=1 when they are not. However, _FORTIFY_SOURCE=1 also requires runtime functions. --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b6d0682..20b5db2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,10 +160,8 @@ add_compile_options( $<$,$>:-Weffc++> $<$,$>:-Wdeclaration-after-statement>) -if(HAVE_LIBSSP) # Implies WITH_FORTIFY_SOURCE +if(WITH_FORTIFY_SOURCE AND HAVE_LIBSSP) add_definitions(-D_FORTIFY_SOURCE=2) -else(WITH_FORTIFY_SOURCE) - add_definitions(-D_FORTIFY_SOURCE=1) endif() if(HAVE_STACK_PROTECTOR_FLAG AND HAVE_LIBSSP)