diff mbox series

[v2] package/libfuse3: bump to version 3.12.0

Message ID 20220929112328.546093-1-giulio.benetti@benettiengineering.com
State Rejected
Headers show
Series [v2] package/libfuse3: bump to version 3.12.0 | expand

Commit Message

Giulio Benetti Sept. 29, 2022, 11:23 a.m. UTC
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 fuse_lowlevel.h:
```
int fuse_parse_cmdline_312(struct fuse_args *args,
			   struct fuse_cmdline_opts *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:
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 uses
static functions in fuse_lowlevel.h instead of #define's and remove the
useless fuse_parse_cmdline() implementation from helper.c

Patch is pending upstream:
https://github.com/libfuse/libfuse/pull/698

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
V1->V2:
* changed local patch approach after discussing on PR:
  https://github.com/libfuse/libfuse/pull/698
---
 .../0001-Fix-build-failure-with-uclibc.patch  | 94 +++++++++++++++++++
 package/libfuse3/libfuse3.hash                |  2 +-
 package/libfuse3/libfuse3.mk                  |  2 +-
 3 files changed, 96 insertions(+), 2 deletions(-)
 create mode 100644 package/libfuse3/0001-Fix-build-failure-with-uclibc.patch

Comments

Giulio Benetti Sept. 29, 2022, 11:24 a.m. UTC | #1
This should have been V3 :-/

Do I need to re-send it?
diff mbox series

Patch

diff --git a/package/libfuse3/0001-Fix-build-failure-with-uclibc.patch b/package/libfuse3/0001-Fix-build-failure-with-uclibc.patch
new file mode 100644
index 0000000000..43cb0c9f96
--- /dev/null
+++ b/package/libfuse3/0001-Fix-build-failure-with-uclibc.patch
@@ -0,0 +1,94 @@ 
+From c42f50d2bdc93d56eb21d1e552d452b253fe9219 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Thu, 8 Sep 2022 23:37:19 +0200
+Subject: [PATCH] Fix build failure with uclibc
+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 replace the 2 #define fuse_parse_cmdline() with static
+functions in fuse_lowlevel.h and consequently remove the UCLIBC and APPLE
+fuse_parse_cmdline() implementation from helper.c
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+[Upstream status: https://github.com/libfuse/libfuse/pull/698]
+---
+ include/fuse_lowlevel.h | 12 ++++++++++--
+ lib/helper.c            | 12 ------------
+ 2 files changed, 10 insertions(+), 14 deletions(-)
+
+diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
+index 53f0fcf..484771b 100644
+--- a/include/fuse_lowlevel.h
++++ b/include/fuse_lowlevel.h
+@@ -1914,11 +1914,19 @@ int fuse_parse_cmdline(struct fuse_args *args,
+ #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)
++static int fuse_parse_cmdline(struct fuse_args *args,
++			      struct fuse_cmdline_opts *opts)
++{
++	return 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)
++static int fuse_parse_cmdline(struct fuse_args *args,
++			      struct fuse_cmdline_opts *opts)
++{
++	return fuse_parse_cmdline_312(args, opts);
++}
+ #endif
+ #endif
+ 
+diff --git a/lib/helper.c b/lib/helper.c
+index 84013b9..c3796c1 100644
+--- a/lib/helper.c
++++ b/lib/helper.c
+@@ -251,18 +251,6 @@ int fuse_parse_cmdline_30(struct fuse_args *args,
+ 	return rc;
+ }
+ 
+-/**
+- * Compatibility ABI symbol for systems that do not support version symboling
+- */
+-#if (defined(__UCLIBC__) || defined(__APPLE__))
+-int fuse_parse_cmdline(struct fuse_args *args,
+-		       struct fuse_cmdline_opts *opts)
+-{
+-	return fuse_parse_cmdline_30(args, out_opts);
+-}
+-#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