summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/files/0001-CMakeLists.txt-Fix-checking-for-CFLAGS.patch
diff options
context:
space:
mode:
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.patch46
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 @@
1From e14502834fe6a9c6c9a439401ac3d2c8fd979267 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Sun, 8 Jun 2025 00:36:38 -0700
4Subject: [PATCH] CMakeLists.txt: Improve checking for CFLAGS
5
6The 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
14Use 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
22Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/e14502834fe6a9c6c9a439401ac3d2c8fd979267]
23
24Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
25---
26 CMakeLists.txt | 5 ++---
27 1 file changed, 2 insertions(+), 3 deletions(-)
28
29diff --git a/CMakeLists.txt b/CMakeLists.txt
30index 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