On Tue, Aug 09, 2022 at 04:51:03PM +0000, Gwyn Ciesla via devel wrote: > Good morning! > > zfs-fuse is FTBFS starting with f36. > > https://bugzilla.redhat.com/show_bug.cgi?id=2047144 > > I've been banging my head on it for a long time, to no avail. I can get around the SConstruct failure by removing some environment variables, and then I hit a linking issue I can't get past. Most problems are caused by GCC 10 no longer merging duplicate global variable storage. This was super tedios to resolve. I started with the gcc10_fixes.patch from Debian and had to tweak it even more. A build system bug was causing the extra quotes in compiler options. The code is broken wrt -Wformat-security. So this has to be turned off, unless someone wants to audit all the printf() calls and fix them up. I'd recommend the latter really, but I attach the quick fix since that is at least no more awful than it has been for every Fedora release previously. So in the RPM spec add diff --git a/zfs-fuse.spec b/zfs-fuse.spec index b26c656..84b6eb0 100644 --- a/zfs-fuse.spec +++ b/zfs-fuse.spec @@ -17,6 +17,8 @@ Patch0: zfs-fuse-0.7.2.2-stack.patch Patch1: zfs-fuse-0.7.2.2-python3.patch Patch2: tirpc.patch Patch3: common.patch +Patch4: gcc.patch + BuildRequires: gcc BuildRequires: fuse-devel libaio-devel perl-generators scons gcc-c++ BuildRequires: zlib-devel openssl-devel libattr-devel lzo-devel bzip2-devel xz-devel @@ -50,6 +52,7 @@ operating system. %patch1 -p1 %patch2 -p1 %patch3 -p0 +%patch4 -p1 f=LICENSE mv $f $f.iso88591 @@ -63,6 +66,7 @@ chmod -x contrib/zfsstress.py cp -f /usr/lib/rpm/redhat/config.{guess,sub} src/lib/libumem/ %build +%define _warning_options '-Wall' export CCFLAGS="%{optflags}" pushd src The gcc.patch is attached. > Only libguestfs and libvirt require this, other that users with > ZFS filesystems, but I'd rather not retire it if it can be avoided. Don't let libvirt/libguestfs force you to keep maintaining zfs-fuse. If you want to retire it, we'll just disable zfs in libvirt/libguestfs. Honestly I'd retire it, given it is dead upstream, unless someone wants to re-incarnate the upstream project and bring the code upto modern standards. Even with the patches there's still tonnes of (non-fatal) compiler warnings that really ought to be evaluated for correctness. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
diff -x src/lib/libsolkerncompat/include/sys/utsname.h -rup zfs-fuse-0.7.2.2.orig/src/cmd/mount_zfs/mount_zfs.c zfs-fuse-0.7.2.2.new/src/cmd/mount_zfs/mount_zfs.c --- zfs-fuse-0.7.2.2.orig/src/cmd/mount_zfs/mount_zfs.c 2015-11-24 11:32:31.000000000 -0500 +++ zfs-fuse-0.7.2.2.new/src/cmd/mount_zfs/mount_zfs.c 2022-08-09 14:09:10.011720713 -0400 @@ -35,6 +35,7 @@ #include <locale.h> libzfs_handle_t *g_zfs; +int aok; typedef struct option_map { const char *name; diff -x src/lib/libsolkerncompat/include/sys/utsname.h -rup zfs-fuse-0.7.2.2.orig/src/cmd/zfs/zfs_main.c zfs-fuse-0.7.2.2.new/src/cmd/zfs/zfs_main.c --- zfs-fuse-0.7.2.2.orig/src/cmd/zfs/zfs_main.c 2022-08-09 13:12:22.885797414 -0400 +++ zfs-fuse-0.7.2.2.new/src/cmd/zfs/zfs_main.c 2022-08-09 14:11:52.170622824 -0400 @@ -57,6 +57,7 @@ #include "zfs_comutil.h" libzfs_handle_t *g_zfs; +int aok; static FILE *mnttab_file; static char history_str[HIS_MAX_RECORD_LEN]; diff -x src/lib/libsolkerncompat/include/sys/utsname.h -rup zfs-fuse-0.7.2.2.orig/src/cmd/zfs/zfs_util.h zfs-fuse-0.7.2.2.new/src/cmd/zfs/zfs_util.h --- zfs-fuse-0.7.2.2.orig/src/cmd/zfs/zfs_util.h 2015-11-24 11:32:31.000000000 -0500 +++ zfs-fuse-0.7.2.2.new/src/cmd/zfs/zfs_util.h 2022-08-09 14:05:33.980183340 -0400 @@ -34,7 +34,7 @@ extern "C" { void * safe_malloc(size_t size); void nomem(void); -libzfs_handle_t *g_zfs; +extern libzfs_handle_t *g_zfs; #ifdef __cplusplus } diff -x src/lib/libsolkerncompat/include/sys/utsname.h -rup zfs-fuse-0.7.2.2.orig/src/cmd/zpool/zpool_main.c zfs-fuse-0.7.2.2.new/src/cmd/zpool/zpool_main.c --- zfs-fuse-0.7.2.2.orig/src/cmd/zpool/zpool_main.c 2015-11-24 11:32:31.000000000 -0500 +++ zfs-fuse-0.7.2.2.new/src/cmd/zpool/zpool_main.c 2022-08-09 14:13:03.659138821 -0400 @@ -53,6 +53,8 @@ #include "statcommon.h" #include "format.h" +int aok; + static int zpool_do_create(int, char **); static int zpool_do_destroy(int, char **); @@ -181,6 +183,8 @@ static char history_str[HIS_MAX_RECORD_L static uint_t timestamp_fmt = NODATE; +libzfs_handle_t *g_zfs; + static const char * get_usage(zpool_help_t idx) { switch (idx) { diff -x src/lib/libsolkerncompat/include/sys/utsname.h -rup zfs-fuse-0.7.2.2.orig/src/cmd/zpool/zpool_util.h zfs-fuse-0.7.2.2.new/src/cmd/zpool/zpool_util.h --- zfs-fuse-0.7.2.2.orig/src/cmd/zpool/zpool_util.h 2015-11-24 11:32:31.000000000 -0500 +++ zfs-fuse-0.7.2.2.new/src/cmd/zpool/zpool_util.h 2022-08-09 14:05:18.772286305 -0400 @@ -63,7 +63,7 @@ void pool_list_free(zpool_list_t *); int pool_list_count(zpool_list_t *); void pool_list_remove(zpool_list_t *, zpool_handle_t *); -libzfs_handle_t *g_zfs; +extern libzfs_handle_t *g_zfs; #ifdef __cplusplus } diff -x src/lib/libsolkerncompat/include/sys/utsname.h -rup zfs-fuse-0.7.2.2.orig/src/lib/libsolcompat/include/sys/utsname.h zfs-fuse-0.7.2.2.new/src/lib/libsolcompat/include/sys/utsname.h --- zfs-fuse-0.7.2.2.orig/src/lib/libsolcompat/include/sys/utsname.h 2015-11-24 11:32:31.000000000 -0500 +++ zfs-fuse-0.7.2.2.new/src/lib/libsolcompat/include/sys/utsname.h 2022-08-09 14:05:18.771286311 -0400 @@ -29,7 +29,7 @@ #include_next <sys/utsname.h> -struct utsname utsname; +extern struct utsname utsname; #endif diff -x src/lib/libsolkerncompat/include/sys/utsname.h -rup zfs-fuse-0.7.2.2.orig/src/lib/libsolkerncompat/main.c zfs-fuse-0.7.2.2.new/src/lib/libsolkerncompat/main.c --- zfs-fuse-0.7.2.2.orig/src/lib/libsolkerncompat/main.c 2015-11-24 11:32:31.000000000 -0500 +++ zfs-fuse-0.7.2.2.new/src/lib/libsolkerncompat/main.c 2022-08-09 14:05:18.776286278 -0400 @@ -44,6 +44,7 @@ unsigned long _pagesize; unsigned int _pageshift; kmem_cache_t *vnode_cache; extern void system_taskq_init(); +struct utsname utsname; void libsolkerncompat_init() { diff -x src/lib/libsolkerncompat/include/sys/utsname.h -rup zfs-fuse-0.7.2.2.orig/src/lib/libzfs/libzfs_zfsfuse.c zfs-fuse-0.7.2.2.new/src/lib/libzfs/libzfs_zfsfuse.c --- zfs-fuse-0.7.2.2.orig/src/lib/libzfs/libzfs_zfsfuse.c 2015-11-24 11:32:31.000000000 -0500 +++ zfs-fuse-0.7.2.2.new/src/lib/libzfs/libzfs_zfsfuse.c 2022-08-09 14:05:18.775286284 -0400 @@ -37,8 +37,6 @@ #include "libzfs_impl.h" -int aok=0; - int zfsfuse_open(const char *pathname, int flags) { struct sockaddr_un name; diff -x src/lib/libsolkerncompat/include/sys/utsname.h -rup zfs-fuse-0.7.2.2.orig/src/SConstruct zfs-fuse-0.7.2.2.new/src/SConstruct --- zfs-fuse-0.7.2.2.orig/src/SConstruct 2022-08-09 13:12:22.893797361 -0400 +++ zfs-fuse-0.7.2.2.new/src/SConstruct 2022-08-09 14:04:49.822482574 -0400 @@ -30,7 +30,7 @@ f.close() env.CacheDir('/tmp/.zfs-fuse.scons') env['CC'] = os.environ.setdefault("CC","gcc") -env['CCFLAGS'] = os.environ.setdefault("CFLAGS","-fcommon") +env['CCFLAGS'] = Split(os.environ.setdefault("CFLAGS","-fcommon")) env['LINKFLAGS'] = Split('-pipe -Wall -ltirpc') env.Append(CCFLAGS = Split('-pipe -Wall -std=c99 -Wno-switch -Wno-unused -Wno-missing-braces -Wno-parentheses -Wno-uninitialized -Wcast-align -fno-strict-aliasing -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -DTEXT_DOMAIN=\\"zfs-fuse\\" ')) diff -x src/lib/libsolkerncompat/include/sys/utsname.h -rup zfs-fuse-0.7.2.2.orig/src/zfs-fuse/zfs_vnops.c zfs-fuse-0.7.2.2.new/src/zfs-fuse/zfs_vnops.c --- zfs-fuse-0.7.2.2.orig/src/zfs-fuse/zfs_vnops.c 2015-11-24 11:32:31.000000000 -0500 +++ zfs-fuse-0.7.2.2.new/src/zfs-fuse/zfs_vnops.c 2022-08-09 14:05:18.776286278 -0400 @@ -5130,7 +5130,6 @@ zfs_isdir() /* * Directory vnode operations template */ -vnodeops_t *zfs_dvnodeops; const fs_operation_def_t zfs_dvnodeops_template[] = { VOPNAME_OPEN, { .vop_open = zfs_open }, VOPNAME_CLOSE, { .vop_close = zfs_close }, @@ -5163,7 +5162,6 @@ const fs_operation_def_t zfs_dvnodeops_t /* * Regular file vnode operations template */ -vnodeops_t *zfs_fvnodeops; const fs_operation_def_t zfs_fvnodeops_template[] = { VOPNAME_OPEN, { .vop_open = zfs_open }, VOPNAME_CLOSE, { .vop_close = zfs_close }, @@ -5198,7 +5196,6 @@ const fs_operation_def_t zfs_fvnodeops_t /* * Symbolic link vnode operations template */ -vnodeops_t *zfs_symvnodeops; const fs_operation_def_t zfs_symvnodeops_template[] = { VOPNAME_GETATTR, { .vop_getattr = zfs_getattr }, VOPNAME_SETATTR, { .vop_setattr = zfs_setattr }, @@ -5216,7 +5213,6 @@ const fs_operation_def_t zfs_symvnodeops /* * special share hidden files vnode operations template */ -vnodeops_t *zfs_sharevnodeops; const fs_operation_def_t zfs_sharevnodeops_template[] = { VOPNAME_GETATTR, { .vop_getattr = zfs_getattr }, VOPNAME_ACCESS, { .vop_access = zfs_access }, @@ -5240,7 +5236,6 @@ const fs_operation_def_t zfs_sharevnodeo * zfs_link() - no links into/out of attribute space * zfs_rename() - no moves into/out of attribute space */ -vnodeops_t *zfs_xdvnodeops; const fs_operation_def_t zfs_xdvnodeops_template[] = { VOPNAME_OPEN, { .vop_open = zfs_open }, VOPNAME_CLOSE, { .vop_close = zfs_close }, @@ -5271,7 +5266,6 @@ const fs_operation_def_t zfs_xdvnodeops_ /* * Error vnode operations template */ -vnodeops_t *zfs_evnodeops; const fs_operation_def_t zfs_evnodeops_template[] = { VOPNAME_INACTIVE, { .vop_inactive = zfs_inactive }, VOPNAME_PATHCONF, { .vop_pathconf = zfs_pathconf },
_______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue