From: Bernd Schubert Date: Sun, 2 Oct 2022 20:39:52 +0000 (+0200) Subject: Fix ublic/apple build for the fuse_parse_cmdline ABI symbol X-Git-Tag: fuse-3.13.0~11 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f212ec087037b5bb74700e6cce63c208bdbe8442;p=qemu-gpiodev%2Flibfuse.git Fix ublic/apple build for the fuse_parse_cmdline ABI symbol For __APPLE__ and __ULIBC__, which are assumed to not support versioned symbols, helper.c has a compat ABI symbol for fuse_parse_cmdline(). However that ABI symbol was conflicting with the API macro (which redirects to the right API function for recompilations against current libfuse). Additionally the parameter 'opts' had a typo and was called 'out_opts'. --- diff --git a/lib/compat.c b/lib/compat.c new file mode 100644 index 0000000..bdff5c9 --- /dev/null +++ b/lib/compat.c @@ -0,0 +1,56 @@ +/* + FUSE: Filesystem in Userspace + Copyright (C) 2001-2007 Miklos Szeredi + + Helper functions to create (simple) standalone programs. With the + aid of these functions it should be possible to create full FUSE + file system by implementing nothing but the request handlers. + + This program can be distributed under the terms of the GNU LGPLv2. + See the file COPYING.LIB. +*/ + +/* Description: + This file has compatibility symbols for platforms that do not + support version symboling +*/ + +#include "config.h" +#include "fuse_i.h" +#include "fuse_misc.h" +#include "fuse_opt.h" +#include "fuse_lowlevel.h" +#include "mount_util.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * Compatibility ABI symbol for systems that do not support version symboling + */ +#if (defined(__UCLIBC__) || defined(__APPLE__)) +/* With current libfuse fuse_parse_cmdline is a macro pointing to the + * versioned function. Here in this file we need to provide the ABI symbol + * and the redirecting macro is conflicting. + */ +#ifdef fuse_parse_cmdline +#undef fuse_parse_cmdline +#endif +int fuse_parse_cmdline_30(struct fuse_args *args, + struct fuse_cmdline_opts *opts); +int fuse_parse_cmdline(struct fuse_args *args, + struct fuse_cmdline_opts *opts); +int fuse_parse_cmdline(struct fuse_args *args, + struct fuse_cmdline_opts *opts) +{ + return fuse_parse_cmdline_30(args, opts); +} +#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) { diff --git a/lib/meson.build b/lib/meson.build index ef0e11e..54d0759 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -2,7 +2,7 @@ libfuse_sources = ['fuse.c', 'fuse_i.h', 'fuse_loop.c', 'fuse_loop_mt.c', 'fuse_lowlevel.c', 'fuse_misc.h', 'fuse_opt.c', 'fuse_signals.c', 'buffer.c', 'cuse_lowlevel.c', 'helper.c', 'modules/subdir.c', 'mount_util.c', - 'fuse_log.c' ] + 'fuse_log.c', 'compat.c' ] if host_machine.system().startswith('linux') libfuse_sources += [ 'mount.c' ]