--- a/compat/include/protocols/dumprestore.h
+++ b/compat/include/protocols/dumprestore.h
@@ -78,12 +78,12 @@ typedef u_int32_t	dump_ino_t;
 typedef unsigned int	dump_ino_t;
 #endif
 
-union u_data {
+extern union u_data {
 	char	s_addrs[TP_NINDIR];	/* 1 => data; 0 => hole in inode */
 	int32_t	s_inos[TP_NINOS];	/* table of first inode on each volume */
 } u_data;
 
-union u_spcl {
+extern union u_spcl {
 	char dummy[TP_BSIZE];
 	struct	s_spcl {
 		int32_t	c_type;		    /* record type (see below) */
--- a/dump/main.c
+++ b/dump/main.c
@@ -73,6 +73,8 @@
 #endif
 
 #include <protocols/dumprestore.h>
+union u_spcl u_spcl;
+union u_data u_data;
 
 #include "dump.h"
 #include "pathnames.h"
--- a/restore/main.c
+++ b/restore/main.c
@@ -65,6 +65,8 @@
 #endif
 #endif	/* __linux__ */
 #include <protocols/dumprestore.h>
+union u_spcl u_spcl;
+union u_data u_data;
 
 #include <compaterr.h>
 #include <stdio.h>
@@ -78,6 +80,7 @@
 
 #include "pathnames.h"
 #include "restore.h"
+struct context curfile;
 #include "extern.h"
 
 int abortifconnerr = 1;		/* set to 1 if lib dumprmt.o should exit on connection errors
--- a/dump/itime.c
+++ b/dump/itime.c
@@ -71,11 +71,6 @@
 
 #include "dump.h"
 
-struct	dumpdates **ddatev;
-int	nddates;
-int	ddates_in;
-struct	dumptime *dthead;
-
 static	void dumprecout (FILE *, struct dumpdates *);
 static	int getrecord (FILE *, struct dumpdates *);
 static	int makedumpdate (struct dumpdates *, char *);
--- a/common/legacy_indexer.c
+++ b/common/legacy_indexer.c
@@ -49,10 +49,8 @@ static int GetTapePos (long long *);
 static int MkTapeString (struct s_spcl *, long long);
 #define FILESQFAPOS	20
 
-int tapepos;
-int ntrec;		/* blocking factor on tape */
-//extern int tapepos;
-//extern int ntrec;		/* blocking factor on tape */
+extern int tapepos;
+extern int ntrec;		/* blocking factor on tape */
 extern int magtapeout;  /* is output a magnetic tape? */
 
 static int gtperr = 0;
--- a/restore/restore.h
+++ b/restore/restore.h
@@ -131,7 +131,7 @@ struct entry {
 /*
  * The entry describes the next file available on the tape
  */
-struct context {
+extern struct context {
 	char	*name;		/* name of file */
 	dump_ino_t ino;		/* inumber of file */
 #if defined(__linux__) || defined(sunos)
