Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-cpp/tbb/, dev-cpp/tbb/files/
Date: Thu, 28 Apr 2022 01:26:48
Message-Id: 1651109032.5ace694ca2a1bd0f49996845f9122569fd9b6c18.sam@gentoo
1 commit: 5ace694ca2a1bd0f49996845f9122569fd9b6c18
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Apr 28 01:23:52 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Apr 28 01:23:52 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ace694c
7
8 dev-cpp/tbb: add flag stripping patch
9
10 Otherwise breaks with e.g. -Werror=format-security in *FLAGS.
11
12 Bug: https://github.com/oneapi-src/oneTBB/pull/716
13 Signed-off-by: Sam James <sam <AT> gentoo.org>
14
15 .../tbb/files/tbb-2021.5.0-flags-stripping.patch | 27 ++++++++++++++++++++++
16 dev-cpp/tbb/tbb-2021.5.0-r1.ebuild | 2 ++
17 2 files changed, 29 insertions(+)
18
19 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
20 new file mode 100644
21 index 000000000000..4252ea446423
22 --- /dev/null
23 +++ b/dev-cpp/tbb/files/tbb-2021.5.0-flags-stripping.patch
24 @@ -0,0 +1,27 @@
25 +https://github.com/oneapi-src/oneTBB/pull/716
26 +
27 +From 9595b9699ae6863d1e0cf770a89728eafcaf8845 Mon Sep 17 00:00:00 2001
28 +From: Christoph Erhardt <github@××××××××.de>
29 +Date: Wed, 5 Jan 2022 15:13:32 +0100
30 +Subject: [PATCH] Fix overeager stripping of compile flag
31 +
32 +The existing regex strips all occurrences of the given string from
33 +`${CMAKE_CXX_FLAGS}`, regardless of whether it is just a substring of a
34 +flag. For instance, `-Werror=format-security` gets truncated to
35 +`=format-security`.
36 +
37 +The new regex makes sure that only whole words get replaced.
38 +
39 +Signed-off-by: Christoph Erhardt <github@××××××××.de>
40 +--- a/cmake/utils.cmake
41 ++++ b/cmake/utils.cmake
42 +@@ -18,7 +18,7 @@ macro(tbb_remove_compile_flag flag)
43 + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS ${_tbb_compile_options})
44 + unset(_tbb_compile_options)
45 + if (CMAKE_CXX_FLAGS)
46 +- string(REGEX REPLACE ${flag} "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
47 ++ string(REGEX REPLACE "(^|[ \t\r\n]+)${flag}($|[ \t\r\n]+)" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
48 + endif()
49 + endmacro()
50 +
51 +
52
53 diff --git a/dev-cpp/tbb/tbb-2021.5.0-r1.ebuild b/dev-cpp/tbb/tbb-2021.5.0-r1.ebuild
54 index aa3f0e7c26e2..8c4c5a5883a4 100644
55 --- a/dev-cpp/tbb/tbb-2021.5.0-r1.ebuild
56 +++ b/dev-cpp/tbb/tbb-2021.5.0-r1.ebuild
57 @@ -32,6 +32,8 @@ PATCHES=(
58 "${FILESDIR}"/${PN}-2021.5.0-musl-mallinfo.patch
59 # musl again, should be in.. 2022?
60 "${FILESDIR}"/${PN}-2021.5.0-musl-setcontext.patch
61 +
62 + "${FILESDIR}"/${PN}-2021.5.0-flags-stripping.patch
63 )
64
65 src_configure() {