svn commit: r359389 - head/usr.sbin/config

Kyle Evans kevans at FreeBSD.org
Sat Mar 28 04:02:10 UTC 2020


Author: kevans
Date: Sat Mar 28 04:02:00 2020
New Revision: 359389
URL: https://svnweb.freebsd.org/changeset/base/359389

Log:
  config(8): fixes for -fno-common
  
  Move this handful of definitions into main.c, properly declare these as
  extern in config.h. This fixes the config(8) build with -fno-common.
  
  Unexplained in my previous commit to gas, -fno-common will become the
  default in GCC10 and LLVM11, so it's worth addressing these in advance.
  
  MFC after:	3 days

Modified:
  head/usr.sbin/config/config.h
  head/usr.sbin/config/main.c

Modified: head/usr.sbin/config/config.h
==============================================================================
--- head/usr.sbin/config/config.h	Sat Mar 28 03:58:57 2020	(r359388)
+++ head/usr.sbin/config/config.h	Sat Mar 28 04:02:00 2020	(r359389)
@@ -45,7 +45,7 @@ struct cfgfile {
 	STAILQ_ENTRY(cfgfile)	cfg_next;
 	char	*cfg_path;
 };
-STAILQ_HEAD(, cfgfile) cfgfiles;
+extern STAILQ_HEAD(cfgfile_head, cfgfile) cfgfiles;
 
 struct file_list {
 	STAILQ_ENTRY(file_list) f_next;
@@ -103,8 +103,8 @@ struct config {
  * in the makerules, etc.  machinearch is the global notion of the
  * MACHINE_ARCH for this MACHINE.
  */
-char	*machinename;
-char	*machinearch;
+extern char	*machinename;
+extern char	*machinearch;
 
 /*
  * For each machine, a set of CPU's may be specified as supported.
@@ -115,7 +115,7 @@ struct cputype {
 	SLIST_ENTRY(cputype) cpu_next;
 };
 
-SLIST_HEAD(, cputype) cputype;
+extern SLIST_HEAD(cputype_head, cputype) cputype;
 
 /*
  * A set of options may also be specified which are like CPU types,
@@ -131,7 +131,7 @@ struct opt {
 	SLIST_ENTRY(opt) op_append;
 };
 
-SLIST_HEAD(opt_head, opt) opt, mkopt, rmopts;
+extern SLIST_HEAD(opt_head, opt) opt, mkopt, rmopts;
 
 struct opt_list {
 	char *o_name;
@@ -141,7 +141,7 @@ struct opt_list {
 	SLIST_ENTRY(opt_list) o_next;
 };
 
-SLIST_HEAD(, opt_list) otab;
+extern SLIST_HEAD(opt_list_head, opt_list) otab;
 
 struct envvar {
 	char	*env_str;
@@ -149,21 +149,21 @@ struct envvar {
 	STAILQ_ENTRY(envvar) envvar_next;
 };
 
-STAILQ_HEAD(envvar_head, envvar) envvars;
+extern STAILQ_HEAD(envvar_head, envvar) envvars;
 
 struct hint {
 	char	*hint_name;
 	STAILQ_ENTRY(hint) hint_next;
 };
 
-STAILQ_HEAD(hint_head, hint) hints;
+extern STAILQ_HEAD(hint_head, hint) hints;
 
 struct includepath {
 	char	*path;
 	SLIST_ENTRY(includepath) path_next;
 };
 
-SLIST_HEAD(, includepath) includepath;
+extern SLIST_HEAD(includepath_head, includepath) includepath;
 
 /*
  * Tag present in the kernconf.tmpl template file. It's mandatory for those

Modified: head/usr.sbin/config/main.c
==============================================================================
--- head/usr.sbin/config/main.c	Sat Mar 28 03:58:57 2020	(r359388)
+++ head/usr.sbin/config/main.c	Sat Mar 28 04:02:00 2020	(r359389)
@@ -72,6 +72,17 @@ static const char rcsid[] =
 
 #define	CDIR	"../compile/"
 
+char	*machinename;
+char	*machinearch;
+
+struct cfgfile_head	cfgfiles;
+struct cputype_head	cputype;
+struct opt_head		opt, mkopt, rmopts;
+struct opt_list_head	otab;
+struct envvar_head	envvars;
+struct hint_head	hints;
+struct includepath_head	includepath;
+
 char *	PREFIX;
 char 	destdir[MAXPATHLEN];
 char 	srcdir[MAXPATHLEN];


More information about the svn-src-all mailing list