[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#957608: nfs-utils: ftbfs with GCC-10



Hi,

On Sun, Jul 26, 2020 at 12:20:17AM +0200, Reiner Herrmann wrote:
> Control: tags -1 + fixed-upstream
> 
> Hi,
> 
> this has been fixed upstream in version 2.4.3.
> This is the relevant commit:
>   http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commitdiff;h=1eafe05616b4660fb15d106e06f0b3e18983708c

For upstream yes, but as we have a quite older version we need to fix
this slightly differently. There is as well one conf_path change
affected.

Finally for bullseye we need/should catch-up with upstream, and there
is current ongoing work for that.

Regards,
Salvatore
>From 5db7c4829c294da6c6f366f93dbbf560bcc8c040 Mon Sep 17 00:00:00 2001
From: Salvatore Bonaccorso <carnil@debian.org>
Date: Sat, 25 Jul 2020 21:24:35 +0200
Subject: [PATCH] Allow compilation to succeed with -fno-common

Closes: #957608
---
 debian/changelog                              |  6 ++
 ...mpilation-to-succeed-with-fno-common.patch | 77 +++++++++++++++++++
 debian/patches/series                         |  1 +
 3 files changed, 84 insertions(+)
 create mode 100644 debian/patches/Allow-compilation-to-succeed-with-fno-common.patch

diff --git a/debian/changelog b/debian/changelog
index f2d4d427a81d..4b4c2e6618b6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+nfs-utils (1:1.3.4-4) UNRELEASED; urgency=medium
+
+  * Allow compilation to succeed with -fno-common (Closes: #957608)
+
+ -- Salvatore Bonaccorso <carnil@debian.org>  Sat, 25 Jul 2020 21:31:52 +0200
+
 nfs-utils (1:1.3.4-3) unstable; urgency=medium
 
   [ Salvatore Bonaccorso ]
diff --git a/debian/patches/Allow-compilation-to-succeed-with-fno-common.patch b/debian/patches/Allow-compilation-to-succeed-with-fno-common.patch
new file mode 100644
index 000000000000..2d5880758d38
--- /dev/null
+++ b/debian/patches/Allow-compilation-to-succeed-with-fno-common.patch
@@ -0,0 +1,77 @@
+From: NeilBrown <neilb@suse.de>
+Date: Fri, 7 Feb 2020 11:05:03 -0500
+Subject: Allow compilation to succeed with -fno-common
+Origin: https://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=1eafe05616b4660fb15d106e06f0b3e18983708c
+Bug-Debian: https://bugs.debian.org/957608
+
+When compiled with -fno-common, global variables that are declared
+multple times cause an error.  With -fcommon (the default), they are
+merged.
+
+Declaring such variable multiple times is probably not a good idea, and
+is definitely not necessary.
+
+This patch changes all the global variables defined in include files to
+be explicitly "extern", and where necessary, adds the variable
+declaration to a suitable .c file.
+
+To test, run
+  CFLAGS=-fno-common ./configure
+  make
+
+Signed-off-by: NeilBrown <neilb@suse.de>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+[Salvatore Bonaccorso: Backport to 1.3.4:
+ - Drop changes in utils/nfsdcld/
+ - support/nfs/conffile.c: Drop definition of conf_path
+]
+---
+ utils/mountd/v4root.c        |  2 --
+ utils/nfsdcld/cld-internal.h | 10 +++++-----
+ utils/nfsdcld/nfsdcld.c      |  6 ++++++
+ utils/statd/statd.c          |  1 +
+ utils/statd/statd.h          |  2 +-
+ 5 files changed, 13 insertions(+), 8 deletions(-)
+
+--- a/utils/mountd/v4root.c
++++ b/utils/mountd/v4root.c
+@@ -28,8 +28,6 @@
+ #include "v4root.h"
+ #include "pseudoflavors.h"
+ 
+-int v4root_needed;
+-
+ static nfs_export pseudo_root = {
+ 	.m_next = NULL,
+ 	.m_client = NULL,
+--- a/utils/statd/statd.c
++++ b/utils/statd/statd.c
+@@ -66,6 +66,7 @@ static struct option longopts[] =
+ };
+ 
+ extern void sm_prog_1 (struct svc_req *, register SVCXPRT *);
++stat_chge	SM_stat_chge;
+ 
+ #ifdef SIMULATIONS
+ extern void simulator (int, char **);
+--- a/utils/statd/statd.h
++++ b/utils/statd/statd.h
+@@ -41,7 +41,7 @@ extern void	load_state(void);
+ /*
+  * Host status structure and macros.
+  */
+-stat_chge		SM_stat_chge;
++extern stat_chge	SM_stat_chge;
+ #define MY_NAME		SM_stat_chge.mon_name
+ #define MY_STATE	SM_stat_chge.state
+ 
+--- a/support/nfs/conffile.c
++++ b/support/nfs/conffile.c
+@@ -104,7 +104,6 @@ struct conf_binding {
+   int is_default;
+ };
+ 
+-char *conf_path;
+ LIST_HEAD (conf_bindings, conf_binding) conf_bindings[256];
+ 
+ static char *conf_addr;
diff --git a/debian/patches/series b/debian/patches/series
index 5cb2def49d02..b3c7ef297712 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -17,3 +17,4 @@ fix-glibc2.28-ftbfs.patch
 0011-gssd-Duplicate-the-upcall-string-for-error-messages.patch
 nfsiostat-replace-list-reserved-word.patch
 statd-take-user-id-from-var-lib-nfs-sm.patch
+Allow-compilation-to-succeed-with-fno-common.patch
-- 
2.28.0.rc1


Reply to: