CMake: Fix build on Solaris the stack_protector feature enabled

Solaris requires the ssp library to be linked when
-fstack-protector-strong is passed to the compiler.

Pick-to: 6.8
Fixes: QTBUG-129085
Change-Id: I55396fd9dc102ffd98bef54fc3dfc1aadf18a404
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Joerg Bornemann 2024-09-23 09:49:59 +02:00
parent 2ced94b410
commit 73875b8bb5

View File

@ -333,6 +333,9 @@ endif()
if(QT_FEATURE_stack_protector)
target_compile_options(PlatformCommonInternal INTERFACE -fstack-protector-strong)
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
target_link_libraries(PlatformCommonInternal INTERFACE ssp)
endif()
endif()
if(QT_FEATURE_stack_clash_protection)