add zfs 0.7 snapshot
[portage-squeep] / sys-fs / zfs / files / 0.8.3-fno-common.patch
1 From af09c050e95bebbaeca52156218f3f91e8c9951a Mon Sep 17 00:00:00 2001
2 From: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu>
3 Date: Thu, 6 Feb 2020 18:25:29 +0100
4 Subject: [PATCH] Fix static data to link with -fno-common
5
6 -fno-common is the new default in GCC 10, replacing -fcommon in
7 GCC <= 9, so static data must only be allocated once.
8
9 Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
10 Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu>
11 Closes #9943
12 ---
13 cmd/zfs/zfs_util.h | 2 +-
14 cmd/zpool/zpool_main.c | 2 ++
15 cmd/zpool/zpool_util.h | 2 +-
16 lib/libshare/smb.c | 2 ++
17 lib/libshare/smb.h | 2 +-
18 5 files changed, 7 insertions(+), 3 deletions(-)
19
20 diff --git a/cmd/zfs/zfs_util.h b/cmd/zfs/zfs_util.h
21 index 3ddff9e22d7..a56af59adb1 100644
22 --- a/cmd/zfs/zfs_util.h
23 +++ b/cmd/zfs/zfs_util.h
24 @@ -33,7 +33,7 @@ extern "C" {
25
26 void * safe_malloc(size_t size);
27 void nomem(void);
28 -libzfs_handle_t *g_zfs;
29 +extern libzfs_handle_t *g_zfs;
30
31 #ifdef __cplusplus
32 }
33 diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
34 index ae5e8a370fc..ff4f44d4652 100644
35 --- a/cmd/zpool/zpool_main.c
36 +++ b/cmd/zpool/zpool_main.c
37 @@ -76,6 +76,8 @@
38
39 #include "statcommon.h"
40
41 +libzfs_handle_t *g_zfs;
42 +
43 static int zpool_do_create(int, char **);
44 static int zpool_do_destroy(int, char **);
45
46 diff --git a/cmd/zpool/zpool_util.h b/cmd/zpool/zpool_util.h
47 index ce760df723c..1f23f61aaa4 100644
48 --- a/cmd/zpool/zpool_util.h
49 +++ b/cmd/zpool/zpool_util.h
50 @@ -79,7 +79,7 @@ void pool_list_free(zpool_list_t *);
51 int pool_list_count(zpool_list_t *);
52 void pool_list_remove(zpool_list_t *, zpool_handle_t *);
53
54 -libzfs_handle_t *g_zfs;
55 +extern libzfs_handle_t *g_zfs;
56
57
58 typedef struct vdev_cmd_data
59 diff --git a/lib/libshare/smb.c b/lib/libshare/smb.c
60 index a95607ee032..f567f7c49d7 100644
61 --- a/lib/libshare/smb.c
62 +++ b/lib/libshare/smb.c
63 @@ -65,6 +65,8 @@ static boolean_t smb_available(void);
64
65 static sa_fstype_t *smb_fstype;
66
67 +smb_share_t *smb_shares;
68 +
69 /*
70 * Retrieve the list of SMB shares.
71 */
72 diff --git a/lib/libshare/smb.h b/lib/libshare/smb.h
73 index 7a0c0fd162d..8ea44677f9a 100644
74 --- a/lib/libshare/smb.h
75 +++ b/lib/libshare/smb.h
76 @@ -44,6 +44,6 @@ typedef struct smb_share_s {
77 struct smb_share_s *next;
78 } smb_share_t;
79
80 -smb_share_t *smb_shares;
81 +extern smb_share_t *smb_shares;
82
83 void libshare_smb_init(void);