[Buildroot] [PATCH] package/libfuse3: bump to version 3.12.0

Giulio Benetti giulio.benetti at benettiengineering.com
Tue Sep 13 23:42:10 UTC 2022


This patch is not enough. I've realized only now that __APPLE__ doesn't
support SYMVER at all and FUSE_SYMVER macro can use symver attribute as
well as assembly symver directive, so please drop this patch.

I'll send a fixed version of this one once realized how to fix the
problem upstream.

Sorry for the noise

Best regards
-- 
Giulio Benetti
Benetti Engineering sas

On 14/09/22 01:26, Giulio Benetti wrote:
> This new version needs a patch to deal with a build failure when SYMVER
> is not available. As described in the patch itself there is a #define
> in low_level.h header that is included in helper.c; that defines twice
> the same function because:
> in low_level.h:
> ```
> int fuse_parse_cmdline_312(struct fuse_args *args,
> 			   struct fuse_cmdline_opts *opts);
> #define fuse_parse_cmdline(args, opts) fuse_parse_cmdline_312(args, opts)
> ```
> While in helper.c:
> ```
> int fuse_parse_cmdline_312(struct fuse_args *args,
> 			   struct fuse_cmdline_opts *opts)
> {
> 	....
> }
> 
> int fuse_parse_cmdline(struct fuse_args *args,
> 		       struct fuse_cmdline_opts *opts)
> {
> 	....
> }
> ```
> and:
> #define fuse_parse_cmdline(args, opts) fuse_parse_cmdline_312(args, opts)
> makes helper.c expands to:
> ```
> int fuse_parse_cmdline_312(struct fuse_args *args,
> 			   struct fuse_cmdline_opts *opts)
> {
> 	....
> }
> 
> int fuse_parse_cmdline_312(struct fuse_args *args,
> 		       struct fuse_cmdline_opts *opts)
> {
> 	....
> }
> ```
> though fuse_parse_cmdline_312() defined twice. To fix this patch moves
> all the checking for FUSE_MAKE_VERSION into helper.c and doesn't redirect
> fuse_parse_cmdline() using #define in low_level.h. While doing this patch
> also uses HAVE_SYMVER_ATTRIBUTE instead of checking against __UCLIBC__
> and __APPLE__. This because __UCLIBC__ can support SYMVER and in this case
> we would end up to have a double definition of fuse_parse_cmdline()
> instead.
> 
> Patch is pending upstream:
> https://github.com/libfuse/libfuse/pull/698
> 
> Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
> ---
>   ...e-with-uclibc-using-HAVE_SYMVER_ATTR.patch | 101 ++++++++++++++++++
>   package/libfuse3/libfuse3.hash                |   2 +-
>   package/libfuse3/libfuse3.mk                  |   2 +-
>   3 files changed, 103 insertions(+), 2 deletions(-)
>   create mode 100644 package/libfuse3/0001-Fix-build-failure-with-uclibc-using-HAVE_SYMVER_ATTR.patch
> 
> diff --git a/package/libfuse3/0001-Fix-build-failure-with-uclibc-using-HAVE_SYMVER_ATTR.patch b/package/libfuse3/0001-Fix-build-failure-with-uclibc-using-HAVE_SYMVER_ATTR.patch
> new file mode 100644
> index 0000000000..4886a54ca4
> --- /dev/null
> +++ b/package/libfuse3/0001-Fix-build-failure-with-uclibc-using-HAVE_SYMVER_ATTR.patch
> @@ -0,0 +1,101 @@
> +From f4e9e90660837576a3d772eca479485c55db3e91 Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti at benettiengineering.com>
> +Date: Thu, 8 Sep 2022 23:37:19 +0200
> +Subject: [PATCH] Fix build failure with uclibc using HAVE_SYMVER_ATTRIBUTE
> + macro and moving handling to helper.c file
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Building with uclibc leads to failure:
> +```
> +FAILED: lib/libfuse3.so.3.12.0.p/helper.c.o.
> +/home/giuliobenetti/git/upstream/test-libfuse3/bootlin-armv5-uclibc/host/bin/arm-linux-gcc -Ilib/libf
> +In file included from ../lib/fuse_i.h:10,
> +                 from ../lib/helper.c:14:
> +../include/fuse_lowlevel.h:1921:40: error: redefinition of ‘fuse_parse_cmdline_312’
> + 1921 | #define fuse_parse_cmdline(args, opts) fuse_parse_cmdline_312(args, opts)
> +      |                                        ^~~~~~~~~~~~~~~~~~~~~~
> +../lib/helper.c:258:5: note: in expansion of macro ‘fuse_parse_cmdline’
> +  258 | int fuse_parse_cmdline(struct fuse_args *args,
> +      |     ^~~~~~~~~~~~~~~~~~
> +../lib/helper.c:208:5: note: previous definition of ‘fuse_parse_cmdline_312’ was here
> +  208 | int fuse_parse_cmdline_312(struct fuse_args *args,
> +```
> +This happens because uclibc, depending on version, can support symver, so
> +if symver is supported and uclibc is used function fuse_parse_cmdline_312()
> +will be defined twice:
> +1. the function itself with symver
> +2. fuse_parse_cmdline() as the #define of fuse_parse_cmdline_312() and its
> +prototype
> +This leads to have the redefinition of ‘fuse_parse_cmdline_312’.
> +
> +To solve this let's check against HAVE_SYMVER_ATTRIBUTE instead of
> +__UCLIBC__ and __APPLE__ and move all the checks of FUSE_USE_VERSION to
> +helper.c file instead of fuse_lowlevel.h with #define fuse_parse_cmdline
> +that defines fuse_parse_cmdline_312() twice in helper.c leading to the
> +error above.
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti at benettiengineering.com>
> +---
> +Pending upstream:
> +https://github.com/libfuse/libfuse/pull/698
> +---
> + include/fuse_lowlevel.h | 12 ------------
> + lib/helper.c            |  9 ++++++---
> + 2 files changed, 6 insertions(+), 15 deletions(-)
> +
> +diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
> +index 53f0fcf..3e43efc 100644
> +--- a/include/fuse_lowlevel.h
> ++++ b/include/fuse_lowlevel.h
> +@@ -1907,20 +1907,8 @@ struct fuse_cmdline_opts {
> +  * @param opts output argument for parsed options
> +  * @return 0 on success, -1 on failure
> +  */
> +-#if (!defined(__UCLIBC__) && !defined(__APPLE__))
> + int fuse_parse_cmdline(struct fuse_args *args,
> + 		       struct fuse_cmdline_opts *opts);
> +-#else
> +-#if FUSE_USE_VERSION < FUSE_MAKE_VERSION(3, 12)
> +-int fuse_parse_cmdline_30(struct fuse_args *args,
> +-			   struct fuse_cmdline_opts *opts);
> +-#define fuse_parse_cmdline(args, opts) fuse_parse_cmdline_30(args, opts)
> +-#else
> +-int fuse_parse_cmdline_312(struct fuse_args *args,
> +-			   struct fuse_cmdline_opts *opts);
> +-#define fuse_parse_cmdline(args, opts) fuse_parse_cmdline_312(args, opts)
> +-#endif
> +-#endif
> +
> + /**
> +  * Create a low level session.
> +diff --git a/lib/helper.c b/lib/helper.c
> +index 84013b9..7f10ae4 100644
> +--- a/lib/helper.c
> ++++ b/lib/helper.c
> +@@ -254,15 +254,18 @@ int fuse_parse_cmdline_30(struct fuse_args *args,
> + /**
> +  * Compatibility ABI symbol for systems that do not support version symboling
> +  */
> +-#if (defined(__UCLIBC__) || defined(__APPLE__))
> ++#if (!defined(HAVE_SYMVER_ATTRIBUTE))
> + int fuse_parse_cmdline(struct fuse_args *args,
> + 		       struct fuse_cmdline_opts *opts)
> + {
> +-	return fuse_parse_cmdline_30(args, out_opts);
> ++#if FUSE_USE_VERSION < FUSE_MAKE_VERSION(3, 12)
> ++	return fuse_parse_cmdline_30(args, opts);
> ++#else
> ++	return fuse_parse_cmdline_312(args, opts);
> ++#endif
> + }
> + #endif
> +
> +-
> + int fuse_daemonize(int foreground)
> + {
> + 	if (!foreground) {
> +--
> +2.34.1
> +
> diff --git a/package/libfuse3/libfuse3.hash b/package/libfuse3/libfuse3.hash
> index 2fb5f329e3..bd77e77b75 100644
> --- a/package/libfuse3/libfuse3.hash
> +++ b/package/libfuse3/libfuse3.hash
> @@ -1,3 +1,3 @@
>   # Locally calculated sha256 checksums
> -sha256  25a00226d2d449c15b2f08467d6d5ebbb2a428260c4ab773721c32adbc6da072  libfuse3-3.11.0.tar.gz
> +sha256  df6cc8807c4fd36b6b0ebef2b738dad6d19a9c7c085ccc3775063688d0bfcc0b  libfuse3-3.12.0.tar.gz
>   sha256  b8832d9caaa075bbbd2aef24efa09f8b7ab66a832812d88c602da0c7b4397fad  LICENSE
> diff --git a/package/libfuse3/libfuse3.mk b/package/libfuse3/libfuse3.mk
> index b3e3176708..8913f00af4 100644
> --- a/package/libfuse3/libfuse3.mk
> +++ b/package/libfuse3/libfuse3.mk
> @@ -4,7 +4,7 @@
>   #
>   ################################################################################
>   
> -LIBFUSE3_VERSION = 3.11.0
> +LIBFUSE3_VERSION = 3.12.0
>   LIBFUSE3_SITE = $(call github,libfuse,libfuse,fuse-$(LIBFUSE3_VERSION))
>   LIBFUSE3_LICENSE = LGPL-2.1
>   LIBFUSE3_LICENSE_FILES = LICENSE




More information about the buildroot mailing list