CVS commit: src/external/gpl3/gcc

2020-09-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Sep 15 05:21:46 UTC 2020

Modified Files:
src/external/gpl3/gcc: README.gcc9

Log Message:
powerpc64, sh3 and vax builds now work.
sh3 and vax now works (workarounds commited.)


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gcc/README.gcc9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/README.gcc9
diff -u src/external/gpl3/gcc/README.gcc9:1.13 src/external/gpl3/gcc/README.gcc9:1.14
--- src/external/gpl3/gcc/README.gcc9:1.13	Mon Sep 14 19:51:54 2020
+++ src/external/gpl3/gcc/README.gcc9	Tue Sep 15 05:21:46 2020
@@ -1,4 +1,4 @@
-$NetBSD: README.gcc9,v 1.13 2020/09/14 19:51:54 skrll Exp $
+$NetBSD: README.gcc9,v 1.14 2020/09/15 05:21:46 mrg Exp $
 
 new stuff:
 	cc1objcplus
@@ -56,12 +56,12 @@ mipsel		y	y	y	y		y[3]		y	n	n
 mips64eb	y	y	y	y		y[3]		y	y	n
 mips64el	y	y	y	y		y[3]		n	n	n
 powerpc		y	y	y	y		y[3]		y	y	n
-powerpc64	y	?	y	y		n[6]		?	n	?
-sh3eb		y	n	y	y		n[1]		n	n	?
-sh3el		y	n	y	y		n		n	n	?
+powerpc64	y	y	y	y		y		?	N/A	n
+sh3eb		y	n	y	y		y		?	?	?
+sh3el		y	y	y	y		y		y	y	n
 sparc		y	y	y	y		y		y	y	n
 sparc64		y	y	y	y		y		n	n	?
-vax		y	n	y	y		n[2]		y	y	?
+vax		y	y	y	y		y		y	y	n
 x86_64		y	y	y	y		y		y	y	y
 riscv32		y	N/A	y	y		y		N/A	N/A	y	
 riscv64		y	N/A	y	y		y		N/A	N/A	y
@@ -70,22 +70,14 @@ coldfire	?	N/A	?	?		?		N/A	N/A
 	-	---	--	--			---
 architecture	tools	kernels	libgcc	native-gcc	make release	runs	atf
 
-[1]: /usr/xsrc/external/mit/pixman/dist/pixman/pixman-fast-path.c: In function 'fast_composite_scaled_nearest__565_normal_OVER':
- /usr/xsrc/external/mit/pixman/dist/pixman/pixman-fast-path.c:1204:1: internal compiler error: Segmentation fault
-  1204 | FAST_NEAREST (_565_normal, , 0565, uint32_t, uint16_t, OVER, NORMAL)
-[2]: /usr/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h: In member function 'void __sanitizer::StaticSpinMutex::LockSlow()':
- /usr/src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:58:3: error: unable to generate reloads for:
- 58 |   }
-|   ^
 [3]: consult cpu/platform table for full data
-[6]: /usr/src/sys/compat/common/compat_util.c:116:1: internal compiler error: in rs6000_pltseq_template, at config/rs6000/rs6000.c:21977
-[8]: prep floppies overflow; need to find if they are size limited
+[8]: prep and bebox floppies overflow; need to find if they are size limited
 [10]: tests in lib/libc/sys are skipped; see port-alpha/55652
 [11]: at least there's no regression in kernel and lib/libc/{gen,sys}
 
 
 CPU vs platform test table (for CPUs with multiple ports).  this is "make release" or just kernels.
-values:		y (yes), k (kernels only), n (failed), r (running), ? (not attempted)
+values:		y (yes), k (kernels only), n (failed), r (running), ? (not attempted), nx (yes, no x11)
 
 CPU		platform list
 ---		 
@@ -112,12 +104,11 @@ mips64eb:	 		y		 
 mips64el:	y		y		y
 
 		amigappc	bebox	evbppc	ibmnws		macppc		mvmeppc		ofppc		prep		rs6000		sandpoint
-powerpc:	y		y	r	y		r		y		y		n[8]		y		y
+powerpc:	y		n[8]	y	y		y		y		y		n[8]		y		y
 
 		evbppc		macppc		ofppc
-powerpc64:	n		?		?
+powerpc64:	y		?		?
 
 		dreamcast	evbsh3		hpcsh		landisk		mmeye
-sh3eb:		-		-		-		-		-
-sh3el:		-		-		-		-		-
-
+sh3eb:		 		-		 		 		r
+sh3el:		r		-		-		y



CVS commit: src/external/gpl3/gcc

2020-09-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Sep 15 05:19:35 UTC 2020

Modified Files:
src/external/gpl3/gcc/lib: Makefile.sanitizer
src/external/gpl3/gcc/usr.bin/backend: Makefile
src/external/gpl3/gcc/usr.bin/common-target: Makefile

Log Message:
make build and work on sh3 and vax.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/gpl3/gcc/lib/Makefile.sanitizer
cvs rdiff -u -r1.62 -r1.63 src/external/gpl3/gcc/usr.bin/backend/Makefile
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc/usr.bin/common-target/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/lib/Makefile.sanitizer
diff -u src/external/gpl3/gcc/lib/Makefile.sanitizer:1.15 src/external/gpl3/gcc/lib/Makefile.sanitizer:1.16
--- src/external/gpl3/gcc/lib/Makefile.sanitizer:1.15	Sat Sep 12 15:01:38 2020
+++ src/external/gpl3/gcc/lib/Makefile.sanitizer	Tue Sep 15 05:19:34 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.sanitizer,v 1.15 2020/09/12 15:01:38 kamil Exp $
+#	$NetBSD: Makefile.sanitizer,v 1.16 2020/09/15 05:19:34 mrg Exp $
 
 SANITIZER=${GCCDIST}/libsanitizer
 .PATH: ${SANITIZER}/interception ${SANITIZER}/sanitizer_common
@@ -103,6 +103,7 @@ COPTS.sanitizer_printf.cc += -O1
 COPTS.sanitizer_procmaps_common.cc += -O1
 COPTS.sanitizer_stackdepot.cc += -O1
 COPTS.sanitizer_symbolizer_libcdep.cc += -O1
+COPTS.sanitizer_symbolizer_report.cc += -O1
 COPTS.ubsan_diag.cc += -O1
 COPTS.ubsan_init.cc += -O1
 .endif

Index: src/external/gpl3/gcc/usr.bin/backend/Makefile
diff -u src/external/gpl3/gcc/usr.bin/backend/Makefile:1.62 src/external/gpl3/gcc/usr.bin/backend/Makefile:1.63
--- src/external/gpl3/gcc/usr.bin/backend/Makefile:1.62	Sun Sep  6 10:50:53 2020
+++ src/external/gpl3/gcc/usr.bin/backend/Makefile	Tue Sep 15 05:19:34 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.62 2020/09/06 10:50:53 mrg Exp $
+#	$NetBSD: Makefile,v 1.63 2020/09/15 05:19:34 mrg Exp $
 
 LIBISPRIVATE=	yes
 
@@ -581,6 +581,7 @@ COPTS.tree-ssa-loop-ivopts.c+=-O0
 COPTS.tree-ssa-loop-manip.c+=-O0
 COPTS.tree-ssa-loop-niter.c+=-O0
 COPTS.tree-ssa-math-opts.c+=-O0
+COPTS.tree-ssa-phiopt.c+= -O0
 COPTS.tree-ssa-pre.c+=-O0
 COPTS.tree-ssa-reassoc.c+=-O0
 COPTS.tree-ssa-strlen.c+=-O0
@@ -599,6 +600,7 @@ COPTS.varasm.c+=-O0
 COPTS.vr-values.c+=-O0
 COPTS.web.c+=-O0
 COPTS.wide-int.cc+=-O0
+COPTS.wide-int-range.cc+=-O0
 .else
 COPTS.tree.c=	${${ACTIVE_CC} == "clang" :? -O0 :}
 .endif

Index: src/external/gpl3/gcc/usr.bin/common-target/Makefile
diff -u src/external/gpl3/gcc/usr.bin/common-target/Makefile:1.9 src/external/gpl3/gcc/usr.bin/common-target/Makefile:1.10
--- src/external/gpl3/gcc/usr.bin/common-target/Makefile:1.9	Thu Oct 24 18:48:09 2019
+++ src/external/gpl3/gcc/usr.bin/common-target/Makefile	Tue Sep 15 05:19:35 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.9 2019/10/24 18:48:09 christos Exp $
+#	$NetBSD: Makefile,v 1.10 2020/09/15 05:19:35 mrg Exp $
 
 LIBISPRIVATE=	yes
 
@@ -22,6 +22,9 @@ COPTS.prefix.c+=	-Wno-stack-protector
 COPTS.opts-common.c+=	-Wno-stack-protector
 COPTS.rs6000-common.c+=	-Wno-stack-protector
 COPTS.arm-common.c+=	-Wno-stack-protector
+.if ${MACHINE_CPU} == "sh3"
+COPTS.opts.c+=		${GCC_NO_FORMAT_TRUNCATION}
+.endif
 
 GENPROG_ERROR_DEPENDS=errors.lo
 



CVS commit: src/external/mit/xorg/lib/pixman

2020-09-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Sep 15 05:14:19 UTC 2020

Modified Files:
src/external/mit/xorg/lib/pixman: Makefile

Log Message:
avoid ICE on sh3.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/external/mit/xorg/lib/pixman/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/xorg/lib/pixman/Makefile
diff -u src/external/mit/xorg/lib/pixman/Makefile:1.35 src/external/mit/xorg/lib/pixman/Makefile:1.36
--- src/external/mit/xorg/lib/pixman/Makefile:1.35	Wed Mar 30 16:19:06 2016
+++ src/external/mit/xorg/lib/pixman/Makefile	Tue Sep 15 05:14:19 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.35 2016/03/30 16:19:06 macallan Exp $
+#	$NetBSD: Makefile,v 1.36 2020/09/15 05:14:19 mrg Exp $
 
 NOLINT=	1	# defined
 
@@ -98,6 +98,11 @@ CPPFLAGS+=	-DUSE_LOONGSON_MMI
 COPTS.pixman-mmx.c=	-march=loongson2f -mhard-float -Wa,-mhard-float
 .endif
 
+.if ${MACHINE_CPU} == "sh3"
+# XXX pixman-fast-path.c:1204:1: internal compiler error: Segmentation fault
+COPTS.pixman-fast-path.c+=	-O1
+.endif
+
 INCS=	pixman.h pixman-version.h
 INCSDIR=${X11INCDIR}/pixman-1
 



CVS commit: src/sys/arch/vax

2020-09-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Sep 15 05:08:07 UTC 2020

Modified Files:
src/sys/arch/vax/boot/xxboot: Makefile
src/sys/arch/vax/boot/xxboot_ustarfs: Makefile
src/sys/arch/vax/conf: Makefile.vax

Log Message:
make build (and run) with GCC 9.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/vax/boot/xxboot/Makefile
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/vax/boot/xxboot_ustarfs/Makefile
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/vax/conf/Makefile.vax

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/vax/boot/xxboot/Makefile
diff -u src/sys/arch/vax/boot/xxboot/Makefile:1.21 src/sys/arch/vax/boot/xxboot/Makefile:1.22
--- src/sys/arch/vax/boot/xxboot/Makefile:1.21	Sun Dec 11 12:19:34 2005
+++ src/sys/arch/vax/boot/xxboot/Makefile	Tue Sep 15 05:08:07 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2005/12/11 12:19:34 christos Exp $
+#	$NetBSD: Makefile,v 1.22 2020/09/15 05:08:07 mrg Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -41,4 +41,6 @@ ${PROG}: ${OBJS} ${LIBSA} ${LIBKERN}
 	${SIZE} ${PROG}.out
 	${OBJCOPY} -O binary ${PROG}.out ${PROG}
 
+COPTS.bootxx.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-error=array-bounds :}
+
 .include 

Index: src/sys/arch/vax/boot/xxboot_ustarfs/Makefile
diff -u src/sys/arch/vax/boot/xxboot_ustarfs/Makefile:1.8 src/sys/arch/vax/boot/xxboot_ustarfs/Makefile:1.9
--- src/sys/arch/vax/boot/xxboot_ustarfs/Makefile:1.8	Sun Dec 11 12:19:34 2005
+++ src/sys/arch/vax/boot/xxboot_ustarfs/Makefile	Tue Sep 15 05:08:07 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2005/12/11 12:19:34 christos Exp $
+#	$NetBSD: Makefile,v 1.9 2020/09/15 05:08:07 mrg Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -37,4 +37,6 @@ ${PROG}: ${OBJS} ${LIBSA} ${LIBKERN}
 	${SIZE} ${PROG}.out
 	${OBJCOPY} -O binary ${PROG}.out ${PROG}
 
+COPTS.bootxx.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-error=array-bounds :}
+
 .include 

Index: src/sys/arch/vax/conf/Makefile.vax
diff -u src/sys/arch/vax/conf/Makefile.vax:1.84 src/sys/arch/vax/conf/Makefile.vax:1.85
--- src/sys/arch/vax/conf/Makefile.vax:1.84	Sat Sep 22 12:24:03 2018
+++ src/sys/arch/vax/conf/Makefile.vax	Tue Sep 15 05:08:07 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.vax,v 1.84 2018/09/22 12:24:03 rin Exp $
+#	$NetBSD: Makefile.vax,v 1.85 2020/09/15 05:08:07 mrg Exp $
 
 # Makefile for NetBSD
 #
@@ -34,6 +34,8 @@ GENASSYM_CONF=	${VAX}/vax/genassym.cf
 CPPFLAGS+=	-D_VAX_INLINE_
 AFLAGS+=	-x assembler-with-cpp -fno-pic
 CFLAGS+=	-fno-pic
+COPTS.wsmux.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -O1 :}
+
 
 ##
 ## (3) libkern and compat



CVS commit: src/external/gpl3/gcc/dist/gcc/config/rs6000

2020-09-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Sep 15 05:06:56 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd64.h

Log Message:
merge generic changes in eg rs6000/freebsd64.h into netbsd64.h


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 \
src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.26 src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.27
--- src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h:1.26	Mon Sep  7 22:21:55 2020
+++ src/external/gpl3/gcc/dist/gcc/config/rs6000/netbsd64.h	Tue Sep 15 05:06:56 2020
@@ -20,6 +20,10 @@
Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.  */
 
+/* Undef gnu-user.h macros we don't want.  */
+#undef CPLUSPLUS_CPP_SPEC
+#undef LINK_GCC_C_SEQUENCE_SPEC
+
 #ifndef RS6000_BI_ARCH
 
 #undef	DEFAULT_ABI
@@ -105,7 +109,7 @@ extern int dot_symbols;
 	{			\
 	  rs6000_current_abi = ABI_ELFv2;			\
 	  if (dot_symbols)	\
-		error ("-mcall-aixdesc incompatible with -mabi=elfv2"); \
+		error ("%<-mcall-aixdesc%> incompatible with %<-mabi=elfv2%>"); \
 	}			\
 	  if (rs6000_isa_flags & OPTION_MASK_RELOCATABLE)	\
 	{			\
@@ -131,14 +135,14 @@ extern int dot_symbols;
 	  if ((rs6000_isa_flags & OPTION_MASK_POWERPC64) == 0)	\
 	{			\
 	  rs6000_isa_flags |= OPTION_MASK_POWERPC64;	\
-	  error ("-m64 requires a PowerPC64 cpu");		\
+	  error ("%<-m64%> requires a PowerPC64 cpu");	\
 	}			\
 	  if ((rs6000_isa_flags_explicit			\
 	   & OPTION_MASK_MINIMAL_TOC) != 0)			\
 	{			\
 	  if (global_options_set.x_rs6000_current_cmodel	\
 		  && rs6000_current_cmodel != CMODEL_SMALL)	\
-		error ("-mcmodel incompatible with other toc options"); \
+		error ("%<-mcmodel%> incompatible with other toc options"); \
 	  SET_CMODEL (CMODEL_SMALL);			\
 	}			\
 	  else			\
@@ -422,13 +426,13 @@ extern int dot_symbols;
 #undef  ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
 #define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE)\
   (TARGET_TOC   \
-   && (GET_CODE (X) == SYMBOL_REF   \
+   && (SYMBOL_REF_P (X)			\
|| (GET_CODE (X) == CONST && GET_CODE (XEXP (X, 0)) == PLUS  \
-   && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF)   \
+   && SYMBOL_REF_P (XEXP (XEXP (X, 0), 0)))			\
|| GET_CODE (X) == LABEL_REF \
-   || (GET_CODE (X) == CONST_INT\
+   || (CONST_INT_P (X)		\
&& GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode))  \
-   || (GET_CODE (X) == CONST_DOUBLE \
+   || (CONST_DOUBLE_P (X)		\
&& ((TARGET_64BIT\
 && (TARGET_MINIMAL_TOC  \
 || (SCALAR_FLOAT_MODE_P (GET_MODE (X))  \
@@ -542,6 +546,7 @@ extern int dot_symbols;
 #undef UINTMAX_TYPE
 #define UINTMAX_TYPE UINT64_TYPE
 
+#if 0
 /* Override rs6000.h definition.  */
 #undef  ASM_APP_ON
 #define ASM_APP_ON "#APP\n"
@@ -549,6 +554,7 @@ extern int dot_symbols;
 /* Override rs6000.h definition.  */
 #undef  ASM_APP_OFF
 #define ASM_APP_OFF "#NO_APP\n"
+#endif
 
 #undef  RS6000_MCOUNT
 #define RS6000_MCOUNT "_mcount"



CVS commit: src/external/gpl3/gcc/lib

2020-09-14 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep 15 04:55:23 UTC 2020

Modified Files:
src/external/gpl3/gcc/lib: Makefile

Log Message:
Do not build libtsan on sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/gcc/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/lib/Makefile
diff -u src/external/gpl3/gcc/lib/Makefile:1.19 src/external/gpl3/gcc/lib/Makefile:1.20
--- src/external/gpl3/gcc/lib/Makefile:1.19	Sun Sep 13 02:37:32 2020
+++ src/external/gpl3/gcc/lib/Makefile	Tue Sep 15 04:55:23 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.19 2020/09/13 02:37:32 kamil Exp $
+#	$NetBSD: Makefile,v 1.20 2020/09/15 04:55:23 martin Exp $
 
 .include 
 
@@ -13,8 +13,10 @@ SUBDIR+= libsupc++ libstdc++-v3
 
 SUBDIR+= .WAIT libasan liblsan libubsan
 
-# TSan does not work with 32bit address space
-.if (!empty(MACHINE_ARCH:M*64*) || ${MACHINE_ARCH} == alpha)
+# TSan does not work with 32bit address space and has not been porter
+# to all architectures
+.if (!empty(MACHINE_ARCH:M*64*) || ${MACHINE_ARCH} == alpha) && \
+	${MACHINE_ARCH} != "sparc64"
 SUBDIR+= libtsan
 .endif
 .endif



CVS commit: src/share/mk

2020-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 15 04:54:41 UTC 2020

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
make everyone use gdb.old


To generate a diff of this commit:
cvs rdiff -u -r1.1216 -r1.1217 src/share/mk/bsd.own.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1216 src/share/mk/bsd.own.mk:1.1217
--- src/share/mk/bsd.own.mk:1.1216	Mon Sep 14 15:00:28 2020
+++ src/share/mk/bsd.own.mk	Tue Sep 15 00:54:41 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1216 2020/09/14 19:00:28 skrll Exp $
+#	$NetBSD: bsd.own.mk,v 1.1217 2020/09/15 04:54:41 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -111,9 +111,9 @@ EXTERNAL_BINUTILS_SUBDIR=	/does/not/exis
 #
 HAVE_GDB?=	830
 
-.if ${HAVE_GDB} == 830
+.if ${HAVE_GDB} == 1000
 EXTERNAL_GDB_SUBDIR=		gdb
-.elif ${HAVE_GDB} == 801
+.elif ${HAVE_GDB} == 830
 EXTERNAL_GDB_SUBDIR=		gdb.old
 .else
 EXTERNAL_GDB_SUBDIR=		/does/not/exist



CVS commit: src/external/gpl3/gdb

2020-09-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 15 02:05:31 UTC 2020

Modified Files:
src/external/gpl3/gdb: gdb2netbsd
src/external/gpl3/gdb/dist: config.guess config.sub
src/external/gpl3/gdb/dist/bfd: bfdio.c config.bfd configure elf.c
elf32-arm.c elf32-i386.c merge.c netbsd-core.c
src/external/gpl3/gdb/dist/bfd/doc: Makefile.am Makefile.in
src/external/gpl3/gdb/dist/binutils/po: sv.po
src/external/gpl3/gdb/dist/gdb: ChangeLog Makefile.in aarch64-tdep.c
ada-lang.c alpha-bsd-nat.c alpha-bsd-tdep.h alpha-nbsd-tdep.c
alpha-tdep.c amd64-bsd-nat.c amd64-nbsd-nat.c amd64-nbsd-tdep.c
arm-bsd-tdep.c arm-nbsd-nat.c arm-nbsd-tdep.c arm-tdep.c auxv.c
bsd-kvm.c configure configure.ac configure.host configure.nat
configure.tgt dtrace-probe.c event-top.c hppa-nbsd-nat.c
hppa-nbsd-tdep.c hppa-tdep.c hppa-tdep.h i386-bsd-nat.c
i386-bsd-nat.h i386-nbsd-nat.c i386-nbsd-tdep.c inf-ptrace.c
inflow.c inflow.h infrun.c m68k-bsd-nat.c mips-nbsd-nat.c
mips-nbsd-tdep.c mips-nbsd-tdep.h mips-tdep.h nbsd-nat.h
nbsd-tdep.c nbsd-tdep.h objfiles.c p-exp.y ppc-nbsd-nat.c
ppc-nbsd-tdep.c ppc-nbsd-tdep.h regcache.c remote.c ser-unix.c
sh-nbsd-nat.c sh-nbsd-tdep.c sh-tdep.c solib.c sparc-nat.c
sparc-nat.h sparc-nbsd-nat.c sparc-nbsd-tdep.c sparc-tdep.h
sparc64-nbsd-nat.c sparc64-nbsd-tdep.c sparc64-tdep.c top.c
ui-file.c user-regs.c utils.c varobj.c vax-bsd-nat.c
vax-nbsd-tdep.c x86-bsd-nat.c
src/external/gpl3/gdb/dist/gdb/doc: stabs.texinfo
src/external/gpl3/gdb/dist/gdb/tui: tui-data.c tui-stack.c
tui-wingeneral.c tui-winsource.c
src/external/gpl3/gdb/dist/include/elf: common.h
src/external/gpl3/gdb/dist/include/opcode: ppc.h
src/external/gpl3/gdb/dist/libiberty: make-temp-file.c strerror.c
src/external/gpl3/gdb/dist/opcodes: arm-dis.c cgen.sh configure
src/external/gpl3/gdb/dist/readline/readline/doc: texi2dvi texi2html
src/external/gpl3/gdb/dist/readline/readline/examples: readlinebuf.h
src/external/gpl3/gdb/dist/readline/readline/examples/rlfe: config.h.in
extern.h os.h
src/external/gpl3/gdb/dist/sim: configure
src/external/gpl3/gdb/dist/sim/common: callback.c create-version.sh
src/external/gpl3/gdb/dist/sim/mn10300: Makefile.in
src/external/gpl3/gdb/dist/sim/ppc: emul_netbsd.c
src/external/gpl3/gdb/dist/sim/v850: Makefile.in
src/external/gpl3/gdb/dist/zlib: ChangeLog adler32.c compress.c crc32.c
deflate.c deflate.h example.c minigzip.c trees.c uncompr.c zconf.h
zconf.h.cmakein zconf.h.in zutil.c zutil.h
src/external/gpl3/gdb/dist/zlib/contrib/ada: buffer_demo.adb mtest.adb
read.adb test.adb zlib-streams.adb zlib-streams.ads zlib-thin.adb
zlib-thin.ads zlib.adb zlib.ads
src/external/gpl3/gdb/dist/zlib/contrib/iostream2: zstream.h
src/external/gpl3/gdb/dist/zlib/test: example.c minigzip.c
Removed Files:
src/external/gpl3/gdb/dist: md5.sum
src/external/gpl3/gdb/dist/bfd: aout-tic30.c coff-ppc.c coff-tic80.c
cpu-cr16c.c cpu-plugin.c cpu-tic80.c elf32-cr16c.c pe-ppc.c
pei-ppc.c
src/external/gpl3/gdb/dist/bfd/doc: aoutx.texi archive.texi
archures.texi bfd.info bfdio.texi bfdt.texi bfdver.texi bfdwin.texi
cache.texi coffcode.texi core.texi elf.texi elfcode.texi
format.texi hash.texi init.texi libbfd.texi linker.texi mmo.texi
opncls.texi reloc.texi section.texi syms.texi targets.texi
src/external/gpl3/gdb/dist/bfd/po: da.gmo es.gmo fi.gmo fr.gmo hr.gmo
id.gmo ja.gmo pt.gmo ro.gmo ru.gmo rw.gmo sr.gmo sv.gmo tr.gmo
uk.gmo vi.gmo zh_CN.gmo
src/external/gpl3/gdb/dist/gdb: ctf.c ctf.h demangle.c
dwarf-index-cache.c dwarf-index-cache.h dwarf-index-common.c
dwarf-index-common.h dwarf-index-write.c dwarf-index-write.h
dwarf2-frame-tailcall.c dwarf2-frame-tailcall.h dwarf2-frame.c
dwarf2-frame.h dwarf2expr.c dwarf2expr.h dwarf2loc.c dwarf2loc.h
dwarf2read.c dwarf2read.h event-loop.c event-loop.h gcore
gdb-dlfcn.c gdb-dlfcn.h gdb_select.h gdb_usleep.c gdb_usleep.h
i386-cygwin-tdep.c libmcheck.m4 nbsd-nat.c selftest.m4 solib-spu.c
solib-spu.h spu-linux-nat.c spu-multiarch.c spu-tdep.c spu-tdep.h
warning.m4
src/external/gpl3/gdb/dist/gdb/common: agent.c agent.h array-view.h
ax.def break-common.h btrace-common.c btrace-common.h buffer.c
buffer.h byte-vector.h cleanups.c cleanups.h common-debug.c
common-debug.h common-defs.h common-exceptions.c
common-exceptions.h 

CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 23:09:34 UTC 2020

Modified Files:
src/usr.bin/make: cond.c

Log Message:
make(1): fix coverity annotation for CondParser_String

It had been broken since 2020-09-08, when CondLexer (now CondParser) was
added.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/usr.bin/make/cond.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.146 src/usr.bin/make/cond.c:1.147
--- src/usr.bin/make/cond.c:1.146	Sun Sep 13 19:46:23 2020
+++ src/usr.bin/make/cond.c	Mon Sep 14 23:09:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.146 2020/09/13 19:46:23 rillig Exp $	*/
+/*	$NetBSD: cond.c,v 1.147 2020/09/14 23:09:34 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -93,7 +93,7 @@
 #include "dir.h"
 
 /*	"@(#)cond.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: cond.c,v 1.146 2020/09/13 19:46:23 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.147 2020/09/14 23:09:34 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -405,7 +405,7 @@ is_separator(char ch)
  *	Sets quoted if the string was quoted.
  *	Sets freeIt if needed.
  */
-/* coverity:[+alloc : arg-*3] */
+/* coverity:[+alloc : arg-*4] */
 static const char *
 CondParser_String(CondParser *par, Boolean doEval, Boolean strictLHS,
 		  Boolean *quoted, void **freeIt)



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 21:55:53 UTC 2020

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: opt-debug-lint.exp opt-debug-lint.mk

Log Message:
make(1): fix wrong error for undefined variables in lint mode


To generate a diff of this commit:
cvs rdiff -u -r1.521 -r1.522 src/usr.bin/make/var.c
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/opt-debug-lint.exp \
src/usr.bin/make/unit-tests/opt-debug-lint.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.521 src/usr.bin/make/var.c:1.522
--- src/usr.bin/make/var.c:1.521	Mon Sep 14 20:43:44 2020
+++ src/usr.bin/make/var.c	Mon Sep 14 21:55:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.521 2020/09/14 20:43:44 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.522 2020/09/14 21:55:53 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.521 2020/09/14 20:43:44 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.522 2020/09/14 21:55:53 rillig Exp $");
 
 #define VAR_DEBUG_IF(cond, fmt, ...)	\
 if (!(DEBUG(VAR) && (cond)))	\
@@ -3557,7 +3557,9 @@ Var_Parse(const char **pp, GNode *ctxt, 
 		return VPE_OK;
 		}
 
-		if ((eflags & VARE_UNDEFERR) && DEBUG(LINT)) {
+		if ((eflags & VARE_UNDEFERR) && (eflags & VARE_WANTRES) &&
+		DEBUG(LINT))
+		{
 		Parse_Error(PARSE_FATAL, "Variable \"%s\" is undefined",
 varname);
 		free(varname);

Index: src/usr.bin/make/unit-tests/opt-debug-lint.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-lint.exp:1.6 src/usr.bin/make/unit-tests/opt-debug-lint.exp:1.7
--- src/usr.bin/make/unit-tests/opt-debug-lint.exp:1.6	Mon Sep 14 21:52:49 2020
+++ src/usr.bin/make/unit-tests/opt-debug-lint.exp	Mon Sep 14 21:55:53 2020
@@ -1,6 +1,5 @@
 make: "opt-debug-lint.mk" line 19: Variable "X" is undefined
 make: "opt-debug-lint.mk" line 41: Variable "UNDEF" is undefined
-make: "opt-debug-lint.mk" line 58: Variable "UNDEF" is undefined
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
Index: src/usr.bin/make/unit-tests/opt-debug-lint.mk
diff -u src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.6 src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.7
--- src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.6	Mon Sep 14 21:52:49 2020
+++ src/usr.bin/make/unit-tests/opt-debug-lint.mk	Mon Sep 14 21:55:53 2020
@@ -1,4 +1,4 @@
-# $NetBSD: opt-debug-lint.mk,v 1.6 2020/09/14 21:52:49 rillig Exp $
+# $NetBSD: opt-debug-lint.mk,v 1.7 2020/09/14 21:55:53 rillig Exp $
 #
 # Tests for the -dL command line option, which runs additional checks
 # to catch common mistakes, such as unclosed variable expressions.
@@ -52,9 +52,6 @@ ${UNDEF}: ${UNDEF}
 # if the variable is indeed defined.  Otherwise they are only parsed, and
 # for parsing it doesn't make a difference whether the variable is defined
 # or not.
-#
-# FIXME: As of 2020-09-14, the following line prints an error message saying
-# that UNDEF is undefined.
 .if defined(UNDEF) && exists(${UNDEF})
 .  error
 .endif



CVS commit: src/usr.bin/make/unit-tests

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 21:52:49 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: opt-debug-lint.exp opt-debug-lint.mk

Log Message:
make(1): add test for wrong error in lint mode for undefined variable


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/opt-debug-lint.exp \
src/usr.bin/make/unit-tests/opt-debug-lint.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/opt-debug-lint.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-lint.exp:1.5 src/usr.bin/make/unit-tests/opt-debug-lint.exp:1.6
--- src/usr.bin/make/unit-tests/opt-debug-lint.exp:1.5	Mon Sep 14 07:13:29 2020
+++ src/usr.bin/make/unit-tests/opt-debug-lint.exp	Mon Sep 14 21:52:49 2020
@@ -1,5 +1,6 @@
 make: "opt-debug-lint.mk" line 19: Variable "X" is undefined
 make: "opt-debug-lint.mk" line 41: Variable "UNDEF" is undefined
+make: "opt-debug-lint.mk" line 58: Variable "UNDEF" is undefined
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
Index: src/usr.bin/make/unit-tests/opt-debug-lint.mk
diff -u src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.5 src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.6
--- src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.5	Mon Sep 14 21:23:58 2020
+++ src/usr.bin/make/unit-tests/opt-debug-lint.mk	Mon Sep 14 21:52:49 2020
@@ -1,4 +1,4 @@
-# $NetBSD: opt-debug-lint.mk,v 1.5 2020/09/14 21:23:58 rillig Exp $
+# $NetBSD: opt-debug-lint.mk,v 1.6 2020/09/14 21:52:49 rillig Exp $
 #
 # Tests for the -dL command line option, which runs additional checks
 # to catch common mistakes, such as unclosed variable expressions.
@@ -47,5 +47,17 @@
 # observable from the outside of the function Var_Parse.
 ${UNDEF}: ${UNDEF}
 
+# In a condition that has a defined(UNDEF) guard, all guarded conditions
+# may assume that the variable is defined since they will only be evaluated
+# if the variable is indeed defined.  Otherwise they are only parsed, and
+# for parsing it doesn't make a difference whether the variable is defined
+# or not.
+#
+# FIXME: As of 2020-09-14, the following line prints an error message saying
+# that UNDEF is undefined.
+.if defined(UNDEF) && exists(${UNDEF})
+.  error
+.endif
+
 all:
 	@:;



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 21:23:58 UTC 2020

Modified Files:
src/usr.bin/make: parse.c
src/usr.bin/make/unit-tests: opt-debug-lint.mk

Log Message:
make(1): in lint mode, allow undefined variables in dependency lines

This is needed to get past the first few seconds in a src/build.sh run.

The nest obstacle is src/tools/Makefile.gnuhost:30, where the variable
MODULE is undefined even though that file says in line 3 that MODULE is
expected to be set.  It has been saying this since 2001, but since make
didn't have the corresponding check enabled, this didn't break the
build.


To generate a diff of this commit:
cvs rdiff -u -r1.319 -r1.320 src/usr.bin/make/parse.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/opt-debug-lint.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.319 src/usr.bin/make/parse.c:1.320
--- src/usr.bin/make/parse.c:1.319	Mon Sep 14 19:59:47 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 21:23:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.319 2020/09/14 19:59:47 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.320 2020/09/14 21:23:58 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.319 2020/09/14 19:59:47 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.320 2020/09/14 21:23:58 rillig Exp $");
 
 /* types and constants */
 
@@ -3067,10 +3067,40 @@ Parse_File(const char *name, int fd)
 
 	/*
 	 * We now know it's a dependency line so it needs to have all
-	 * variables expanded before being parsed. Tell the variable
-	 * module to complain if some variable is undefined...
+	 * variables expanded before being parsed.
+	 *
+	 * XXX: Ideally the dependency line would first be split into
+	 * its left-hand side, dependency operator and right-hand side,
+	 * and then each side would be expanded on its own.  This would
+	 * allow for the left-hand side to allow only defined variables
+	 * and to allow variables on the right-hand side to be undefined
+	 * as well.
+	 *
+	 * Parsing the line first would also prevent that targets
+	 * generated from variable expressions are interpreted as the
+	 * dependency operator, such as in "target${:U:} middle: source",
+	 * in which the middle is interpreted as a source, not a target.
 	 */
-	line = Var_Subst(line, VAR_CMD, VARE_UNDEFERR|VARE_WANTRES);
+	{
+	/* In lint mode, allow undefined variables to appear in
+	 * dependency lines.
+	 *
+	 * Ideally, only the right-hand side would allow undefined
+	 * variables since it is common to have no dependencies.
+	 * Having undefined variables on the left-hand side is more
+	 * unusual though.  Since both sides are expanded in a single
+	 * pass, there is not much choice what to do here.
+	 *
+	 * In normal mode, it does not matter whether undefined
+	 * variables are allowed or not since as of 2020-09-14,
+	 * Var_Parse does not print any parse errors in such a case.
+	 * It simply returns the special empty string var_Error,
+	 * which cannot be detected in the result of Var_Subst. */
+		VarEvalFlags eflags = DEBUG(LINT)
+  ? VARE_WANTRES
+  : VARE_UNDEFERR|VARE_WANTRES;
+		line = Var_Subst(line, VAR_CMD, eflags);
+	}
 
 	/*
 	 * Need a list for the target nodes

Index: src/usr.bin/make/unit-tests/opt-debug-lint.mk
diff -u src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.4 src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.5
--- src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.4	Mon Sep 14 07:13:29 2020
+++ src/usr.bin/make/unit-tests/opt-debug-lint.mk	Mon Sep 14 21:23:58 2020
@@ -1,4 +1,4 @@
-# $NetBSD: opt-debug-lint.mk,v 1.4 2020/09/14 07:13:29 rillig Exp $
+# $NetBSD: opt-debug-lint.mk,v 1.5 2020/09/14 21:23:58 rillig Exp $
 #
 # Tests for the -dL command line option, which runs additional checks
 # to catch common mistakes, such as unclosed variable expressions.
@@ -42,5 +42,10 @@
 .  error
 .endif
 
+# Since 2020-09-14, dependency lines may contain undefined variables.
+# Before, undefined variables were forbidden, but this distinction was not
+# observable from the outside of the function Var_Parse.
+${UNDEF}: ${UNDEF}
+
 all:
 	@:;



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 20:43:44 UTC 2020

Modified Files:
src/usr.bin/make: for.c var.c

Log Message:
make(1): inline character constants in var.c

This removes a level of indirection, and the macro names were quite
similar in appearance as well.  The macros may have been used by people
whose editors don't recognize C string and character literals when
navigating to the corresponding brace or parenthesis.  These editors had
already been confused before this commit since there are also string
literals with unbalanced parentheses, and there are far fewer
compensating comments such as /*{*/ or /*)*/ in the code.  In fact, the
only such comment that is left over was in for.c.

This way, there is now a single consistent way of writing these
character literals, which is without macros or comments, since that is
the simplest form.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/usr.bin/make/for.c
cvs rdiff -u -r1.520 -r1.521 src/usr.bin/make/var.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/for.c
diff -u src/usr.bin/make/for.c:1.83 src/usr.bin/make/for.c:1.84
--- src/usr.bin/make/for.c:1.83	Sun Sep 13 15:15:51 2020
+++ src/usr.bin/make/for.c	Mon Sep 14 20:43:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: for.c,v 1.83 2020/09/13 15:15:51 rillig Exp $	*/
+/*	$NetBSD: for.c,v 1.84 2020/09/14 20:43:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1992, The Regents of the University of California.
@@ -60,7 +60,7 @@
 #include"strlist.h"
 
 /*	"@(#)for.c	8.1 (Berkeley) 6/6/93"	*/
-MAKE_RCSID("$NetBSD: for.c,v 1.83 2020/09/13 15:15:51 rillig Exp $");
+MAKE_RCSID("$NetBSD: for.c,v 1.84 2020/09/14 20:43:44 rillig Exp $");
 
 typedef enum {
 FOR_SUB_ESCAPE_CHAR = 0x0001,
@@ -424,7 +424,7 @@ ForIterate(void *v_arg, size_t *ret_len)
 	Buf_AddBytesBetween(, cmd_cp, cp);
 	Buf_AddStr(, "{:U");
 	cmd_cp = ++cp;
-	for_substitute(, >items, arg->sub_next + i, /*{*/ '}');
+	for_substitute(, >items, arg->sub_next + i, '}');
 	Buf_AddByte(, '}');
 	break;
 	}

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.520 src/usr.bin/make/var.c:1.521
--- src/usr.bin/make/var.c:1.520	Mon Sep 14 07:04:56 2020
+++ src/usr.bin/make/var.c	Mon Sep 14 20:43:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.520 2020/09/14 07:04:56 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.521 2020/09/14 20:43:44 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.520 2020/09/14 07:04:56 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.521 2020/09/14 20:43:44 rillig Exp $");
 
 #define VAR_DEBUG_IF(cond, fmt, ...)	\
 if (!(DEBUG(VAR) && (cond)))	\
@@ -262,11 +262,6 @@ typedef enum {
 VARP_ANCHOR_END	= 0x08	/* Match at end of word */
 } VarPatternFlags;
 
-#define BROPEN	'{'
-#define BRCLOSE	'}'
-#define PROPEN	'('
-#define PRCLOSE	')'
-
 /*-
  *---
  * VarFind --
@@ -1692,14 +1687,14 @@ ParseModifierPart(
 	 * No code should ever depend on these details, but who knows. */
 
 	varstart = p;		/* Nested variable, only parsed */
-	if (p[1] == PROPEN || p[1] == BROPEN) {
+	if (p[1] == '(' || p[1] == '{') {
 	/*
 	 * Find the end of this variable reference
 	 * and suck it in without further ado.
 	 * It will be interpreted later.
 	 */
 	int have = p[1];
-	int want = have == PROPEN ? PRCLOSE : BRCLOSE;
+	int want = have == '(' ? ')' : '}';
 	int depth = 1;
 
 	for (p += 2; *p != '\0' && depth > 0; p++) {
@@ -2828,7 +2823,7 @@ ApplyModifier_Assign(const char **pp, Ap
 	break;
 }
 
-delim = st->startc == PROPEN ? PRCLOSE : BRCLOSE;
+delim = st->startc == '(' ? ')' : '}';
 val = ParseModifierPart(pp, delim, st->eflags, st->ctxt, NULL, NULL, NULL);
 if (st->v->flags & VAR_JUNK) {
 	/* restore original name */
@@ -3468,7 +3463,7 @@ Var_Parse(const char **pp, GNode *ctxt, 
 endc = '\0';
 
 startc = start[1];
-if (startc != PROPEN && startc != BROPEN) {
+if (startc != '(' && startc != '{') {
 	char name[2];
 
 	/*
@@ -3503,7 +3498,7 @@ Var_Parse(const char **pp, GNode *ctxt, 
 	size_t namelen;
 	char *varname;
 
-	endc = startc == PROPEN ? PRCLOSE : BRCLOSE;
+	endc = startc == '(' ? ')' : '}';
 
 	p = start + 2;
 	varname = ParseVarname(, startc, endc, ctxt, eflags, );



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 19:59:47 UTC 2020

Modified Files:
src/usr.bin/make: parse.c
src/usr.bin/make/unit-tests: include-main.exp include-sub.mk

Log Message:
make(1): describe how Parse_Error might print stack traces

In deeply nested include chains and .for loops this may be a useful
feature.  It's a little tricky to generate an intuitive stack trace,
though not impossible.  This explanation also serves as a detailed
documentation about how the .include and .for directives are
implemented.


To generate a diff of this commit:
cvs rdiff -u -r1.318 -r1.319 src/usr.bin/make/parse.c
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/include-main.exp
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/include-sub.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.318 src/usr.bin/make/parse.c:1.319
--- src/usr.bin/make/parse.c:1.318	Mon Sep 14 18:21:26 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 19:59:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.318 2020/09/14 18:21:26 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.319 2020/09/14 19:59:47 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.318 2020/09/14 18:21:26 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.319 2020/09/14 19:59:47 rillig Exp $");
 
 /* types and constants */
 
@@ -245,9 +245,46 @@ static int fatals = 0;
 /* current file being read */
 static IFile *curFile;
 
-/* The current file from the command line (at the bottom of the stack) and
- * further up all the files that are currently being read due to nested
- * .include or .for directives. */
+/* The include chain of makefiles that leads to curFile.  At the bottom of
+ * the stack is the top-level makefile from the command line, and on top of
+ * this file, there are the included files or .for loops, up to but excluding
+ * curFile.
+ *
+ * This data could be used to print stack traces on parse errors.  As of
+ * 2020-09-14, this is not done though.  It seems quite simple to print the
+ * tuples (fname:lineno:fromForLoop), from top to bottom.  This simple idea is
+ * made complicated by the fact that the .for loops also use this stack for
+ * storing information.
+ *
+ * The lineno fields of the IFiles with fromForLoop == TRUE look confusing,
+ * which is demonstrated by the test 'include-main.mk'.  They seem sorted
+ * backwards since they tell the number of completely parsed lines, which for
+ * a .for loop is right after the terminating .endfor.  To compensate for this
+ * confusion, there is another field first_lineno pointing at the start of the
+ * .for loop, 1-based for human consumption.
+ *
+ * To make the stack trace intuitive, the entry below the first .for loop must
+ * be ignored completely since neither its lineno nor its first_lineno is
+ * useful.  Instead, the topmost .for loop needs to be printed twice, once
+ * with its first_lineno and once with its lineno.
+ *
+ * As of 2020-09-15, using the above rules, the stack trace for the .info line
+ * in include-subsub.mk would be:
+ *
+ *	curFile:	include-subsub.mk:4
+ *			(lineno, from an .include)
+ *	includes[4]:	include-sub.mk:32
+ *			(lineno, from a .for loop below an .include)
+ *	includes[4]:	include-sub.mk:31
+ *			(first_lineno, from a .for loop, lineno == 32)
+ *	includes[3]:	include-sub.mk:30
+ *			(first_lineno, from a .for loop, lineno == 33)
+ *	includes[2]:	include-sub.mk:29
+ *			(first_lineno, from a .for loop, lineno == 34)
+ *	includes[1]:	include-sub.mk:35
+ *			(not printed since it is below a .for loop)
+ *	includes[0]:	include-main.mk:27
+ */
 static Stack /* of *IFile */ includes;
 
 /* include paths (lists of directories) */

Index: src/usr.bin/make/unit-tests/include-main.exp
diff -u src/usr.bin/make/unit-tests/include-main.exp:1.4 src/usr.bin/make/unit-tests/include-main.exp:1.5
--- src/usr.bin/make/unit-tests/include-main.exp:1.4	Sat Sep  5 18:18:05 2020
+++ src/usr.bin/make/unit-tests/include-main.exp	Mon Sep 14 19:59:47 2020
@@ -3,8 +3,8 @@ make: "include-main.mk" line 21: main-be
 make: "include-sub.mk" line 4: sub-before-ok
 make: "include-sub.mk" line 14: sub-before-for-ok
 make: "include-subsub.mk" line 4: subsub-ok
-make: "include-sub.mk" line 23: sub-after-ok
-make: "include-sub.mk" line 30: sub-after-for-ok
+make: "include-sub.mk" line 38: sub-after-ok
+make: "include-sub.mk" line 45: sub-after-for-ok
 make: "include-main.mk" line 30: main-after-ok
 make: "include-main.mk" line 37: main-after-for-ok
 exit status 0

Index: src/usr.bin/make/unit-tests/include-sub.mk
diff -u src/usr.bin/make/unit-tests/include-sub.mk:1.3 src/usr.bin/make/unit-tests/include-sub.mk:1.4
--- src/usr.bin/make/unit-tests/include-sub.mk:1.3	Sat Sep  5 18:13:47 2020
+++ 

CVS commit: src/external/gpl3/gcc

2020-09-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 14 19:51:54 UTC 2020

Modified Files:
src/external/gpl3/gcc: README.gcc9

Log Message:
hppa status


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gcc/README.gcc9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/README.gcc9
diff -u src/external/gpl3/gcc/README.gcc9:1.12 src/external/gpl3/gcc/README.gcc9:1.13
--- src/external/gpl3/gcc/README.gcc9:1.12	Mon Sep 14 01:19:50 2020
+++ src/external/gpl3/gcc/README.gcc9	Mon Sep 14 19:51:54 2020
@@ -1,4 +1,4 @@
-$NetBSD: README.gcc9,v 1.12 2020/09/14 01:19:50 mrg Exp $
+$NetBSD: README.gcc9,v 1.13 2020/09/14 19:51:54 skrll Exp $
 
 new stuff:
 	cc1objcplus
@@ -46,7 +46,7 @@ earmv7		y	n	n	y		n		?	?	y
 earmv7eb	y	n	n	y		n		?	?	y
 earmv7hf	y	y	y	y		y		y	y	y
 earmv7hfeb	y	n	n	y		n		?	?	y
-hppa		y	y	y	y		y		?	?	?
+hppa		y	y	y	y		y		y	y	y
 i386		y	y	y	y		y		y	y	y
 ia64		y	y	y	y		y		y	N/A	y
 m68000		y	y	y	y		y		y	?	n



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 19:14:19 UTC 2020

Modified Files:
src/usr.bin/make: lst.c

Log Message:
make(1): in debug mode, reset unused stack space to NULL


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/usr.bin/make/lst.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/lst.c
diff -u src/usr.bin/make/lst.c:1.63 src/usr.bin/make/lst.c:1.64
--- src/usr.bin/make/lst.c:1.63	Sun Sep 13 15:15:51 2020
+++ src/usr.bin/make/lst.c	Mon Sep 14 19:14:19 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.63 2020/09/13 15:15:51 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.64 2020/09/14 19:14:19 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -36,7 +36,7 @@
 
 #include "make.h"
 
-MAKE_RCSID("$NetBSD: lst.c,v 1.63 2020/09/13 15:15:51 rillig Exp $");
+MAKE_RCSID("$NetBSD: lst.c,v 1.64 2020/09/14 19:14:19 rillig Exp $");
 
 struct ListNode {
 struct ListNode *prev;	/* previous element in list */
@@ -651,9 +651,15 @@ void Stack_Push(Stack *stack, void *datu
 
 void *Stack_Pop(Stack *stack)
 {
+void *datum;
+
 assert(stack->len > 0);
 stack->len--;
-return stack->items[stack->len];
+datum = stack->items[stack->len];
+#ifdef CLEANUP
+stack->items[stack->len] = NULL;
+#endif
+return datum;
 }
 
 void Stack_Done(Stack *stack)



CVS commit: src/share/mk

2020-09-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 14 19:00:28 UTC 2020

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Switch hppa to gcc 9.

Summary for 883 test programs:
7487 passed test cases.
644 failed test cases.
51 expected failed test cases.
582 skipped test cases.


To generate a diff of this commit:
cvs rdiff -u -r1.1215 -r1.1216 src/share/mk/bsd.own.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1215 src/share/mk/bsd.own.mk:1.1216
--- src/share/mk/bsd.own.mk:1.1215	Mon Sep 14 00:11:45 2020
+++ src/share/mk/bsd.own.mk	Mon Sep 14 19:00:28 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1215 2020/09/14 00:11:45 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1216 2020/09/14 19:00:28 skrll Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -65,7 +65,8 @@ TOOLCHAIN_MISSING?=	no
 #
 .if ${MACHINE_ARCH} == "x86_64" || ${MACHINE_ARCH} == "i386" || \
 ${MACHINE_CPU} == "aarch64" || ${MACHINE_CPU} == "arm" || \
-${MACHINE_CPU} == "riscv" || ${MACHINE} == "ia64"
+${MACHINE_CPU} == "riscv" || ${MACHINE} == "ia64" || \
+${MACHINE_CPU} == "hppa"
 HAVE_GCC?=	9
 .else
 HAVE_GCC?=	8



CVS commit: src/usr.bin/make/unit-tests

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 18:49:24 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: directive-for.exp directive-for.mk

Log Message:
make(1): add test for nested .for loops with the same variable name


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/directive-for.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/directive-for.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/directive-for.exp
diff -u src/usr.bin/make/unit-tests/directive-for.exp:1.1 src/usr.bin/make/unit-tests/directive-for.exp:1.2
--- src/usr.bin/make/unit-tests/directive-for.exp:1.1	Wed Sep  2 05:33:57 2020
+++ src/usr.bin/make/unit-tests/directive-for.exp	Mon Sep 14 18:49:24 2020
@@ -1 +1,2 @@
+make: "directive-for.mk" line 100: outer
 exit status 0

Index: src/usr.bin/make/unit-tests/directive-for.mk
diff -u src/usr.bin/make/unit-tests/directive-for.mk:1.2 src/usr.bin/make/unit-tests/directive-for.mk:1.3
--- src/usr.bin/make/unit-tests/directive-for.mk:1.2	Wed Sep  2 22:58:59 2020
+++ src/usr.bin/make/unit-tests/directive-for.mk	Mon Sep 14 18:49:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for.mk,v 1.2 2020/09/02 22:58:59 rillig Exp $
+# $NetBSD: directive-for.mk,v 1.3 2020/09/14 18:49:24 rillig Exp $
 #
 # Tests for the .for directive.
 
@@ -93,5 +93,13 @@ EXPANSION${plus}=	value
 .  error This must be a make from before 2009.
 .endif
 
+# When the outer .for loop is expanded, it sees the expression ${i} and
+# expands it.  The inner loop then has nothing more to expand.
+.for i in outer
+.  for i in inner
+.info ${i}
+.  endfor
+.endfor
+
 all:
 	@:;



CVS commit: src/usr.bin/make/unit-tests

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 18:27:16 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: deptgt.exp deptgt.mk

Log Message:
make(1): in the deptgt test, describe what happens to the targets


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/deptgt.exp
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/deptgt.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/deptgt.exp
diff -u src/usr.bin/make/unit-tests/deptgt.exp:1.3 src/usr.bin/make/unit-tests/deptgt.exp:1.4
--- src/usr.bin/make/unit-tests/deptgt.exp:1.3	Mon Sep 14 18:21:26 2020
+++ src/usr.bin/make/unit-tests/deptgt.exp	Mon Sep 14 18:27:15 2020
@@ -1,5 +1,5 @@
 make: "deptgt.mk" line 10: warning: Extra target ignored
-make: "deptgt.mk" line 27: Unassociated shell command ": command3"
+make: "deptgt.mk" line 28: Unassociated shell command ": command3		# parse error, since targets == NULL"
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/deptgt.mk
diff -u src/usr.bin/make/unit-tests/deptgt.mk:1.4 src/usr.bin/make/unit-tests/deptgt.mk:1.5
--- src/usr.bin/make/unit-tests/deptgt.mk:1.4	Mon Sep 14 18:21:26 2020
+++ src/usr.bin/make/unit-tests/deptgt.mk	Mon Sep 14 18:27:15 2020
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt.mk,v 1.4 2020/09/14 18:21:26 rillig Exp $
+# $NetBSD: deptgt.mk,v 1.5 2020/09/14 18:27:15 rillig Exp $
 #
 # Tests for special targets like .BEGIN or .SUFFIXES in dependency
 # declarations.
@@ -9,9 +9,7 @@
 # dependency line: That doesn't work, and make immediately rejects it.
 .SUFFIXES .PHONY: .c.o
 
-# Keyword "parse.c:targets"
-#
-# The following lines demonstrate how 'target' is set and reset during
+# The following lines demonstrate how 'targets' is set and reset during
 # parsing of dependencies.  To see it in action, set breakpoints in:
 #
 #	ParseDoDependency	at the beginning
@@ -20,11 +18,14 @@
 #	Parse_File		at "targets = Lst_Init()"
 #	Parse_File		at "!inLine"
 #
-target1 target2: sources
-	: command1
-	: command2
-VAR=value
-	: command3
+# Keywords:
+#	parse.c:targets
+
+target1 target2: sources	# targets := [target1, target2]
+	: command1		# targets == [target1, target2]
+	: command2		# targets == [target1, target2]
+VAR=value			# targets := NULL
+	: command3		# parse error, since targets == NULL
 
 all:
 	@:;



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 18:21:26 UTC 2020

Modified Files:
src/usr.bin/make: parse.c
src/usr.bin/make/unit-tests: deptgt.exp deptgt.mk

Log Message:
make(1): add test for the global variable 'targets' in parse.c


To generate a diff of this commit:
cvs rdiff -u -r1.317 -r1.318 src/usr.bin/make/parse.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/deptgt.exp
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/deptgt.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.317 src/usr.bin/make/parse.c:1.318
--- src/usr.bin/make/parse.c:1.317	Mon Sep 14 17:47:05 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 18:21:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.317 2020/09/14 17:47:05 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.318 2020/09/14 18:21:26 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.317 2020/09/14 17:47:05 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.318 2020/09/14 18:21:26 rillig Exp $");
 
 /* types and constants */
 
@@ -214,7 +214,9 @@ static GNode *mainNode;
 
 /* eval state */
 
-/* targets we're working on */
+/* During parsing, the targets from the previous dependency line.
+ *
+ * See unit-tests/deptgt.mk, keyword "parse.c:targets". */
 static Lst targets;
 
 #ifdef CLEANUP
@@ -3034,7 +3036,7 @@ Parse_File(const char *name, int fd)
 	line = Var_Subst(line, VAR_CMD, VARE_UNDEFERR|VARE_WANTRES);
 
 	/*
-	 * Need a non-circular list for the target nodes
+	 * Need a list for the target nodes
 	 */
 	if (targets != NULL)
 		Lst_Free(targets);

Index: src/usr.bin/make/unit-tests/deptgt.exp
diff -u src/usr.bin/make/unit-tests/deptgt.exp:1.2 src/usr.bin/make/unit-tests/deptgt.exp:1.3
--- src/usr.bin/make/unit-tests/deptgt.exp:1.2	Mon Sep 14 17:43:36 2020
+++ src/usr.bin/make/unit-tests/deptgt.exp	Mon Sep 14 18:21:26 2020
@@ -1,2 +1,5 @@
 make: "deptgt.mk" line 10: warning: Extra target ignored
-exit status 0
+make: "deptgt.mk" line 27: Unassociated shell command ": command3"
+make: Fatal errors encountered -- cannot continue
+make: stopped in unit-tests
+exit status 1

Index: src/usr.bin/make/unit-tests/deptgt.mk
diff -u src/usr.bin/make/unit-tests/deptgt.mk:1.3 src/usr.bin/make/unit-tests/deptgt.mk:1.4
--- src/usr.bin/make/unit-tests/deptgt.mk:1.3	Mon Sep 14 17:43:36 2020
+++ src/usr.bin/make/unit-tests/deptgt.mk	Mon Sep 14 18:21:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt.mk,v 1.3 2020/09/14 17:43:36 rillig Exp $
+# $NetBSD: deptgt.mk,v 1.4 2020/09/14 18:21:26 rillig Exp $
 #
 # Tests for special targets like .BEGIN or .SUFFIXES in dependency
 # declarations.
@@ -9,5 +9,22 @@
 # dependency line: That doesn't work, and make immediately rejects it.
 .SUFFIXES .PHONY: .c.o
 
+# Keyword "parse.c:targets"
+#
+# The following lines demonstrate how 'target' is set and reset during
+# parsing of dependencies.  To see it in action, set breakpoints in:
+#
+#	ParseDoDependency	at the beginning
+#	ParseFinishLine		at "targets = NULL"
+#	Parse_File		at "Lst_Free(targets)"
+#	Parse_File		at "targets = Lst_Init()"
+#	Parse_File		at "!inLine"
+#
+target1 target2: sources
+	: command1
+	: command2
+VAR=value
+	: command3
+
 all:
 	@:;



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 17:47:05 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): fix documentation of ParseLinkSrcArgs.specType

That code is never called for .SUFFIXES, but for .END.


To generate a diff of this commit:
cvs rdiff -u -r1.316 -r1.317 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.316 src/usr.bin/make/parse.c:1.317
--- src/usr.bin/make/parse.c:1.316	Mon Sep 14 17:44:57 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 17:47:05 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.316 2020/09/14 17:44:57 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.317 2020/09/14 17:47:05 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.316 2020/09/14 17:44:57 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.317 2020/09/14 17:47:05 rillig Exp $");
 
 /* types and constants */
 
@@ -747,7 +747,7 @@ struct ParseLinkSrcArgs {
 GNode *cgn;
 
 /* The special target of the current dependency line. */
-/* Example: for ".SUFFIXES: .c.o", it is 'Suffixes'. */
+/* Example: for ".END: action", it is 'End'. */
 ParseSpecial specType;
 };
 



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 17:44:58 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): clean up documentation and code of ParseLinkSrc

The previous documentation was focused on the implementation details,
which are already clear from the code.  Add some high-level
documentation to help readers understand how this function fits into the
overall picture.


To generate a diff of this commit:
cvs rdiff -u -r1.315 -r1.316 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.315 src/usr.bin/make/parse.c:1.316
--- src/usr.bin/make/parse.c:1.315	Mon Sep 14 16:59:41 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 17:44:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.315 2020/09/14 16:59:41 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.316 2020/09/14 17:44:57 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.315 2020/09/14 16:59:41 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.316 2020/09/14 17:44:57 rillig Exp $");
 
 /* types and constants */
 
@@ -745,48 +745,40 @@ ParseMessage(char *line)
 
 struct ParseLinkSrcArgs {
 GNode *cgn;
+
+/* The special target of the current dependency line. */
+/* Example: for ".SUFFIXES: .c.o", it is 'Suffixes'. */
 ParseSpecial specType;
 };
 
-/*-
- *-
- * ParseLinkSrc  --
- *	Link the parent node to its new child. Used in a Lst_ForEach by
- *	ParseDoDependency. If the specType isn't 'Not', the parent
- *	isn't linked as a parent of the child.
- *
- * Input:
- *	pgnp		The parent node
- *	cgpn		The child node
- *
- * Results:
- *	Always = 0
+/* Add the child to the parent's children.
  *
- * Side Effects:
- *	New elements are added to the parents list of cgn and the
- *	children list of cgn. the unmade field of pgn is updated
- *	to reflect the additional child.
- *-
- */
+ * Add the parent to the child's parents, but only if the target is not
+ * special.  An example for such a special target is .END, which does not
+ * need to be informed once the child target has been made. */
 static int
 ParseLinkSrc(void *pgnp, void *data)
 {
 const struct ParseLinkSrcArgs *args = data;
-GNode  *pgn = (GNode *)pgnp;
-GNode  *cgn = args->cgn;
+GNode *pgn = pgnp;
+GNode *cgn = args->cgn;
 
 if ((pgn->type & OP_DOUBLEDEP) && !Lst_IsEmpty(pgn->cohorts))
 	pgn = LstNode_Datum(Lst_Last(pgn->cohorts));
+
 Lst_Append(pgn->children, cgn);
+pgn->unmade += 1;
+
 if (args->specType == Not)
 	Lst_Append(cgn->parents, pgn);
-pgn->unmade += 1;
+
 if (DEBUG(PARSE)) {
-	fprintf(debug_file, "# %s: added child %s - %s\n", __func__,
-	pgn->name, cgn->name);
+	fprintf(debug_file, "# %s: added child %s - %s\n",
+		__func__, pgn->name, cgn->name);
 	Targ_PrintNode(pgn, 0);
 	Targ_PrintNode(cgn, 0);
 }
+
 return 0;
 }
 



CVS commit: src/usr.bin/make/unit-tests

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 17:43:36 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: deptgt.exp deptgt.mk

Log Message:
make(1): add test for combining several special targets


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/deptgt.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/deptgt.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/deptgt.exp
diff -u src/usr.bin/make/unit-tests/deptgt.exp:1.1 src/usr.bin/make/unit-tests/deptgt.exp:1.2
--- src/usr.bin/make/unit-tests/deptgt.exp:1.1	Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/deptgt.exp	Mon Sep 14 17:43:36 2020
@@ -1 +1,2 @@
+make: "deptgt.mk" line 10: warning: Extra target ignored
 exit status 0

Index: src/usr.bin/make/unit-tests/deptgt.mk
diff -u src/usr.bin/make/unit-tests/deptgt.mk:1.2 src/usr.bin/make/unit-tests/deptgt.mk:1.3
--- src/usr.bin/make/unit-tests/deptgt.mk:1.2	Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/deptgt.mk	Mon Sep 14 17:43:36 2020
@@ -1,9 +1,13 @@
-# $NetBSD: deptgt.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: deptgt.mk,v 1.3 2020/09/14 17:43:36 rillig Exp $
 #
 # Tests for special targets like .BEGIN or .SUFFIXES in dependency
 # declarations.
 
 # TODO: Implementation
 
+# Just in case anyone tries to compile several special targets in a single
+# dependency line: That doesn't work, and make immediately rejects it.
+.SUFFIXES .PHONY: .c.o
+
 all:
 	@:;



CVS commit: src/sys/arch/aarch64/aarch64

2020-09-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Sep 14 17:14:12 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: kobj_machdep.c

Log Message:
swap insns for aarch64eb


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/aarch64/aarch64/kobj_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/aarch64/aarch64/kobj_machdep.c
diff -u src/sys/arch/aarch64/aarch64/kobj_machdep.c:1.4 src/sys/arch/aarch64/aarch64/kobj_machdep.c:1.5
--- src/sys/arch/aarch64/aarch64/kobj_machdep.c:1.4	Wed Jul  8 03:45:13 2020
+++ src/sys/arch/aarch64/aarch64/kobj_machdep.c	Mon Sep 14 17:14:12 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kobj_machdep.c,v 1.4 2020/07/08 03:45:13 ryo Exp $	*/
+/*	$NetBSD: kobj_machdep.c,v 1.5 2020/09/14 17:14:12 ryo Exp $	*/
 
 /*
  * Copyright (c) 2018 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kobj_machdep.c,v 1.4 2020/07/08 03:45:13 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kobj_machdep.c,v 1.5 2020/09/14 17:14:12 ryo Exp $");
 
 #define ELFSIZE		ARCH_ELFSIZE
 
@@ -184,7 +184,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 	old = *where;
 #ifdef DDB
 	snprintf(disasmbuf, sizeof(disasmbuf), "%08x %s",
-	*insn, strdisasm((vaddr_t)insn), 0);
+	le32toh(*insn), strdisasm((vaddr_t)insn), 0);
 #endif
 #endif /* KOBJ_MACHDEP_DEBUG */
 
@@ -247,7 +247,8 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		}
 		val &= WIDTHMASK(12);
 		val >>= shift;
-		*insn = (*insn & ~__BITS(21,10)) | (val << 10);
+		*insn = htole32(
+		(le32toh(*insn) & ~__BITS(21,10)) | (val << 10));
 		break;
 
 	case R_AARCH64_ADR_PREL_PG_HI21_NC:
@@ -268,8 +269,9 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 		}
 		immlo = val & WIDTHMASK(2);
 		immhi = (val >> 2) & WIDTHMASK(19);
-		*insn = (*insn & ~(__BITS(30,29) | __BITS(23,5))) |
-		(immlo << 29) | (immhi << 5);
+		*insn = htole32((le32toh(*insn) &
+		~(__BITS(30,29) | __BITS(23,5))) |
+		(immlo << 29) | (immhi << 5));
 		break;
 
 	case R_AARCH_JUMP26:
@@ -291,7 +293,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 			break;
 		}
 		val &= WIDTHMASK(26);
-		*insn = (*insn & ~__BITS(25,0)) | val;
+		*insn = htole32((le32toh(*insn) & ~__BITS(25,0)) | val);
 		break;
 
 	case R_AARCH64_PREL64:
@@ -348,7 +350,7 @@ kobj_reloc(kobj_t ko, uintptr_t relocbas
 #ifdef DDB
 	printf("%s:insn %s\n", __func__, disasmbuf);
 	printf("%s:  -> %08x %s\n", __func__,
-	*insn, strdisasm((vaddr_t)insn, 0));
+	le32toh(*insn), strdisasm((vaddr_t)insn, 0));
 #endif
 	printf("\n");
 #endif /* KOBJ_MACHDEP_DEBUG */



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 16:59:41 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): eliminate the global variable specType

This variable didn't have an intended lifetype of "whole application",
therefore it is better implemented as a local variable that is passed
around the few functions that really need it.  It's the same pattern as
in the ModifyWord functions in var.c, only this time without a typedef.


To generate a diff of this commit:
cvs rdiff -u -r1.314 -r1.315 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.314 src/usr.bin/make/parse.c:1.315
--- src/usr.bin/make/parse.c:1.314	Mon Sep 14 16:40:06 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 16:59:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.314 2020/09/14 16:40:06 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.315 2020/09/14 16:59:41 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.314 2020/09/14 16:40:06 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.315 2020/09/14 16:59:41 rillig Exp $");
 
 /* types and constants */
 
@@ -223,14 +223,6 @@ static Lst targCmds;
 #endif
 
 /*
- * specType contains the SPECial TYPE of the current target. It is
- * Not if the target is unspecial. If it *is* special, however, the children
- * are linked as children of the parent but not vice versa. This variable is
- * set in ParseDoDependency
- */
-static ParseSpecial specType;
-
-/*
  * Predecessor node for handling .ORDER. Initialized to NULL when .ORDER
  * seen, then set to each successive source on the line.
  */
@@ -751,6 +743,11 @@ ParseMessage(char *line)
 return TRUE;
 }
 
+struct ParseLinkSrcArgs {
+GNode *cgn;
+ParseSpecial specType;
+};
+
 /*-
  *-
  * ParseLinkSrc  --
@@ -772,15 +769,16 @@ ParseMessage(char *line)
  *-
  */
 static int
-ParseLinkSrc(void *pgnp, void *cgnp)
+ParseLinkSrc(void *pgnp, void *data)
 {
+const struct ParseLinkSrcArgs *args = data;
 GNode  *pgn = (GNode *)pgnp;
-GNode  *cgn = (GNode *)cgnp;
+GNode  *cgn = args->cgn;
 
 if ((pgn->type & OP_DOUBLEDEP) && !Lst_IsEmpty(pgn->cohorts))
 	pgn = LstNode_Datum(Lst_Last(pgn->cohorts));
 Lst_Append(pgn->children, cgn);
-if (specType == Not)
+if (args->specType == Not)
 	Lst_Append(cgn->parents, pgn);
 pgn->unmade += 1;
 if (DEBUG(PARSE)) {
@@ -895,7 +893,7 @@ ParseDoOp(void *gnp, void *opp)
  *-
  */
 static void
-ParseDoSrc(int tOp, const char *src)
+ParseDoSrc(int tOp, const char *src, ParseSpecial specType)
 {
 GNode	*gn = NULL;
 static int wait_number = 0;
@@ -925,8 +923,10 @@ ParseDoSrc(int tOp, const char *src)
 		if (doing_depend)
 		ParseMark(gn);
 		gn->type = OP_WAIT | OP_PHONY | OP_DEPENDS | OP_NOTMAIN;
-		if (targets != NULL)
-		Lst_ForEach(targets, ParseLinkSrc, gn);
+		if (targets != NULL) {
+		struct ParseLinkSrcArgs args = { gn, specType };
+		Lst_ForEach(targets, ParseLinkSrc, );
+		}
 		return;
 	}
 	}
@@ -994,8 +994,10 @@ ParseDoSrc(int tOp, const char *src)
 	if (tOp) {
 	gn->type |= tOp;
 	} else {
-	if (targets != NULL)
-		Lst_ForEach(targets, ParseLinkSrc, gn);
+	if (targets != NULL) {
+	struct ParseLinkSrcArgs args = { gn, specType };
+		Lst_ForEach(targets, ParseLinkSrc, );
+	}
 	}
 	break;
 }
@@ -1175,11 +1177,17 @@ ParseDoDependency(char *line)
  * to the targets list */
 char	   *lstart = line;
 
+/*
+ * specType contains the SPECial TYPE of the current target. It is Not
+ * if the target is unspecial. If it *is* special, however, the children
+ * are linked as children of the parent but not vice versa.
+ */
+ParseSpecial specType = Not;
+
 if (DEBUG(PARSE))
 	fprintf(debug_file, "ParseDoDependency(%s)\n", line);
 tOp = 0;
 
-specType = Not;
 paths = NULL;
 
 curTargs = Lst_Init();
@@ -1661,7 +1669,7 @@ ParseDoDependency(char *line)
 
 		while (!Lst_IsEmpty(sources)) {
 		GNode *gn = Lst_Dequeue(sources);
-		ParseDoSrc(tOp, gn->name);
+		ParseDoSrc(tOp, gn->name, specType);
 		}
 		Lst_Free(sources);
 		cp = line;
@@ -1671,7 +1679,7 @@ ParseDoDependency(char *line)
 		cp += 1;
 		}
 
-		ParseDoSrc(tOp, line);
+		ParseDoSrc(tOp, line, specType);
 	}
 	while (*cp && ch_isspace(*cp)) {
 		cp++;



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 16:40:06 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): extract ParseDependencyTargetWord from ParseDoDependency


To generate a diff of this commit:
cvs rdiff -u -r1.313 -r1.314 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.313 src/usr.bin/make/parse.c:1.314
--- src/usr.bin/make/parse.c:1.313	Mon Sep 14 16:33:07 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 16:40:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.313 2020/09/14 16:33:07 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.314 2020/09/14 16:40:06 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.313 2020/09/14 16:33:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.314 2020/09/14 16:40:06 rillig Exp $");
 
 /* types and constants */
 
@@ -1101,6 +1101,40 @@ ParseErrorNoDependency(const char *lstar
 	Parse_Error(PARSE_FATAL, "Need an operator");
 }
 
+static void
+ParseDependencyTargetWord(/*const*/ char **pp, const char *lstart)
+{
+/*const*/ char *cp = *pp;
+
+while (*cp != '\0') {
+	if ((ch_isspace(*cp) || *cp == '!' || *cp == ':' || *cp == '(') &&
+	!ParseIsEscaped(lstart, cp))
+	break;
+
+	if (*cp == '$') {
+	/*
+	 * Must be a dynamic source (would have been expanded
+	 * otherwise), so call the Var module to parse the puppy
+	 * so we can safely advance beyond it...There should be
+	 * no errors in this, as they would have been discovered
+	 * in the initial Var_Subst and we wouldn't be here.
+	 */
+	const char *nested_p = cp;
+	const char *nested_val;
+	void*freeIt;
+
+	(void)Var_Parse(_p, VAR_CMD, VARE_UNDEFERR|VARE_WANTRES,
+			_val, );
+	/* TODO: handle errors */
+	free(freeIt);
+	cp += nested_p - cp;
+	} else
+	cp++;
+}
+
+*pp = cp;
+}
+
 /* Parse a dependency line consisting of targets, followed by a dependency
  * operator, optionally followed by sources.
  *
@@ -1161,31 +1195,8 @@ ParseDoDependency(char *line)
 	 */
 
 	/* Find the end of the next word. */
-	for (cp = line; *cp != '\0';) {
-	if ((ch_isspace(*cp) || *cp == '!' || *cp == ':' || *cp == '(') &&
-		!ParseIsEscaped(lstart, cp))
-		break;
-
-	if (*cp == '$') {
-		/*
-		 * Must be a dynamic source (would have been expanded
-		 * otherwise), so call the Var module to parse the puppy
-		 * so we can safely advance beyond it...There should be
-		 * no errors in this, as they would have been discovered
-		 * in the initial Var_Subst and we wouldn't be here.
-		 */
-		const char *nested_p = cp;
-		const char *nested_val;
-		void*freeIt;
-
-		(void)Var_Parse(_p, VAR_CMD, VARE_UNDEFERR|VARE_WANTRES,
-_val, );
-		/* TODO: handle errors */
-		free(freeIt);
-		cp += nested_p - cp;
-	} else
-		cp++;
-	}
+	cp = line;
+	ParseDependencyTargetWord(, lstart);
 
 	/*
 	 * If the word is followed by a left parenthesis, it's the



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 16:33:07 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): split "general GNode *" in ParseDoDepends


To generate a diff of this commit:
cvs rdiff -u -r1.312 -r1.313 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.312 src/usr.bin/make/parse.c:1.313
--- src/usr.bin/make/parse.c:1.312	Mon Sep 14 16:27:07 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 16:33:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.312 2020/09/14 16:27:07 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.313 2020/09/14 16:33:07 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.312 2020/09/14 16:27:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.313 2020/09/14 16:33:07 rillig Exp $");
 
 /* types and constants */
 
@@ -1130,7 +1130,6 @@ static void
 ParseDoDependency(char *line)
 {
 char  	   *cp;		/* our current position */
-GNode 	   *gn = NULL;	/* a general purpose temporary node */
 int op;		/* the operator on the line */
 charsavec;	/* a place to save a character */
 Lst	paths;   	/* List of search paths to alter when parsing
@@ -1290,19 +1289,21 @@ ParseDoDependency(char *line)
 		case End:
 		case Stale:
 		case dotError:
-		case Interrupt:
-		gn = Targ_FindNode(line, TARG_CREATE);
+		case Interrupt: {
+		GNode *gn = Targ_FindNode(line, TARG_CREATE);
 		if (doing_depend)
 			ParseMark(gn);
 		gn->type |= OP_NOTMAIN|OP_SPECIAL;
 		Lst_Append(targets, gn);
 		break;
-		case Default:
-		gn = Targ_NewGN(".DEFAULT");
-		gn->type |= (OP_NOTMAIN|OP_TRANSFORM);
+		}
+		case Default: {
+		GNode *gn = Targ_NewGN(".DEFAULT");
+		gn->type |= OP_NOTMAIN|OP_TRANSFORM;
 		Lst_Append(targets, gn);
 		DEFAULT = gn;
 		break;
+		}
 		case DeleteOnError:
 		deleteOnError = TRUE;
 		break;
@@ -1371,12 +1372,9 @@ ParseDoDependency(char *line)
 
 	while(!Lst_IsEmpty(curTargs)) {
 		char *targName = Lst_Dequeue(curTargs);
-
-		if (!Suff_IsTransform (targName)) {
-		gn = Targ_FindNode(targName, TARG_CREATE);
-		} else {
-		gn = Suff_AddTransform(targName);
-		}
+		GNode *gn = Suff_IsTransform(targName)
+			? Suff_AddTransform(targName)
+			: Targ_FindNode(targName, TARG_CREATE);
 		if (doing_depend)
 		ParseMark(gn);
 
@@ -1651,7 +1649,7 @@ ParseDoDependency(char *line)
 		}
 
 		while (!Lst_IsEmpty(sources)) {
-		gn = Lst_Dequeue(sources);
+		GNode *gn = Lst_Dequeue(sources);
 		ParseDoSrc(tOp, gn->name);
 		}
 		Lst_Free(sources);



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 16:27:07 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): fix type of parseKeywords.op


To generate a diff of this commit:
cvs rdiff -u -r1.311 -r1.312 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.311 src/usr.bin/make/parse.c:1.312
--- src/usr.bin/make/parse.c:1.311	Mon Sep 14 16:23:32 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 16:27:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.311 2020/09/14 16:23:32 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.312 2020/09/14 16:27:07 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.311 2020/09/14 16:23:32 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.312 2020/09/14 16:27:07 rillig Exp $");
 
 /* types and constants */
 
@@ -273,7 +273,7 @@ Lst defIncPath;		/* default for sysIncPa
 static const struct {
 const char   *name;	/* Name of keyword */
 ParseSpecial  spec;		/* Type when used as a target */
-int		  op;		/* Operator when used as a source */
+GNodeType	  op;		/* Operator when used as a source */
 } parseKeywords[] = {
 { ".BEGIN", 	  Begin,	0 },
 { ".DEFAULT",	  Default,  	0 },



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 16:23:33 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): extract some code out of ParseDoDependency

With its almost 600 lines, that function is way too long.


To generate a diff of this commit:
cvs rdiff -u -r1.310 -r1.311 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.310 src/usr.bin/make/parse.c:1.311
--- src/usr.bin/make/parse.c:1.310	Mon Sep 14 16:16:52 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 16:23:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.310 2020/09/14 16:16:52 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.311 2020/09/14 16:23:32 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.310 2020/09/14 16:16:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.311 2020/09/14 16:23:32 rillig Exp $");
 
 /* types and constants */
 
@@ -1072,6 +1072,35 @@ ParseClearPath(void *path, void *dummy M
 return 0;
 }
 
+/*
+ * We got to the end of the line while we were still looking at targets.
+ *
+ * Ending a dependency line without an operator is a Bozo no-no.  As a
+ * heuristic, this is also often triggered by undetected conflicts from
+ * cvs/rcs merges.
+ */
+static void
+ParseErrorNoDependency(const char *lstart, const char *line)
+{
+if ((strncmp(line, "<<", 6) == 0) ||
+	(strncmp(line, "==", 6) == 0) ||
+	(strncmp(line, ">>", 6) == 0))
+	Parse_Error(PARSE_FATAL,
+		"Makefile appears to contain unresolved cvs/rcs/??? merge conflicts");
+else if (lstart[0] == '.') {
+	const char *dirstart = lstart + 1;
+	const char *dirend;
+	while (ch_isspace(*dirstart))
+	dirstart++;
+	dirend = dirstart;
+	while (ch_isalnum(*dirend) || *dirend == '-')
+	dirend++;
+	Parse_Error(PARSE_FATAL, "Unknown directive \"%.*s\"",
+		(int)(dirend - dirstart), dirstart);
+} else
+	Parse_Error(PARSE_FATAL, "Need an operator");
+}
+
 /* Parse a dependency line consisting of targets, followed by a dependency
  * operator, optionally followed by sources.
  *
@@ -1186,31 +1215,7 @@ ParseDoDependency(char *line)
 	}
 
 	if (!*cp) {
-	/*
-	 * We got to the end of the line while we were still
-	 * looking at targets.
-	 *
-	 * Ending a dependency line without an operator is a Bozo
-	 * no-no.  As a heuristic, this is also often triggered by
-	 * undetected conflicts from cvs/rcs merges.
-	 */
-	if ((strncmp(line, "<<", 6) == 0) ||
-		(strncmp(line, "==", 6) == 0) ||
-		(strncmp(line, ">>", 6) == 0))
-		Parse_Error(PARSE_FATAL,
-		"Makefile appears to contain unresolved cvs/rcs/??? merge conflicts");
-	else if (lstart[0] == '.') {
-		const char *dirstart = lstart + 1;
-		const char *dirend;
-		while (ch_isspace(*dirstart))
-		dirstart++;
-		dirend = dirstart;
-		while (ch_isalnum(*dirend) || *dirend == '-')
-		dirend++;
-		Parse_Error(PARSE_FATAL, "Unknown directive \"%.*s\"",
-			(int)(dirend - dirstart), dirstart);
-	} else
-		Parse_Error(PARSE_FATAL, "Need an operator");
+	ParseErrorNoDependency(lstart, line);
 	goto out;
 	}
 



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 16:16:52 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): inline LPAREN in parse.c

It's shorter and more readable, and the other characters don't have
named constants as well.


To generate a diff of this commit:
cvs rdiff -u -r1.309 -r1.310 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.309 src/usr.bin/make/parse.c:1.310
--- src/usr.bin/make/parse.c:1.309	Mon Sep 14 16:12:41 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 16:16:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.309 2020/09/14 16:12:41 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.310 2020/09/14 16:16:52 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.309 2020/09/14 16:12:41 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.310 2020/09/14 16:16:52 rillig Exp $");
 
 /* types and constants */
 
@@ -204,13 +204,6 @@ typedef enum {
 Attribute	/* Generic attribute */
 } ParseSpecial;
 
-/*
- * Other tokens
- */
-#define LPAREN	'('
-#define RPAREN	')'
-
-
 /* result data */
 
 /*
@@ -1141,12 +1134,11 @@ ParseDoDependency(char *line)
 
 	/* Find the end of the next word. */
 	for (cp = line; *cp != '\0';) {
-	char ch = *cp;
-	if ((ch_isspace(ch) || ch == '!' || ch == ':' || ch == LPAREN) &&
+	if ((ch_isspace(*cp) || *cp == '!' || *cp == ':' || *cp == '(') &&
 		!ParseIsEscaped(lstart, cp))
 		break;
 
-	if (ch == '$') {
+	if (*cp == '$') {
 		/*
 		 * Must be a dynamic source (would have been expanded
 		 * otherwise), so call the Var module to parse the puppy
@@ -1171,7 +1163,7 @@ ParseDoDependency(char *line)
 	 * If the word is followed by a left parenthesis, it's the
 	 * name of an object file inside an archive (ar file).
 	 */
-	if (!ParseIsEscaped(lstart, cp) && *cp == LPAREN) {
+	if (!ParseIsEscaped(lstart, cp) && *cp == '(') {
 	/*
 	 * Archives must be handled specially to make sure the OP_ARCHV
 	 * flag is set in their 'type' field, for one thing, and because
@@ -1634,7 +1626,7 @@ ParseDoDependency(char *line)
 	 * and handle them accordingly.
 	 */
 	for (; *cp && !ch_isspace(*cp); cp++) {
-		if (*cp == LPAREN && cp > line && cp[-1] != '$') {
+		if (*cp == '(' && cp > line && cp[-1] != '$') {
 		/*
 		 * Only stop for a left parenthesis if it isn't at the
 		 * start of a word (that'll be for variable changes
@@ -1645,7 +1637,7 @@ ParseDoDependency(char *line)
 		}
 	}
 
-	if (*cp == LPAREN) {
+	if (*cp == '(') {
 		sources = Lst_Init();
 		if (!Arch_ParseArchive(, sources, VAR_CMD)) {
 		Parse_Error(PARSE_FATAL,



CVS commit: src/sys/arch/hppa/conf

2020-09-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 14 16:13:19 UTC 2020

Modified Files:
src/sys/arch/hppa/conf: Makefile.hppa

Log Message:
(Re)Enable -Werror=array-bounds.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hppa/conf/Makefile.hppa

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hppa/conf/Makefile.hppa
diff -u src/sys/arch/hppa/conf/Makefile.hppa:1.7 src/sys/arch/hppa/conf/Makefile.hppa:1.8
--- src/sys/arch/hppa/conf/Makefile.hppa:1.7	Mon Sep  7 02:22:27 2020
+++ src/sys/arch/hppa/conf/Makefile.hppa	Mon Sep 14 16:13:18 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.hppa,v 1.7 2020/09/07 02:22:27 mrg Exp $
+# $NetBSD: Makefile.hppa,v 1.8 2020/09/14 16:13:18 skrll Exp $
 
 # Makefile for NetBSD
 #
@@ -32,7 +32,6 @@ GENASSYM_CONF=	${HPPA}/hppa/genassym.cf
 ##
 CPPFLAGS+=	-Dhppa
 CFLAGS+=	-mpa-risc-1-1 -msoft-float -mdisable-fpregs
-CWARNFLAGS.gcc+=${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -Wno-error=array-bounds :}
 
 .include "${HPPA}/spmath/Makefile.inc"
 



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 16:12:41 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): flip conditions in ParseDoDependency

In the usual case where the character is a letter or another ordinary
character, each of the terminal conditions has to be evaluated,
therefore from the compiler's view the order doesn't matter.  For
humans, "a unless b" is easier to grasp and more common than "not b but
a", therefore switch to the common pattern.


To generate a diff of this commit:
cvs rdiff -u -r1.308 -r1.309 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.308 src/usr.bin/make/parse.c:1.309
--- src/usr.bin/make/parse.c:1.308	Mon Sep 14 16:05:09 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 16:12:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.308 2020/09/14 16:05:09 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.309 2020/09/14 16:12:41 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.308 2020/09/14 16:05:09 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.309 2020/09/14 16:12:41 rillig Exp $");
 
 /* types and constants */
 
@@ -1141,11 +1141,12 @@ ParseDoDependency(char *line)
 
 	/* Find the end of the next word. */
 	for (cp = line; *cp != '\0';) {
-	if (!ParseIsEscaped(lstart, cp) &&
-		(ch_isspace(*cp) || *cp == '!' || *cp == ':' || *cp == LPAREN))
+	char ch = *cp;
+	if ((ch_isspace(ch) || ch == '!' || ch == ':' || ch == LPAREN) &&
+		!ParseIsEscaped(lstart, cp))
 		break;
 
-	if (*cp == '$') {
+	if (ch == '$') {
 		/*
 		 * Must be a dynamic source (would have been expanded
 		 * otherwise), so call the Var module to parse the puppy



CVS commit: src/sys/arch/hppa/hppa

2020-09-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 14 16:11:32 UTC 2020

Modified Files:
src/sys/arch/hppa/hppa: machdep.c

Log Message:
-Wno-error=array-bounds (missed from previous commit)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hppa/hppa/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hppa/hppa/machdep.c
diff -u src/sys/arch/hppa/hppa/machdep.c:1.15 src/sys/arch/hppa/hppa/machdep.c:1.16
--- src/sys/arch/hppa/hppa/machdep.c:1.15	Tue Sep  8 06:13:53 2020
+++ src/sys/arch/hppa/hppa/machdep.c	Mon Sep 14 16:11:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.15 2020/09/08 06:13:53 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.16 2020/09/14 16:11:32 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.15 2020/09/08 06:13:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.16 2020/09/14 16:11:32 skrll Exp $");
 
 #include "opt_cputype.h"
 #include "opt_ddb.h"
@@ -489,19 +489,19 @@ hppa_init(paddr_t start, void *bi)
 	DPRINTF(("SPID bits: 0x%x, error = %d\n", pdc_spidbits.spidbits, error));
 
 	/* Calculate the OS_HPMC handler checksums. */
-	p = _hpmc;
+	p = os_hpmc;
 	if (pdcproc_instr(p))
 		*p = 0x08000240;
 	p[7] = ((char *) _hpmc_cont_end) - ((char *) _hpmc_cont);
 	p[6] = (u_int) _hpmc_cont;
 	p[5] = -(p[0] + p[1] + p[2] + p[3] + p[4] + p[6] + p[7]);
 	p = _hpmc_cont;
-	q = (_hpmc_cont_end - 1);
+	q = os_hpmc_checksum;
 	for (*q = 0; p < q; *q -= *(p++));
 
 	/* Calculate the OS_TOC handler checksum. */
 	p = (u_int *) _toc;
-	q = (_toc_end - 1);
+	q = os_toc_checksum;
 	for (*q = 0; p < q; *q -= *(p++));
 
 	/* Install the OS_TOC handler. */



CVS commit: src/sys/arch/hppa/hppa

2020-09-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 14 16:11:00 UTC 2020

Modified Files:
src/sys/arch/hppa/hppa: machdep.h trap.S

Log Message:
-Wno-error=array-bounds


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hppa/hppa/machdep.h
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/hppa/hppa/trap.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hppa/hppa/machdep.h
diff -u src/sys/arch/hppa/hppa/machdep.h:1.18 src/sys/arch/hppa/hppa/machdep.h:1.19
--- src/sys/arch/hppa/hppa/machdep.h:1.18	Mon Apr 15 20:45:08 2019
+++ src/sys/arch/hppa/hppa/machdep.h	Mon Sep 14 16:11:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.h,v 1.18 2019/04/15 20:45:08 skrll Exp $	*/
+/*	$NetBSD: machdep.h,v 1.19 2020/09/14 16:11:00 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -95,11 +95,15 @@ void hppa_ktext_stw(vaddr_t, int);
 void hppa_ktext_stb(vaddr_t, char);
 
 /* Machine check handling. */
-extern u_int os_hpmc;
+extern u_int os_hpmc[8];
 extern u_int os_hpmc_cont;
 extern u_int os_hpmc_cont_end;
+extern u_int os_hpmc_checksum[1];
+
 int os_toc(void);
 extern u_int os_toc_end;
+extern u_int os_toc_checksum[1];
+
 void hppa_machine_check(int);
 
 /* BTLB handling. */

Index: src/sys/arch/hppa/hppa/trap.S
diff -u src/sys/arch/hppa/hppa/trap.S:1.72 src/sys/arch/hppa/hppa/trap.S:1.73
--- src/sys/arch/hppa/hppa/trap.S:1.72	Tue Apr 16 07:08:46 2019
+++ src/sys/arch/hppa/hppa/trap.S	Mon Sep 14 16:11:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.S,v 1.72 2019/04/16 07:08:46 skrll Exp $	*/
+/*	$NetBSD: trap.S,v 1.73 2020/09/14 16:11:00 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -841,8 +841,11 @@ L$check_do_rfi:
 	nop
 	nop
 	nop
+
+ALTENTRY(os_hpmc_checksum)
 	nop
 ALTENTRY(os_hpmc_cont_end)
+ALTENTRY(os_toc_checksum)
 	nop
 ALTENTRY(os_toc_end)
 EXIT(TLABEL(hpmc))



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 16:05:09 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): split complicated condition in ParseDoDependency


To generate a diff of this commit:
cvs rdiff -u -r1.307 -r1.308 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.307 src/usr.bin/make/parse.c:1.308
--- src/usr.bin/make/parse.c:1.307	Mon Sep 14 15:11:13 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 16:05:09 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.307 2020/09/14 15:11:13 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.308 2020/09/14 16:05:09 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.307 2020/09/14 15:11:13 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.308 2020/09/14 16:05:09 rillig Exp $");
 
 /* types and constants */
 
@@ -1140,9 +1140,11 @@ ParseDoDependency(char *line)
 	 */
 
 	/* Find the end of the next word. */
-	for (cp = line; *cp && (ParseIsEscaped(lstart, cp) ||
-		 !(ch_isspace(*cp) ||
-			 *cp == '!' || *cp == ':' || *cp == LPAREN));) {
+	for (cp = line; *cp != '\0';) {
+	if (!ParseIsEscaped(lstart, cp) &&
+		(ch_isspace(*cp) || *cp == '!' || *cp == ':' || *cp == LPAREN))
+		break;
+
 	if (*cp == '$') {
 		/*
 		 * Must be a dynamic source (would have been expanded



CVS commit: src/tests/usr.bin

2020-09-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 14 15:17:53 UTC 2020

Modified Files:
src/tests/usr.bin/c++: t_tsan_data_race.sh
t_tsan_heap_use_after_free.sh t_tsan_lock_order_inversion.sh
t_tsan_locked_mutex_destroy.sh t_tsan_signal_errno.sh
t_tsan_thread_leak.sh t_tsan_vptr_race.sh
src/tests/usr.bin/cc: t_tsan_data_race.sh t_tsan_heap_use_after_free.sh
t_tsan_lock_order_inversion.sh t_tsan_locked_mutex_destroy.sh
t_tsan_signal_errno.sh t_tsan_thread_leak.sh

Log Message:
Enable TSan tests for GCC and >32bit address space environments


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/c++/t_tsan_data_race.sh \
src/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh \
src/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh \
src/tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh \
src/tests/usr.bin/c++/t_tsan_signal_errno.sh \
src/tests/usr.bin/c++/t_tsan_thread_leak.sh \
src/tests/usr.bin/c++/t_tsan_vptr_race.sh
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/cc/t_tsan_data_race.sh \
src/tests/usr.bin/cc/t_tsan_heap_use_after_free.sh \
src/tests/usr.bin/cc/t_tsan_lock_order_inversion.sh \
src/tests/usr.bin/cc/t_tsan_locked_mutex_destroy.sh \
src/tests/usr.bin/cc/t_tsan_signal_errno.sh \
src/tests/usr.bin/cc/t_tsan_thread_leak.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/c++/t_tsan_data_race.sh
diff -u src/tests/usr.bin/c++/t_tsan_data_race.sh:1.2 src/tests/usr.bin/c++/t_tsan_data_race.sh:1.3
--- src/tests/usr.bin/c++/t_tsan_data_race.sh:1.2	Fri Aug 23 06:39:54 2019
+++ src/tests/usr.bin/c++/t_tsan_data_race.sh	Mon Sep 14 15:17:53 2020
@@ -29,12 +29,16 @@
 test_target()
 {
 	SUPPORT='n'
-	if uname -m | grep -q "amd64" && command -v c++ >/dev/null 2>&1 && \
-		   ! echo __clang__ | c++ -E - | grep -q __clang__; then
-		# only clang with major version newer than 7 is supported
-		CLANG_MAJOR=`echo __clang_major__ | c++ -E - | grep -o '^[[:digit:]]'`
-		if [ "$CLANG_MAJOR" -ge "7" ]; then
-			SUPPORT='y'
+	# Detect address space larger than 32 bits
+	maxaddress=`sysctl vm.maxaddress|awk '{print $3}'`
+	if [ $maxaddress -gt 4294967295 ]; then
+		if command -v cc >/dev/null 2>&1; then
+			if ! echo __clang__ | cc -E - | grep -q __clang__; then
+SUPPORT='y'
+			elif ! cc -v 2>&1 | awk '/gcc version/{print $3}' | \
+awk -F '.' '($0+0) > 9 {exit 1}'; then
+SUPPORT='y'
+			fi
 		fi
 	fi
 }
Index: src/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh
diff -u src/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh:1.2 src/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh:1.3
--- src/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh:1.2	Fri Aug 23 06:39:54 2019
+++ src/tests/usr.bin/c++/t_tsan_heap_use_after_free.sh	Mon Sep 14 15:17:53 2020
@@ -29,12 +29,16 @@
 test_target()
 {
 	SUPPORT='n'
-	if uname -m | grep -q "amd64" && command -v c++ >/dev/null 2>&1 && \
-		   ! echo __clang__ | c++ -E - | grep -q __clang__; then
-		# only clang with major version newer than 7 is supported
-		CLANG_MAJOR=`echo __clang_major__ | c++ -E - | grep -o '^[[:digit:]]'`
-		if [ "$CLANG_MAJOR" -ge "7" ]; then
-			SUPPORT='y'
+	# Detect address space larger than 32 bits
+	maxaddress=`sysctl vm.maxaddress|awk '{print $3}'`
+	if [ $maxaddress -gt 4294967295 ]; then
+		if command -v cc >/dev/null 2>&1; then
+			if ! echo __clang__ | cc -E - | grep -q __clang__; then
+SUPPORT='y'
+			elif ! cc -v 2>&1 | awk '/gcc version/{print $3}' | \
+awk -F '.' '($0+0) > 9 {exit 1}'; then
+SUPPORT='y'
+			fi
 		fi
 	fi
 }
Index: src/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh
diff -u src/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh:1.2 src/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh:1.3
--- src/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh:1.2	Fri Aug 23 06:39:54 2019
+++ src/tests/usr.bin/c++/t_tsan_lock_order_inversion.sh	Mon Sep 14 15:17:53 2020
@@ -29,12 +29,16 @@
 test_target()
 {
 	SUPPORT='n'
-	if uname -m | grep -q "amd64" && command -v c++ >/dev/null 2>&1 && \
-		   ! echo __clang__ | c++ -E - | grep -q __clang__; then
-		# only clang with major version newer than 7 is supported
-		CLANG_MAJOR=`echo __clang_major__ | c++ -E - | grep -o '^[[:digit:]]'`
-		if [ "$CLANG_MAJOR" -ge "7" ]; then
-			SUPPORT='y'
+	# Detect address space larger than 32 bits
+	maxaddress=`sysctl vm.maxaddress|awk '{print $3}'`
+	if [ $maxaddress -gt 4294967295 ]; then
+		if command -v cc >/dev/null 2>&1; then
+			if ! echo __clang__ | cc -E - | grep -q __clang__; then
+SUPPORT='y'
+			elif ! cc -v 2>&1 | awk '/gcc version/{print $3}' | \
+awk -F '.' '($0+0) > 9 {exit 1}'; then
+SUPPORT='y'
+			fi
 		fi
 	fi
 }
Index: src/tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh
diff -u src/tests/usr.bin/c++/t_tsan_locked_mutex_destroy.sh:1.2 

CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 15:11:13 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): split confusing condition in ParseDoDependency

A while loop is easier to understand than a do-while loop.

An if statement of the form if-something-then-do-something is easier to
understand than if-complicated-condition-then-continue-doing-something.


To generate a diff of this commit:
cvs rdiff -u -r1.306 -r1.307 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.306 src/usr.bin/make/parse.c:1.307
--- src/usr.bin/make/parse.c:1.306	Mon Sep 14 14:58:27 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 15:11:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.306 2020/09/14 14:58:27 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.307 2020/09/14 15:11:13 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.306 2020/09/14 14:58:27 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.307 2020/09/14 15:11:13 rillig Exp $");
 
 /* types and constants */
 
@@ -1133,7 +1133,7 @@ ParseDoDependency(char *line)
  * First, grind through the targets.
  */
 
-do {
+while (TRUE) {
 	/*
 	 * Here LINE points to the beginning of the next word, and
 	 * LSTART points to the actual beginning of the line.
@@ -1413,8 +1413,11 @@ ParseDoDependency(char *line)
 	}
 	}
 	line = cp;
-} while (*line && (ParseIsEscaped(lstart, line) ||
-	(*line != '!' && *line != ':')));
+	if (*line == '\0')
+	break;
+	if ((*line == '!' || *line == ':') && !ParseIsEscaped(lstart, line))
+	break;
+}
 
 /*
  * Don't need the list of target names anymore...



CVS commit: src/sys

2020-09-14 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Sep 14 15:09:57 UTC 2020

Modified Files:
src/sys/net: if_llatbl.h nd.c nd.h
src/sys/netinet: if_arp.c
src/sys/netinet6: nd6.c

Log Message:
nd: Name l3addr union of llentry and use in-place of nd_addr.

Probably makes more sense and makes nd.h less messy.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/net/if_llatbl.h
cvs rdiff -u -r1.1 -r1.2 src/sys/net/nd.c src/sys/net/nd.h
cvs rdiff -u -r1.295 -r1.296 src/sys/netinet/if_arp.c
cvs rdiff -u -r1.272 -r1.273 src/sys/netinet6/nd6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if_llatbl.h
diff -u src/sys/net/if_llatbl.h:1.17 src/sys/net/if_llatbl.h:1.18
--- src/sys/net/if_llatbl.h:1.17	Thu Jul 18 06:47:10 2019
+++ src/sys/net/if_llatbl.h	Mon Sep 14 15:09:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_llatbl.h,v 1.17 2019/07/18 06:47:10 ozaki-r Exp $	*/
+/*	$NetBSD: if_llatbl.h,v 1.18 2020/09/14 15:09:57 roy Exp $	*/
 /*
  * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved.
  * Copyright (c) 2004-2008 Qing Li. All rights reserved.
@@ -63,7 +63,7 @@ extern krwlock_t lltable_rwlock;
  */
 struct llentry {
 	LIST_ENTRY(llentry)	 lle_next;
-	union {
+	union l3addr {
 		struct in_addr	addr4;
 		struct in6_addr	addr6;
 	} r_l3addr;
@@ -86,7 +86,7 @@ struct llentry {
 	uint16_t		 la_asked;
 	uint16_t		 la_preempt;
 	uint16_t		 ln_byhint;
-	int16_t			 ln_state;	/* IPv6 has ND6_LLINFO_NOSTATE == -2 */
+	int16_t			 ln_state;	/* ND_LLINFO_NOSTATE == -2 */
 	uint16_t		 ln_router;
 	time_t			 ln_ntick;
 	int			 lle_refcnt;

Index: src/sys/net/nd.c
diff -u src/sys/net/nd.c:1.1 src/sys/net/nd.c:1.2
--- src/sys/net/nd.c:1.1	Fri Sep 11 14:59:22 2020
+++ src/sys/net/nd.c	Mon Sep 14 15:09:57 2020
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd.c,v 1.1 2020/09/11 14:59:22 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd.c,v 1.2 2020/09/14 15:09:57 roy Exp $");
 
 #include 
 #include 
@@ -57,7 +57,7 @@ nd_timer(void *arg)
 	struct psref psref;
 	struct mbuf *m = NULL;
 	bool send_ns = false, missed = false;
-	union nd_addr taddr, *daddrp = NULL;
+	union l3addr taddr, *daddrp = NULL;
 
 	SOFTNET_KERNEL_LOCK_UNLESS_NET_MPSAFE();
 	LLE_WLOCK(ln);
@@ -158,7 +158,7 @@ nd_timer(void *arg)
 
 	if (send_ns) {
 		uint8_t lladdr[255], *lladdrp;
-		union nd_addr src, *psrc;
+		union l3addr src, *psrc;
 
 		nd_set_timer(ln, ND_TIMER_RETRANS);
 		if (ln->ln_state > ND_LLINFO_INCOMPLETE &&
@@ -353,7 +353,7 @@ nd_resolve(struct llentry *ln, const str
 	 */
 	if (!ND_IS_LLINFO_PERMANENT(ln) && ln->ln_asked == 0) {
 		struct psref psref;
-		union nd_addr dst, src, *psrc;
+		union l3addr dst, src, *psrc;
 
 		ln->ln_asked++;
 		nd_set_timer(ln, ND_TIMER_RETRANS);
Index: src/sys/net/nd.h
diff -u src/sys/net/nd.h:1.1 src/sys/net/nd.h:1.2
--- src/sys/net/nd.h:1.1	Fri Sep 11 14:59:22 2020
+++ src/sys/net/nd.h	Mon Sep 14 15:09:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd.h,v 1.1 2020/09/11 14:59:22 roy Exp $	*/
+/*	$NetBSD: nd.h,v 1.2 2020/09/14 15:09:57 roy Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -65,12 +65,6 @@
 		((MIN_RANDOM_FACTOR * (x >> 10)) + (cprng_fast32() & \
 		((MAX_RANDOM_FACTOR - MIN_RANDOM_FACTOR) * (x >> 10
 
-#include 
-union nd_addr {
-	struct in_addr	nd_addr4;
-	struct in6_addr	nd_addr6;
-};
-
 struct nd_domain {
 	int nd_family;
 	int nd_delay;		/* delay first probe time in seconds */
@@ -81,10 +75,10 @@ struct nd_domain {
 	bool (*nd_nud_enabled)(struct ifnet *);
 	unsigned int (*nd_reachable)(struct ifnet *);	/* msec */
 	unsigned int (*nd_retrans)(struct ifnet *);	/* msec */
-	union nd_addr *(*nd_holdsrc)(struct llentry *, union nd_addr *);
-	void (*nd_output)(struct ifnet *, const union nd_addr *,
-	const union nd_addr *, const uint8_t *, const union nd_addr *);
-	void (*nd_missed)(struct ifnet *, const union nd_addr *, struct mbuf *);
+	union l3addr *(*nd_holdsrc)(struct llentry *, union l3addr *);
+	void (*nd_output)(struct ifnet *, const union l3addr *,
+	const union l3addr *, const uint8_t *, const union l3addr *);
+	void (*nd_missed)(struct ifnet *, const union l3addr *, struct mbuf *);
 	void (*nd_free)(struct llentry *, int);
 };
 

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.295 src/sys/netinet/if_arp.c:1.296
--- src/sys/netinet/if_arp.c:1.295	Fri Sep 11 15:16:00 2020
+++ src/sys/netinet/if_arp.c	Mon Sep 14 15:09:57 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.295 2020/09/11 15:16:00 roy Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.296 2020/09/14 15:09:57 roy Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.295 2020/09/11 15:16:00 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.296 2020/09/14 15:09:57 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -141,10 

CVS commit: src/external/gpl3/gcc/lib

2020-09-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 14 15:01:58 UTC 2020

Modified Files:
src/external/gpl3/gcc/lib/libasan: Makefile
src/external/gpl3/gcc/lib/liblsan: Makefile
src/external/gpl3/gcc/lib/libtsan: Makefile
src/external/gpl3/gcc/lib/libubsan: Makefile

Log Message:
Consistently, always link sanitizer runtime with libm and libpthread

This reflects the behavior from LLVM and avoids issues with dlsym(3) APIs.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/external/gpl3/gcc/lib/libasan/Makefile
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc/lib/liblsan/Makefile
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gcc/lib/libtsan/Makefile
cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gcc/lib/libubsan/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/lib/libasan/Makefile
diff -u src/external/gpl3/gcc/lib/libasan/Makefile:1.32 src/external/gpl3/gcc/lib/libasan/Makefile:1.33
--- src/external/gpl3/gcc/lib/libasan/Makefile:1.32	Mon Sep  7 09:09:40 2020
+++ src/external/gpl3/gcc/lib/libasan/Makefile	Mon Sep 14 15:01:57 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.32 2020/09/07 09:09:40 mrg Exp $
+# $NetBSD: Makefile,v 1.33 2020/09/14 15:01:57 kamil Exp $
 
 UNSUPPORTED_COMPILER.clang=	# defined
 NOSANITIZER=	# defined
@@ -46,6 +46,7 @@ LIB=	asan
 SRCS+=	${ASAN_SRCS} lsan_common.cc lsan_common_linux.cc
 LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt
 LIBDPLIBS+= m  ${NETBSDSRCDIR}/lib/libm
+LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
 CPPFLAGS+=-DCAN_SANITIZE_UB=0
 
 .if ${MACHINE_ARCH} == "vax"

Index: src/external/gpl3/gcc/lib/liblsan/Makefile
diff -u src/external/gpl3/gcc/lib/liblsan/Makefile:1.7 src/external/gpl3/gcc/lib/liblsan/Makefile:1.8
--- src/external/gpl3/gcc/lib/liblsan/Makefile:1.7	Fri May 15 14:29:53 2020
+++ src/external/gpl3/gcc/lib/liblsan/Makefile	Mon Sep 14 15:01:57 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2020/05/15 14:29:53 joerg Exp $
+# $NetBSD: Makefile,v 1.8 2020/09/14 15:01:57 kamil Exp $
 
 .include 
 
@@ -23,7 +23,9 @@ COPTS.sanitizer_file.cc += -O1
 
 LIB=	lsan
 SRCS+=	${LSAN_SRCS}
+LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
 LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt
+LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
 
 CWARNFLAGS.clang+=	-Wno-error=unused-private-field
 

Index: src/external/gpl3/gcc/lib/libtsan/Makefile
diff -u src/external/gpl3/gcc/lib/libtsan/Makefile:1.14 src/external/gpl3/gcc/lib/libtsan/Makefile:1.15
--- src/external/gpl3/gcc/lib/libtsan/Makefile:1.14	Mon Sep 14 14:33:01 2020
+++ src/external/gpl3/gcc/lib/libtsan/Makefile	Mon Sep 14 15:01:58 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2020/09/14 14:33:01 kamil Exp $
+# $NetBSD: Makefile,v 1.15 2020/09/14 15:01:58 kamil Exp $
 
 UNSUPPORTED_COMPILER.clang= # defined
 NOSANITIZER=# defined
@@ -64,6 +64,7 @@ LIB=	tsan
 SRCS+=	${TSAN_SRCS}
 LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt
 LIBDPLIBS+= m  ${NETBSDSRCDIR}/lib/libm
+LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
 CPPFLAGS+=-DCAN_SANITIZE_UB=0
 COPTS.tsan_interceptors.cc += -Wno-unused-function
 

Index: src/external/gpl3/gcc/lib/libubsan/Makefile
diff -u src/external/gpl3/gcc/lib/libubsan/Makefile:1.17 src/external/gpl3/gcc/lib/libubsan/Makefile:1.18
--- src/external/gpl3/gcc/lib/libubsan/Makefile:1.17	Sat Sep  5 09:50:15 2020
+++ src/external/gpl3/gcc/lib/libubsan/Makefile	Mon Sep 14 15:01:58 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2020/09/05 09:50:15 mrg Exp $
+#	$NetBSD: Makefile,v 1.18 2020/09/14 15:01:58 kamil Exp $
 
 UNSUPPORTED_COMPILER.clang=	# defined
 LIBISCXX = yes
@@ -32,7 +32,9 @@ COPTS.sanitizer_file.cc += -O1
 
 LIB=	ubsan
 SRCS+=	${UBSAN_SRCS}
+LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
 LIBDPLIBS+= rt ${NETBSDSRCDIR}/lib/librt
+LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
 CPPFLAGS+=-DCAN_SANITIZE_UB=1
 
 .include 



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 14:58:27 UTC 2020

Modified Files:
src/usr.bin/make: parse.c

Log Message:
make(1): clean up documentation of ParseDoDependency

The documentation was too low-level in parts, essentially repeating the
code in prose.  Instead, add more examples and high-level context
information since that is something that the code cannot do.


To generate a diff of this commit:
cvs rdiff -u -r1.305 -r1.306 src/usr.bin/make/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.305 src/usr.bin/make/parse.c:1.306
--- src/usr.bin/make/parse.c:1.305	Sun Sep 13 21:12:08 2020
+++ src/usr.bin/make/parse.c	Mon Sep 14 14:58:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.305 2020/09/13 21:12:08 rillig Exp $	*/
+/*	$NetBSD: parse.c,v 1.306 2020/09/14 14:58:27 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*	"@(#)parse.c	8.3 (Berkeley) 3/19/94"	*/
-MAKE_RCSID("$NetBSD: parse.c,v 1.305 2020/09/13 21:12:08 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.306 2020/09/14 14:58:27 rillig Exp $");
 
 /* types and constants */
 
@@ -1079,42 +1079,30 @@ ParseClearPath(void *path, void *dummy M
 return 0;
 }
 
-/*-
- *-
- * ParseDoDependency  --
- *	Parse the dependency line in line.
- *
- * Input:
- *	line		the line to parse
- *
- * Results:
- *	None
+/* Parse a dependency line consisting of targets, followed by a dependency
+ * operator, optionally followed by sources.
  *
- * Side Effects:
- *	The nodes of the sources are linked as children to the nodes of the
- *	targets. Some nodes may be created.
+ * The nodes of the sources are linked as children to the nodes of the
+ * targets. Nodes are created as necessary.
  *
- *	We parse a dependency line by first extracting words from the line and
- * finding nodes in the list of all targets with that name. This is done
- * until a character is encountered which is an operator character. Currently
- * these are only ! and :. At this point the operator is parsed and the
- * pointer into the line advanced until the first source is encountered.
- * 	The parsed operator is applied to each node in the 'targets' list,
+ * The operator is applied to each node in the global 'targets' list,
  * which is where the nodes found for the targets are kept, by means of
  * the ParseDoOp function.
- *	The sources are read in much the same way as the targets were except
- * that now they are expanded using the wildcarding scheme of the C-Shell
+ *
+ * The sources are parsed in much the same way as the targets, except
+ * that they are expanded using the wildcarding scheme of the C-Shell,
  * and all instances of the resulting words in the list of all targets
  * are found. Each of the resulting nodes is then linked to each of the
  * targets as one of its children.
- *	Certain targets are handled specially. These are the ones detailed
- * by the specType variable.
- *	The storing of transformation rules is also taken care of here.
- * A target is recognized as a transformation rule by calling
+ *
+ * Certain targets and sources such as .PHONY or .PRECIOUS are handled
+ * specially. These are the ones detailed by the specType variable.
+ *
+ * The storing of transformation rules such as '.c.o' is also taken care of
+ * here. A target is recognized as a transformation rule by calling
  * Suff_IsTransform. If it is a transformation rule, its node is gotten
  * from the suffix module via Suff_AddTransform rather than the standard
  * Targ_FindNode in the target module.
- *-
  */
 static void
 ParseDoDependency(char *line)



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2020-09-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 14 14:56:43 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl_amd64.S

Log Message:
Undo local patch adding GNU-stack

This is unneeded on NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S:1.8 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S:1.9
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S:1.8	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S	Mon Sep 14 14:56:43 2020
@@ -397,7 +397,7 @@ ASM_SYMBOL_INTERCEPTOR(__sigsetjmp):
 ASM_SIZE(ASM_SYMBOL_INTERCEPTOR(__sigsetjmp))
 #endif  // !defined(__APPLE__) && !defined(__NetBSD__)
 
-#if defined(__FreeBSD__) || defined(__linux__) || defined(__NetBSD__)
+#if defined(__FreeBSD__) || defined(__linux__)
 /* We do not need executable stack.  */
 /* This note is not needed on NetBSD. */
 .section.note.GNU-stack,"",@progbits



CVS commit: src/external/gpl3/gcc/lib/libtsan

2020-09-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 14 14:33:01 UTC 2020

Modified Files:
src/external/gpl3/gcc/lib/libtsan: Makefile
Removed Files:
src/external/gpl3/gcc/lib/libtsan: tsan_rtl_unimpl.cc

Log Message:
Avoid using dummy tsan_rtl_unimpl.cc

Instead of providing broken support, error during build to catch the
problem quickly.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gcc/lib/libtsan/Makefile
cvs rdiff -u -r1.1 -r0 src/external/gpl3/gcc/lib/libtsan/tsan_rtl_unimpl.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/lib/libtsan/Makefile
diff -u src/external/gpl3/gcc/lib/libtsan/Makefile:1.13 src/external/gpl3/gcc/lib/libtsan/Makefile:1.14
--- src/external/gpl3/gcc/lib/libtsan/Makefile:1.13	Sun Sep 13 02:37:32 2020
+++ src/external/gpl3/gcc/lib/libtsan/Makefile	Mon Sep 14 14:33:01 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2020/09/13 02:37:32 kamil Exp $
+# $NetBSD: Makefile,v 1.14 2020/09/14 14:33:01 kamil Exp $
 
 UNSUPPORTED_COMPILER.clang= # defined
 NOSANITIZER=# defined
@@ -48,11 +48,16 @@ TSAN_SRCS= \
 	tsan_symbolize.cc \
 	tsan_sync.cc 
 
-# XXX ${MACHINE} won't match mips64 or ppc64
-.if exists(${SANITIZER}/tsan/tsan_rtl_${MACHINE}.S)
-TSAN_SRCS+= tsan_rtl_${MACHINE}.S
+.if ${MACHINE_ARCH} == "x86_64"
+TSAN_SRCS+= tsan_rtl_amd64.S
+.elif ${MACHINE_ARCH} == "aarch64"
+TSAN_SRCS+= tsan_rtl_aarch64.S
+.elif ${MACHINE_ARCH} == "mips64el"
+TSAN_SRCS+= tsan_rtl_mips64.S
+.elif ${MACHINE_ARCH} == "powerpc64"
+TSAN_SRCS+= tsan_rtl_ppc64.S
 .else
-TSAN_SRCS+= tsan_rtl_unimpl.cc
+.error Unsupported
 .endif
 
 LIB=	tsan



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

2020-09-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 14 11:56:01 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_interceptors.cc

Log Message:
Catch unsupported LONG_JMP_SP_ENV_SLOT

A variation of this patch is pending upstream: https://reviews.llvm.org/D87602


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.11 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.12
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.11	Sat Sep 12 22:23:57 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc	Mon Sep 14 11:56:01 2020
@@ -497,12 +497,16 @@ static void SetJmp(ThreadState *thr, upt
 }
 
 static void LongJmp(ThreadState *thr, uptr *env) {
-#ifdef __powerpc__
+#if SANITIZER_NETBSD
+# ifdef __x86_64__
+  uptr mangled_sp = env[6];
+# else
+#  error Unsupported
+# endif
+#elif defined(__powerpc__)
   uptr mangled_sp = env[0];
 #elif SANITIZER_FREEBSD
   uptr mangled_sp = env[2];
-#elif SANITIZER_NETBSD
-  uptr mangled_sp = env[6];
 #elif SANITIZER_MAC
 # ifdef __aarch64__
   uptr mangled_sp =



CVS commit: src/sys/arch/aarch64

2020-09-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Sep 14 10:53:02 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: db_interface.c trap.c
src/sys/arch/aarch64/include: db_machdep.h

Log Message:
sprinkle LE32TOH to fetch instructions on aarch64eb


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/aarch64/db_interface.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/aarch64/aarch64/trap.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/aarch64/include/db_machdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/aarch64/aarch64/db_interface.c
diff -u src/sys/arch/aarch64/aarch64/db_interface.c:1.9 src/sys/arch/aarch64/aarch64/db_interface.c:1.10
--- src/sys/arch/aarch64/aarch64/db_interface.c:1.9	Tue Aug 11 19:46:56 2020
+++ src/sys/arch/aarch64/aarch64/db_interface.c	Mon Sep 14 10:53:02 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: db_interface.c,v 1.9 2020/08/11 19:46:56 skrll Exp $ */
+/* $NetBSD: db_interface.c,v 1.10 2020/09/14 10:53:02 ryo Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.9 2020/08/11 19:46:56 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.10 2020/09/14 10:53:02 ryo Exp $");
 
 #include 
 #include 
@@ -234,6 +234,8 @@ SignExtend(int bitwidth, uint64_t imm, u
 db_addr_t
 db_branch_taken(db_expr_t inst, db_addr_t pc, db_regs_t *regs)
 {
+	LE32TOH(inst);
+
 #define INSN_FMT_RN(insn)		(((insn) >> 5) & 0x1f)
 #define INSN_FMT_IMM26(insn)	((insn) & 0x03ff)
 #define INSN_FMT_IMM19(insn)	(((insn) >> 5) & 0x7)
@@ -267,6 +269,8 @@ db_branch_taken(db_expr_t inst, db_addr_
 bool
 db_inst_unconditional_flow_transfer(db_expr_t inst)
 {
+	LE32TOH(inst);
+
 	if (((inst & 0xfc1f) == 0xd65f) ||	/* ret xN */
 	((inst & 0xfc00) == 0x9400) ||	/* bl */
 	((inst & 0xfc1f) == 0xd63f) ||	/* blr */

Index: src/sys/arch/aarch64/aarch64/trap.c
diff -u src/sys/arch/aarch64/aarch64/trap.c:1.36 src/sys/arch/aarch64/aarch64/trap.c:1.37
--- src/sys/arch/aarch64/aarch64/trap.c:1.36	Sun Aug  2 06:58:16 2020
+++ src/sys/arch/aarch64/aarch64/trap.c	Mon Sep 14 10:53:02 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.36 2020/08/02 06:58:16 maxv Exp $ */
+/* $NetBSD: trap.c,v 1.37 2020/09/14 10:53:02 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.36 2020/08/02 06:58:16 maxv Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.37 2020/09/14 10:53:02 ryo Exp $");
 
 #include "opt_arm_intr_impl.h"
 #include "opt_compat_netbsd32.h"
@@ -386,6 +386,7 @@ emul_aarch64_insn(struct trapframe *tf)
 		return EMUL_ARM_FAULT;
 	}
 
+	LE32TOH(insn);
 	if ((insn & 0xffe0) == 0xd53b0020) {
 		/* mrs x?,ctr_el0 */
 		unsigned int Xt = insn & 31;

Index: src/sys/arch/aarch64/include/db_machdep.h
diff -u src/sys/arch/aarch64/include/db_machdep.h:1.10 src/sys/arch/aarch64/include/db_machdep.h:1.11
--- src/sys/arch/aarch64/include/db_machdep.h:1.10	Wed Jul  8 03:45:13 2020
+++ src/sys/arch/aarch64/include/db_machdep.h	Mon Sep 14 10:53:02 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.h,v 1.10 2020/07/08 03:45:13 ryo Exp $ */
+/* $NetBSD: db_machdep.h,v 1.11 2020/09/14 10:53:02 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -76,7 +76,11 @@ typedef uintptr_t db_addr_t;
 
 #define BKPT_ADDR(addr)		(addr)
 #define BKPT_SIZE		4
+#ifdef __AARCH64EB__
+#define BKPT_INSN		0x20d4	/* brk #0 */
+#else
 #define BKPT_INSN		0xd420	/* brk #0 */
+#endif
 #define BKPT_SET(insn, addr)	(BKPT_INSN)
 
 typedef struct trapframe db_regs_t;
@@ -99,18 +103,21 @@ int kdb_trap(int, struct trapframe *);
 static inline bool
 inst_return(db_expr_t insn)
 {
+	LE32TOH(insn);
 	return ((insn & 0xfc1f) == 0xd65f);	/* ret xN */
 }
 
 static inline bool
 inst_trap_return(db_expr_t insn)
 {
+	LE32TOH(insn);
 	return insn == 0xd69f03e0;			/* eret */
 }
 
 static inline bool
 inst_call(db_expr_t insn)
 {
+	LE32TOH(insn);
 	return ((insn & 0xfc00) == 0x9400)	/* bl */
 	|| ((insn & 0xfc1f) == 0xd63f);	/* blr */
 }
@@ -118,6 +125,7 @@ inst_call(db_expr_t insn)
 static inline bool
 inst_load(db_expr_t insn)
 {
+	LE32TOH(insn);
 	return
 	((insn & 0xffe00c00) == 0xb880) ||	/* ldursw */
 	/* ldrsw imm{pre,post}idx */
@@ -155,6 +163,7 @@ inst_load(db_expr_t insn)
 static inline bool
 inst_store(db_expr_t insn)
 {
+	LE32TOH(insn);
 	return
 	((insn & 0xbfe0) == 0x8820) ||	/* stlxp,stxp */
 	/* stp {pre,post}idx,stp signed,stnp */
@@ -178,6 +187,7 @@ inst_store(db_expr_t insn)
 static inline bool
 inst_branch(db_expr_t insn)
 {
+	LE32TOH(insn);
 	return
 	((insn & 0xff10) == 0x5400) ||	/* b.cond */
 	((insn & 0xfc00) == 0x1400) ||	/* b imm */



CVS commit: src/sys/arch/aarch64

2020-09-14 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Mon Sep 14 10:06:35 UTC 2020

Modified Files:
src/sys/arch/aarch64/aarch64: pmap.c
src/sys/arch/aarch64/include: cpu.h types.h

Log Message:
PID_MAX is just an initial value (soft maximum). Don't use it for CTASSERT.
defined __HAVE_CPU_MAXPROC to use function cpu_maxproc().

pointed out by mrg@, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/aarch64/aarch64/pmap.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/aarch64/include/cpu.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/aarch64/include/types.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/aarch64/aarch64/pmap.c
diff -u src/sys/arch/aarch64/aarch64/pmap.c:1.88 src/sys/arch/aarch64/aarch64/pmap.c:1.89
--- src/sys/arch/aarch64/aarch64/pmap.c:1.88	Sun Sep  6 17:38:10 2020
+++ src/sys/arch/aarch64/aarch64/pmap.c	Mon Sep 14 10:06:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.88 2020/09/06 17:38:10 ryo Exp $	*/
+/*	$NetBSD: pmap.c,v 1.89 2020/09/14 10:06:35 ryo Exp $	*/
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.88 2020/09/06 17:38:10 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.89 2020/09/14 10:06:35 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -1413,6 +1413,13 @@ pmap_protect(struct pmap *pm, vaddr_t sv
 	pm_unlock(pm);
 }
 
+/* XXX: due to the current implementation of pmap depends on 16bit ASID */
+int
+cpu_maxproc(void)
+{
+	return 65535;
+}
+
 void
 pmap_activate(struct lwp *l)
 {
@@ -1436,8 +1443,7 @@ pmap_activate(struct lwp *l)
 	reg_tcr_el1_write(tcr | TCR_EPD0);
 	__asm __volatile("isb" ::: "memory");
 
-	/* XXX */
-	CTASSERT(PID_MAX <= 65535);	/* 16bit ASID */
+	/* XXX: allocate asid, and regenerate if needed */
 	if (pm->pm_asid == -1)
 		pm->pm_asid = l->l_proc->p_pid;
 

Index: src/sys/arch/aarch64/include/cpu.h
diff -u src/sys/arch/aarch64/include/cpu.h:1.26 src/sys/arch/aarch64/include/cpu.h:1.27
--- src/sys/arch/aarch64/include/cpu.h:1.26	Wed Aug 12 13:19:35 2020
+++ src/sys/arch/aarch64/include/cpu.h	Mon Sep 14 10:06:35 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.26 2020/08/12 13:19:35 skrll Exp $ */
+/* $NetBSD: cpu.h,v 1.27 2020/09/14 10:06:35 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014, 2020 The NetBSD Foundation, Inc.
@@ -147,6 +147,7 @@ static __inline struct cpu_info *lwp_get
 #undef curlwp
 #define	curlwp			(aarch64_curlwp())
 
+int	cpu_maxproc(void);
 void	cpu_signotify(struct lwp *l);
 void	cpu_need_proftick(struct lwp *l);
 

Index: src/sys/arch/aarch64/include/types.h
diff -u src/sys/arch/aarch64/include/types.h:1.15 src/sys/arch/aarch64/include/types.h:1.16
--- src/sys/arch/aarch64/include/types.h:1.15	Mon Aug  3 06:30:00 2020
+++ src/sys/arch/aarch64/include/types.h	Mon Sep 14 10:06:35 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: types.h,v 1.15 2020/08/03 06:30:00 ryo Exp $ */
+/* $NetBSD: types.h,v 1.16 2020/09/14 10:06:35 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -96,6 +96,7 @@ typedef __uint64_t __register_t;
 #define __HAVE_COMMON___TLS_GET_ADDR
 #define __HAVE_CPU_COUNTER
 #define __HAVE_CPU_DATA_FIRST
+#define __HAVE_CPU_MAXPROC
 #define __HAVE_FAST_SOFTINTS
 #define __HAVE_MINIMAL_EMUL
 #define __HAVE_MM_MD_DIRECT_MAPPED_PHYS



CVS commit: src/sys/arch/sparc/include

2020-09-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Sep 14 09:47:43 UTC 2020

Modified Files:
src/sys/arch/sparc/include: ptrace.h

Log Message:
Switch from register_t to unsigned long int

Removes dependency on _KERNTYPES.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/sparc/include/ptrace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc/include/ptrace.h
diff -u src/sys/arch/sparc/include/ptrace.h:1.15 src/sys/arch/sparc/include/ptrace.h:1.16
--- src/sys/arch/sparc/include/ptrace.h:1.15	Tue Dec 24 14:50:59 2019
+++ src/sys/arch/sparc/include/ptrace.h	Mon Sep 14 09:47:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptrace.h,v 1.15 2019/12/24 14:50:59 kamil Exp $ */
+/*	$NetBSD: ptrace.h,v 1.16 2020/09/14 09:47:43 kamil Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -55,14 +55,14 @@
 	"PT_SETFPREGS",
 
 #include 
-#define PTRACE_REG_PC(r)	((register_t)(r)->r_pc)
+#define PTRACE_REG_PC(r)	((unsigned long int)(r)->r_pc)
 #define PTRACE_REG_FP(r)	0 /* not stored in struct reg */
 #define PTRACE_REG_SET_PC(r, v)	do {	\
 	(r)->r_pc = (v);		\
 	(r)->r_npc = (v) + 4;		\
 } while (/*CONSTCOND*/0)
-#define PTRACE_REG_SP(r)	((register_t)(r)->r_out[6])
-#define PTRACE_REG_INTRV(r)	((register_t)(r)->r_out[0])
+#define PTRACE_REG_SP(r)	((unsigned long int)(r)->r_out[6])
+#define PTRACE_REG_INTRV(r)	((unsigned long int)(r)->r_out[0])
 
 #define PTRACE_ILLEGAL_ASM	__asm __volatile (".word 0" : : : "memory")
 



CVS commit: src

2020-09-14 Thread Kimmo Suominen
Module Name:src
Committed By:   kim
Date:   Mon Sep 14 09:02:11 UTC 2020

Modified Files:
src: build.sh

Log Message:
Fix typo in usage


To generate a diff of this commit:
cvs rdiff -u -r1.343 -r1.344 src/build.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.343 src/build.sh:1.344
--- src/build.sh:1.343	Sun Jul 26 09:17:24 2020
+++ src/build.sh	Mon Sep 14 09:02:11 2020
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.343 2020/07/26 09:17:24 rillig Exp $
+#	$NetBSD: build.sh,v 1.344 2020/09/14 09:02:11 kim Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1028,7 +1028,7 @@ usage()
 	cat <<_usage_
 
 Usage: ${progname} [-EhnoPRrUuxy] [-a arch] [-B buildid] [-C cdextras]
-[-c compiler>] [-D dest] [-j njob] [-M obj] [-m mach]
+[-c compiler] [-D dest] [-j njob] [-M obj] [-m mach]
 [-N noisy] [-O obj] [-R release] [-S seed] [-T tools]
 [-V var=[value]] [-w wrapper] [-X x11src] [-Y extsrcsrc]
 [-Z var]
@@ -1961,7 +1961,7 @@ createmakewrapper()
 	eval cat <

CVS commit: src/sys/arch/arm/nvidia

2020-09-14 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Sep 14 07:27:19 UTC 2020

Modified Files:
src/sys/arch/arm/nvidia: tegra_sdhc.c

Log Message:
Trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/nvidia/tegra_sdhc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nvidia/tegra_sdhc.c
diff -u src/sys/arch/arm/nvidia/tegra_sdhc.c:1.26 src/sys/arch/arm/nvidia/tegra_sdhc.c:1.27
--- src/sys/arch/arm/nvidia/tegra_sdhc.c:1.26	Sun Mar  1 16:38:59 2020
+++ src/sys/arch/arm/nvidia/tegra_sdhc.c	Mon Sep 14 07:27:19 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_sdhc.c,v 1.26 2020/03/01 16:38:59 skrll Exp $ */
+/* $NetBSD: tegra_sdhc.c,v 1.27 2020/09/14 07:27:19 skrll Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -31,7 +31,7 @@
 #include "locators.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.26 2020/03/01 16:38:59 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_sdhc.c,v 1.27 2020/09/14 07:27:19 skrll Exp $");
 
 #include 
 #include 
@@ -158,7 +158,7 @@ tegra_sdhc_attach(device_t parent, devic
 	if (sc->sc_pin_power)
 		fdtbus_gpio_write(sc->sc_pin_power, 1);
 
-	sc->sc_pin_cd = fdtbus_gpio_acquire(faa->faa_phandle, 
+	sc->sc_pin_cd = fdtbus_gpio_acquire(faa->faa_phandle,
 	"cd-gpios", GPIO_PIN_INPUT);
 	sc->sc_pin_wp = fdtbus_gpio_acquire(faa->faa_phandle,
 	"wp-gpios", GPIO_PIN_INPUT);



CVS commit: src/usr.bin/make/unit-tests

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 07:13:29 UTC 2020

Modified Files:
src/usr.bin/make/unit-tests: cond-undef-lint.exp cond-undef-lint.mk
opt-debug-lint.exp opt-debug-lint.mk

Log Message:
make(1): remove obsolete comments from tests


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/cond-undef-lint.exp
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cond-undef-lint.mk
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/opt-debug-lint.exp
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/opt-debug-lint.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/cond-undef-lint.exp
diff -u src/usr.bin/make/unit-tests/cond-undef-lint.exp:1.2 src/usr.bin/make/unit-tests/cond-undef-lint.exp:1.3
--- src/usr.bin/make/unit-tests/cond-undef-lint.exp:1.2	Mon Sep 14 07:04:56 2020
+++ src/usr.bin/make/unit-tests/cond-undef-lint.exp	Mon Sep 14 07:13:29 2020
@@ -1,7 +1,7 @@
-make: "cond-undef-lint.mk" line 20: Variable "UNDEF" is undefined
-make: "cond-undef-lint.mk" line 35: Variable "UNDEF" is undefined
-make: "cond-undef-lint.mk" line 35: Variable "VAR." is undefined
-make: "cond-undef-lint.mk" line 42: Variable "VAR.defined" is undefined
+make: "cond-undef-lint.mk" line 23: Variable "UNDEF" is undefined
+make: "cond-undef-lint.mk" line 38: Variable "UNDEF" is undefined
+make: "cond-undef-lint.mk" line 38: Variable "VAR." is undefined
+make: "cond-undef-lint.mk" line 45: Variable "VAR.defined" is undefined
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/cond-undef-lint.mk
diff -u src/usr.bin/make/unit-tests/cond-undef-lint.mk:1.1 src/usr.bin/make/unit-tests/cond-undef-lint.mk:1.2
--- src/usr.bin/make/unit-tests/cond-undef-lint.mk:1.1	Mon Sep 14 06:44:50 2020
+++ src/usr.bin/make/unit-tests/cond-undef-lint.mk	Mon Sep 14 07:13:29 2020
@@ -1,10 +1,13 @@
-# $NetBSD: cond-undef-lint.mk,v 1.1 2020/09/14 06:44:50 rillig Exp $
+# $NetBSD: cond-undef-lint.mk,v 1.2 2020/09/14 07:13:29 rillig Exp $
 #
 # Tests for defined and undefined variables in .if conditions, in lint mode.
 #
 # As of 2020-09-14, lint mode contains experimental code for printing
 # accurate error messages in case of undefined variables, instead of the
 # wrong "Malformed condition".
+#
+# See also:
+#	opt-debug-lint.mk
 
 .MAKEFLAGS: -dL
 
@@ -60,9 +63,7 @@ INDIRECT=	${NESTED_UNDEF} ${NESTED_DEF}
 NESTED_DEF=	nested-defined
 
 # Since NESTED_UNDEF is not controllable at this point, it must not generate
-# an error message.  This condition should generate no error message at all.
-#
-# TODO: Suppress the error message.
+# an error message, and it doesn't do so, since 2020-09-14.
 .if !${INDIRECT}
 .  error
 .endif

Index: src/usr.bin/make/unit-tests/opt-debug-lint.exp
diff -u src/usr.bin/make/unit-tests/opt-debug-lint.exp:1.4 src/usr.bin/make/unit-tests/opt-debug-lint.exp:1.5
--- src/usr.bin/make/unit-tests/opt-debug-lint.exp:1.4	Sun Sep 13 20:21:24 2020
+++ src/usr.bin/make/unit-tests/opt-debug-lint.exp	Mon Sep 14 07:13:29 2020
@@ -1,5 +1,5 @@
-make: "opt-debug-lint.mk" line 18: Variable "X" is undefined
-make: "opt-debug-lint.mk" line 40: Variable "UNDEF" is undefined
+make: "opt-debug-lint.mk" line 19: Variable "X" is undefined
+make: "opt-debug-lint.mk" line 41: Variable "UNDEF" is undefined
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1

Index: src/usr.bin/make/unit-tests/opt-debug-lint.mk
diff -u src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.3 src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.4
--- src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.3	Sun Sep 13 20:21:24 2020
+++ src/usr.bin/make/unit-tests/opt-debug-lint.mk	Mon Sep 14 07:13:29 2020
@@ -1,4 +1,4 @@
-# $NetBSD: opt-debug-lint.mk,v 1.3 2020/09/13 20:21:24 rillig Exp $
+# $NetBSD: opt-debug-lint.mk,v 1.4 2020/09/14 07:13:29 rillig Exp $
 #
 # Tests for the -dL command line option, which runs additional checks
 # to catch common mistakes, such as unclosed variable expressions.
@@ -11,10 +11,11 @@
 # misleading.  The form of the condition is totally fine, it's the evaluation
 # that fails.
 #
-# TODO: Get rid of the "Malformed conditional" error message.
-# As long as the first error message is only printed in lint mode, it can
-# get tricky to keep track of the actually printed error messages and those
-# that still need to be printed.  That's probably a solvable problem though.
+# Since 2020-09-13, the "Malformed conditional" error message is not printed
+# anymore.
+#
+# See also:
+#	cond-undef-lint.mk
 .if $X
 .  error
 .endif



CVS commit: src/usr.bin/make

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 07:04:56 UTC 2020

Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: cond-undef-lint.exp

Log Message:
make(1): don't require nested variables to be defined in conditions

This code only applies to lint mode (-dL) for now.  After a test phase
and a thorough check for possible side effects, it will be activated in
normal mode, too.  Having this code in lint mode is required to run
src/build.sh, which relies a lot on using variables with undefined
nested variables in conditions.

In the default mode, any errors about nested undefined variables are not
printed since in Var_Subst, oldVars is true.  Therefore, it is not urgent
to properly handle these nested variables correctly there.


To generate a diff of this commit:
cvs rdiff -u -r1.519 -r1.520 src/usr.bin/make/var.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cond-undef-lint.exp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/var.c
diff -u src/usr.bin/make/var.c:1.519 src/usr.bin/make/var.c:1.520
--- src/usr.bin/make/var.c:1.519	Sun Sep 13 21:03:14 2020
+++ src/usr.bin/make/var.c	Mon Sep 14 07:04:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: var.c,v 1.519 2020/09/13 21:03:14 rillig Exp $	*/
+/*	$NetBSD: var.c,v 1.520 2020/09/14 07:04:56 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -121,7 +121,7 @@
 #include"metachar.h"
 
 /*	"@(#)var.c	8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.519 2020/09/13 21:03:14 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.520 2020/09/14 07:04:56 rillig Exp $");
 
 #define VAR_DEBUG_IF(cond, fmt, ...)	\
 if (!(DEBUG(VAR) && (cond)))	\
@@ -3618,7 +3618,10 @@ Var_Parse(const char **pp, GNode *ctxt, 
  */
 nstr = Buf_GetAll(>val, NULL);
 if (strchr(nstr, '$') != NULL && (eflags & VARE_WANTRES)) {
-	nstr = Var_Subst(nstr, ctxt, eflags);
+VarEvalFlags nested_eflags = eflags;
+if (DEBUG(LINT))
+nested_eflags &= ~(unsigned)VARE_UNDEFERR;
+	nstr = Var_Subst(nstr, ctxt, nested_eflags);
 	*freePtr = nstr;
 }
 

Index: src/usr.bin/make/unit-tests/cond-undef-lint.exp
diff -u src/usr.bin/make/unit-tests/cond-undef-lint.exp:1.1 src/usr.bin/make/unit-tests/cond-undef-lint.exp:1.2
--- src/usr.bin/make/unit-tests/cond-undef-lint.exp:1.1	Mon Sep 14 06:44:50 2020
+++ src/usr.bin/make/unit-tests/cond-undef-lint.exp	Mon Sep 14 07:04:56 2020
@@ -2,7 +2,6 @@ make: "cond-undef-lint.mk" line 20: Vari
 make: "cond-undef-lint.mk" line 35: Variable "UNDEF" is undefined
 make: "cond-undef-lint.mk" line 35: Variable "VAR." is undefined
 make: "cond-undef-lint.mk" line 42: Variable "VAR.defined" is undefined
-make: "cond-undef-lint.mk" line 66: Variable "NESTED_UNDEF" is undefined
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1



CVS commit: src/external/gpl3/gdb.old/dist/gdb

2020-09-14 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Sep 14 06:50:31 UTC 2020

Removed Files:
src/external/gpl3/gdb.old/dist/gdb: rust-exp.c x86bsd-nat.c
x86bsd-nat.h

Log Message:
Sync with external/gpl3/gdb/dist/gdb by removing unused files:

- rust-exp.c is generated file.
- x86bsd-nat.[ch] were replaced by x86-bsd-nat.[ch] when 8.0.1 was merged.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r0 src/external/gpl3/gdb.old/dist/gdb/rust-exp.c
cvs rdiff -u -r1.1.1.1 -r0 src/external/gpl3/gdb.old/dist/gdb/x86bsd-nat.c \
src/external/gpl3/gdb.old/dist/gdb/x86bsd-nat.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 06:44:50 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: cond-undef-lint.exp cond-undef-lint.mk

Log Message:
make(1): add test for undefined expressions in conditions in lint mode


To generate a diff of this commit:
cvs rdiff -u -r1.923 -r1.924 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.141 -r1.142 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/cond-undef-lint.exp \
src/usr.bin/make/unit-tests/cond-undef-lint.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.923 src/distrib/sets/lists/tests/mi:1.924
--- src/distrib/sets/lists/tests/mi:1.923	Mon Sep 14 06:22:59 2020
+++ src/distrib/sets/lists/tests/mi	Mon Sep 14 06:44:50 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.923 2020/09/14 06:22:59 rillig Exp $
+# $NetBSD: mi,v 1.924 2020/09/14 06:44:50 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4603,6 +4603,8 @@
 ./usr/tests/usr.bin/make/unit-tests/cond-token-string.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond-token-var.exptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond-token-var.mktests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/cond-undef-lint.exptests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/cond-undef-lint.mktests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond1.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond1.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond2.exp	tests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.141 src/usr.bin/make/unit-tests/Makefile:1.142
--- src/usr.bin/make/unit-tests/Makefile:1.141	Mon Sep 14 06:22:59 2020
+++ src/usr.bin/make/unit-tests/Makefile	Mon Sep 14 06:44:50 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.141 2020/09/14 06:22:59 rillig Exp $
+# $NetBSD: Makefile,v 1.142 2020/09/14 06:44:50 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -67,6 +67,7 @@ TESTS+=		cond-token-number
 TESTS+=		cond-token-plain
 TESTS+=		cond-token-string
 TESTS+=		cond-token-var
+TESTS+=		cond-undef-lint
 TESTS+=		cond1
 TESTS+=		cond2
 TESTS+=		counter

Added files:

Index: src/usr.bin/make/unit-tests/cond-undef-lint.exp
diff -u /dev/null src/usr.bin/make/unit-tests/cond-undef-lint.exp:1.1
--- /dev/null	Mon Sep 14 06:44:50 2020
+++ src/usr.bin/make/unit-tests/cond-undef-lint.exp	Mon Sep 14 06:44:50 2020
@@ -0,0 +1,8 @@
+make: "cond-undef-lint.mk" line 20: Variable "UNDEF" is undefined
+make: "cond-undef-lint.mk" line 35: Variable "UNDEF" is undefined
+make: "cond-undef-lint.mk" line 35: Variable "VAR." is undefined
+make: "cond-undef-lint.mk" line 42: Variable "VAR.defined" is undefined
+make: "cond-undef-lint.mk" line 66: Variable "NESTED_UNDEF" is undefined
+make: Fatal errors encountered -- cannot continue
+make: stopped in unit-tests
+exit status 1
Index: src/usr.bin/make/unit-tests/cond-undef-lint.mk
diff -u /dev/null src/usr.bin/make/unit-tests/cond-undef-lint.mk:1.1
--- /dev/null	Mon Sep 14 06:44:50 2020
+++ src/usr.bin/make/unit-tests/cond-undef-lint.mk	Mon Sep 14 06:44:50 2020
@@ -0,0 +1,68 @@
+# $NetBSD: cond-undef-lint.mk,v 1.1 2020/09/14 06:44:50 rillig Exp $
+#
+# Tests for defined and undefined variables in .if conditions, in lint mode.
+#
+# As of 2020-09-14, lint mode contains experimental code for printing
+# accurate error messages in case of undefined variables, instead of the
+# wrong "Malformed condition".
+
+.MAKEFLAGS: -dL
+
+# DEF is defined, UNDEF is not.
+DEF=		defined
+
+# An expression based on a defined variable is fine.
+.if !${DEF}
+.  error
+.endif
+
+# Since the condition fails to evaluate, neither of the branches is taken.
+.if ${UNDEF}
+.  error
+.else
+.  error
+.endif
+
+# The variable name depends on the undefined variable, which is probably a
+# mistake.  The variable UNDEF, as used here, can be easily turned into
+# an expression that is always defined, using the :U modifier.
+#
+# The outer expression does not generate an error message since there was
+# already an error evaluating this variable's name.
+#
+# TODO: Suppress the error message "Variable VAR. is undefined".  That part
+# of the expression must not be evaluated at all.
+.if ${VAR.${UNDEF}}
+.  error
+.else
+.  error
+.endif
+
+# The variable VAR.defined is not defined and thus generates an error message.
+.if ${VAR.${DEF}}
+.  error
+.else
+.  error
+.endif
+
+
+# Variables that are referenced indirectly may be undefined in a 

CVS commit: src

2020-09-14 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Mon Sep 14 06:22:59 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile cond-token-number.exp
cond-token-number.mk
Added Files:
src/usr.bin/make/unit-tests: cond-cmp-unary.exp cond-cmp-unary.mk

Log Message:
make(1): add tests for numbers in conditions


To generate a diff of this commit:
cvs rdiff -u -r1.922 -r1.923 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.140 -r1.141 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/cond-cmp-unary.exp \
src/usr.bin/make/unit-tests/cond-cmp-unary.mk
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cond-token-number.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/cond-token-number.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.922 src/distrib/sets/lists/tests/mi:1.923
--- src/distrib/sets/lists/tests/mi:1.922	Sun Sep 13 13:03:15 2020
+++ src/distrib/sets/lists/tests/mi	Mon Sep 14 06:22:59 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.922 2020/09/13 13:03:15 rillig Exp $
+# $NetBSD: mi,v 1.923 2020/09/14 06:22:59 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4565,6 +4565,8 @@
 ./usr/tests/usr.bin/make/unit-tests/cond-cmp-numeric.mktests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond-cmp-string.exptests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond-cmp-string.mktests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/cond-cmp-unary.exptests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/cond-cmp-unary.mktests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond-func-commands.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond-func-commands.mk			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond-func-defined.exp			tests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.140 src/usr.bin/make/unit-tests/Makefile:1.141
--- src/usr.bin/make/unit-tests/Makefile:1.140	Sun Sep 13 09:20:23 2020
+++ src/usr.bin/make/unit-tests/Makefile	Mon Sep 14 06:22:59 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.140 2020/09/13 09:20:23 rillig Exp $
+# $NetBSD: Makefile,v 1.141 2020/09/14 06:22:59 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -48,6 +48,7 @@ TESTS+=		cond-cmp-numeric-le
 TESTS+=		cond-cmp-numeric-lt
 TESTS+=		cond-cmp-numeric-ne
 TESTS+=		cond-cmp-string
+TESTS+=		cond-cmp-unary
 TESTS+=		cond-func
 TESTS+=		cond-func-commands
 TESTS+=		cond-func-defined

Index: src/usr.bin/make/unit-tests/cond-token-number.exp
diff -u src/usr.bin/make/unit-tests/cond-token-number.exp:1.1 src/usr.bin/make/unit-tests/cond-token-number.exp:1.2
--- src/usr.bin/make/unit-tests/cond-token-number.exp:1.1	Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/cond-token-number.exp	Mon Sep 14 06:22:59 2020
@@ -1 +1,8 @@
-exit status 0
+make: "cond-token-number.mk" line 13: Malformed conditional (-0)
+make: "cond-token-number.mk" line 21: Malformed conditional (+0)
+make: "cond-token-number.mk" line 29: Malformed conditional (!-1)
+make: "cond-token-number.mk" line 37: Malformed conditional (!+1)
+make: "cond-token-number.mk" line 54: End of the tests.
+make: Fatal errors encountered -- cannot continue
+make: stopped in unit-tests
+exit status 1

Index: src/usr.bin/make/unit-tests/cond-token-number.mk
diff -u src/usr.bin/make/unit-tests/cond-token-number.mk:1.2 src/usr.bin/make/unit-tests/cond-token-number.mk:1.3
--- src/usr.bin/make/unit-tests/cond-token-number.mk:1.2	Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/cond-token-number.mk	Mon Sep 14 06:22:59 2020
@@ -1,8 +1,56 @@
-# $NetBSD: cond-token-number.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: cond-token-number.mk,v 1.3 2020/09/14 06:22:59 rillig Exp $
 #
 # Tests for number tokens in .if conditions.
 
-# TODO: Implementation
+.if 0
+.  error
+.endif
 
-all:
-	@:;
+# Even though -0 is a number and would be accepted by strtod, it is not
+# accepted by the condition parser.
+#
+# See the ch_isdigit call in CondParser_String.
+.if -0
+.  error
+.endif
+
+# Even though +0 is a number and would be accepted by strtod, it is not
+# accepted by the condition parser.
+#
+# See the ch_isdigit call in CondParser_String.
+.if +0
+.  error
+.endif
+
+# Even though -1 is a number and would be accepted by strtod, it is not
+# accepted by the condition parser.
+#
+# See the ch_isdigit call in CondParser_String.
+.if !-1
+.  error
+.endif
+
+# Even though +1 is a number and would be accepted by strtod, it is not
+# accepted by the condition parser.
+#
+# See