diff options
-rw-r--r-- | meta-oe/recipes-bsp/flashrom/flashrom/0001-linux_mtd-fix-build-with-clang-19.patch | 39 | ||||
-rw-r--r-- | meta-oe/recipes-bsp/flashrom/flashrom_1.4.0.bb | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/meta-oe/recipes-bsp/flashrom/flashrom/0001-linux_mtd-fix-build-with-clang-19.patch b/meta-oe/recipes-bsp/flashrom/flashrom/0001-linux_mtd-fix-build-with-clang-19.patch new file mode 100644 index 0000000000..46bd0bba44 --- /dev/null +++ b/meta-oe/recipes-bsp/flashrom/flashrom/0001-linux_mtd-fix-build-with-clang-19.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 615fae91dafdb89f0f8418129918dbb7ff879cf6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Arnaud Ferraris <arnaud.ferraris@collabora.com> | ||
3 | Date: Thu, 24 Oct 2024 17:51:29 +0200 | ||
4 | Subject: [PATCH] linux_mtd: fix build with clang >= 19 | ||
5 | |||
6 | Starting with version 19, clang issues a warning when using `strlen()` | ||
7 | for initializing a static array's size. This causes the build to fail as | ||
8 | the project also sets `-Werror`. | ||
9 | |||
10 | This is fixed by using `sizeof()` instead, which is guaranteed to be | ||
11 | evaluated at compilation time and therefore not triggering the | ||
12 | problematic warning. | ||
13 | |||
14 | Upstream-Status: Backport [https://github.com/flashrom/flashrom/commit/34b1a6aa57e910c0b5a518e8a0cab6841c7efaee] | ||
15 | |||
16 | Change-Id: If470a65702e9ae08e4303123a0014e53a1fee56e | ||
17 | Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com> | ||
18 | Reviewed-on: https://review.coreboot.org/c/flashrom/+/84856 | ||
19 | Tested-by: build bot (Jenkins) <no-reply@coreboot.org> | ||
20 | Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com> | ||
21 | Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> | ||
22 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
23 | --- | ||
24 | linux_mtd.c | 2 +- | ||
25 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
26 | |||
27 | diff --git a/linux_mtd.c b/linux_mtd.c | ||
28 | index eea0cf2..0cb2330 100644 | ||
29 | --- a/linux_mtd.c | ||
30 | +++ b/linux_mtd.c | ||
31 | @@ -49,7 +49,7 @@ static int read_sysfs_string(const char *sysfs_path, const char *filename, char | ||
32 | int i; | ||
33 | size_t bytes_read; | ||
34 | FILE *fp; | ||
35 | - char path[strlen(LINUX_MTD_SYSFS_ROOT) + 32]; | ||
36 | + char path[sizeof(LINUX_MTD_SYSFS_ROOT) + 31]; | ||
37 | |||
38 | snprintf(path, sizeof(path), "%s/%s", sysfs_path, filename); | ||
39 | |||
diff --git a/meta-oe/recipes-bsp/flashrom/flashrom_1.4.0.bb b/meta-oe/recipes-bsp/flashrom/flashrom_1.4.0.bb index 98447809cf..6c5d05f2d0 100644 --- a/meta-oe/recipes-bsp/flashrom/flashrom_1.4.0.bb +++ b/meta-oe/recipes-bsp/flashrom/flashrom_1.4.0.bb | |||
@@ -6,6 +6,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | |||
6 | SRC_URI = "https://download.flashrom.org/releases/flashrom-v${PV}.tar.xz \ | 6 | SRC_URI = "https://download.flashrom.org/releases/flashrom-v${PV}.tar.xz \ |
7 | file://0001-flashrom-Mark-RISCV-as-non-memory-mapped-I-O-archite.patch \ | 7 | file://0001-flashrom-Mark-RISCV-as-non-memory-mapped-I-O-archite.patch \ |
8 | file://0002-meson-Add-options-pciutils-ftdi-usb.patch \ | 8 | file://0002-meson-Add-options-pciutils-ftdi-usb.patch \ |
9 | file://0001-linux_mtd-fix-build-with-clang-19.patch \ | ||
9 | " | 10 | " |
10 | 11 | ||
11 | SRC_URI[sha256sum] = "eb0eb3e61a57fd1926c66f08664cf04a96f92cee23b600cf563087c2178d70d8" | 12 | SRC_URI[sha256sum] = "eb0eb3e61a57fd1926c66f08664cf04a96f92cee23b600cf563087c2178d70d8" |