From 8f89f45f42273b40a93eb6e12762b1bec4033af5 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 23 Sep 2024 09:49:59 +0200 Subject: [PATCH] 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. Fixes: QTBUG-129085 Change-Id: I55396fd9dc102ffd98bef54fc3dfc1aadf18a404 Reviewed-by: Alexey Edelev (cherry picked from commit 73875b8bb5faf9f6ec1064704efaae76e33b0e35) Reviewed-by: Qt Cherry-pick Bot --- cmake/QtInternalTargets.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 60135355632..b95257cc69e 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -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)