From owner-svn-src-vendor@freebsd.org Mon Dec 19 21:51:02 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71270C88B33; Mon, 19 Dec 2016 21:51:02 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39AD71348; Mon, 19 Dec 2016 21:51:02 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJLp16D089737; Mon, 19 Dec 2016 21:51:01 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJLoxW2089716; Mon, 19 Dec 2016 21:50:59 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201612192150.uBJLoxW2089716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 19 Dec 2016 21:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310299 - in vendor/NetBSD/bmake/dist: . mk X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 21:51:02 -0000 Author: sjg Date: Mon Dec 19 21:50:59 2016 New Revision: 310299 URL: https://svnweb.freebsd.org/changeset/base/310299 Log: Import bmake-20161212 From ChangeLog 2016-12-12 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20161212 Merge with NetBSD make, pick up o main.c: look for obj.${MACHINE}-${MACHINE_ARCH} too. 2016-12-09 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20161209 Merge with NetBSD make, pick up o main.c: cleanup setting of .OBJDIR o parse.c: avoid coredump from (var)=val 2016-11-26 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20161126 Merge with NetBSD make, pick up o make.c: Make_OODate: report src node name if path not set 2016-09-26 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20160926 Merge with NetBSD make, pick up o support for .DELETE_ON_ERROR: (remove targets that fail) 2016-09-26 Simon J. Gerraty * Makefile MAN: tweak .Dt to match ${PROG} mk/ChangeLog 2016-12-12 Simon J. Gerraty * install-mk (MK_VERSION): 20161212 * meta2deps.py: set pid_cwd[pid] when we process 'C'hdir, rather than when we detect pid change. 2016-12-07 Simon J. Gerraty * install-mk (MK_VERSION): 20161207 * meta.stage.mk: add stage_as_and_symlink for staging packages. We build foo.tgz stage_as foo-${VERSION}.tgz but want to be able to use foo.tgz to reference the latest staged version - so we make foo.tgz a symlink to it. Using a target to do both operations ensures we stay in sync. 2016-11-26 Simon J. Gerraty * install-mk (MK_VERSION): 20161126 * dirdeps.mk: set DIRDEPS_CACHE before we include local.dirdeps.mk so it can add dependencies. 2016-10-10 Simon J. Gerraty * dirdeps.mk: set DEP_* before we expand .MAKE.DEPENDFILE_PREFERENCE do that they can influence the result correctly. * dirdeps.mk (${DIRDEPS_CACHE}): make sure we pass on TARGET_SPEC * dirdeps.mk: Add ONLY_TARGET_SPEC_LIST and NOT_TARGET_SPEC_LIST similar to ONLY_MACHINE_LIST and NOT_MACHINE_LIST 2016-10-05 Simon J. Gerraty * dirdeps.mk: remove dependence on jot (normal situations anyway). Before we read another Makefile.depend* set DEP_* vars from _DEP_TARGET_SPEC in case it uses any of them with := When bootstrapping, trim any ,* from extention of chosen _src Makefile.depend* to get the machine value we subst for. 2016-09-30 Simon J. Gerraty * dirdeps.mk: use TARGET_SPEC_VARS to qualify components added to DEP_SKIP_DIR and DEP_DIRDEPS_FILTER * sys.mk: extract some bits to sys.{debug,vars}.mk for easier re-use by others. 2016-09-23 Simon Gerraty * lib.mk: Use ${PICO} for extension for PIC objects. default to .pico (like NetBSD) safe on case insensitive filesystem. 2016-08-19 Simon J. Gerraty * meta.sys.mk (META_COOKIE_TOUCH): use ${.OBJDIR}/${.TARGET:T} as default Added: vendor/NetBSD/bmake/dist/mk/sys.debug.mk (contents, props changed) vendor/NetBSD/bmake/dist/mk/sys.vars.mk (contents, props changed) Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/bmake.1 vendor/NetBSD/bmake/dist/bmake.cat1 vendor/NetBSD/bmake/dist/compat.c vendor/NetBSD/bmake/dist/job.c vendor/NetBSD/bmake/dist/main.c vendor/NetBSD/bmake/dist/make.1 vendor/NetBSD/bmake/dist/make.c vendor/NetBSD/bmake/dist/make.h vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/FILES vendor/NetBSD/bmake/dist/mk/dirdeps.mk vendor/NetBSD/bmake/dist/mk/gendirdeps.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/lib.mk vendor/NetBSD/bmake/dist/mk/meta.stage.mk vendor/NetBSD/bmake/dist/mk/meta.sys.mk vendor/NetBSD/bmake/dist/mk/meta2deps.py vendor/NetBSD/bmake/dist/mk/meta2deps.sh vendor/NetBSD/bmake/dist/mk/sys.mk vendor/NetBSD/bmake/dist/nonints.h vendor/NetBSD/bmake/dist/parse.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/ChangeLog Mon Dec 19 21:50:59 2016 (r310299) @@ -1,3 +1,32 @@ +2016-12-12 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20161212 + Merge with NetBSD make, pick up + o main.c: look for obj.${MACHINE}-${MACHINE_ARCH} too. + +2016-12-09 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20161209 + Merge with NetBSD make, pick up + o main.c: cleanup setting of .OBJDIR + o parse.c: avoid coredump from (var)=val + +2016-11-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20161126 + Merge with NetBSD make, pick up + o make.c: Make_OODate: report src node name if path not set + +2016-09-26 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160926 + Merge with NetBSD make, pick up + o support for .DELETE_ON_ERROR: (remove targets that fail) + +2016-09-26 Simon J. Gerraty + + * Makefile MAN: tweak .Dt to match ${PROG} + 2016-08-18 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20160818 Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/Makefile Mon Dec 19 21:50:59 2016 (r310299) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.72 2016/08/18 23:02:26 sjg Exp $ +# $Id: Makefile,v 1.77 2016/12/12 07:34:19 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160818 +_MAKE_VERSION= 20161212 PROG= bmake @@ -156,7 +156,10 @@ my.history: ${MAKEFILE} .NOPATH: ${MAN} ${MAN}: make.1 my.history @echo making $@ - @sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \ + @sed \ + -e '/^.Dt/s/MAKE/${PROG:tu}/' \ + -e 's/^.Nx/NetBSD/' \ + -e '/^.Nm/s/make/${PROG}/' \ -e '/^.Sh HISTORY/rmy.history' \ -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${srcdir}/make.1 > $@ Modified: vendor/NetBSD/bmake/dist/bmake.1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.1 Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/bmake.1 Mon Dec 19 21:50:59 2016 (r310299) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.262 2016/08/18 19:23:20 wiz Exp $ +.\" $NetBSD: make.1,v 1.263 2016/08/26 23:37:54 dholland Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,8 +29,8 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd August 15, 2016 -.Dt MAKE 1 +.Dd August 26, 2016 +.Dt BMAKE 1 .Os .Sh NAME .Nm bmake @@ -2011,6 +2011,14 @@ variable of a target that inherits .Ic .DEFAULT Ns 's commands is set to the target's own name. +.It Ic .DELETE_ON_ERROR +If this target is present in the makefile, it globally causes make to +delete targets whose commands fail. +(By default, only targets whose commands are interrupted during +execution are deleted. +This is the historical behavior.) +This setting can be used to help prevent half-finished or malformed +targets from being left around and corrupting future rebuilds. .It Ic .END Any command lines attached to this target are executed after everything else is done. Modified: vendor/NetBSD/bmake/dist/bmake.cat1 ============================================================================== --- vendor/NetBSD/bmake/dist/bmake.cat1 Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/bmake.cat1 Mon Dec 19 21:50:59 2016 (r310299) @@ -1,4 +1,4 @@ -MAKE(1) NetBSD General Commands Manual MAKE(1) +BMAKE(1) NetBSD General Commands Manual BMAKE(1) NNAAMMEE bbmmaakkee -- maintain program dependencies @@ -1285,6 +1285,14 @@ SSPPEECCIIAALL TTAARRGGEETT target that inherits ..DDEEFFAAUULLTT's commands is set to the target's own name. + ..DDEELLEETTEE__OONN__EERRRROORR + If this target is present in the makefile, it globally causes + make to delete targets whose commands fail. (By default, only + targets whose commands are interrupted during execution are + deleted. This is the historical behavior.) This setting can be + used to help prevent half-finished or malformed targets from + being left around and corrupting future rebuilds. + ..EENNDD Any command lines attached to this target are executed after everything else is done. @@ -1498,4 +1506,4 @@ BBUUGGSS There is no way of escaping a space character in a filename. -NetBSD 5.1 August 15, 2016 NetBSD 5.1 +NetBSD 5.1 August 26, 2016 NetBSD 5.1 Modified: vendor/NetBSD/bmake/dist/compat.c ============================================================================== --- vendor/NetBSD/bmake/dist/compat.c Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/compat.c Mon Dec 19 21:50:59 2016 (r310299) @@ -1,4 +1,4 @@ -/* $NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $ */ +/* $NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $"; +static char rcsid[] = "$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: compat.c,v 1.105 2016/05/12 20:28:34 sjg Exp $"); +__RCSID("$NetBSD: compat.c,v 1.106 2016/08/26 23:28:39 dholland Exp $"); #endif #endif /* not lint */ #endif @@ -119,6 +119,25 @@ static GNode *curTarg = NULL; static GNode *ENDNode; static void CompatInterrupt(int); +/* + * CompatDeleteTarget -- delete a failed, interrupted, or otherwise + * duffed target if not inhibited by .PRECIOUS. + */ +static void +CompatDeleteTarget(GNode *gn) +{ + if ((gn != NULL) && !Targ_Precious (gn)) { + char *p1; + char *file = Var_Value(TARGET, gn, &p1); + + if (!noExecute && eunlink(file) != -1) { + Error("*** %s removed", file); + } + + free(p1); + } +} + /*- *----------------------------------------------------------------------- * CompatInterrupt -- @@ -132,6 +151,9 @@ static void CompatInterrupt(int); * The target is removed and the process exits. If .INTERRUPT exists, * its commands are run first WITH INTERRUPTS IGNORED.. * + * XXX: is .PRECIOUS supposed to inhibit .INTERRUPT? I doubt it, but I've + * left the logic alone for now. - dholland 20160826 + * *----------------------------------------------------------------------- */ static void @@ -139,16 +161,9 @@ CompatInterrupt(int signo) { GNode *gn; - if ((curTarg != NULL) && !Targ_Precious (curTarg)) { - char *p1; - char *file = Var_Value(TARGET, curTarg, &p1); - - if (!noExecute && eunlink(file) != -1) { - Error("*** %s removed", file); - } - - free(p1); + CompatDeleteTarget(curTarg); + if ((curTarg != NULL) && !Targ_Precious (curTarg)) { /* * Run .INTERRUPT only if hit with interrupt signal */ @@ -158,7 +173,6 @@ CompatInterrupt(int signo) Compat_Make(gn, gn); } } - } if (signo == SIGQUIT) _exit(signo); @@ -447,6 +461,11 @@ again: * continue. */ printf(" (continuing)\n"); + } else { + printf("\n"); + } + if (deleteOnError) { + CompatDeleteTarget(gn); } } else { /* @@ -607,7 +626,7 @@ Compat_Make(void *gnp, void *pgnp) } else if (keepgoing) { pgn->flags &= ~REMAKE; } else { - PrintOnError(gn, "\n\nStop."); + PrintOnError(gn, "\nStop."); exit(1); } } else if (gn->made == ERROR) { @@ -698,7 +717,7 @@ Compat_Run(Lst targs) if (gn != NULL) { Compat_Make(gn, gn); if (gn->made == ERROR) { - PrintOnError(gn, "\n\nStop."); + PrintOnError(gn, "\nStop."); exit(1); } } @@ -739,7 +758,7 @@ Compat_Run(Lst targs) if (errors == 0) { Compat_Make(ENDNode, ENDNode); if (gn->made == ERROR) { - PrintOnError(gn, "\n\nStop."); + PrintOnError(gn, "\nStop."); exit(1); } } Modified: vendor/NetBSD/bmake/dist/job.c ============================================================================== --- vendor/NetBSD/bmake/dist/job.c Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/job.c Mon Dec 19 21:50:59 2016 (r310299) @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $ */ +/* $NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.187 2016/05/12 20:28:34 sjg Exp $"); +__RCSID("$NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $"); #endif #endif /* not lint */ #endif @@ -388,6 +388,21 @@ job_table_dump(const char *where) } /* + * Delete the target of a failed, interrupted, or otherwise + * unsuccessful job unless inhibited by .PRECIOUS. + */ +static void +JobDeleteTarget(GNode *gn) +{ + if ((gn->type & (OP_JOIN|OP_PHONY)) == 0 && !Targ_Precious(gn)) { + char *file = (gn->path == NULL ? gn->name : gn->path); + if (!noExecute && eunlink(file) != -1) { + Error("*** %s removed", file); + } + } +} + +/* * JobSigLock/JobSigUnlock * * Signal lock routines to get exclusive access. Currently used to @@ -1033,6 +1048,9 @@ JobFinish (Job *job, WAIT_T status) if (job->flags & JOB_IGNERR) { WAIT_STATUS(status) = 0; } else { + if (deleteOnError) { + JobDeleteTarget(job->node); + } PrintOnError(job->node, NULL); } } else if (DEBUG(JOB)) { @@ -1050,6 +1068,9 @@ JobFinish (Job *job, WAIT_T status) } (void)printf("*** [%s] Signal %d\n", job->node->name, WTERMSIG(status)); + if (deleteOnError) { + JobDeleteTarget(job->node); + } } (void)fflush(stdout); } @@ -2578,12 +2599,7 @@ JobInterrupt(int runINTERRUPT, int signo gn = job->node; - if ((gn->type & (OP_JOIN|OP_PHONY)) == 0 && !Targ_Precious(gn)) { - char *file = (gn->path == NULL ? gn->name : gn->path); - if (!noExecute && eunlink(file) != -1) { - Error("*** %s removed", file); - } - } + JobDeleteTarget(gn); if (job->pid) { if (DEBUG(JOB)) { (void)fprintf(debug_file, Modified: vendor/NetBSD/bmake/dist/main.c ============================================================================== --- vendor/NetBSD/bmake/dist/main.c Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/main.c Mon Dec 19 21:50:59 2016 (r310299) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.250 2016/08/11 19:53:17 sjg Exp $ */ +/* $NetBSD: main.c,v 1.254 2016/12/10 23:12:39 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.250 2016/08/11 19:53:17 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.254 2016/12/10 23:12:39 christos Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.250 2016/08/11 19:53:17 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.254 2016/12/10 23:12:39 christos Exp $"); #endif #endif /* not lint */ #endif @@ -155,6 +155,7 @@ Lst create; /* Targets to be made */ time_t now; /* Time at start of make */ GNode *DEFAULT; /* .DEFAULT node */ Boolean allPrecious; /* .PRECIOUS given on line by itself */ +Boolean deleteOnError; /* .DELETE_ON_ERROR: set */ static Boolean noBuiltins; /* -r flag */ static Lst makefiles; /* ordered list of makefiles to read */ @@ -711,18 +712,24 @@ Main_ParseArgLine(const char *line) } Boolean -Main_SetObjdir(const char *path) +Main_SetObjdir(const char *fmt, ...) { struct stat sb; - char *p = NULL; - char buf[MAXPATHLEN + 1]; + char *p, *path; + char buf[MAXPATHLEN + 1], pbuf[MAXPATHLEN + 1]; Boolean rc = FALSE; + va_list ap; + + va_start(ap, fmt); + vsnprintf(path = pbuf, MAXPATHLEN, fmt, ap); + va_end(ap); /* expand variable substitutions */ if (strchr(path, '$') != 0) { snprintf(buf, MAXPATHLEN, "%s", path); path = p = Var_Subst(NULL, buf, VAR_GLOBAL, VARF_WANTRES); - } + } else + p = NULL; if (path[0] != '/') { snprintf(buf, MAXPATHLEN, "%s/%s", curdir, path); @@ -749,6 +756,18 @@ Main_SetObjdir(const char *path) return rc; } +static Boolean +Main_SetVarObjdir(const char *var, const char *suffix) +{ + char *p1, *path; + if ((path = Var_Value(var, VAR_CMD, &p1)) == NULL) + return FALSE; + + (void)Main_SetObjdir("%s%s", path, suffix); + free(p1); + return TRUE; +} + /*- * ReadAllMakefiles -- * wrapper around ReadMakefile() to read all. @@ -979,6 +998,7 @@ main(int argc, char **argv) noRecursiveExecute = FALSE; /* Execute all .MAKE targets */ keepgoing = FALSE; /* Stop on error */ allPrecious = FALSE; /* Remove targets when interrupted */ + deleteOnError = FALSE; /* Historical default behavior */ queryFlag = FALSE; /* This is not just a check-run */ noBuiltins = FALSE; /* Read the built-in rules */ touchFlag = FALSE; /* Actually update targets */ @@ -1128,28 +1148,19 @@ main(int argc, char **argv) * MAKEOBJDIR is set in the environment, try only that value * and fall back to .CURDIR if it does not exist. * - * Otherwise, try _PATH_OBJDIR.MACHINE, _PATH_OBJDIR, and - * finally _PATH_OBJDIRPREFIX`pwd`, in that order. If none + * Otherwise, try _PATH_OBJDIR.MACHINE-MACHINE_ARCH, _PATH_OBJDIR.MACHINE, + * and * finally _PATH_OBJDIRPREFIX`pwd`, in that order. If none * of these paths exist, just use .CURDIR. */ Dir_Init(curdir); - (void)Main_SetObjdir(curdir); + (void)Main_SetObjdir("%s", curdir); - if ((path = Var_Value("MAKEOBJDIRPREFIX", VAR_CMD, &p1)) != NULL) { - (void)snprintf(mdpath, MAXPATHLEN, "%s%s", path, curdir); - (void)Main_SetObjdir(mdpath); - free(p1); - } else if ((path = Var_Value("MAKEOBJDIR", VAR_CMD, &p1)) != NULL) { - (void)Main_SetObjdir(path); - free(p1); - } else { - (void)snprintf(mdpath, MAXPATHLEN, "%s.%s", _PATH_OBJDIR, machine); - if (!Main_SetObjdir(mdpath) && !Main_SetObjdir(_PATH_OBJDIR)) { - (void)snprintf(mdpath, MAXPATHLEN, "%s%s", - _PATH_OBJDIRPREFIX, curdir); - (void)Main_SetObjdir(mdpath); - } - } + if (!Main_SetVarObjdir("MAKEOBJDIRPREFIX", curdir) && + !Main_SetVarObjdir("MAKEOBJDIR", "") && + !Main_SetObjdir("%s.%s-%s", _PATH_OBJDIR, machine, machine_arch) && + !Main_SetObjdir("%s.%s", _PATH_OBJDIR, machine) && + !Main_SetObjdir("%s", _PATH_OBJDIR)) + (void)Main_SetObjdir("%s%s", _PATH_OBJDIRPREFIX, curdir); /* * Initialize archive, target and suffix modules in preparation for Modified: vendor/NetBSD/bmake/dist/make.1 ============================================================================== --- vendor/NetBSD/bmake/dist/make.1 Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/make.1 Mon Dec 19 21:50:59 2016 (r310299) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.262 2016/08/18 19:23:20 wiz Exp $ +.\" $NetBSD: make.1,v 1.263 2016/08/26 23:37:54 dholland Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd August 15, 2016 +.Dd August 26, 2016 .Dt MAKE 1 .Os .Sh NAME @@ -2011,6 +2011,14 @@ variable of a target that inherits .Ic .DEFAULT Ns 's commands is set to the target's own name. +.It Ic .DELETE_ON_ERROR +If this target is present in the makefile, it globally causes make to +delete targets whose commands fail. +(By default, only targets whose commands are interrupted during +execution are deleted. +This is the historical behavior.) +This setting can be used to help prevent half-finished or malformed +targets from being left around and corrupting future rebuilds. .It Ic .END Any command lines attached to this target are executed after everything else is done. Modified: vendor/NetBSD/bmake/dist/make.c ============================================================================== --- vendor/NetBSD/bmake/dist/make.c Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/make.c Mon Dec 19 21:50:59 2016 (r310299) @@ -1,4 +1,4 @@ -/* $NetBSD: make.c,v 1.95 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: make.c,v 1.96 2016/11/10 23:41:58 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: make.c,v 1.95 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: make.c,v 1.96 2016/11/10 23:41:58 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: make.c,v 1.95 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: make.c,v 1.96 2016/11/10 23:41:58 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -308,7 +308,7 @@ Make_OODate(GNode *gn) if (DEBUG(MAKE)) { if (gn->cmgn != NULL && gn->mtime < gn->cmgn->mtime) { fprintf(debug_file, "modified before source %s...", - gn->cmgn->path); + gn->cmgn->path ? gn->cmgn->path : gn->cmgn->name); } else if (gn->mtime == 0) { fprintf(debug_file, "non-existent and no sources..."); } else { Modified: vendor/NetBSD/bmake/dist/make.h ============================================================================== --- vendor/NetBSD/bmake/dist/make.h Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/make.h Mon Dec 19 21:50:59 2016 (r310299) @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.100 2016/06/07 00:40:00 sjg Exp $ */ +/* $NetBSD: make.h,v 1.102 2016/12/07 15:00:46 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -389,6 +389,7 @@ extern Boolean beSilent; /* True if extern Boolean noExecute; /* True if should execute nothing */ extern Boolean noRecursiveExecute; /* True if should execute nothing */ extern Boolean allPrecious; /* True if every target is precious */ +extern Boolean deleteOnError; /* True if failed targets should be deleted */ extern Boolean keepgoing; /* True if should continue on unaffected * portions of the graph when have an error * in one portion */ @@ -503,7 +504,7 @@ char * Check_Cwd_Cmd(const char *); void Check_Cwd(const char **); void PrintOnError(GNode *, const char *); void Main_ExportMAKEFLAGS(Boolean); -Boolean Main_SetObjdir(const char *); +Boolean Main_SetObjdir(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2); int mkTempFile(const char *, char **); int str2Lst_Append(Lst, char *, const char *); int cached_lstat(const char *, void *); Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Mon Dec 19 21:50:59 2016 (r310299) @@ -1,3 +1,62 @@ +2016-12-12 Simon J. Gerraty + + * install-mk (MK_VERSION): 20161212 + + * meta2deps.py: set pid_cwd[pid] when we process 'C'hdir, + rather than when we detect pid change. + +2016-12-07 Simon J. Gerraty + + * install-mk (MK_VERSION): 20161207 + + * meta.stage.mk: add stage_as_and_symlink for staging packages. + We build foo.tgz stage_as foo-${VERSION}.tgz but want to be able + to use foo.tgz to reference the latest staged version - so we + make foo.tgz a symlink to it. + Using a target to do both operations ensures we stay in sync. + +2016-11-26 Simon J. Gerraty + + * install-mk (MK_VERSION): 20161126 + + * dirdeps.mk: set DIRDEPS_CACHE before we include local.dirdeps.mk + so it can add dependencies. + +2016-10-10 Simon J. Gerraty + + * dirdeps.mk: set DEP_* before we expand .MAKE.DEPENDFILE_PREFERENCE + do that they can influence the result correctly. + + * dirdeps.mk (${DIRDEPS_CACHE}): make sure we pass on TARGET_SPEC + + * dirdeps.mk: Add ONLY_TARGET_SPEC_LIST and NOT_TARGET_SPEC_LIST + similar to ONLY_MACHINE_LIST and NOT_MACHINE_LIST + +2016-10-05 Simon J. Gerraty + + * dirdeps.mk: remove dependence on jot (normal situations anyway). + Before we read another Makefile.depend* set DEP_* vars from + _DEP_TARGET_SPEC in case it uses any of them with := + When bootstrapping, trim any ,* from extention of chosen _src + Makefile.depend* to get the machine value we subst for. + +2016-09-30 Simon J. Gerraty + + * dirdeps.mk: use TARGET_SPEC_VARS to qualify components added to + DEP_SKIP_DIR and DEP_DIRDEPS_FILTER + + * sys.mk: extract some bits to sys.{debug,vars}.mk + for easier re-use by others. + +2016-09-23 Simon Gerraty + + * lib.mk: Use ${PICO} for extension for PIC objects. + default to .pico (like NetBSD) safe on case insensitive filesystem. + +2016-08-19 Simon J. Gerraty + + * meta.sys.mk (META_COOKIE_TOUCH): use ${.OBJDIR}/${.TARGET:T} as default + 2016-08-15 Simon J. Gerraty * install-mk (MK_VERSION): 20160815 Modified: vendor/NetBSD/bmake/dist/mk/FILES ============================================================================== --- vendor/NetBSD/bmake/dist/mk/FILES Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/mk/FILES Mon Dec 19 21:50:59 2016 (r310299) @@ -38,7 +38,9 @@ stage-install.sh subdir.mk sys.mk sys.clean-env.mk +sys.debug.mk sys.dependfile.mk +sys.vars.mk sys/AIX.mk sys/Darwin.mk sys/Generic.mk Modified: vendor/NetBSD/bmake/dist/mk/dirdeps.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/dirdeps.mk Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/mk/dirdeps.mk Mon Dec 19 21:50:59 2016 (r310299) @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.73 2016/08/15 19:28:13 sjg Exp $ +# $Id: dirdeps.mk,v 1.84 2016/11/27 02:44:34 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -56,9 +56,12 @@ # .MAKE.DEPENDFILE_PREFIX) to refer to these makefiles to # distinguish them from others. # -# Each Makefile.depend file sets DEP_RELDIR to be the -# the RELDIR (path relative to SRCTOP) for its directory, and -# since each Makefile.depend file includes dirdeps.mk, this +# Before each Makefile.depend file is read, we set +# DEP_RELDIR to be the the RELDIR (path relative to SRCTOP) for +# its directory, and DEP_MACHINE etc according to the . +# represented by the suffix of the corresponding target. +# +# Since each Makefile.depend file includes dirdeps.mk, this # processing is recursive and results in .MAKE.LEVEL 0 learning the # dependencies of the tree wrt the initial directory (_DEP_RELDIR). # @@ -110,6 +113,29 @@ # # as we may need it to find Makefile.depend* # TARGET_SPEC = ${TARGET_SPEC_VARS:@v@${$v:U}@:ts,} # +# The following variables can influence the initial DIRDEPS +# computation with regard to the TARGET_SPECs that will be +# built. +# Most should also be considered by init.mk +# +# ONLY_TARGET_SPEC_LIST +# Defines a list of TARGET_SPECs for which the current +# directory can be built. +# If ALL_MACHINES is defined, we build for all the +# TARGET_SPECs listed. +# +# ONLY_MACHINE_LIST +# As for ONLY_TARGET_SPEC_LIST but only specifies +# MACHINEs. +# +# NOT_TARGET_SPEC_LIST +# A list of TARGET_SPECs for which the current +# directory should not be built. +# +# NOT_MACHINE_LIST +# A list of MACHINEs the current directory should not be +# built for. +# # touch this at your peril _DIRDEP_USE_LEVEL?= 0 @@ -171,9 +197,13 @@ DEP_$v ?= ${$v} # we compute below are fully qualified wrt DEP_TARGET_SPEC. # The makefiles may only partially specify (eg. MACHINE only), # so we need to construct a set of modifiers to fill in the gaps. -# jot 10 should output 1 2 3 .. 10 -JOT ?= jot -_tspec_x := ${${JOT} ${TARGET_SPEC_VARS:[#]}:L:sh} +.if ${TARGET_SPEC_VARS:[#]} > 10 +# seriously? better have jot(1) or equivalent to produce suitable sequence +_tspec_x := ${${JOT:Ujot} ${TARGET_SPEC_VARS:[#]}:L:sh} +.else +# we can provide the sequence ourselves +_tspec_x := ${1 2 3 4 5 6 7 8 9 10:L:[1..${TARGET_SPEC_VARS:[#]}]} +.endif # this handles unqualified entries M_dep_qual_fixes = C;(/[^/.,]+)$$;\1.$${DEP_TARGET_SPEC}; # there needs to be at least one item missing for these to make sense @@ -287,6 +317,18 @@ _DEP_RELDIR := ${DEP_RELDIR} .endif +# DIRDEPS_CACHE can be very handy for debugging. +# Also if repeatedly building the same target, +# we can avoid the overhead of re-computing the tree dependencies. +MK_DIRDEPS_CACHE ?= no +BUILD_DIRDEPS_CACHE ?= no +BUILD_DIRDEPS ?= yes + +.if ${MK_DIRDEPS_CACHE} == "yes" +# this is where we will cache all our work +DIRDEPS_CACHE ?= ${_OBJDIR:tA}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.} +.endif + # pickup customizations # as below you can use !target(_DIRDEP_USE) to protect things # which should only be done once. @@ -305,8 +347,10 @@ SKIP_DIR.host += ${SKIP_HOSTDIR} DEP_SKIP_DIR = ${SKIP_DIR} \ ${SKIP_DIR.${DEP_TARGET_SPEC}:U} \ - ${SKIP_DIR.${DEP_MACHINE}:U} \ - ${SKIP_DIRDEPS.${DEP_MACHINE}:U} + ${TARGET_SPEC_VARS:@v@${SKIP_DIR.${DEP_$v}:U}@} \ + ${SKIP_DIRDEPS.${DEP_TARGET_SPEC}:U} \ + ${TARGET_SPEC_VARS:@v@${SKIP_DIRDEPS.${DEP_$v}:U}@} + NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}} @@ -344,7 +388,7 @@ _DIRDEP_USE: .USE .MAKE .ifdef ALL_MACHINES # this is how you limit it to only the machines we have been built for # previously. -.if empty(ONLY_MACHINE_LIST) +.if empty(ONLY_TARGET_SPEC_LIST) && empty(ONLY_MACHINE_LIST) .if !empty(ALL_MACHINE_LIST) # ALL_MACHINE_LIST is the list of all legal machines - ignore anything else _machine_list != cd ${_CURDIR} && 'ls' -1 ${ALL_MACHINE_LIST:O:u:@m@${.MAKE.DEPENDFILE:T:R}.$m@} 2> /dev/null; echo @@ -353,7 +397,7 @@ _machine_list != 'ls' -1 ${_CURDIR}/${.M .endif _only_machines := ${_machine_list:${NIgnoreFiles:UN*.bak}:E:O:u} .else -_only_machines := ${ONLY_MACHINE_LIST} +_only_machines := ${ONLY_TARGET_SPEC_LIST:U} ${ONLY_MACHINE_LIST:U} .endif .if empty(_only_machines) @@ -362,30 +406,35 @@ _only_machines := ${TARGET_MACHINE:U${AL .endif .else # ! ALL_MACHINES -# if ONLY_MACHINE_LIST is set, we are limited to that +# if ONLY_TARGET_SPEC_LIST or ONLY_MACHINE_LIST is set, we are limited to that. +# Note that ONLY_TARGET_SPEC_LIST should be fully qualified. # if TARGET_MACHINE is set - it is really the same as ONLY_MACHINE_LIST # otherwise DEP_MACHINE is it - so DEP_MACHINE will match. +_only_machines := ${ONLY_TARGET_SPEC_LIST:U:M${DEP_MACHINE},*} +.if empty(_only_machines) _only_machines := ${ONLY_MACHINE_LIST:U${TARGET_MACHINE:U${DEP_MACHINE}}:M${DEP_MACHINE}} .endif +.endif .if !empty(NOT_MACHINE_LIST) _only_machines := ${_only_machines:${NOT_MACHINE_LIST:${M_ListToSkip}}} .endif +.if !empty(NOT_TARGET_SPEC_LIST) +# we must first qualify +_dm := ${DEP_MACHINE} +_only_machines := ${_only_machines:M*,*} ${_only_machines:N*,*:@DEP_MACHINE@${DEP_TARGET_SPEC}@:S,^,.,:${M_dep_qual_fixes:ts:}:O:u:S,^.,,} +DEP_MACHINE := ${_dm} +_only_machines := ${_only_machines:${NOT_TARGET_SPEC_LIST:${M_ListToSkip}}} +.endif +# clean up +_only_machines := ${_only_machines:O:u} # make sure we have a starting place? DIRDEPS ?= ${RELDIR} .endif # target -# if repeatedly building the same target, -# we can avoid the overhead of re-computing the tree dependencies. -MK_DIRDEPS_CACHE ?= no -BUILD_DIRDEPS_CACHE ?= no -BUILD_DIRDEPS ?= yes - .if !defined(NO_DIRDEPS) && !defined(NO_DIRDEPS_BELOW) .if ${MK_DIRDEPS_CACHE} == "yes" -# this is where we will cache all our work -DIRDEPS_CACHE?= ${_OBJDIR:tA}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.} # just ensure this exists build-dirdeps: @@ -420,6 +469,7 @@ ${DIRDEPS_CACHE}: .META .NOMETA_CMP } > ${.TARGET}.new +@MAKELEVEL=${.MAKE.LEVEL} DIRDEPS_CACHE=${DIRDEPS_CACHE} \ DIRDEPS="${DIRDEPS}" \ + TARGET_SPEC=${TARGET_SPEC} \ MAKEFLAGS= ${.MAKE} -C ${_CURDIR} -f ${BUILD_DIRDEPS_MAKEFILE} \ ${BUILD_DIRDEPS_TARGETS} BUILD_DIRDEPS_CACHE=yes \ .MAKE.DEPENDFILE=.none \ @@ -489,8 +539,10 @@ _machines := ${_machines:O:u} _dm := ${DEP_MACHINE} # apply the same filtering that we do when qualifying DIRDEPS. # M_dep_qual_fixes expects .${MACHINE}* so add (and remove) '.' -_machines := ${_machines:@DEP_MACHINE@${DEP_TARGET_SPEC}@:S,^,.,:${M_dep_qual_fixes:ts:}:O:u:S,^.,,} +# Again we expect that any already qualified machines are fully qualified. +_machines := ${_machines:M*,*} ${_machines:N*,*:@DEP_MACHINE@${DEP_TARGET_SPEC}@:S,^,.,:${M_dep_qual_fixes:ts:}:O:u:S,^.,,} DEP_MACHINE := ${_dm} +_machines := ${_machines:O:u} .endif # reset each time through @@ -522,7 +574,7 @@ _build_dirs += ${_machines:N${DEP_TARGET # these we reset each time through as they can depend on DEP_MACHINE DEP_DIRDEPS_FILTER = \ ${DIRDEPS_FILTER.${DEP_TARGET_SPEC}:U} \ - ${DIRDEPS_FILTER.${DEP_MACHINE}:U} \ + ${TARGET_SPEC_VARS:@v@${DIRDEPS_FILTER.${DEP_$v}:U}@} \ ${DIRDEPS_FILTER:U} .if empty(DEP_DIRDEPS_FILTER) # something harmless @@ -621,6 +673,19 @@ _dirdeps_checked.$d: .endif # Note: _build_all_dirs is fully qualifed so d:R is always the directory .if exists(${d:R}) +# we pass _DEP_TARGET_SPEC to tell the next step what we want +_DEP_TARGET_SPEC := ${d:E} +# some makefiles may still look at this +_DEP_MACHINE := ${d:E:C/,.*//} +# set these too in case Makefile.depend* uses them +.if ${TARGET_SPEC_VARS:[#]} > 1 +_dtspec := ${_DEP_TARGET_SPEC:S/,/ /g} +.for i in ${_tspec_x} +DEP_${TARGET_SPEC_VARS:[$i]} := ${_dtspec:[$i]} +.endfor +.else +DEP_MACHINE := ${_DEP_MACHINE} +.endif # Warning: there is an assumption here that MACHINE is always # the first entry in TARGET_SPEC_VARS. # If TARGET_SPEC and MACHINE are insufficient, you have a problem. @@ -631,10 +696,6 @@ _qm := ${_m:C;(\.depend)$;\1.${d:E};:${M .if ${_debug_search} .info Looking for ${_qm} .endif -# we pass _DEP_TARGET_SPEC to tell the next step what we want -_DEP_TARGET_SPEC := ${d:E} -# some makefiles may still look at this -_DEP_MACHINE := ${d:E:C/,.*//} # set this "just in case" # we can skip :tA since we computed the path above DEP_RELDIR := ${_m:H:S,${SRCTOP}/,,} @@ -687,7 +748,7 @@ _src != cd ${.CURDIR} && for m in ${.MAK _src?= ${.MAKE.DEPENDFILE} -.MAKE.DEPENDFILE_BOOTSTRAP_SED+= -e 's,${_src:E},${MACHINE},g' +.MAKE.DEPENDFILE_BOOTSTRAP_SED+= -e 's/${_src:E:C/,.*//}/${MACHINE}/g' # just create Makefile.depend* for this dir bootstrap-this: .NOTMAIN @@ -696,7 +757,7 @@ bootstrap-this: .NOTMAIN .if ${_src:T} != ${.MAKE.DEPENDFILE_PREFIX:T} (cd ${.CURDIR} && sed ${.MAKE.DEPENDFILE_BOOTSTRAP_SED} ${_src} > ${_want}) .else - cp ${.CURDIR}/${_src} ${_want} + cp ${.CURDIR}/${_src:T} ${_want} .endif # create Makefile.depend* for this dir and its dependencies Modified: vendor/NetBSD/bmake/dist/mk/gendirdeps.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/gendirdeps.mk Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/mk/gendirdeps.mk Mon Dec 19 21:50:59 2016 (r310299) @@ -1,4 +1,4 @@ -# $Id: gendirdeps.mk,v 1.32 2016/04/05 15:58:37 sjg Exp $ +# $Id: gendirdeps.mk,v 1.33 2016/10/11 22:37:28 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -146,6 +146,9 @@ M2D_OBJROOTS += ${OBJTOP} ${_OBJROOT} ${ .if defined(SB_OBJROOT) M2D_OBJROOTS += ${SB_OBJROOT} .endif +.if defined(STAGE_ROOT) +M2D_OBJROOTS += ${STAGE_ROOT} +.endif .if ${.MAKE.DEPENDFILE_PREFERENCE:U${.MAKE.DEPENDFILE}:M*.${MACHINE}} == "" # meta2deps.py only groks objroot # so we need to give it what it expects Modified: vendor/NetBSD/bmake/dist/mk/install-mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/install-mk Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/mk/install-mk Mon Dec 19 21:50:59 2016 (r310299) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.130 2016/08/15 19:28:13 sjg Exp $ +# $Id: install-mk,v 1.135 2016/12/12 19:07:42 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20160815 +MK_VERSION=20161212 OWNER= GROUP= MODE=444 Modified: vendor/NetBSD/bmake/dist/mk/lib.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/lib.mk Mon Dec 19 21:27:18 2016 (r310298) +++ vendor/NetBSD/bmake/dist/mk/lib.mk Mon Dec 19 21:50:59 2016 (r310299) @@ -1,4 +1,4 @@ -# $Id: lib.mk,v 1.54 2016/08/02 20:52:17 sjg Exp $ +# $Id: lib.mk,v 1.55 2016/09/23 23:04:51 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -9,39 +9,30 @@ __${.PARSEFILE}__: NEED_SOLINKS?= yes .endif -.if exists(${.CURDIR}/shlib_version) -SHLIB_MAJOR != . ${.CURDIR}/shlib_version ; echo $$major -SHLIB_MINOR != . ${.CURDIR}/shlib_version ; echo $$minor -.endif - -print-shlib-major: -.if defined(SHLIB_MAJOR) && ${MK_PIC} != "no" - @echo ${SHLIB_MAJOR} -.else - @false +SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version +.if !defined(SHLIB_MAJOR) && exists(${SHLIB_VERSION_FILE}) +SHLIB_MAJOR != . ${SHLIB_VERSION_FILE} ; echo $$major +SHLIB_MINOR != . ${SHLIB_VERSION_FILE} ; echo $$minor +SHLIB_TEENY != . ${SHLIB_VERSION_FILE} ; echo $$teeny .endif -print-shlib-minor: -.if defined(SHLIB_MINOR) && ${MK_PIC} != "no" - @echo ${SHLIB_MINOR} -.else - @false -.endif - -print-shlib-teeny: -.if defined(SHLIB_TEENY) && ${MK_PIC} != "no" - @echo ${SHLIB_TEENY} +.for x in major minor teeny +print-shlib-$x: +.if defined(SHLIB_${x:tu}) && ${MK_PIC} != "no" + @echo ${SHLIB_${x:tu}} .else @false .endif +.endfor SHLIB_FULLVERSION ?= ${${SHLIB_MAJOR} ${SHLIB_MINOR} ${SHLIB_TEENY}:L:ts.} SHLIB_FULLVERSION := ${SHLIB_FULLVERSION} # add additional suffixes not exported. # .po is used for profiling object files. -# .So is used for PIC object files. -.SUFFIXES: .out .a .ln .So .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h +# ${PICO} is used for PIC object files. +PICO?= .pico +.SUFFIXES: .out .a .ln ${PICO} .po .o .s .S .c .cc .C .m .F .f .r .y .l .cl .p .h .SUFFIXES: .sh .m4 .m CFLAGS+= ${COPTS} @@ -62,12 +53,12 @@ CFLAGS+= ${COPTS} # with ELF, also set shared-lib version for ld.so. # SHLIB_LDSTARTFILE: support .o file, call C++ file-level constructors # SHLIB_LDENDFILE: support .o file, call C++ file-level destructors -# FPICFLAGS: flags for ${FC} to compile .[fF] files to .So objects. +# FPICFLAGS: flags for ${FC} to compile .[fF] files to ${PICO} objects. # CPPICFLAGS: flags for ${CPP} to preprocess .[sS] files for ${AS} -# CPICFLAGS: flags for ${CC} to compile .[cC] files to .So objects. +# CPICFLAGS: flags for ${CC} to compile .[cC] files to ${PICO} objects. # CAPICFLAGS flags for {$CC} to compiling .[Ss] files # (usually just ${CPPPICFLAGS} ${CPICFLAGS}) -# APICFLAGS: flags for ${AS} to assemble .[sS] to .So objects. +# APICFLAGS: flags for ${AS} to assemble .[sS] to ${PICO} objects. .if ${TARGET_OSNAME} == "NetBSD" .if ${MACHINE_ARCH} == "alpha" @@ -162,14 +153,14 @@ LD_shared=-b LD_so=sl DLLIB= # HPsUX lorder does not grok anything but .o -LD_sobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,.So,'` +LD_sobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,${PICO},'` LD_pobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,.po,'` .elif ${TARGET_OSNAME} == "OSF1" LD_shared= -msym -shared -expect_unresolved '*' LD_solib= -all lib${LIB}_pic.a DLLIB= # lorder does not grok anything but .o -LD_sobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,.So,'` +LD_sobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,${PICO},'` LD_pobjs=`${LORDER} ${OBJS} | ${TSORT} | sed 's,\.o,.po,'` *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Mon Dec 19 21:51:15 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 242BCC88B76; Mon, 19 Dec 2016 21:51:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCBB41447; Mon, 19 Dec 2016 21:51:14 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBJLpDjQ089791; Mon, 19 Dec 2016 21:51:13 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBJLpD6U089790; Mon, 19 Dec 2016 21:51:13 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201612192151.uBJLpD6U089790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 19 Dec 2016 21:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310300 - vendor/NetBSD/bmake/20161212 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Dec 2016 21:51:15 -0000 Author: sjg Date: Mon Dec 19 21:51:13 2016 New Revision: 310300 URL: https://svnweb.freebsd.org/changeset/base/310300 Log: tag bmake-20161212 Added: vendor/NetBSD/bmake/20161212/ - copied from r310299, vendor/NetBSD/bmake/dist/ From owner-svn-src-vendor@freebsd.org Fri Dec 23 04:35:16 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDA87C8DEAE; Fri, 23 Dec 2016 04:35:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85FC01E86; Fri, 23 Dec 2016 04:35:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBN4ZFoH029309; Fri, 23 Dec 2016 04:35:15 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBN4ZEhl029295; Fri, 23 Dec 2016 04:35:14 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201612230435.uBN4ZEhl029295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 23 Dec 2016 04:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310450 - in vendor-sys/acpica/dist: . generate/unix/acpiexec generate/unix/acpihelp source/common source/compiler source/compiler/parsers source/compiler/preprocessor source/components... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2016 04:35:16 -0000 Author: jkim Date: Fri Dec 23 04:35:14 2016 New Revision: 310450 URL: https://svnweb.freebsd.org/changeset/base/310450 Log: Import ACPICA 20161222. Added: vendor-sys/acpica/dist/source/compiler/parsers/ vendor-sys/acpica/dist/source/compiler/preprocessor/ vendor-sys/acpica/dist/source/os_specific/service_layers/osgendbg.c (contents, props changed) vendor-sys/acpica/dist/source/tools/acpihelp/ahaml.c (contents, props changed) vendor-sys/acpica/dist/source/tools/acpihelp/ahasl.c (contents, props changed) vendor-sys/acpica/dist/source/tools/efihello/ vendor-sys/acpica/dist/source/tools/efihello/efihello.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile vendor-sys/acpica/dist/source/common/acfileio.c vendor-sys/acpica/dist/source/common/ahtable.c vendor-sys/acpica/dist/source/common/ahuuids.c vendor-sys/acpica/dist/source/compiler/aslutils.c vendor-sys/acpica/dist/source/components/debugger/dbinput.c vendor-sys/acpica/dist/source/components/debugger/dbxface.c vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c vendor-sys/acpica/dist/source/components/executer/exconfig.c vendor-sys/acpica/dist/source/components/executer/exfldio.c vendor-sys/acpica/dist/source/components/hardware/hwesleep.c vendor-sys/acpica/dist/source/components/hardware/hwregs.c vendor-sys/acpica/dist/source/components/hardware/hwsleep.c vendor-sys/acpica/dist/source/components/parser/psargs.c vendor-sys/acpica/dist/source/components/parser/pstree.c vendor-sys/acpica/dist/source/components/utilities/utclib.c vendor-sys/acpica/dist/source/components/utilities/utdecode.c vendor-sys/acpica/dist/source/components/utilities/utdelete.c vendor-sys/acpica/dist/source/components/utilities/utmutex.c vendor-sys/acpica/dist/source/components/utilities/utresrc.c vendor-sys/acpica/dist/source/include/acclib.h vendor-sys/acpica/dist/source/include/acdebug.h vendor-sys/acpica/dist/source/include/acdisasm.h vendor-sys/acpica/dist/source/include/acexcep.h vendor-sys/acpica/dist/source/include/acglobal.h vendor-sys/acpica/dist/source/include/aclocal.h vendor-sys/acpica/dist/source/include/acmacros.h vendor-sys/acpica/dist/source/include/acpiosxf.h vendor-sys/acpica/dist/source/include/acpixf.h vendor-sys/acpica/dist/source/include/platform/acefi.h vendor-sys/acpica/dist/source/include/platform/acefiex.h vendor-sys/acpica/dist/source/include/platform/acenv.h vendor-sys/acpica/dist/source/include/platform/aclinux.h vendor-sys/acpica/dist/source/include/platform/aclinuxex.h vendor-sys/acpica/dist/source/os_specific/service_layers/osunixxf.c vendor-sys/acpica/dist/source/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/source/tools/acpiexec/aemain.c vendor-sys/acpica/dist/source/tools/acpihelp/acpihelp.h vendor-sys/acpica/dist/source/tools/acpihelp/ahamlops.c vendor-sys/acpica/dist/source/tools/acpihelp/ahaslkey.c vendor-sys/acpica/dist/source/tools/acpihelp/ahaslops.c vendor-sys/acpica/dist/source/tools/acpihelp/ahdecode.c vendor-sys/acpica/dist/source/tools/acpihelp/ahgrammar.c vendor-sys/acpica/dist/source/tools/acpihelp/ahmain.c vendor-sys/acpica/dist/tests/misc/grammar.asl Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Fri Dec 23 03:42:38 2016 (r310449) +++ vendor-sys/acpica/dist/changes.txt Fri Dec 23 04:35:14 2016 (r310450) @@ -1,4 +1,93 @@ ---------------------------------------- +22 December 2016. Summary of changes for version 20161222: + + +1) ACPICA kernel-resident subsystem: + +AML Debugger: Implemented a new mechanism to simplify and enhance +debugger integration into all environments, including kernel debuggers +and user-space utilities, as well as remote debug services. This +mechanism essentially consists of new OSL interfaces to support debugger +initialization/termination, as well as wait/notify interfaces to perform +the debugger handshake with the host. Lv Zheng. + + New OSL interfaces: + AcpiOsInitializeDebugger (void) + AcpiOsTerminateDebugger (void) + AcpiOsWaitCommandReady (void) + AcpiOsNotifyCommandComplete (void) + + New OS services layer: + osgendbg.c -- Example implementation, and used for AcpiExec + +Update for Generic Address Space (GAS) support: Although the AccessWidth +and/or BitOffset fields of the GAS are not often used, this change now +fully supports these fields. This affects the internal support for FADT +registers, registers in other ACPI data tables, and the AcpiRead and +AcpiWrite public interfaces. Lv Zheng. + +Sleep support: In order to simplify integration of ACPI sleep for the +various host operating systems, a new OSL interface has been introduced. +AcpiOsEnterSleep allows the host to perform any required operations +before the final write to the sleep control register(s) is performed by +ACPICA. Lv Zheng. + + New OSL interface: + AcpiOsEnterSleep(SleepState, RegisterAValue, RegisterBValue) + + Called from these internal interfaces: + AcpiHwLegacySleep + AcpiHwExtendedSleep + +EFI support: Added a very small EFI/ACPICA example application. Provides +a simple demo for EFI integration, as well as assisting with resolution +of issues related to customer ACPICA/EFI integration. Lv Zheng. See: + + source/tools/efihello/efihello.c + +Local C library: Implemented several new functions to enhance ACPICA +portability, for environments where these clib functions are not +available (such as EFI). Lv Zheng: + putchar + getchar + strpbrk + strtok + memmove + +Fixed a regression where occasionally a valid resource descriptor was +incorrectly detected as invalid at runtime, and a +AE_AML_NO_RESOURCE_END_TAG was returned. + +Fixed a problem with the recently implemented support that enables +control method invocations as Target operands to many ASL operators. +Warnings of this form: "Needed type [Reference], found [Processor]" were +seen at runtime for some method invocations. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 141.5K Code, 58.5K Data, 200.0K Total + Debug Version: 201.7K Code, 82.7K Data, 284.4K Total + Previous Release: + Non-Debug Version: 140.5K Code, 58.5K Data, 198.9K Total + Debug Version: 201.3K Code, 82.7K Data, 284.0K Total + + +2) iASL Compiler/Disassembler and Tools: + +Disassembler: Enhanced output by adding the capability to detect and +disassemble ASL Switch/Case statements back to the original ASL source +code instead of if/else blocks. David Box. + +AcpiHelp: Split a large file into separate files based upon +functionality/purpose. New files are: + ahaml.c + ahasl.c + +---------------------------------------- 17 November 2016. Summary of changes for version 20161117: Modified: vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Fri Dec 23 03:42:38 2016 (r310449) +++ vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile Fri Dec 23 04:35:14 2016 (r310450) @@ -163,6 +163,7 @@ OBJECTS = \ $(OBJDIR)/nsxfeval.o\ $(OBJDIR)/nsxfname.o\ $(OBJDIR)/nsxfobj.o\ + $(OBJDIR)/osgendbg.o\ $(OBJDIR)/osunixxf.o\ $(OBJDIR)/psargs.o\ $(OBJDIR)/psloop.o\ Modified: vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile ============================================================================== --- vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile Fri Dec 23 03:42:38 2016 (r310449) +++ vendor-sys/acpica/dist/generate/unix/acpihelp/Makefile Fri Dec 23 04:35:14 2016 (r310450) @@ -28,7 +28,9 @@ HEADERS = \ $(wildcard $(ACPIHELP)/*.h) OBJECTS = \ + $(OBJDIR)/ahaml.o\ $(OBJDIR)/ahamlops.o\ + $(OBJDIR)/ahasl.o\ $(OBJDIR)/ahaslkey.o\ $(OBJDIR)/ahaslops.o\ $(OBJDIR)/ahdecode.o\ Modified: vendor-sys/acpica/dist/source/common/acfileio.c ============================================================================== --- vendor-sys/acpica/dist/source/common/acfileio.c Fri Dec 23 03:42:38 2016 (r310449) +++ vendor-sys/acpica/dist/source/common/acfileio.c Fri Dec 23 04:35:14 2016 (r310450) @@ -403,7 +403,7 @@ AcValidateTableHeader ( UINT32 i; - ACPI_FUNCTION_TRACE ("AcValidateTableHeader"); + ACPI_FUNCTION_TRACE (AcValidateTableHeader); /* Read a potential table header */ Modified: vendor-sys/acpica/dist/source/common/ahtable.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahtable.c Fri Dec 23 03:42:38 2016 (r310449) +++ vendor-sys/acpica/dist/source/common/ahtable.c Fri Dec 23 04:35:14 2016 (r310450) @@ -51,7 +51,7 @@ const AH_TABLE * AcpiAhGetTableInfo ( char *Signature); -extern const AH_TABLE AcpiSupportedTables[]; +extern const AH_TABLE Gbl_AcpiSupportedTables[]; /******************************************************************************* @@ -73,7 +73,7 @@ AcpiAhGetTableInfo ( const AH_TABLE *Info; - for (Info = AcpiSupportedTables; Info->Signature; Info++) + for (Info = Gbl_AcpiSupportedTables; Info->Signature; Info++) { if (ACPI_COMPARE_NAME (Signature, Info->Signature)) { @@ -89,7 +89,7 @@ AcpiAhGetTableInfo ( * Note: Any tables added here should be duplicated within AcpiDmTableData * in the file common/dmtable.c */ -const AH_TABLE AcpiSupportedTables[] = +const AH_TABLE Gbl_AcpiSupportedTables[] = { {ACPI_SIG_ASF, "Alert Standard Format table"}, {ACPI_SIG_BERT, "Boot Error Record Table"}, Modified: vendor-sys/acpica/dist/source/common/ahuuids.c ============================================================================== --- vendor-sys/acpica/dist/source/common/ahuuids.c Fri Dec 23 03:42:38 2016 (r310449) +++ vendor-sys/acpica/dist/source/common/ahuuids.c Fri Dec 23 04:35:14 2016 (r310450) @@ -52,7 +52,7 @@ /* * Table of "known" (ACPI-related) UUIDs */ -const AH_UUID AcpiUuids[] = +const AH_UUID Gbl_AcpiUuids[] = { {"[Controllers]", NULL}, {"GPIO Controller", UUID_GPIO_CONTROLLER}, @@ -112,7 +112,7 @@ AcpiAhMatchUuid ( /* Walk the table of known ACPI-related UUIDs */ - for (Info = AcpiUuids; Info->Description; Info++) + for (Info = Gbl_AcpiUuids; Info->Description; Info++) { /* Null string means desciption is a UUID class */ Modified: vendor-sys/acpica/dist/source/compiler/aslutils.c ============================================================================== --- vendor-sys/acpica/dist/source/compiler/aslutils.c Fri Dec 23 03:42:38 2016 (r310449) +++ vendor-sys/acpica/dist/source/compiler/aslutils.c Fri Dec 23 04:35:14 2016 (r310450) @@ -155,7 +155,7 @@ UtDisplaySupportedTables ( /* All ACPI tables with the common table header */ printf ("\n Supported ACPI tables:\n"); - for (TableData = AcpiSupportedTables, i = 1; + for (TableData = Gbl_AcpiSupportedTables, i = 1; TableData->Signature; TableData++, i++) { printf ("%8u) %s %s\n", i, Modified: vendor-sys/acpica/dist/source/components/debugger/dbinput.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbinput.c Fri Dec 23 03:42:38 2016 (r310449) +++ vendor-sys/acpica/dist/source/components/debugger/dbinput.c Fri Dec 23 04:35:14 2016 (r310450) @@ -64,10 +64,6 @@ AcpiDbMatchCommand ( char *UserCommand); static void -AcpiDbSingleThread ( - void); - -static void AcpiDbDisplayCommandInfo ( const char *Command, BOOLEAN DisplayAll); @@ -1231,61 +1227,17 @@ void ACPI_SYSTEM_XFACE AcpiDbExecuteThread ( void *Context) { - ACPI_STATUS Status = AE_OK; - ACPI_STATUS MStatus; - - - while (Status != AE_CTRL_TERMINATE && !AcpiGbl_DbTerminateLoop) - { - AcpiGbl_MethodExecuting = FALSE; - AcpiGbl_StepToNextCall = FALSE; - MStatus = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady, - ACPI_WAIT_FOREVER); - if (ACPI_FAILURE (MStatus)) - { - return; - } - - Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL); - - AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete); - } + (void) AcpiDbUserCommands (); AcpiGbl_DbThreadsTerminated = TRUE; } /******************************************************************************* * - * FUNCTION: AcpiDbSingleThread - * - * PARAMETERS: None - * - * RETURN: None - * - * DESCRIPTION: Debugger execute thread. Waits for a command line, then - * simply dispatches it. - * - ******************************************************************************/ - -static void -AcpiDbSingleThread ( - void) -{ - - AcpiGbl_MethodExecuting = FALSE; - AcpiGbl_StepToNextCall = FALSE; - - (void) AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL); -} - - -/******************************************************************************* - * * FUNCTION: AcpiDbUserCommands * - * PARAMETERS: Prompt - User prompt (depends on mode) - * Op - Current executing parse op + * PARAMETERS: None * * RETURN: None * @@ -1296,8 +1248,7 @@ AcpiDbSingleThread ( ACPI_STATUS AcpiDbUserCommands ( - char Prompt, - ACPI_PARSE_OBJECT *Op) + void) { ACPI_STATUS Status = AE_OK; @@ -1308,55 +1259,33 @@ AcpiDbUserCommands ( while (!AcpiGbl_DbTerminateLoop) { - /* Force output to console until a command is entered */ - - AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT); - - /* Different prompt if method is executing */ + /* Wait the readiness of the command */ - if (!AcpiGbl_MethodExecuting) - { - AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_COMMAND_PROMPT); - } - else + Status = AcpiOsWaitCommandReady (); + if (ACPI_FAILURE (Status)) { - AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT); + break; } - /* Get the user input line */ + /* Just call to the command line interpreter */ - Status = AcpiOsGetLine (AcpiGbl_DbLineBuf, - ACPI_DB_LINE_BUFFER_SIZE, NULL); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line")); - return (Status); - } + AcpiGbl_MethodExecuting = FALSE; + AcpiGbl_StepToNextCall = FALSE; - /* Check for single or multithreaded debug */ + (void) AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, NULL, NULL); - if (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED) - { - /* - * Signal the debug thread that we have a command to execute, - * and wait for the command to complete. - */ - AcpiOsReleaseMutex (AcpiGbl_DbCommandReady); - - Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandComplete, - ACPI_WAIT_FOREVER); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - } - else - { - /* Just call to the command line interpreter */ + /* Notify the completion of the command */ - AcpiDbSingleThread (); + Status = AcpiOsNotifyCommandComplete (); + if (ACPI_FAILURE (Status)) + { + break; } } + if (ACPI_FAILURE (Status) && Status != AE_CTRL_TERMINATE) + { + ACPI_EXCEPTION ((AE_INFO, Status, "While parsing command line")); + } return (Status); } Modified: vendor-sys/acpica/dist/source/components/debugger/dbxface.c ============================================================================== --- vendor-sys/acpica/dist/source/components/debugger/dbxface.c Fri Dec 23 03:42:38 2016 (r310449) +++ vendor-sys/acpica/dist/source/components/debugger/dbxface.c Fri Dec 23 04:35:14 2016 (r310450) @@ -95,50 +95,23 @@ AcpiDbStartCommand ( AcpiGbl_MethodExecuting = TRUE; Status = AE_CTRL_TRUE; + while (Status == AE_CTRL_TRUE) { - if (AcpiGbl_DebuggerConfiguration == DEBUGGER_MULTI_THREADED) - { - /* Handshake with the front-end that gets user command lines */ + /* Notify the completion of the command */ - AcpiOsReleaseMutex (AcpiGbl_DbCommandComplete); - - Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady, - ACPI_WAIT_FOREVER); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - } - else + Status = AcpiOsNotifyCommandComplete (); + if (ACPI_FAILURE (Status)) { - /* Single threaded, we must get a command line ourselves */ - - /* Force output to console until a command is entered */ - - AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT); - - /* Different prompt if method is executing */ - - if (!AcpiGbl_MethodExecuting) - { - AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_COMMAND_PROMPT); - } - else - { - AcpiOsPrintf ("%1c ", ACPI_DEBUGGER_EXECUTE_PROMPT); - } + goto ErrorExit; + } - /* Get the user input line */ + /* Wait the readiness of the command */ - Status = AcpiOsGetLine (AcpiGbl_DbLineBuf, - ACPI_DB_LINE_BUFFER_SIZE, NULL); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "While parsing command line")); - return (Status); - } + Status = AcpiOsWaitCommandReady (); + if (ACPI_FAILURE (Status)) + { + goto ErrorExit; } Status = AcpiDbCommandDispatch (AcpiGbl_DbLineBuf, WalkState, Op); @@ -146,6 +119,12 @@ AcpiDbStartCommand ( /* AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); */ +ErrorExit: + if (ACPI_FAILURE (Status) && Status != AE_CTRL_TERMINATE) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "While parsing/handling command line")); + } return (Status); } @@ -493,16 +472,7 @@ AcpiInitializeDebugger ( { /* These were created with one unit, grab it */ - Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandComplete, - ACPI_WAIT_FOREVER); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("Could not get debugger mutex\n"); - return_ACPI_STATUS (Status); - } - - Status = AcpiOsAcquireMutex (AcpiGbl_DbCommandReady, - ACPI_WAIT_FOREVER); + Status = AcpiOsInitializeDebugger (); if (ACPI_FAILURE (Status)) { AcpiOsPrintf ("Could not get debugger mutex\n"); @@ -556,14 +526,14 @@ AcpiTerminateDebugger ( if (AcpiGbl_DebuggerConfiguration & DEBUGGER_MULTI_THREADED) { - AcpiOsReleaseMutex (AcpiGbl_DbCommandReady); - /* Wait the AML Debugger threads */ while (!AcpiGbl_DbThreadsTerminated) { AcpiOsSleep (100); } + + AcpiOsTerminateDebugger (); } if (AcpiGbl_DbBuffer) Modified: vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c ============================================================================== --- vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c Fri Dec 23 03:42:38 2016 (r310449) +++ vendor-sys/acpica/dist/source/components/disassembler/dmopcode.c Fri Dec 23 04:35:14 2016 (r310450) @@ -68,6 +68,13 @@ static void AcpiDmPromoteSubtree ( ACPI_PARSE_OBJECT *StartOp); +static BOOLEAN +AcpiDmIsSwitchBlock ( + ACPI_PARSE_OBJECT *Op); + +static BOOLEAN +AcpiDmIsCaseBlock ( + ACPI_PARSE_OBJECT *Op); /******************************************************************************* * @@ -968,6 +975,28 @@ AcpiDmDisassembleOneOp ( AcpiDmNamestring (Op->Common.Value.Name); break; + case AML_WHILE_OP: + + if (AcpiDmIsSwitchBlock(Op)) + { + AcpiOsPrintf ("%s", "Switch"); + break; + } + + AcpiOsPrintf ("%s", OpInfo->Name); + break; + + case AML_IF_OP: + + if (Op->Common.DisasmOpcode == ACPI_DASM_CASE) + { + AcpiOsPrintf ("%s", "Case"); + break; + } + + AcpiOsPrintf ("%s", OpInfo->Name); + break; + case AML_ELSE_OP: AcpiDmConvertToElseIf (Op); @@ -1078,6 +1107,12 @@ AcpiDmConvertToElseIf ( { /* Not a proper Else..If sequence, cannot convert to ElseIf */ + if (OriginalElseOp->Common.DisasmOpcode == ACPI_DASM_DEFAULT) + { + AcpiOsPrintf ("%s", "Default"); + return; + } + AcpiOsPrintf ("%s", "Else"); return; } @@ -1087,13 +1122,42 @@ AcpiDmConvertToElseIf ( ElseOp = IfOp->Common.Next; if (ElseOp && ElseOp->Common.Next) { + if (OriginalElseOp->Common.DisasmOpcode == ACPI_DASM_DEFAULT) + { + AcpiOsPrintf ("%s", "Default"); + return; + } + AcpiOsPrintf ("%s", "Else"); return; } - /* Emit ElseIf, mark the IF as now an ELSEIF */ + if (OriginalElseOp->Common.DisasmOpcode == ACPI_DASM_DEFAULT) + { + /* + * There is an ElseIf but in this case the Else is actually + * a Default block for a Switch/Case statement. No conversion. + */ + AcpiOsPrintf ("%s", "Default"); + return; + } + + if (OriginalElseOp->Common.DisasmOpcode == ACPI_DASM_CASE) + { + /* + * This ElseIf is actually a Case block for a Switch/Case + * statement. Print Case but do not return so that we can + * promote the subtree and keep the indentation level. + */ + AcpiOsPrintf ("%s", "Case"); + } + else + { + /* Emit ElseIf, mark the IF as now an ELSEIF */ + + AcpiOsPrintf ("%s", "ElseIf"); + } - AcpiOsPrintf ("%s", "ElseIf"); IfOp->Common.DisasmFlags |= ACPI_PARSEOP_ELSEIF; /* The IF parent will now be the same as the original ELSE parent */ @@ -1184,3 +1248,400 @@ AcpiDmPromoteSubtree ( Op = Op->Common.Next; } } + +/******************************************************************************* + * + * FUNCTION: AcpiDmIsTempName + * + * PARAMETERS: Op - Object to be examined + * + * RETURN: TRUE if object is a temporary (_T_x) name + * + * DESCRIPTION: Determine if an object is a temporary name and ignore it. + * Temporary names are only used for Switch statements. This + * function depends on this restriced usage. + * + ******************************************************************************/ + +BOOLEAN +AcpiDmIsTempName ( + ACPI_PARSE_OBJECT *Op) +{ + char *Temp; + + if (Op->Common.AmlOpcode != AML_NAME_OP) + { + return (FALSE); + } + + Temp = (char *)(Op->Common.Aml); + ++Temp; + + if (strncmp(Temp, "_T_", 3)) + { + return (FALSE); + } + + /* Ignore Op */ + + Op->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + + return (TRUE); +} + +/******************************************************************************* + * + * FUNCTION: AcpiDmIsSwitchBlock + * + * PARAMETERS: Op - While Object + * + * RETURN: TRUE if While block can be converted to a Switch/Case block + * + * DESCRIPTION: Determines if While block is a Switch/Case statement. Modifies + * parse tree to allow for Switch/Case disassembly during walk. + * + * EXAMPLE: Example of parse tree to be converted + * + * While + * One + * Store + * ByteConst + * -NamePath- + * If + * LEqual + * -NamePath- + * Zero + * Return + * One + * Else + * Return + * WordConst + * Break + * + ******************************************************************************/ + +static BOOLEAN +AcpiDmIsSwitchBlock ( + ACPI_PARSE_OBJECT *Op) +{ + ACPI_PARSE_OBJECT *OneOp; + ACPI_PARSE_OBJECT *StoreOp; + ACPI_PARSE_OBJECT *NamePathOp; + ACPI_PARSE_OBJECT *PredicateOp; + ACPI_PARSE_OBJECT *CurrentOp; + ACPI_PARSE_OBJECT *TempOp; + + /* Check for One Op Predicate */ + + OneOp = AcpiPsGetArg (Op, 0); + if (!OneOp || (OneOp->Common.AmlOpcode != AML_ONE_OP)) + { + return (FALSE); + } + + /* Check for Store Op */ + + StoreOp = OneOp->Common.Next; + if (!StoreOp || (StoreOp->Common.AmlOpcode != AML_STORE_OP)) + { + return (FALSE); + } + + /* Check for Name Op with _T_ string */ + + NamePathOp = AcpiPsGetArg (StoreOp, 1); + if (!NamePathOp || (NamePathOp->Common.AmlOpcode != AML_INT_NAMEPATH_OP)) + { + return (FALSE); + } + + if (strncmp((char *)(NamePathOp->Common.Aml), "_T_", 3)) + { + return (FALSE); + } + + /* This is a Switch/Case control block */ + + /* Ignore the One Op Predicate */ + + OneOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + + /* Ignore the Store Op, but not the children */ + + StoreOp->Common.DisasmOpcode = ACPI_DASM_IGNORE_SINGLE; + + /* + * First arg of Store Op is the Switch condition. + * Mark it as a Switch predicate and as a parameter list for paren + * closing and correct indentation. + */ + PredicateOp = AcpiPsGetArg (StoreOp, 0); + PredicateOp->Common.DisasmOpcode = ACPI_DASM_SWITCH_PREDICATE; + PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; + + /* Ignore the Name Op */ + + NamePathOp->Common.DisasmFlags = ACPI_PARSEOP_IGNORE; + + /* Remaining opcodes are the Case statements (If/ElseIf's) */ + + CurrentOp = StoreOp->Common.Next; + while (AcpiDmIsCaseBlock (CurrentOp)) + { + /* Block is a Case structure */ + + if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP) + { + /* ElseIf */ + + CurrentOp->Common.DisasmOpcode = ACPI_DASM_CASE; + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + } + + /* If */ + + CurrentOp->Common.DisasmOpcode = ACPI_DASM_CASE; + + /* + * Mark the parse tree for Case disassembly. There are two + * types of Case statements. The first type of statement begins with + * an LEqual. The second starts with an LNot and uses a Match statement + * on a Package of constants. + */ + TempOp = AcpiPsGetArg (CurrentOp, 0); + switch (TempOp->Common.AmlOpcode) + { + case (AML_LEQUAL_OP): + + /* Ignore just the LEqual Op */ + + TempOp->Common.DisasmOpcode = ACPI_DASM_IGNORE_SINGLE; + + /* Ignore the NamePath Op */ + + TempOp = AcpiPsGetArg (TempOp, 0); + TempOp->Common.DisasmFlags = ACPI_PARSEOP_IGNORE; + + /* + * Second arg of LEqual will be the Case predicate. + * Mark it as a predicate and also as a parameter list for paren + * closing and correct indentation. + */ + PredicateOp = TempOp->Common.Next; + PredicateOp->Common.DisasmOpcode = ACPI_DASM_SWITCH_PREDICATE; + PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; + + break; + + case (AML_LNOT_OP): + + /* + * The Package will be the predicate of the Case statement. + * It's under: + * LNOT + * LEQUAL + * MATCH + * PACKAGE + */ + + /* Get the LEqual Op from LNot */ + + TempOp = AcpiPsGetArg (TempOp, 0); + + /* Get the Match Op from LEqual */ + + TempOp = AcpiPsGetArg (TempOp, 0); + + /* Get the Package Op from Match */ + + PredicateOp = AcpiPsGetArg (TempOp, 0); + + /* Mark as parameter list for paren closing */ + + PredicateOp->Common.DisasmFlags |= ACPI_PARSEOP_PARAMETER_LIST; + + /* + * The Package list would be too deeply indented if we + * chose to simply ignore the all the parent opcodes, so + * we rearrange the parse tree instead. + */ + + /* + * Save the second arg of the If/Else Op which is the + * block code of code for this Case statement. + */ + TempOp = AcpiPsGetArg (CurrentOp, 1); + + /* + * Move the Package Op to the child (predicate) of the + * Case statement. + */ + CurrentOp->Common.Value.Arg = PredicateOp; + PredicateOp->Common.Parent = CurrentOp; + + /* Add the block code */ + + PredicateOp->Common.Next = TempOp; + + break; + + default: + + /* Should never get here */ + + break; + } + + /* Advance to next Case block */ + + CurrentOp = CurrentOp->Common.Next; + } + + /* If CurrentOp is now an Else, then this is a Default block */ + + if (CurrentOp && CurrentOp->Common.AmlOpcode == AML_ELSE_OP) + { + CurrentOp->Common.DisasmOpcode = ACPI_DASM_DEFAULT; + } + + /* + * From the first If advance to the Break op. It's possible to + * have an Else (Default) op here when there is only one Case + * statement, so check for it. + */ + CurrentOp = StoreOp->Common.Next->Common.Next; + if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP) + { + CurrentOp = CurrentOp->Common.Next; + } + + /* Ignore the Break Op */ + + CurrentOp->Common.DisasmFlags |= ACPI_PARSEOP_IGNORE; + + return (TRUE); +} + +/******************************************************************************* + * + * FUNCTION: AcpiDmIsCaseBlock + * + * PARAMETERS: Op - Object to test + * + * RETURN: TRUE if Object is beginning of a Case block. + * + * DESCRIPTION: Determines if an Object is the beginning of a Case block for a + * Switch/Case statement. Parse tree must be one of the following + * forms: + * + * Else (Optional) + * If + * LEqual + * -NamePath- _T_x + * + * Else (Optional) + * If + * LNot + * LEqual + * Match + * Package + * ByteConst + * -NamePath- _T_x + * + ******************************************************************************/ + +static BOOLEAN +AcpiDmIsCaseBlock ( + ACPI_PARSE_OBJECT *Op) +{ + ACPI_PARSE_OBJECT *CurrentOp; + + if (!Op) + { + return (FALSE); + } + + /* Look for an If or ElseIf */ + + CurrentOp = Op; + if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP) + { + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + if (!CurrentOp) + { + return (FALSE); + } + } + + if (!CurrentOp || CurrentOp->Common.AmlOpcode != AML_IF_OP) + { + return (FALSE); + } + + /* Child must be LEqual or LNot */ + + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + if (!CurrentOp) + { + return (FALSE); + } + + switch (CurrentOp->Common.AmlOpcode) + { + case (AML_LEQUAL_OP): + + /* Next child must be NamePath with string _T_ */ + + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + if (!CurrentOp || !CurrentOp->Common.Value.Name || + strncmp(CurrentOp->Common.Value.Name, "_T_", 3)) + { + return (FALSE); + } + + break; + + case (AML_LNOT_OP): + + /* Child of LNot must be LEqual op */ + + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_LEQUAL_OP)) + { + return (FALSE); + } + + /* Child of LNot must be Match op */ + + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_MATCH_OP)) + { + return (FALSE); + } + + /* First child of Match must be Package op */ + + CurrentOp = AcpiPsGetArg (CurrentOp, 0); + if (!CurrentOp || (CurrentOp->Common.AmlOpcode != AML_PACKAGE_OP)) + { + return (FALSE); + } + + /* Third child of Match must be NamePath with string _T_ */ + + CurrentOp = AcpiPsGetArg (CurrentOp->Common.Parent, 2); + if (!CurrentOp || !CurrentOp->Common.Value.Name || + strncmp(CurrentOp->Common.Value.Name, "_T_", 3)) + { + return (FALSE); + } + + break; + + default: + + return (FALSE); + } + + return (TRUE); +} Modified: vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c ============================================================================== --- vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c Fri Dec 23 03:42:38 2016 (r310449) +++ vendor-sys/acpica/dist/source/components/disassembler/dmwalk.c Fri Dec 23 04:35:14 2016 (r310450) @@ -455,6 +455,20 @@ AcpiDmDescendingOp ( return (AE_CTRL_DEPTH); } + if (AcpiDmIsTempName(Op)) + { + /* Ignore compiler generated temporary names */ + + return (AE_CTRL_DEPTH); + } + + if (Op->Common.DisasmOpcode == ACPI_DASM_IGNORE_SINGLE) + { + /* Ignore this op, but not it's children */ + + return (AE_OK); + } + if (Op->Common.AmlOpcode == AML_IF_OP) { NextOp = AcpiPsGetDepthNext (NULL, Op); @@ -889,7 +903,8 @@ AcpiDmAscendingOp ( ACPI_PARSE_OBJECT *ParentOp; - if (Op->Common.DisasmFlags & ACPI_PARSEOP_IGNORE) + if (Op->Common.DisasmFlags & ACPI_PARSEOP_IGNORE || + Op->Common.DisasmOpcode == ACPI_DASM_IGNORE_SINGLE) { /* Ignore this op -- it was handled elsewhere */ @@ -1049,9 +1064,12 @@ AcpiDmAscendingOp ( *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@freebsd.org Fri Dec 23 04:37:13 2016 Return-Path: Delivered-To: svn-src-vendor@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24B92C8DF2B; Fri, 23 Dec 2016 04:37:13 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D058D1FEB; Fri, 23 Dec 2016 04:37:12 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBN4bCKo029453; Fri, 23 Dec 2016 04:37:12 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBN4bCru029452; Fri, 23 Dec 2016 04:37:12 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201612230437.uBN4bCru029452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 23 Dec 2016 04:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r310451 - vendor-sys/acpica/20161222 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Dec 2016 04:37:13 -0000 Author: jkim Date: Fri Dec 23 04:37:11 2016 New Revision: 310451 URL: https://svnweb.freebsd.org/changeset/base/310451 Log: Tag ACPICA 20161222. Added: vendor-sys/acpica/20161222/ - copied from r310450, vendor-sys/acpica/dist/