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

Re: [PATCH] cmake: fix SSP compiler flag check


On Wednesday, 29 August 2018 19:46:18 CEST Joel Carlson wrote:
> Need to use CMAKE_REQUIRED_FLAGS when checking SSP, not
> CMAKE_REQUIRED_DEFINITIONS.

Damn, I reintroduced that issue.

Fixed, thanks!
 
> 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)


-- 
Andreas Schneider                 asn@xxxxxxxxxxxxxx
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D



References:
[PATCH] cmake: fix SSP compiler flag checkJoel Carlson <joelsoncarl@xxxxxxxxx>