diff '--color=auto' -upr oneTBB-2023.0.0.orig/cmake/compilers/Clang.cmake oneTBB-2023.0.0/cmake/compilers/Clang.cmake
--- oneTBB-2023.0.0.orig/cmake/compilers/Clang.cmake	2026-05-14 05:27:04.063915633 +0300
+++ oneTBB-2023.0.0/cmake/compilers/Clang.cmake	2026-05-14 05:21:48.313089374 +0300
@@ -71,35 +71,11 @@ endif()
 # Clang flags to prevent compiler from optimizing out security checks
 # Don't use -fPIC, -fstack-clash-protection, -fcf-protection on Windows (not supported by Clang with MSVC toolchain)
 # Also disable CRT security warnings on Windows (getenv, strncpy, etc. are deprecated but TBB uses them)
-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 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)
-    if (NOT EMSCRIPTEN)
-        # Some versions of Clang implicitly set -march=i686 when compiling for x86 and some don't.
-        # -fcf-protection requires i686, so check -fcf-protection explicitly.
-        include(CheckCXXSourceCompiles)
-        set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
-        set(CMAKE_REQUIRED_FLAGS "-fcf-protection=full")
-        check_cxx_source_compiles("int main(int, char*[]) { return 0; }" CF_PROTECTION_FULL_SUPPORTED)
-        unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
-        unset(CMAKE_REQUIRED_FLAGS)
-
-        if (CF_PROTECTION_FULL_SUPPORTED)
-            set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} -fcf-protection=full)
-        else()
-            message(WARNING "Compiler does not support -fcf-protection=full.")
-        endif()
-    endif()
-endif()
+set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security -fPIC)
 
 # -z switch is not supported on MacOS and Windows
 if (NOT APPLE AND NOT WIN32)
-    set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now,-z,noexecstack)
+    set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,noexecstack)
 endif()
 
 set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS})
diff '--color=auto' -upr oneTBB-2023.0.0.orig/cmake/compilers/GNU.cmake oneTBB-2023.0.0/cmake/compilers/GNU.cmake
--- oneTBB-2023.0.0.orig/cmake/compilers/GNU.cmake	2026-05-14 05:27:04.063987034 +0300
+++ oneTBB-2023.0.0/cmake/compilers/GNU.cmake	2026-05-14 05:24:19.666595681 +0300
@@ -105,12 +105,7 @@ 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 (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 ()
-set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fstack-clash-protection>)
+set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security)
 
 # -z switch is not supported on MacOS and MinGW
 if (NOT APPLE AND NOT MINGW)
