Disable -fstack-protector on alpha architecture
authorAntigravity <antigravity@google.com>
Thu, 6 Aug 2026 11:30:12 +0000 (13:30 +0200)
committerAlexandre Detiste <tchet@debian.org>
Thu, 6 Aug 2026 11:30:12 +0000 (13:30 +0200)
Forwarded: not-needed

CMake hardcodes -fstack-protector-strong for GNU and Clang compilers, which overrides
dpkg-buildflags and causes build failures on alpha.

Gbp-Pq: Name alpha-no-fstack-protector.patch

cmake/compilers/Clang.cmake
cmake/compilers/GNU.cmake

index 3f9bdb50e59c48f04750e3f1ef4118a5a32ac9b0..5b58a2fa1ad9fcfe0ae6fa0fa1517fb9b6d5187f 100644 (file)
@@ -75,7 +75,10 @@ set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS}
     -Wformat -Wformat-security -Werror=format-security
     $<$<PLATFORM_ID:Windows>:-D_CRT_SECURE_NO_WARNINGS>
     $<$<NOT:$<PLATFORM_ID:Windows>>:-fPIC>
-    $<$<NOT:$<PLATFORM_ID:Emscripten>>:-fstack-protector-strong>)
+    )
+if (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "alpha")
+    set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$<NOT:$<PLATFORM_ID:Emscripten>>:-fstack-protector-strong>)
+endif()
 
 if (NOT APPLE AND NOT ANDROID_PLATFORM AND CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)" AND NOT WIN32)
     set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} -fstack-clash-protection)
index 5fb8e5a5db9640bc110b055a4df80ed2d2c41bdd..b15ffa0bc86b18df297049248e3ad8dff6371e07 100644 (file)
@@ -109,7 +109,10 @@ endif ()
 # Gnu flags to prevent compiler from optimizing out security checks
 set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv)
 set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security
-    -fstack-protector-strong )
+    )
+if (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "alpha")
+    set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fstack-protector-strong)
+endif()
 if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)" AND NOT EMSCRIPTEN)
     set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fcf-protection=full>)
 endif ()