summaryrefslogtreecommitdiff
path: root/dev-cpp/tbb/files/tbb-2021.5.0-flags-stripping.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-05-12 16:42:50 +0300
committerV3n3RiX <venerix@koprulu.sector>2022-05-12 16:42:50 +0300
commit752d6256e5204b958b0ef7905675a940b5e9172f (patch)
tree330d16e6362a49cbed8875a777fe641a43376cd3 /dev-cpp/tbb/files/tbb-2021.5.0-flags-stripping.patch
parent0c100b7dd2b30e75b799d806df4ef899fd98e1ea (diff)
gentoo resync : 12.05.2022
Diffstat (limited to 'dev-cpp/tbb/files/tbb-2021.5.0-flags-stripping.patch')
-rw-r--r--dev-cpp/tbb/files/tbb-2021.5.0-flags-stripping.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/dev-cpp/tbb/files/tbb-2021.5.0-flags-stripping.patch b/dev-cpp/tbb/files/tbb-2021.5.0-flags-stripping.patch
new file mode 100644
index 000000000000..4252ea446423
--- /dev/null
+++ b/dev-cpp/tbb/files/tbb-2021.5.0-flags-stripping.patch
@@ -0,0 +1,27 @@
+https://github.com/oneapi-src/oneTBB/pull/716
+
+From 9595b9699ae6863d1e0cf770a89728eafcaf8845 Mon Sep 17 00:00:00 2001
+From: Christoph Erhardt <github@sicherha.de>
+Date: Wed, 5 Jan 2022 15:13:32 +0100
+Subject: [PATCH] Fix overeager stripping of compile flag
+
+The existing regex strips all occurrences of the given string from
+`${CMAKE_CXX_FLAGS}`, regardless of whether it is just a substring of a
+flag. For instance, `-Werror=format-security` gets truncated to
+`=format-security`.
+
+The new regex makes sure that only whole words get replaced.
+
+Signed-off-by: Christoph Erhardt <github@sicherha.de>
+--- a/cmake/utils.cmake
++++ b/cmake/utils.cmake
+@@ -18,7 +18,7 @@ macro(tbb_remove_compile_flag flag)
+ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS ${_tbb_compile_options})
+ unset(_tbb_compile_options)
+ if (CMAKE_CXX_FLAGS)
+- string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
++ string(REGEX REPLACE "(^|[ \t\r\n]+)${flag}($|[ \t\r\n]+)" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+ endif()
+ endmacro()
+
+