diff options
author | Sam James <sam@gentoo.org> | 2022-04-28 02:23:52 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-04-28 02:23:52 +0100 |
commit | 5ace694ca2a1bd0f49996845f9122569fd9b6c18 (patch) | |
tree | 3ca03b65ec5dd8d1aa512a2c20ca1ad3b4721740 /dev-cpp/tbb | |
parent | sys-libs/ncurses: modernise style a bit more (diff) | |
download | gentoo-5ace694ca2a1bd0f49996845f9122569fd9b6c18.tar.gz gentoo-5ace694ca2a1bd0f49996845f9122569fd9b6c18.tar.bz2 gentoo-5ace694ca2a1bd0f49996845f9122569fd9b6c18.zip |
dev-cpp/tbb: add flag stripping patch
Otherwise breaks with e.g. -Werror=format-security in *FLAGS.
Bug: https://github.com/oneapi-src/oneTBB/pull/716
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-cpp/tbb')
-rw-r--r-- | dev-cpp/tbb/files/tbb-2021.5.0-flags-stripping.patch | 27 | ||||
-rw-r--r-- | dev-cpp/tbb/tbb-2021.5.0-r1.ebuild | 2 |
2 files changed, 29 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() + + diff --git a/dev-cpp/tbb/tbb-2021.5.0-r1.ebuild b/dev-cpp/tbb/tbb-2021.5.0-r1.ebuild index aa3f0e7c26e2..8c4c5a5883a4 100644 --- a/dev-cpp/tbb/tbb-2021.5.0-r1.ebuild +++ b/dev-cpp/tbb/tbb-2021.5.0-r1.ebuild @@ -32,6 +32,8 @@ PATCHES=( "${FILESDIR}"/${PN}-2021.5.0-musl-mallinfo.patch # musl again, should be in.. 2022? "${FILESDIR}"/${PN}-2021.5.0-musl-setcontext.patch + + "${FILESDIR}"/${PN}-2021.5.0-flags-stripping.patch ) src_configure() { |