summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/mtd/files/0001-Improve-check-for-GCC-compiler-version.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/mtd/files/0001-Improve-check-for-GCC-compiler-version.patch')
-rw-r--r--meta/recipes-devtools/mtd/files/0001-Improve-check-for-GCC-compiler-version.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-devtools/mtd/files/0001-Improve-check-for-GCC-compiler-version.patch b/meta/recipes-devtools/mtd/files/0001-Improve-check-for-GCC-compiler-version.patch
new file mode 100644
index 0000000000..2329dfece3
--- /dev/null
+++ b/meta/recipes-devtools/mtd/files/0001-Improve-check-for-GCC-compiler-version.patch
@@ -0,0 +1,34 @@
1From e7adb21350ff3b96dbd2de56a127e9d916c08d62 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 22 Mar 2025 19:05:32 -0700
4Subject: [PATCH] Improve check for GCC compiler version
5
6When using unreleased compiler has version like
715.0.1 and that test fails because __GNUC_MINOR__ < 1
8becomes true, therefore check for full version string
9which is more rubust.
10
11Upstream-Status: Backport [https://github.com/sigma-star/mtd-utils/commit/ac0ab65ebcd7b11739986b81343457469fbb43b0]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 ubifs-utils/common/atomic.h | 6 +++++-
15 1 file changed, 5 insertions(+), 1 deletion(-)
16
17diff --git a/ubifs-utils/common/atomic.h b/ubifs-utils/common/atomic.h
18index f287d43..95754b2 100644
19--- a/ubifs-utils/common/atomic.h
20+++ b/ubifs-utils/common/atomic.h
21@@ -2,8 +2,12 @@
22 #ifndef __ATOMIC_H__
23 #define __ATOMIC_H__
24
25+#define GCC_VERSION (__GNUC__ * 10000 \
26+ + __GNUC_MINOR__ * 100 \
27+ + __GNUC_PATCHLEVEL__)
28+
29 /* Check GCC version, just to be safe */
30-#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC_MINOR__ < 1)
31+#if GCC_VERSION < 40100
32 # error atomic.h works only with GCC newer than version 4.1
33 #endif /* GNUC >= 4.1 */
34