summaryrefslogtreecommitdiff
path: root/sys-fs/zfs-utils/files/0.8.3-fno-common.patch
blob: 3b09d8bbc59753088b8d5a33d0b804676836f7c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
From af09c050e95bebbaeca52156218f3f91e8c9951a Mon Sep 17 00:00:00 2001
From: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu>
Date: Thu, 6 Feb 2020 18:25:29 +0100
Subject: [PATCH] Fix static data to link with -fno-common

-fno-common is the new default in GCC 10, replacing -fcommon in
GCC <= 9, so static data must only be allocated once.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Romain Dolbeau <romain.dolbeau@european-processor-initiative.eu>
Closes #9943
---
 cmd/zfs/zfs_util.h     | 2 +-
 cmd/zpool/zpool_main.c | 2 ++
 cmd/zpool/zpool_util.h | 2 +-
 lib/libshare/smb.c     | 2 ++
 lib/libshare/smb.h     | 2 +-
 5 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/cmd/zfs/zfs_util.h b/cmd/zfs/zfs_util.h
index 3ddff9e22d7..a56af59adb1 100644
--- a/cmd/zfs/zfs_util.h
+++ b/cmd/zfs/zfs_util.h
@@ -33,7 +33,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 --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index ae5e8a370fc..ff4f44d4652 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -76,6 +76,8 @@
 
 #include "statcommon.h"
 
+libzfs_handle_t *g_zfs;
+
 static int zpool_do_create(int, char **);
 static int zpool_do_destroy(int, char **);
 
diff --git a/cmd/zpool/zpool_util.h b/cmd/zpool/zpool_util.h
index ce760df723c..1f23f61aaa4 100644
--- a/cmd/zpool/zpool_util.h
+++ b/cmd/zpool/zpool_util.h
@@ -79,7 +79,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;
 
 
 typedef	struct vdev_cmd_data
diff --git a/lib/libshare/smb.c b/lib/libshare/smb.c
index a95607ee032..f567f7c49d7 100644
--- a/lib/libshare/smb.c
+++ b/lib/libshare/smb.c
@@ -65,6 +65,8 @@ static boolean_t smb_available(void);
 
 static sa_fstype_t *smb_fstype;
 
+smb_share_t *smb_shares;
+
 /*
  * Retrieve the list of SMB shares.
  */
diff --git a/lib/libshare/smb.h b/lib/libshare/smb.h
index 7a0c0fd162d..8ea44677f9a 100644
--- a/lib/libshare/smb.h
+++ b/lib/libshare/smb.h
@@ -44,6 +44,6 @@ typedef struct smb_share_s {
 	struct smb_share_s *next;
 } smb_share_t;
 
-smb_share_t *smb_shares;
+extern smb_share_t *smb_shares;
 
 void libshare_smb_init(void);