Pull up following revision(s) (requested by mrg in ticket #1678):

bin/pax/options.c: revision 1.119
	usr.bin/config/scan.l: revision 1.32
	usr.bin/make/main.c: revision 1.274
	bin/pax/extern.h: revision 1.60
	usr.bin/config/defs.h: revision 1.106
	usr.bin/make/make.h: revision 1.105
	sbin/newfs_udf/udf_create.c: revision 1.27 (patch)
	sbin/newfs_udf/newfs_udf.h: revision 1.7 (patch)
	usr.bin/config/main.c: revision 1.100
	usr.sbin/installboot/Makefile:	revisions 1.53,1.54 (patch)
	usr.sbin/installboot/installboot.h: revision 1.41 (patch)
	usr.sbin/installboot/machines.c: revisisons 1.41,1.42 (patch)

Avoid depending on common symbols.
This commit is contained in:
martin 2021-05-07 17:40:31 +00:00
parent 888eaace83
commit 649e662bb6
12 changed files with 185 additions and 119 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.59 2012/08/09 08:09:21 christos Exp $ */
/* $NetBSD: extern.h,v 1.59.26.1 2021/05/07 17:40:31 martin Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@ -204,9 +204,8 @@ void options(int, char **);
OPLIST * opt_next(void);
int bad_opt(void);
int mkpath(char *);
char *chdname;
#if !HAVE_NBTOOL_CONFIG_H
int do_chroot;
extern int do_chroot;
#endif
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: options.c,v 1.118 2015/12/19 18:45:52 christos Exp $ */
/* $NetBSD: options.c,v 1.118.8.1 2021/05/07 17:40:31 martin Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
#else
__RCSID("$NetBSD: options.c,v 1.118 2015/12/19 18:45:52 christos Exp $");
__RCSID("$NetBSD: options.c,v 1.118.8.1 2021/05/07 17:40:31 martin Exp $");
#endif
#endif /* not lint */
@ -74,6 +74,11 @@ __RCSID("$NetBSD: options.c,v 1.118 2015/12/19 18:45:52 christos Exp $");
#include "mtree.h"
#endif /* SMALL */
char *chdname;
#if !HAVE_NBTOOL_CONFIG_H
int do_chroot;
#endif
/*
* Routines which handle command line options
*/

View File

@ -52,10 +52,6 @@ extern int meta_perc;
extern float meta_fract;
/* shared structure between udf_create.c users */
struct udf_create_context context;
struct udf_disclayout layout;
/* prototypes */
int udf_write_sector(void *sector, uint64_t location);
int udf_update_trackinfo(struct mmc_discinfo *di, struct mmc_trackinfo *ti);

View File

@ -1,4 +1,4 @@
/* $NetBSD: udf_create.c,v 1.25 2015/06/16 23:18:55 christos Exp $ */
/* $NetBSD: udf_create.c,v 1.25.8.1 2021/05/07 17:40:31 martin Exp $ */
/*
* Copyright (c) 2006, 2008 Reinoud Zandijk
@ -30,7 +30,7 @@
#endif
#include <sys/cdefs.h>
__RCSID("$NetBSD: udf_create.c,v 1.25 2015/06/16 23:18:55 christos Exp $");
__RCSID("$NetBSD: udf_create.c,v 1.25.8.1 2021/05/07 17:40:31 martin Exp $");
#include <stdio.h>
#include <stdlib.h>
@ -52,6 +52,10 @@ __RCSID("$NetBSD: udf_create.c,v 1.25 2015/06/16 23:18:55 christos Exp $");
# endif
#endif
/* shared structure between udf_create.c users */
struct udf_create_context context;
struct udf_disclayout layout;
/*
* NOTE that there is some overlap between this code and the udf kernel fs.
* This is intentially though it might better be factored out one day.

View File

@ -1,4 +1,4 @@
/* $NetBSD: defs.h,v 1.98.6.1 2017/07/18 19:13:10 snj Exp $ */
/* $NetBSD: defs.h,v 1.98.6.2 2021/05/07 17:40:31 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@ -429,80 +429,88 @@ struct devm {
*/
struct hashtab;
int lkmmode;
const char *conffile; /* source file, e.g., "GENERIC.sparc" */
const char *machine; /* machine type, e.g., "sparc" or "sun3" */
const char *machinearch; /* machine arch, e.g., "sparc" or "m68k" */
struct nvlist *machinesubarches;
extern int lkmmode;
extern const char *conffile; /* source file, e.g., "GENERIC.sparc" */
extern const char *machine; /* machine type, e.g., "sparc" or "sun3" */
extern const char *machinearch; /* machine arch, e.g., "sparc" or "m68k" */
extern struct nvlist *machinesubarches;
/* machine subarches, e.g., "sun68k" or "hpc" */
const char *ioconfname; /* ioconf name, mutually exclusive to machine */
const char *srcdir; /* path to source directory (rel. to build) */
const char *builddir; /* path to build directory */
const char *defbuilddir; /* default build directory */
const char *ident; /* kernel "ident"ification string */
int errors; /* counts calls to error() */
int minmaxusers; /* minimum "maxusers" parameter */
int defmaxusers; /* default "maxusers" parameter */
int maxmaxusers; /* default "maxusers" parameter */
int maxusers; /* configuration's "maxusers" parameter */
int maxpartitions; /* configuration's "maxpartitions" parameter */
int version; /* version of the configuration file */
struct nvlist *options; /* options */
struct nvlist *fsoptions; /* filesystems */
struct nvlist *mkoptions; /* makeoptions */
struct nvlist *appmkoptions; /* appending mkoptions */
struct nvlist *condmkoptions; /* conditional makeoption table */
struct hashtab *devbasetab; /* devbase lookup */
struct hashtab *devroottab; /* attach at root lookup */
struct hashtab *devatab; /* devbase attachment lookup */
struct hashtab *devitab; /* device instance lookup */
struct hashtab *deaddevitab; /* removed instances lookup */
struct hashtab *selecttab; /* selects things that are "optional foo" */
struct hashtab *needcnttab; /* retains names marked "needs-count" */
struct hashtab *opttab; /* table of configured options */
struct hashtab *fsopttab; /* table of configured file systems */
struct dlhash *defopttab; /* options that have been "defopt"'d */
struct dlhash *defflagtab; /* options that have been "defflag"'d */
struct dlhash *defparamtab; /* options that have been "defparam"'d */
struct dlhash *defoptlint; /* lint values for options */
struct nvhash *deffstab; /* defined file systems */
struct dlhash *optfiletab; /* "defopt"'d option .h files */
struct hashtab *attrtab; /* attributes (locators, etc.) */
struct hashtab *attrdeptab; /* attribute dependencies */
struct hashtab *bdevmtab; /* block devm lookup */
struct hashtab *cdevmtab; /* character devm lookup */
extern const char *ioconfname; /* ioconf name, mutually exclusive to machine */
extern const char *srcdir; /* path to source directory (rel. to build) */
extern const char *builddir; /* path to build directory */
extern const char *defbuilddir; /* default build directory */
extern const char *ident; /* kernel "ident"ification string */
extern int errors; /* counts calls to error() */
extern int minmaxusers; /* minimum "maxusers" parameter */
extern int defmaxusers; /* default "maxusers" parameter */
extern int maxmaxusers; /* default "maxusers" parameter */
extern int maxusers; /* configuration's "maxusers" parameter */
extern int maxpartitions; /* configuration's "maxpartitions" parameter */
extern int version; /* version of the configuration file */
extern struct nvlist *options; /* options */
extern struct nvlist *fsoptions; /* filesystems */
extern struct nvlist *mkoptions; /* makeoptions */
extern struct nvlist *appmkoptions; /* appending mkoptions */
extern struct nvlist *condmkoptions; /* conditional makeoption table */
extern struct hashtab *devbasetab; /* devbase lookup */
extern struct hashtab *devroottab; /* attach at root lookup */
extern struct hashtab *devatab; /* devbase attachment lookup */
extern struct hashtab *devitab; /* device instance lookup */
extern struct hashtab *deaddevitab; /* removed instances lookup */
extern struct hashtab *selecttab; /* selects things that are "optional foo" */
extern struct hashtab *needcnttab; /* retains names marked "needs-count" */
extern struct hashtab *opttab; /* table of configured options */
extern struct hashtab *fsopttab; /* table of configured file systems */
extern struct dlhash *defopttab; /* options that have been "defopt"'d */
extern struct dlhash *defflagtab; /* options that have been "defflag"'d */
extern struct dlhash *defparamtab; /* options that have been "defparam"'d */
extern struct dlhash *defoptlint; /* lint values for options */
extern struct nvhash *deffstab; /* defined file systems */
extern struct dlhash *optfiletab; /* "defopt"'d option .h files */
extern struct hashtab *attrtab; /* attributes (locators, etc.) */
extern struct hashtab *attrdeptab; /* attribute dependencies */
extern struct hashtab *bdevmtab; /* block devm lookup */
extern struct hashtab *cdevmtab; /* character devm lookup */
TAILQ_HEAD(, devbase) allbases; /* list of all devbase structures */
TAILQ_HEAD(, deva) alldevas; /* list of all devbase attachments */
TAILQ_HEAD(conftq, config) allcf; /* list of configured kernels */
TAILQ_HEAD(, devi) alldevi, /* list of all instances */
allpseudo; /* list of all pseudo-devices */
TAILQ_HEAD(, devm) alldevms; /* list of all device-majors */
TAILQ_HEAD(, pspec) allpspecs; /* list of all parent specs */
int ndevi; /* number of devi's (before packing) */
int npspecs; /* number of parent specs */
devmajor_t maxbdevm; /* max number of block major */
devmajor_t maxcdevm; /* max number of character major */
int do_devsw; /* 0 if pre-devsw config */
int oktopackage; /* 0 before setmachine() */
int devilevel; /* used for devi->i_level */
TAILQ_HEAD(devbasetq, devbase);
TAILQ_HEAD(devatq, deva);
TAILQ_HEAD(conftq, config);
TAILQ_HEAD(devitq, devi);
TAILQ_HEAD(devmtq, devm);
TAILQ_HEAD(pspectq, pspec);
struct filelist allfiles; /* list of all kernel source files */
struct filelist allcfiles; /* list of all .c files */
struct filelist allsfiles; /* list of all .S files */
struct filelist allofiles; /* list of all .o files */
extern struct devbasetq allbases; /* list of all devbase structures */
extern struct devatq alldevas; /* list of all devbase attachments */
extern struct conftq allcf; /* list of configured kernels */
extern struct devitq alldevi, /* list of all instances */
allpseudo; /* list of all pseudo-devices */
extern struct devmtq alldevms; /* list of all device-majors */
extern struct pspectq allpspecs; /* list of all parent specs */
extern int ndevi; /* number of devi's (before packing) */
extern int npspecs; /* number of parent specs */
extern devmajor_t maxbdevm; /* max number of block major */
extern devmajor_t maxcdevm; /* max number of character major */
extern int do_devsw; /* 0 if pre-devsw config */
extern int oktopackage; /* 0 before setmachine() */
extern int devilevel; /* used for devi->i_level */
struct prefixlist prefixes, /* prefix stack */
allprefixes; /* all prefixes used (after popped) */
struct prefixlist buildprefixes, /* build prefix stack */
allbuildprefixes;/* all build prefixes used (after popped) */
SLIST_HEAD(, prefix) curdirs; /* curdir stack */
extern struct filelist allfiles; /* list of all kernel source files */
extern struct filelist allcfiles; /* list of all .c files */
extern struct filelist allsfiles; /* list of all .S files */
extern struct filelist allofiles; /* list of all .o files */
extern struct prefixlist prefixes, /* prefix stack */
allprefixes; /* all prefixes used
* (after popped) */
extern struct prefixlist buildprefixes, /* build prefix stack */
allbuildprefixes;/* all build prefixes used
* (after popped) */
extern struct attr allattr;
struct devi **packed; /* arrayified table for packed devi's */
size_t npacked; /* size of packed table, <= ndevi */
extern struct devi **packed; /* arrayified table for packed devi's */
extern size_t npacked; /* size of packed table, <= ndevi */
struct { /* loc[] table for config */
extern struct locators { /* loc[] table for config */
const char **vec;
int used;
} locators;

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.91 2016/09/05 00:40:28 sevan Exp $ */
/* $NetBSD: main.c,v 1.91.6.1 2021/05/07 17:40:31 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@ -45,7 +45,7 @@
#endif
#include <sys/cdefs.h>
__RCSID("$NetBSD: main.c,v 1.91 2016/09/05 00:40:28 sevan Exp $");
__RCSID("$NetBSD: main.c,v 1.91.6.1 2021/05/07 17:40:31 martin Exp $");
#ifndef MAKE_BOOTSTRAP
#include <sys/cdefs.h>
@ -86,6 +86,78 @@ COPYRIGHT("@(#) Copyright (c) 1992, 1993\
#define LINE_MAX 1024
#endif
struct devbasetq allbases;
struct devatq alldevas;
struct conftq allcf;
struct devitq alldevi, allpseudo;
struct devmtq alldevms;
struct pspectq allpspecs;
struct devi **packed;
size_t npacked;
struct locators locators;
int lkmmode;
const char *conffile; /* source file, e.g., "GENERIC.sparc" */
const char *machine; /* machine type, e.g., "sparc" or "sun3" */
const char *machinearch; /* machine arch, e.g., "sparc" or "m68k" */
struct nvlist *machinesubarches;
/* machine subarches, e.g., "sun68k" or "hpc" */
const char *ioconfname; /* ioconf name, mutually exclusive to machine */
const char *srcdir; /* path to source directory (rel. to build) */
const char *builddir; /* path to build directory */
const char *defbuilddir; /* default build directory */
const char *ident; /* kernel "ident"ification string */
int errors; /* counts calls to error() */
int minmaxusers; /* minimum "maxusers" parameter */
int defmaxusers; /* default "maxusers" parameter */
int maxmaxusers; /* default "maxusers" parameter */
int maxusers; /* configuration's "maxusers" parameter */
int maxpartitions; /* configuration's "maxpartitions" parameter */
int version; /* version of the configuration file */
struct nvlist *options; /* options */
struct nvlist *fsoptions; /* filesystems */
struct nvlist *mkoptions; /* makeoptions */
struct nvlist *appmkoptions; /* appending mkoptions */
struct nvlist *condmkoptions; /* conditional makeoption table */
struct hashtab *devbasetab; /* devbase lookup */
struct hashtab *devroottab; /* attach at root lookup */
struct hashtab *devatab; /* devbase attachment lookup */
struct hashtab *deaddevitab; /* removed instances lookup */
struct hashtab *selecttab; /* selects things that are "optional foo" */
struct hashtab *needcnttab; /* retains names marked "needs-count" */
struct hashtab *opttab; /* table of configured options */
struct hashtab *fsopttab; /* table of configured file systems */
struct dlhash *defopttab; /* options that have been "defopt"'d */
struct dlhash *defflagtab; /* options that have been "defflag"'d */
struct dlhash *defparamtab; /* options that have been "defparam"'d */
struct dlhash *defoptlint; /* lint values for options */
struct nvhash *deffstab; /* defined file systems */
struct dlhash *optfiletab; /* "defopt"'d option .h files */
struct hashtab *attrtab; /* attributes (locators, etc.) */
struct hashtab *attrdeptab; /* attribute dependencies */
struct hashtab *bdevmtab; /* block devm lookup */
struct hashtab *cdevmtab; /* character devm lookup */
int ndevi; /* number of devi's (before packing) */
int npspecs; /* number of parent specs */
devmajor_t maxbdevm; /* max number of block major */
devmajor_t maxcdevm; /* max number of character major */
int do_devsw; /* 0 if pre-devsw config */
int oktopackage; /* 0 before setmachine() */
int devilevel; /* used for devi->i_level */
struct filelist allfiles; /* list of all kernel source files */
struct filelist allcfiles; /* list of all .c files */
struct filelist allsfiles; /* list of all .S files */
struct filelist allofiles; /* list of all .o files */
struct prefixlist prefixes, /* prefix stack */
allprefixes; /* all prefixes used (after popped) */
struct prefixlist buildprefixes, /* build prefix stack */
allbuildprefixes;/* all build prefixes used (after popped) */
int vflag; /* verbose output */
int Pflag; /* pack locators */
int Lflag; /* lint config generation */

View File

@ -1,5 +1,5 @@
%{
/* $NetBSD: scan.l,v 1.26 2016/08/07 10:37:24 christos Exp $ */
/* $NetBSD: scan.l,v 1.26.6.1 2021/05/07 17:40:31 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: scan.l,v 1.26 2016/08/07 10:37:24 christos Exp $");
__RCSID("$NetBSD: scan.l,v 1.26.6.1 2021/05/07 17:40:31 martin Exp $");
#include <sys/param.h>
#include <errno.h>
@ -108,6 +108,7 @@ static int endinclude(void);
static int getincludepath(void);
static int getcurifdef(void);
SLIST_HEAD(, prefix) curdirs; /* curdir stack */
%}

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.265.2.1 2017/07/18 15:26:14 snj Exp $ */
/* $NetBSD: main.c,v 1.265.2.2 2021/05/07 17:40:31 martin Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: main.c,v 1.265.2.1 2017/07/18 15:26:14 snj Exp $";
static char rcsid[] = "$NetBSD: main.c,v 1.265.2.2 2021/05/07 17:40:31 martin Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
__RCSID("$NetBSD: main.c,v 1.265.2.1 2017/07/18 15:26:14 snj Exp $");
__RCSID("$NetBSD: main.c,v 1.265.2.2 2021/05/07 17:40:31 martin Exp $");
#endif
#endif /* not lint */
#endif
@ -195,6 +195,8 @@ char *makeDependfile;
pid_t myPid;
int makelevel;
FILE *debug_file;
Boolean forceJobs = FALSE;
extern Lst parseIncPath;

View File

@ -1,4 +1,4 @@
/* $NetBSD: make.h,v 1.102 2016/12/07 15:00:46 christos Exp $ */
/* $NetBSD: make.h,v 1.102.6.1 2021/05/07 17:40:31 martin Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -447,7 +447,7 @@ extern pid_t myPid;
* There is one bit per module. It is up to the module what debug
* information to print.
*/
FILE *debug_file; /* Output written here - default stdout */
extern FILE *debug_file; /* Output written here - default stdout */
extern int debug;
#define DEBUG_ARCH 0x00001
#define DEBUG_COND 0x00002

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.51 2017/01/11 12:19:44 joerg Exp $
# $NetBSD: Makefile,v 1.51.6.1 2021/05/07 17:40:31 martin Exp $
#
.include <bsd.own.mk>
@ -19,6 +19,7 @@ ARCH_FILES?= ${ARCH_XLAT:M${MACHINE}-*:S/${MACHINE}-//}
.if empty(ARCH_FILES)
ARCH_FILES= ${MACHINE}.c
.endif
COPTS.machines.c+= -DSINGLE_ARCH=ib_mach_${MACHINE}
.endif
SRCS+=${ARCH_FILES}

View File

@ -1,4 +1,4 @@
/* $NetBSD: installboot.h,v 1.39 2014/02/24 07:23:44 skrll Exp $ */
/* $NetBSD: installboot.h,v 1.39.18.1 2021/05/07 17:40:31 martin Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@ -165,6 +165,7 @@ int ext2fs_findstage2(ib_params *, uint32_t *, ib_block *);
extern struct ib_mach ib_mach_alpha;
extern struct ib_mach ib_mach_amd64;
extern struct ib_mach ib_mach_amiga;
extern struct ib_mach ib_mach_emips;
extern struct ib_mach ib_mach_ews4800mips;
extern struct ib_mach ib_mach_hp300;
extern struct ib_mach ib_mach_hppa;

View File

@ -1,4 +1,4 @@
/* $NetBSD: machines.c,v 1.39 2014/02/24 07:23:44 skrll Exp $ */
/* $NetBSD: machines.c,v 1.39.18.1 2021/05/07 17:40:31 martin Exp $ */
/*-
* Copyright (c) 2002-2005 The NetBSD Foundation, Inc.
@ -35,40 +35,16 @@
#include <sys/cdefs.h>
#if !defined(__lint)
__RCSID("$NetBSD: machines.c,v 1.39 2014/02/24 07:23:44 skrll Exp $");
__RCSID("$NetBSD: machines.c,v 1.39.18.1 2021/05/07 17:40:31 martin Exp $");
#endif /* !__lint */
#include <sys/types.h>
#include "installboot.h"
/*
* Define these here so they end up as zero-filled bss if installboot
* isn't built with all the architectures defined.
* A lot simpler that conditionally including the definitions themselves.
*/
struct ib_mach
ib_mach_alpha,
ib_mach_amd64,
ib_mach_amiga,
ib_mach_emips,
ib_mach_ews4800mips,
ib_mach_hp300,
ib_mach_hppa,
ib_mach_i386,
ib_mach_landisk,
ib_mach_macppc,
ib_mach_news68k,
ib_mach_newsmips,
ib_mach_next68k,
ib_mach_pmax,
ib_mach_sparc,
ib_mach_sparc64,
ib_mach_sun2,
ib_mach_sun3,
ib_mach_vax,
ib_mach_x68k;
struct ib_mach * const machines[] = {
#ifdef SINGLE_ARCH
&SINGLE_ARCH,
#else
&ib_mach_alpha,
&ib_mach_amd64,
&ib_mach_amiga,
@ -89,6 +65,7 @@ struct ib_mach * const machines[] = {
&ib_mach_sun3,
&ib_mach_vax,
&ib_mach_x68k,
#endif
NULL
};