diff mbox series

[meta-filesystems] f2fs-tools: Fix build with gcc-15

Message ID 20250403082208.440900-1-thond2009@gmail.com
State Under Review
Headers show
Series [meta-filesystems] f2fs-tools: Fix build with gcc-15 | expand

Commit Message

Nguyen Dat Tho April 3, 2025, 8:22 a.m. UTC
From: Nguyen Dat Tho <tho3.nguyen@lge.com>

To fix error: https://errors.yoctoproject.org/Errors/Details/850170/

Signed-off-by: Nguyen Dat Tho <tho3.nguyen@lge.com>
---
 ...-f2fs_fs.h-fix-std-c23-build-failure.patch | 42 +++++++++++++++++++
 .../f2fs-tools/f2fs-tools_1.16.0.bb           |  1 +
 2 files changed, 43 insertions(+)
 create mode 100644 meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools/0001-include-f2fs_fs.h-fix-std-c23-build-failure.patch

Comments

Khem Raj April 4, 2025, 12:01 a.m. UTC | #1
while it might fix gcc-15, it is regressing gcc-14 build see -
https://autobuilder.yoctoproject.org/valkyrie/#/builders/81/builds/539/steps/14/logs/stdio

On Thu, Apr 3, 2025 at 1:22 AM Nguyen Dat Tho via
lists.openembedded.org <thond2009=gmail.com@lists.openembedded.org>
wrote:
>
> From: Nguyen Dat Tho <tho3.nguyen@lge.com>
>
> To fix error: https://errors.yoctoproject.org/Errors/Details/850170/
>
> Signed-off-by: Nguyen Dat Tho <tho3.nguyen@lge.com>
> ---
>  ...-f2fs_fs.h-fix-std-c23-build-failure.patch | 42 +++++++++++++++++++
>  .../f2fs-tools/f2fs-tools_1.16.0.bb           |  1 +
>  2 files changed, 43 insertions(+)
>  create mode 100644 meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools/0001-include-f2fs_fs.h-fix-std-c23-build-failure.patch
>
> diff --git a/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools/0001-include-f2fs_fs.h-fix-std-c23-build-failure.patch b/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools/0001-include-f2fs_fs.h-fix-std-c23-build-failure.patch
> new file mode 100644
> index 0000000000..7b81b93715
> --- /dev/null
> +++ b/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools/0001-include-f2fs_fs.h-fix-std-c23-build-failure.patch
> @@ -0,0 +1,42 @@
> +From 4a66e47406a9c651ddba035e5f6e8b1f2cc90a40 Mon Sep 17 00:00:00 2001
> +From: Nguyen Dat Tho <tho3.nguyen@lge.com>
> +Date: Thu, 3 Apr 2025 12:37:26 +0900
> +Subject: [PATCH] include/f2fs_fs.h: fix -std=c23 build failure
> +
> +gcc-15 switched to -std=c23 by default:
> +
> +    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212
> +
> +As a result `f2fs-tools` fails as below, so only typedef u8 bool
> +for __STDC_VERSION__ <= 201710L (C17)
> +
> +In file included from ../../git/lib/libf2fs_zoned.c:11:
> +../../git/include/f2fs_fs.h:107:25: error: two or more data types in declaration specifiers
> +  107 | typedef u8              bool;
> +      |                         ^~~~
> +../../git/include/f2fs_fs.h:107:1: warning: useless type name in empty declaration
> +  107 | typedef u8              bool;
> +
> +Signed-off-by: Nguyen Dat Tho <tho3.nguyen@lge.com>
> +
> +Upstream-Status: Submitted [https://lore.kernel.org/linux-f2fs-devel/20250403040220.305573-1-thond2009@gmail.com/T/#u]
> +---
> + include/f2fs_fs.h | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
> +index f890634..1be77f1 100644
> +--- a/include/f2fs_fs.h
> ++++ b/include/f2fs_fs.h
> +@@ -103,7 +103,7 @@ typedef uint16_t   u16;
> + typedef uint8_t               u8;
> + typedef u32           block_t;
> + typedef u32           nid_t;
> +-#ifndef bool
> ++#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ <= 201710L
> + typedef u8            bool;
> + #endif
> + typedef unsigned long pgoff_t;
> +--
> +2.34.1
> +
> diff --git a/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.16.0.bb b/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.16.0.bb
> index 997fa1240a..48f20b7220 100644
> --- a/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.16.0.bb
> +++ b/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.16.0.bb
> @@ -9,6 +9,7 @@ DEPENDS = "util-linux"
>
>  SRCREV = "06c027abc6153c4a97cba5317844e8dcaaee3cf7"
>  SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git;branch=master \
> +           file://0001-include-f2fs_fs.h-fix-std-c23-build-failure.patch \
>             file://0002-f2fs_io-Define-_FILE_OFFSET_BITS-64.patch \
>             "
>  UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#116535): https://lists.openembedded.org/g/openembedded-devel/message/116535
> Mute This Topic: https://lists.openembedded.org/mt/112061986/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools/0001-include-f2fs_fs.h-fix-std-c23-build-failure.patch b/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools/0001-include-f2fs_fs.h-fix-std-c23-build-failure.patch
new file mode 100644
index 0000000000..7b81b93715
--- /dev/null
+++ b/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools/0001-include-f2fs_fs.h-fix-std-c23-build-failure.patch
@@ -0,0 +1,42 @@ 
+From 4a66e47406a9c651ddba035e5f6e8b1f2cc90a40 Mon Sep 17 00:00:00 2001
+From: Nguyen Dat Tho <tho3.nguyen@lge.com>
+Date: Thu, 3 Apr 2025 12:37:26 +0900
+Subject: [PATCH] include/f2fs_fs.h: fix -std=c23 build failure
+
+gcc-15 switched to -std=c23 by default:
+
+    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212
+
+As a result `f2fs-tools` fails as below, so only typedef u8 bool
+for __STDC_VERSION__ <= 201710L (C17)
+
+In file included from ../../git/lib/libf2fs_zoned.c:11:
+../../git/include/f2fs_fs.h:107:25: error: two or more data types in declaration specifiers
+  107 | typedef u8              bool;
+      |                         ^~~~
+../../git/include/f2fs_fs.h:107:1: warning: useless type name in empty declaration
+  107 | typedef u8              bool;
+
+Signed-off-by: Nguyen Dat Tho <tho3.nguyen@lge.com>
+
+Upstream-Status: Submitted [https://lore.kernel.org/linux-f2fs-devel/20250403040220.305573-1-thond2009@gmail.com/T/#u]
+---
+ include/f2fs_fs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
+index f890634..1be77f1 100644
+--- a/include/f2fs_fs.h
++++ b/include/f2fs_fs.h
+@@ -103,7 +103,7 @@ typedef uint16_t	u16;
+ typedef uint8_t		u8;
+ typedef u32		block_t;
+ typedef u32		nid_t;
+-#ifndef bool
++#if defined __STDC__ && defined __STDC_VERSION__ && __STDC_VERSION__ <= 201710L
+ typedef u8		bool;
+ #endif
+ typedef unsigned long	pgoff_t;
+-- 
+2.34.1
+
diff --git a/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.16.0.bb b/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.16.0.bb
index 997fa1240a..48f20b7220 100644
--- a/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.16.0.bb
+++ b/meta-filesystems/recipes-utils/f2fs-tools/f2fs-tools_1.16.0.bb
@@ -9,6 +9,7 @@  DEPENDS = "util-linux"
 
 SRCREV = "06c027abc6153c4a97cba5317844e8dcaaee3cf7"
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git;branch=master \
+           file://0001-include-f2fs_fs.h-fix-std-c23-build-failure.patch \
            file://0002-f2fs_io-Define-_FILE_OFFSET_BITS-64.patch \
            "
 UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"