1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-07-16 08:41:51 +03:00

cmake: Do not attempt to use -fstack-clash-protection on MacOS M1 chips

This is supported in clang, but only on x86_64 so we need to back down to the
architecture checks. Otherwise the checks pass with warning, but the build
itself fails with errors (-Werror).

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit dc18b41357)
This commit is contained in:
Jakub Jelen
2024-08-06 10:00:51 +02:00
parent 12077f7294
commit 9cdcd16e82

View File

@ -92,9 +92,12 @@ if (UNIX)
endif (WITH_STACK_PROTECTOR_STRONG) endif (WITH_STACK_PROTECTOR_STRONG)
if (NOT WINDOWS AND NOT CYGWIN) if (NOT WINDOWS AND NOT CYGWIN)
check_c_compiler_flag_ssp("-fstack-clash-protection" WITH_STACK_CLASH_PROTECTION) # apple m* chips do not support this option
if (WITH_STACK_CLASH_PROTECTION) if (NOT ${CMAKE_SYSTEM_PROCESSOR} STREQUAL arm64)
list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-clash-protection") check_c_compiler_flag_ssp("-fstack-clash-protection" WITH_STACK_CLASH_PROTECTION)
if (WITH_STACK_CLASH_PROTECTION)
list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-clash-protection")
endif()
endif() endif()
endif() endif()