[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] cmake: fix SSP compiler flag check


Need to use CMAKE_REQUIRED_FLAGS when checking SSP, not
CMAKE_REQUIRED_DEFINITIONS.

Signed-off-by: Joel Carlson <JoelsonCarl@xxxxxxxxx>
---
Discovered the problem while running test builds after bumping the version
buildroot was grabbing from 1.1.1 to 1.1.2.

The issue was originally fixed in commit
d677b564c2193a5cd381925c2eeaad6b23c6af2f but was then broken again in commit
3cba65086482ede6e43f1f4b494f38287b44f720
---
 cmake/Modules/CheckCCompilerFlagSSP.cmake | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cmake/Modules/CheckCCompilerFlagSSP.cmake b/cmake/Modules/CheckCCompilerFlagSSP.cmake
index e421091..ab206ca 100644
--- a/cmake/Modules/CheckCCompilerFlagSSP.cmake
+++ b/cmake/Modules/CheckCCompilerFlagSSP.cmake
@@ -20,10 +20,10 @@
 include(CheckCSourceCompiles)
 
 macro(CHECK_C_COMPILER_FLAG_SSP _FLAG _RESULT)
-   set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
-   set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
+   set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+   set(CMAKE_REQUIRED_FLAGS "${_FLAG}")
 
    check_c_source_compiles("int main(int argc, char **argv) { char buffer[256]; return buffer[argc]=0;}" ${_RESULT})
 
-   set(CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
+   set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
 endmacro(CHECK_C_COMPILER_FLAG_SSP)
-- 
2.7.4


Follow-Ups:
Re: [PATCH] cmake: fix SSP compiler flag checkAndreas Schneider <asn@xxxxxxxxxxxxxx>