diff options
Diffstat (limited to 'meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-Fix-checking-for-CFLAGS.patch')
-rw-r--r-- | meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-Fix-checking-for-CFLAGS.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-Fix-checking-for-CFLAGS.patch b/meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-Fix-checking-for-CFLAGS.patch new file mode 100644 index 0000000000..412e1c146d --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-Fix-checking-for-CFLAGS.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From e14502834fe6a9c6c9a439401ac3d2c8fd979267 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Sun, 8 Jun 2025 00:36:38 -0700 | ||
4 | Subject: [PATCH] CMakeLists.txt: Improve checking for CFLAGS | ||
5 | |||
6 | The previous log wasn't clear: | ||
7 | -- Performing Test found | ||
8 | -- Performing Test found - Success | ||
9 | -- Performing Test found | ||
10 | -- Performing Test found - Success | ||
11 | -- Performing Test found | ||
12 | -- Performing Test found - Failed | ||
13 | |||
14 | Use a new var compiler-supports${flag} will make it more clear: | ||
15 | -- Performing Test compiler-supports-fno-strict-overflow | ||
16 | -- Performing Test compiler-supports-fno-strict-overflow - Success | ||
17 | -- Performing Test compiler-supports-fno-delete-null-pointer-checks | ||
18 | -- Performing Test compiler-supports-fno-delete-null-pointer-checks - Success | ||
19 | -- Performing Test compiler-supports-fhardened | ||
20 | -- Performing Test compiler-supports-fhardened - Failed | ||
21 | |||
22 | Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/e14502834fe6a9c6c9a439401ac3d2c8fd979267] | ||
23 | |||
24 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
25 | --- | ||
26 | CMakeLists.txt | 5 ++--- | ||
27 | 1 file changed, 2 insertions(+), 3 deletions(-) | ||
28 | |||
29 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
30 | index 08e3e5274..f275c396b 100644 | ||
31 | --- a/CMakeLists.txt | ||
32 | +++ b/CMakeLists.txt | ||
33 | @@ -416,11 +416,10 @@ endif() | ||
34 | |||
35 | # try to ensure some compiler sanity and hardening options where supported | ||
36 | foreach (flag -fno-strict-overflow -fno-delete-null-pointer-checks -fhardened) | ||
37 | - check_c_compiler_flag(${flag} found) | ||
38 | - if (found) | ||
39 | + check_c_compiler_flag(${flag} compiler-supports${flag}) | ||
40 | + if (compiler-supports${flag}) | ||
41 | add_compile_options(${flag}) | ||
42 | endif() | ||
43 | - unset(found) | ||
44 | endforeach() | ||
45 | |||
46 | # generated sources | ||