diff options
| author | Khem Raj <raj.khem@gmail.com> | 2025-03-24 09:33:33 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-27 11:19:03 +0000 |
| commit | d7b46cb0790472931eff3a579d3c43c8a277a6d6 (patch) | |
| tree | 784f9f217d682cd5e5d067dec42ce77e76dce9f9 /meta/recipes-devtools | |
| parent | a6b876bc4880c597c5c2753702f4d1de3986448f (diff) | |
| download | poky-d7b46cb0790472931eff3a579d3c43c8a277a6d6.tar.gz | |
mtd-utils: Fix GCC version detection
Helps building with GCC with 0 in minor version e.g. 15.0.1
(From OE-Core rev: ed24490dccf348ba55816d45a2444d4bf0f574c8)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
| -rw-r--r-- | meta/recipes-devtools/mtd/files/0001-Improve-check-for-GCC-compiler-version.patch | 34 | ||||
| -rw-r--r-- | meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb | 3 |
2 files changed, 36 insertions, 1 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..3cd58e053d --- /dev/null +++ b/meta/recipes-devtools/mtd/files/0001-Improve-check-for-GCC-compiler-version.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | From e7adb21350ff3b96dbd2de56a127e9d916c08d62 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sat, 22 Mar 2025 19:05:32 -0700 | ||
| 4 | Subject: [PATCH] Improve check for GCC compiler version | ||
| 5 | |||
| 6 | When using unreleased compiler has version like | ||
| 7 | 15.0.1 and that test fails because __GNUC_MINOR__ < 1 | ||
| 8 | becomes true, therefore check for full version string | ||
| 9 | which is more rubust. | ||
| 10 | |||
| 11 | Upstream-Status: Submitted [https://lists.infradead.org/pipermail/linux-mtd/2025-March/108860.html] | ||
| 12 | Signed-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 | |||
| 17 | diff --git a/ubifs-utils/common/atomic.h b/ubifs-utils/common/atomic.h | ||
| 18 | index 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 | |||
diff --git a/meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb b/meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb index aa593ac14f..2f7043b977 100644 --- a/meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb +++ b/meta/recipes-devtools/mtd/mtd-utils_2.3.0.bb | |||
| @@ -16,7 +16,8 @@ SRC_URI = "git://git.infradead.org/mtd-utils.git;branch=master \ | |||
| 16 | file://0001-ubifs-utils-ubifs.h-Include-fcntl.h.patch \ | 16 | file://0001-ubifs-utils-ubifs.h-Include-fcntl.h.patch \ |
| 17 | file://0002-ubifs-utils-journal-Include-sys-stat.h.patch \ | 17 | file://0002-ubifs-utils-journal-Include-sys-stat.h.patch \ |
| 18 | file://0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch \ | 18 | file://0003-ubifs-utils-link-libmissing.a-in-case-execinfo.h-isn.patch \ |
| 19 | file://0004-ubifs-utils-extract_files-Include-linux-limits.h.patch" | 19 | file://0004-ubifs-utils-extract_files-Include-linux-limits.h.patch \ |
| 20 | file://0001-Improve-check-for-GCC-compiler-version.patch" | ||
| 20 | 21 | ||
| 21 | S = "${WORKDIR}/git" | 22 | S = "${WORKDIR}/git" |
| 22 | 23 | ||
