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 | 42 |
1 files changed, 15 insertions, 27 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 index ed270a5704..412e1c146d 100644 --- 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 | |||
@@ -1,18 +1,9 @@ | |||
1 | From 19f7ef341f19ac5594c7d0113f9eb8224934464a Mon Sep 17 00:00:00 2001 | 1 | From e14502834fe6a9c6c9a439401ac3d2c8fd979267 Mon Sep 17 00:00:00 2001 |
2 | From: Robert Yang <liezhi.yang@windriver.com> | 2 | From: Robert Yang <liezhi.yang@windriver.com> |
3 | Date: Sun, 8 Jun 2025 00:19:06 -0700 | 3 | Date: Sun, 8 Jun 2025 00:36:38 -0700 |
4 | Subject: [PATCH] CMakeLists.txt: Fix checking for CFLAGS | 4 | Subject: [PATCH] CMakeLists.txt: Improve checking for CFLAGS |
5 | 5 | ||
6 | The previous code doesn't work because the check_c_compiler_flag() only ran | 6 | The previous log wasn't clear: |
7 | once because 'found' is in CACHE, here is log: | ||
8 | -- Performing Test found | ||
9 | -- Performing Test found - Success | ||
10 | |||
11 | That would result in: | ||
12 | * All the flags are added when the first one works | ||
13 | * None of the flags is added when the first one doesn't work | ||
14 | |||
15 | We can use "unset(found CACHE)" to fix that, but the log is still not clear: | ||
16 | -- Performing Test found | 7 | -- Performing Test found |
17 | -- Performing Test found - Success | 8 | -- Performing Test found - Success |
18 | -- Performing Test found | 9 | -- Performing Test found |
@@ -20,15 +11,15 @@ We can use "unset(found CACHE)" to fix that, but the log is still not clear: | |||
20 | -- Performing Test found | 11 | -- Performing Test found |
21 | -- Performing Test found - Failed | 12 | -- Performing Test found - Failed |
22 | 13 | ||
23 | Use a new var SUPPORTS_${flag} will make it more clear: | 14 | Use a new var compiler-supports${flag} will make it more clear: |
24 | -- Performing Test SUPPORTS_-fno-strict-overflow | 15 | -- Performing Test compiler-supports-fno-strict-overflow |
25 | -- Performing Test SUPPORTS_-fno-strict-overflow - Success | 16 | -- Performing Test compiler-supports-fno-strict-overflow - Success |
26 | -- Performing Test SUPPORTS_-fno-delete-null-pointer-checks | 17 | -- Performing Test compiler-supports-fno-delete-null-pointer-checks |
27 | -- Performing Test SUPPORTS_-fno-delete-null-pointer-checks - Success | 18 | -- Performing Test compiler-supports-fno-delete-null-pointer-checks - Success |
28 | -- Performing Test SUPPORTS_-fhardened | 19 | -- Performing Test compiler-supports-fhardened |
29 | -- Performing Test SUPPORTS_-fhardened - Failed | 20 | -- Performing Test compiler-supports-fhardened - Failed |
30 | 21 | ||
31 | Upstream-Status: Submitted [https://github.com/rpm-software-management/rpm/pull/3796] | 22 | Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/e14502834fe6a9c6c9a439401ac3d2c8fd979267] |
32 | 23 | ||
33 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | 24 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> |
34 | --- | 25 | --- |
@@ -36,7 +27,7 @@ Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | |||
36 | 1 file changed, 2 insertions(+), 3 deletions(-) | 27 | 1 file changed, 2 insertions(+), 3 deletions(-) |
37 | 28 | ||
38 | diff --git a/CMakeLists.txt b/CMakeLists.txt | 29 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
39 | index 08e3e5274..a7566ab5a 100644 | 30 | index 08e3e5274..f275c396b 100644 |
40 | --- a/CMakeLists.txt | 31 | --- a/CMakeLists.txt |
41 | +++ b/CMakeLists.txt | 32 | +++ b/CMakeLists.txt |
42 | @@ -416,11 +416,10 @@ endif() | 33 | @@ -416,11 +416,10 @@ endif() |
@@ -45,14 +36,11 @@ index 08e3e5274..a7566ab5a 100644 | |||
45 | foreach (flag -fno-strict-overflow -fno-delete-null-pointer-checks -fhardened) | 36 | foreach (flag -fno-strict-overflow -fno-delete-null-pointer-checks -fhardened) |
46 | - check_c_compiler_flag(${flag} found) | 37 | - check_c_compiler_flag(${flag} found) |
47 | - if (found) | 38 | - if (found) |
48 | + check_c_compiler_flag(${flag} SUPPORTS_${flag}) | 39 | + check_c_compiler_flag(${flag} compiler-supports${flag}) |
49 | + if (SUPPORTS_${flag}) | 40 | + if (compiler-supports${flag}) |
50 | add_compile_options(${flag}) | 41 | add_compile_options(${flag}) |
51 | endif() | 42 | endif() |
52 | - unset(found) | 43 | - unset(found) |
53 | endforeach() | 44 | endforeach() |
54 | 45 | ||
55 | # generated sources | 46 | # generated sources |
56 | -- | ||
57 | 2.49.0 | ||
58 | |||