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
This commit is contained in:
Romain Dolbeau 2020-02-06 18:25:29 +01:00 committed by GitHub
parent 5b7e6a3617
commit af09c050e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 3 deletions

View File

@ -33,7 +33,7 @@ extern "C" {
void * safe_malloc(size_t size); void * safe_malloc(size_t size);
void nomem(void); void nomem(void);
libzfs_handle_t *g_zfs; extern libzfs_handle_t *g_zfs;
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -76,6 +76,8 @@
#include "statcommon.h" #include "statcommon.h"
libzfs_handle_t *g_zfs;
static int zpool_do_create(int, char **); static int zpool_do_create(int, char **);
static int zpool_do_destroy(int, char **); static int zpool_do_destroy(int, char **);

View File

@ -79,7 +79,7 @@ void pool_list_free(zpool_list_t *);
int pool_list_count(zpool_list_t *); int pool_list_count(zpool_list_t *);
void pool_list_remove(zpool_list_t *, zpool_handle_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 typedef struct vdev_cmd_data

View File

@ -65,6 +65,8 @@ static boolean_t smb_available(void);
static sa_fstype_t *smb_fstype; static sa_fstype_t *smb_fstype;
smb_share_t *smb_shares;
/* /*
* Retrieve the list of SMB shares. * Retrieve the list of SMB shares.
*/ */

View File

@ -44,6 +44,6 @@ typedef struct smb_share_s {
struct smb_share_s *next; struct smb_share_s *next;
} smb_share_t; } smb_share_t;
smb_share_t *smb_shares; extern smb_share_t *smb_shares;
void libshare_smb_init(void); void libshare_smb_init(void);