CVS commit: src/usr.sbin/makefs/ffs

2022-03-06 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sun Mar  6 08:31:54 UTC 2022

Modified Files:
src/usr.sbin/makefs/ffs: buf.h newfs_extern.h
Added Files:
src/usr.sbin/makefs/ffs: namespace.h

Log Message:
Make sure daddr_t is a 64 bit type when building tools.
(see also PR sw-bug/56742 ).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/makefs/ffs/buf.h
cvs rdiff -u -r0 -r1.1 src/usr.sbin/makefs/ffs/namespace.h
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makefs/ffs/newfs_extern.h

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



CVS commit: src/usr.sbin/makefs/ffs

2022-03-06 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sun Mar  6 08:31:54 UTC 2022

Modified Files:
src/usr.sbin/makefs/ffs: buf.h newfs_extern.h
Added Files:
src/usr.sbin/makefs/ffs: namespace.h

Log Message:
Make sure daddr_t is a 64 bit type when building tools.
(see also PR sw-bug/56742 ).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/makefs/ffs/buf.h
cvs rdiff -u -r0 -r1.1 src/usr.sbin/makefs/ffs/namespace.h
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makefs/ffs/newfs_extern.h

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

Modified files:

Index: src/usr.sbin/makefs/ffs/buf.h
diff -u src/usr.sbin/makefs/ffs/buf.h:1.13 src/usr.sbin/makefs/ffs/buf.h:1.14
--- src/usr.sbin/makefs/ffs/buf.h:1.13	Mon Sep  3 16:29:37 2018
+++ src/usr.sbin/makefs/ffs/buf.h	Sun Mar  6 08:31:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: buf.h,v 1.13 2018/09/03 16:29:37 riastradh Exp $	*/
+/*	$NetBSD: buf.h,v 1.14 2022/03/06 08:31:54 hgutch Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -49,6 +49,7 @@
 #include 
 #include 
 #include 
+#include "namespace.h"
 
 struct componentname {
 	char *cn_nameptr;

Index: src/usr.sbin/makefs/ffs/newfs_extern.h
diff -u src/usr.sbin/makefs/ffs/newfs_extern.h:1.4 src/usr.sbin/makefs/ffs/newfs_extern.h:1.5
--- src/usr.sbin/makefs/ffs/newfs_extern.h:1.4	Mon Dec 21 00:58:08 2015
+++ src/usr.sbin/makefs/ffs/newfs_extern.h	Sun Mar  6 08:31:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: newfs_extern.h,v 1.4 2015/12/21 00:58:08 christos Exp $	*/
+/*	$NetBSD: newfs_extern.h,v 1.5 2022/03/06 08:31:54 hgutch Exp $	*/
 /* From: NetBSD: extern.h,v 1.3 2000/12/01 12:03:27 simonb Exp $ */
 
 /*
@@ -25,6 +25,8 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "namespace.h"
+
 /* prototypes */
 struct fs	*ffs_mkfs(const char *, const fsinfo_t *, time_t);
 void		ffs_write_superblock(struct fs *, const fsinfo_t *);

Added files:

Index: src/usr.sbin/makefs/ffs/namespace.h
diff -u /dev/null src/usr.sbin/makefs/ffs/namespace.h:1.1
--- /dev/null	Sun Mar  6 08:31:55 2022
+++ src/usr.sbin/makefs/ffs/namespace.h	Sun Mar  6 08:31:54 2022
@@ -0,0 +1,5 @@
+/*	$Id: namespace.h,v 1.1 2022/03/06 08:31:54 hgutch Exp $	*/
+
+#ifndef daddr_t
+#define daddr_t int64_t
+#endif



CVS commit: src/sys/arch

2022-05-14 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat May 14 07:11:23 UTC 2022

Modified Files:
src/sys/arch/sparc/stand/ofwboot: Locore.c
src/sys/arch/sparc64/sparc64: ofw_machdep.c

Log Message:
PR 56829: Fix "map" call to Open Firmware and no longer mess up OFW stack.
This unbreaks miniroot.fs.

Thanks to Björn Johannesson for originally pointing this out and to
mrg@ for pointing out the actual issue and suggesting a fix.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/sparc/stand/ofwboot/Locore.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/sparc64/sparc64/ofw_machdep.c

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



CVS commit: src/sys/arch

2022-05-14 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat May 14 07:11:23 UTC 2022

Modified Files:
src/sys/arch/sparc/stand/ofwboot: Locore.c
src/sys/arch/sparc64/sparc64: ofw_machdep.c

Log Message:
PR 56829: Fix "map" call to Open Firmware and no longer mess up OFW stack.
This unbreaks miniroot.fs.

Thanks to Björn Johannesson for originally pointing this out and to
mrg@ for pointing out the actual issue and suggesting a fix.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/sparc/stand/ofwboot/Locore.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/sparc64/sparc64/ofw_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/sparc/stand/ofwboot/Locore.c
diff -u src/sys/arch/sparc/stand/ofwboot/Locore.c:1.16 src/sys/arch/sparc/stand/ofwboot/Locore.c:1.17
--- src/sys/arch/sparc/stand/ofwboot/Locore.c:1.16	Fri Sep 15 13:25:34 2017
+++ src/sys/arch/sparc/stand/ofwboot/Locore.c	Sat May 14 07:11:23 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: Locore.c,v 1.16 2017/09/15 13:25:34 martin Exp $	*/
+/*	$NetBSD: Locore.c,v 1.17 2022/05/14 07:11:23 hgutch Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -664,8 +664,6 @@ OF_map_phys(paddr_t paddr, off_t size, v
 		cell_t vaddr;
 		cell_t paddr_hi;
 		cell_t paddr_lo;
-		cell_t status;
-		cell_t retaddr;
 	} args;
 
 #ifdef	__notyet
@@ -676,7 +674,7 @@ OF_map_phys(paddr_t paddr, off_t size, v
 #endif
 	args.name = ADR2CELL("call-method");
 	args.nargs = 7;
-	args.nreturns = 1;
+	args.nreturns = 0;
 	args.method = ADR2CELL("map");
 	args.ihandle = HDL2CELL(mmuh);
 	args.mode = mode;
@@ -687,9 +685,7 @@ OF_map_phys(paddr_t paddr, off_t size, v
 
 	if (openfirmware(&args) == -1)
 		return -1;
-	if (args.status)
-		return -1;
-	return (vaddr_t)args.retaddr;
+	return 0;
 }
 
 

Index: src/sys/arch/sparc64/sparc64/ofw_machdep.c
diff -u src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.50 src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.51
--- src/sys/arch/sparc64/sparc64/ofw_machdep.c:1.50	Thu Mar 17 08:08:03 2022
+++ src/sys/arch/sparc64/sparc64/ofw_machdep.c	Sat May 14 07:11:23 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_machdep.c,v 1.50 2022/03/17 08:08:03 andvar Exp $	*/
+/*	$NetBSD: ofw_machdep.c,v 1.51 2022/05/14 07:11:23 hgutch Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -34,7 +34,7 @@
 #include "opt_multiprocessor.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.50 2022/03/17 08:08:03 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.51 2022/05/14 07:11:23 hgutch Exp $");
 
 #include 
 #include 
@@ -339,8 +339,6 @@ prom_map_phys(paddr_t paddr, off_t size,
 		cell_t vaddr;
 		cell_t phys_hi;
 		cell_t phys_lo;
-		cell_t status;
-		cell_t retaddr;
 	} args;
 
 	if (mmuh == -1 && ((mmuh = get_mmu_handle()) == -1)) {
@@ -349,7 +347,7 @@ prom_map_phys(paddr_t paddr, off_t size,
 	}
 	args.name = ADR2CELL(&"call-method");
 	args.nargs = 7;
-	args.nreturns = 1;
+	args.nreturns = 0;
 	args.method = ADR2CELL(&"map");
 	args.ihandle = HDL2CELL(mmuh);
 	args.mode = mode;
@@ -360,9 +358,7 @@ prom_map_phys(paddr_t paddr, off_t size,
 
 	if (openfirmware(&args) == -1)
 		return -1;
-	if (args.status)
-		return -1;
-	return (int)args.retaddr;
+	return 0;
 }
 
 



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

2023-02-07 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Tue Feb  7 14:11:16 UTC 2023

Modified Files:
src/sys/arch/sparc64/include: vmparam.h

Log Message:
Avoid using (1<<64)-1 for VM_MAX{,USER}_ADDRESS as rounding that up to
the next page boundary gives 0 and instead make the VA space end one
page earlier.

Fixes PR sparc64/57219.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/sparc64/include/vmparam.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/sparc64/include/vmparam.h
diff -u src/sys/arch/sparc64/include/vmparam.h:1.42 src/sys/arch/sparc64/include/vmparam.h:1.43
--- src/sys/arch/sparc64/include/vmparam.h:1.42	Fri Feb 26 02:01:16 2021
+++ src/sys/arch/sparc64/include/vmparam.h	Tue Feb  7 14:11:16 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: vmparam.h,v 1.42 2021/02/26 02:01:16 simonb Exp $ */
+/*	$NetBSD: vmparam.h,v 1.43 2023/02/07 14:11:16 hgutch Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -176,8 +176,8 @@
  * User/kernel map constants.
  */
 #define VM_MIN_ADDRESS		((vaddr_t)0)
-#define VM_MAX_ADDRESS		((vaddr_t)-1)
-#define VM_MAXUSER_ADDRESS	((vaddr_t)-1)
+#define VM_MAX_ADDRESS		(((vaddr_t)(-1))&~PGOFSET)
+#define VM_MAXUSER_ADDRESS	VM_MAX_ADDRESS
 #define VM_MAXUSER_ADDRESS32	((vaddr_t)(0xL&~PGOFSET))
 
 #define VM_MIN_KERNEL_ADDRESS	((vaddr_t)KERNBASE)



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

2023-02-07 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Tue Feb  7 14:11:16 UTC 2023

Modified Files:
src/sys/arch/sparc64/include: vmparam.h

Log Message:
Avoid using (1<<64)-1 for VM_MAX{,USER}_ADDRESS as rounding that up to
the next page boundary gives 0 and instead make the VA space end one
page earlier.

Fixes PR sparc64/57219.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/sparc64/include/vmparam.h

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



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

2022-06-25 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat Jun 25 17:46:05 UTC 2022

Modified Files:
src/external/gpl3/gdb/dist/gdb: location.c
src/external/gpl3/gdb/dist/gdbsupport: common-defs.h

Log Message:
Cherry-picking two upstream commits[1,2] to fix tools build under gcc 12
if MKCROSSGDB is set.  Without these, gcc 12 correctly points out that
certain checkr for pointers being NULL are always false and errors out
due to -Werror=nonnull-compare/-Werror=address (implicitly set by -Wall).

Build failure reported by Piyush Sachdeva.

[1] 
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=fb6262e8534e0148a4a424e9e5138159af19faf1;hp=f681e5867de63f1c8ca692023cf86e4c884fdae7
[2] 
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=da7ee7f9ce2fc8c278a46e0b360d44319a5a1e7a;hp=cb2e519a5e41052a4dd55be4f1c4d818d2e8af9d


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/gpl3/gdb/dist/gdb/location.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdbsupport/common-defs.h

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



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

2022-06-25 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat Jun 25 17:46:05 UTC 2022

Modified Files:
src/external/gpl3/gdb/dist/gdb: location.c
src/external/gpl3/gdb/dist/gdbsupport: common-defs.h

Log Message:
Cherry-picking two upstream commits[1,2] to fix tools build under gcc 12
if MKCROSSGDB is set.  Without these, gcc 12 correctly points out that
certain checkr for pointers being NULL are always false and errors out
due to -Werror=nonnull-compare/-Werror=address (implicitly set by -Wall).

Build failure reported by Piyush Sachdeva.

[1] 
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=fb6262e8534e0148a4a424e9e5138159af19faf1;hp=f681e5867de63f1c8ca692023cf86e4c884fdae7
[2] 
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=da7ee7f9ce2fc8c278a46e0b360d44319a5a1e7a;hp=cb2e519a5e41052a4dd55be4f1c4d818d2e8af9d


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/gpl3/gdb/dist/gdb/location.c
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gdb/dist/gdbsupport/common-defs.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/gdb/dist/gdb/location.c
diff -u src/external/gpl3/gdb/dist/gdb/location.c:1.1.1.4 src/external/gpl3/gdb/dist/gdb/location.c:1.2
--- src/external/gpl3/gdb/dist/gdb/location.c:1.1.1.4	Tue Sep 15 01:43:31 2020
+++ src/external/gpl3/gdb/dist/gdb/location.c	Sat Jun 25 17:46:05 2022
@@ -960,12 +960,11 @@ event_location_empty_p (const struct eve
   return 0;
 
 case EXPLICIT_LOCATION:
-  return (EL_EXPLICIT (location) == NULL
-	  || (EL_EXPLICIT (location)->source_filename == NULL
-		  && EL_EXPLICIT (location)->function_name == NULL
-		  && EL_EXPLICIT (location)->label_name == NULL
-		  && (EL_EXPLICIT (location)->line_offset.sign
-		  == LINE_OFFSET_UNKNOWN)));
+  return (EL_EXPLICIT (location)->source_filename == NULL
+	  && EL_EXPLICIT (location)->function_name == NULL
+	  && EL_EXPLICIT (location)->label_name == NULL
+	  && (EL_EXPLICIT (location)->line_offset.sign
+		  == LINE_OFFSET_UNKNOWN));
 
 case PROBE_LOCATION:
   return EL_PROBE (location) == NULL;

Index: src/external/gpl3/gdb/dist/gdbsupport/common-defs.h
diff -u src/external/gpl3/gdb/dist/gdbsupport/common-defs.h:1.1.1.1 src/external/gpl3/gdb/dist/gdbsupport/common-defs.h:1.2
--- src/external/gpl3/gdb/dist/gdbsupport/common-defs.h:1.1.1.1	Tue Sep 15 01:43:49 2020
+++ src/external/gpl3/gdb/dist/gdbsupport/common-defs.h	Sat Jun 25 17:46:05 2022
@@ -110,6 +110,81 @@
 #undef ATTRIBUTE_PRINTF
 #define ATTRIBUTE_PRINTF _GL_ATTRIBUTE_FORMAT_PRINTF
 
+/* This is defined by ansidecl.h, but we disable the attribute.
+
+   Say a developer starts out with:
+   ...
+   extern void foo (void *ptr) __atttribute__((nonnull (1)));
+   void foo (void *ptr) {}
+   ...
+   with the idea in mind to catch:
+   ...
+   foo (nullptr);
+   ...
+   at compile time with -Werror=nonnull, and then adds:
+   ...
+void foo (void *ptr) {
+   +  gdb_assert (ptr != nullptr);
+}
+   ...
+   to catch:
+   ...
+   foo (variable_with_nullptr_value);
+   ...
+   at runtime as well.
+
+   Said developer then verifies that the assert works (using -O0), and commits
+   the code.
+
+   Some other developer then checks out the code and accidentally writes some
+   variant of:
+   ...
+   foo (variable_with_nullptr_value);
+   ...
+   and builds with -O2, and ... the assert doesn't trigger, because it's
+   optimized away by gcc.
+
+   There's no suppported recipe to prevent the assertion from being optimized
+   away (other than: build with -O0, or remove the nonnull attribute).  Note
+   that -fno-delete-null-pointer-checks does not help.  A patch was submitted
+   to improve gcc documentation to point this out more clearly (
+   https://gcc.gnu.org/pipermail/gcc-patches/2021-July/576218.html ).  The
+   patch also mentions a possible workaround that obfuscates the pointer
+   using:
+   ...
+void foo (void *ptr) {
+   +  asm ("" : "+r"(ptr));
+  gdb_assert (ptr != nullptr);
+}
+   ...
+   but that still requires the developer to manually add this in all cases
+   where that's necessary.
+
+   A warning was added to detect the situation: -Wnonnull-compare, which does
+   help in detecting those cases, but each new gcc release may indicate a new
+   batch of locations that needs fixing, which means we've added a maintenance
+   burden.
+
+   We could try to deal with the problem more proactively by introducing a
+   gdb_assert variant like:
+   ...
+   void gdb_assert_non_null (void *ptr) {
+  asm ("" : "+r"(ptr));
+  gdb_assert (ptr != nullptr);
+}
+void foo (void *ptr) {
+  gdb_assert_nonnull (ptr);
+}
+   ...
+   and make it a coding style to use it everywhere, but again, maintenance
+   burden.
+
+   With all these things considered, for now we go with the solution with the
+   least maintenance burden:

CVS commit: src/distrib/amd64/liveimage/emuimage

2022-07-13 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Wed Jul 13 18:51:03 UTC 2022

Modified Files:
src/distrib/amd64/liveimage/emuimage: rc.conf.emuimage

Log Message:
Check for right sysctl node to make live image work OOTB on OpenStack:

  machdep.dmi.system-product = OpenStack Compute


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/distrib/amd64/liveimage/emuimage/rc.conf.emuimage

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



CVS commit: src/distrib/amd64/liveimage/emuimage

2022-07-13 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Wed Jul 13 18:51:03 UTC 2022

Modified Files:
src/distrib/amd64/liveimage/emuimage: rc.conf.emuimage

Log Message:
Check for right sysctl node to make live image work OOTB on OpenStack:

  machdep.dmi.system-product = OpenStack Compute


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/distrib/amd64/liveimage/emuimage/rc.conf.emuimage

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

Modified files:

Index: src/distrib/amd64/liveimage/emuimage/rc.conf.emuimage
diff -u src/distrib/amd64/liveimage/emuimage/rc.conf.emuimage:1.1 src/distrib/amd64/liveimage/emuimage/rc.conf.emuimage:1.2
--- src/distrib/amd64/liveimage/emuimage/rc.conf.emuimage:1.1	Sat Jul 24 16:13:44 2021
+++ src/distrib/amd64/liveimage/emuimage/rc.conf.emuimage	Wed Jul 13 18:51:03 2022
@@ -1,4 +1,4 @@
-# $NetBSD: rc.conf.emuimage,v 1.1 2021/07/24 16:13:44 jmcneill Exp $
+# $NetBSD: rc.conf.emuimage,v 1.2 2022/07/13 18:51:03 hgutch Exp $
 
 is_ec2() {
 	val=NO
@@ -6,6 +6,7 @@ is_ec2() {
 	for node in machdep.dmi.system-vendor \
 		machdep.dmi.system-version \
 		machdep.dmi.bios-version \
+		machdep.dmi.system-product \
 		machdep.xen.version ; do
 		if /sbin/sysctl -q $node; then
 			nodeval="$(/sbin/sysctl -n $node | tr '[A-Z]' '[a-z]')"



CVS commit: src/libexec/telnetd

2022-08-26 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Fri Aug 26 22:01:20 UTC 2022

Modified Files:
src/libexec/telnetd: utility.c

Log Message:
Fix CVE-2020-10188


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/libexec/telnetd/utility.c

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



CVS commit: src/libexec/telnetd

2022-08-26 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Fri Aug 26 22:01:20 UTC 2022

Modified Files:
src/libexec/telnetd: utility.c

Log Message:
Fix CVE-2020-10188


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/libexec/telnetd/utility.c

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

Modified files:

Index: src/libexec/telnetd/utility.c
diff -u src/libexec/telnetd/utility.c:1.33 src/libexec/telnetd/utility.c:1.34
--- src/libexec/telnetd/utility.c:1.33	Mon Feb  4 04:36:41 2019
+++ src/libexec/telnetd/utility.c	Fri Aug 26 22:01:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: utility.c,v 1.33 2019/02/04 04:36:41 mrg Exp $	*/
+/*	$NetBSD: utility.c,v 1.34 2022/08/26 22:01:20 hgutch Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)utility.c	8.4 (Berkeley) 5/30/95";
 #else
-__RCSID("$NetBSD: utility.c,v 1.33 2019/02/04 04:36:41 mrg Exp $");
+__RCSID("$NetBSD: utility.c,v 1.34 2022/08/26 22:01:20 hgutch Exp $");
 #endif
 #endif /* not lint */
 
@@ -43,7 +43,7 @@ __RCSID("$NetBSD: utility.c,v 1.33 2019/
 #define PRINTOPTIONS
 #include "telnetd.h"
 
-char *nextitem(char *);
+char *nextitem(char *, const char *);
 void putstr(char *);
 
 extern int not42;
@@ -143,31 +143,38 @@ ptyflush(void)
  * character.
  */
 char *
-nextitem(char *current)
+nextitem(char *current, const char *endp)
 {
+if (current >= endp) {
+	return NULL;
+}
 if ((*current&0xff) != IAC) {
 	return current+1;
 }
+if (current+1 >= endp) {
+	return NULL;
+}
 switch (*(current+1)&0xff) {
 case DO:
 case DONT:
 case WILL:
 case WONT:
-	return current+3;
+	return current+3 <= endp ? current+3 : NULL;
 case SB:		/* loop forever looking for the SE */
 	{
 	char *look = current+2;
 
-	for (;;) {
+	while (look < endp) {
 		if ((*look++&0xff) == IAC) {
-		if ((*look++&0xff) == SE) {
+		if (look < endp && (*look++&0xff) == SE) {
 			return look;
 		}
 		}
 	}
+	return NULL;
 	}
 default:
-	return current+2;
+	return current+2 <= endp ? current+2 : NULL;
 }
 }  /* end of nextitem */
 
@@ -194,7 +201,7 @@ netclear(void)
 char *thisitem, *next;
 char *good;
 #define	wewant(p)	((nfrontp > p) && ((*p&0xff) == IAC) && \
-((*(p+1)&0xff) != EC) && ((*(p+1)&0xff) != EL))
+(nfrontp > p+1) && ((*(p+1)&0xff) != EC) && ((*(p+1)&0xff) != EL))
 
 #ifdef	ENCRYPTION
 thisitem = nclearto > netobuf ? nclearto : netobuf;
@@ -202,7 +209,7 @@ netclear(void)
 thisitem = netobuf;
 #endif	/* ENCRYPTION */
 
-while ((next = nextitem(thisitem)) <= nbackp) {
+while ((next = nextitem(thisitem, nbackp)) != NULL && (next <= nbackp)) {
 	thisitem = next;
 }
 
@@ -214,20 +221,23 @@ netclear(void)
 good = netobuf;	/* where the good bytes go */
 #endif	/* ENCRYPTION */
 
-while (nfrontp > thisitem) {
+while ((thisitem != NULL) && (nfrontp > thisitem)) {
 	if (wewant(thisitem)) {
 	int length;
 
 	next = thisitem;
 	do {
-		next = nextitem(next);
-	} while (wewant(next) && (nfrontp > next));
+		next = nextitem(next, nfrontp);
+	} while ((next != NULL) && wewant(next) && (nfrontp > next));
+	if (next == NULL) {
+		next = nfrontp;
+	}
 	length = next-thisitem;
 	memmove(good, thisitem, length);
 	good += length;
 	thisitem = next;
 	} else {
-	thisitem = nextitem(thisitem);
+	thisitem = nextitem(thisitem, nfrontp);
 	}
 }
 



CVS commit: src

2022-08-28 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sun Aug 28 10:48:17 UTC 2022

Modified Files:
src/bin/csh: csh.1
src/bin/expr: expr.1
src/external/bsd/flex/bin: flex.1
src/lib/libc/string: strlcpy.3
src/sbin/disklabel: disklabel.5
src/share/man/man4: unix.4
src/share/man/man4/man4.sun2: leds.4
src/share/man/man4/man4.sun3: leds.4
src/usr.bin/head: head.1
src/usr.bin/mkstr: mkstr.1
src/usr.bin/tail: tail.1

Log Message:
Change back various occurrences of \*[Le], \*[Ge] (less/greater equal)
and \*(ua (upwards arrow) to literal "<=", ">=" and "^" whenever
appropriate (e.g., in code examples).


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/bin/csh/csh.1
cvs rdiff -u -r1.37 -r1.38 src/bin/expr/expr.1
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/flex/bin/flex.1
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/string/strlcpy.3
cvs rdiff -u -r1.30 -r1.31 src/sbin/disklabel/disklabel.5
cvs rdiff -u -r1.28 -r1.29 src/share/man/man4/unix.4
cvs rdiff -u -r1.10 -r1.11 src/share/man/man4/man4.sun2/leds.4
cvs rdiff -u -r1.13 -r1.14 src/share/man/man4/man4.sun3/leds.4
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/head/head.1
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/mkstr/mkstr.1
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/tail/tail.1

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

Modified files:

Index: src/bin/csh/csh.1
diff -u src/bin/csh/csh.1:1.56 src/bin/csh/csh.1:1.57
--- src/bin/csh/csh.1:1.56	Sat Jul  9 21:19:44 2022
+++ src/bin/csh/csh.1	Sun Aug 28 10:48:15 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: csh.1,v 1.56 2022/07/09 21:19:44 uwe Exp $
+.\"	$NetBSD: csh.1,v 1.57 2022/08/28 10:48:15 hgutch Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -476,7 +476,7 @@ nest.)
 This `!' may be preceded by a `\e' to prevent its special meaning; for
 convenience, an `!' is passed unchanged when it is followed by a blank,
 tab, newline, `=' or `('.
-(History substitutions also occur when an input line begins with `\*(ua'.
+(History substitutions also occur when an input line begins with `^'.
 This special abbreviation will be described later.)
 Any input line that contains history substitution is echoed on the terminal
 before it is executed as it would have been typed without history substitution.
@@ -530,7 +530,7 @@ first (command) word
 .It Ar n
 .Ar n Ns 'th
 argument
-.It \*(ua
+.It ^
 first argument,  i.e., `1'
 .It $
 last argument
@@ -544,7 +544,7 @@ range of words
 abbreviates
 .Ar `\&0\-y\'
 .It *
-abbreviates `\*(ua\-$', or nothing if only 1 word in event
+abbreviates `^\-$', or nothing if only 1 word in event
 .It Ar x*
 abbreviates
 .Ar `x\-$\'
@@ -555,7 +555,7 @@ but omitting word `$'
 .El
 .Pp
 The `:' separating the event specification from the word designator
-can be omitted if the argument selector begins with a `\*(ua', `$', `*',
+can be omitted if the argument selector begins with a `^', `$', `*',
 `\-' or `%'.
 After the optional word designator can be
 placed a sequence of modifiers, each preceded by a `:'.
@@ -624,14 +624,14 @@ A history reference may be given without
 Here, the reference is to the previous command unless a previous
 history reference occurred on the same line in which case this form repeats
 the previous reference.
-Thus `!?foo?\*(ua !$' gives the first and last arguments
+Thus `!?foo?^ !$' gives the first and last arguments
 from the command matching `?foo?'.
 .Pp
 A special abbreviation of a history reference occurs when the first
-non-blank character of an input line is a `\*(ua'.
-This is equivalent to `!:s\*(ua' providing a convenient
+non-blank character of an input line is a `^'.
+This is equivalent to `!:s^' providing a convenient
 shorthand for substitutions on the text of the previous line.
-Thus `\*(ualb\*(ualib' fixes the spelling of
+Thus `^lb^lib' fixes the spelling of
 `lib'
 in the previous command.
 Finally, a history substitution may be surrounded with `{' and `}'
@@ -669,7 +669,7 @@ left unchanged.
 .Pp
 Thus if the alias for `ls' is `ls \-l' the command `ls /usr' would map to
 `ls \-l /usr', the argument list here being undisturbed.
-Similarly if the alias for `lookup' was `grep !\*(ua /etc/passwd' then
+Similarly if the alias for `lookup' was `grep !^ /etc/passwd' then
 `lookup bill' would map to `grep bill /etc/passwd'.
 .Pp
 If an alias is found, the word transformation of the input text
@@ -987,12 +987,12 @@ and
 commands.
 The following operators are available:
 .Bd -ragged -offset indent
-\&|\&|  &&  \&| \*(ua  &  ==  !=  =~  !~  \*[Le]  \*[Ge]
+\&|\&|  &&  \&|  ^  &  ==  !=  =~  !~  <=  >=
 <  > <<  >>  +  \-  *  /  %  !  ~  (  )
 .Ed
 .Pp
 Here the precedence increases to the right,
-`==' `!=' `=~' and `!~', `\*[Le]' `\*[Ge]' `<'
+`==' `!=' `=~' and `!~', `<=' `>=' `<'
 and `>', `<<' and `>>', `+' and `\-',
 `*' `/' and `%' being, in grou

CVS commit: src

2022-08-28 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sun Aug 28 10:48:17 UTC 2022

Modified Files:
src/bin/csh: csh.1
src/bin/expr: expr.1
src/external/bsd/flex/bin: flex.1
src/lib/libc/string: strlcpy.3
src/sbin/disklabel: disklabel.5
src/share/man/man4: unix.4
src/share/man/man4/man4.sun2: leds.4
src/share/man/man4/man4.sun3: leds.4
src/usr.bin/head: head.1
src/usr.bin/mkstr: mkstr.1
src/usr.bin/tail: tail.1

Log Message:
Change back various occurrences of \*[Le], \*[Ge] (less/greater equal)
and \*(ua (upwards arrow) to literal "<=", ">=" and "^" whenever
appropriate (e.g., in code examples).


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/bin/csh/csh.1
cvs rdiff -u -r1.37 -r1.38 src/bin/expr/expr.1
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/flex/bin/flex.1
cvs rdiff -u -r1.13 -r1.14 src/lib/libc/string/strlcpy.3
cvs rdiff -u -r1.30 -r1.31 src/sbin/disklabel/disklabel.5
cvs rdiff -u -r1.28 -r1.29 src/share/man/man4/unix.4
cvs rdiff -u -r1.10 -r1.11 src/share/man/man4/man4.sun2/leds.4
cvs rdiff -u -r1.13 -r1.14 src/share/man/man4/man4.sun3/leds.4
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/head/head.1
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/mkstr/mkstr.1
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/tail/tail.1

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



Re: CVS commit: src

2022-08-28 Thread Harold Gutch
Hi,

On Sun, Aug 28, 2022 at 03:26:28PM +0300, Valery Ushakov wrote:
> On Sun, Aug 28, 2022 at 10:48:17 +0000, Harold Gutch wrote:
> 
> > Change back various occurrences of \*[Le], \*[Ge] (less/greater equal)
> > and \*(ua (upwards arrow) to literal "<=", ">=" and "^" whenever
> > appropriate (e.g., in code examples).
> 
> Thanks.  Using your commit as a pretext (and in no way intended as
> censure) ...
> 
> I wonder if we should switch to consistently use \(ha (a groff
> extension also understood by heirloom) for ascii circumflex.  Troff
> turns plain ^ into circumflex accent which is visually very small and
> you cannot find it, obviously, when you search pdf output for "^".

No strong opinion here - my test case earlier was "man csh" when
LC_CTYPE=en_US.UTF-8 where \*(ua renders an actual error.  Both ^ and
\ha render a caret here, so no objection from my side to such a
change.


> Check out e.g.
> 
>   groff -Tps -mandoc csh.1 > csh.ps && ps2pdf csh.ps csh.pdf
> 
> (that postscript output has a lot of other problems, b/c examples are
> not in monospaced font, etc, which makes the ^ size problem even worse
> visually).

At least on macOS (and using pstopdf from there), \ha seems like a 
small improvement over ^ in that Preview now actually finds
occurrences of ^ if you search for it.  It doesn't highlight the
carets but it now returns the pages with one on it (it doesn't find
the pages only containing ones that come from a ^ in the source).


  Harold


CVS commit: src/sys/dev/usb

2024-01-13 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat Jan 13 14:42:14 UTC 2024

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add Microsoft Sculpt Wireless keyboard/mouse.

>From M. Boerschig in PR 57845.


To generate a diff of this commit:
cvs rdiff -u -r1.812 -r1.813 src/sys/dev/usb/usbdevs

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

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.812 src/sys/dev/usb/usbdevs:1.813
--- src/sys/dev/usb/usbdevs:1.812	Sat Jan  6 00:24:07 2024
+++ src/sys/dev/usb/usbdevs	Sat Jan 13 14:42:14 2024
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.812 2024/01/06 00:24:07 maya Exp $
+$NetBSD: usbdevs,v 1.813 2024/01/13 14:42:14 hgutch Exp $
 
 /*-
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -2368,6 +2368,7 @@ product MICROSOFT 24GHZ_XCVR10		0x071d	2
 product MICROSOFT 24GHZ_XCVR20		0x071f	2.4GHz Transceiver V2.0
 product MICROSOFT 24GHZ_XCVR70		0x0745	2.4GHz Transceiver V7.0
 product MICROSOFT 24GHZ_XCVR80		0x07b2	2.4GHz Transceiver V8.0
+product MICROSOFT 24GHZ_XCVR90		0x07a5	2.4GHz Transceiver V9.0
 product MICROSOFT CM6000		0x077d	Comfort Mouse 6000
 
 



CVS commit: src/sys/dev/usb

2024-01-13 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat Jan 13 14:42:14 UTC 2024

Modified Files:
src/sys/dev/usb: usbdevs

Log Message:
Add Microsoft Sculpt Wireless keyboard/mouse.

>From M. Boerschig in PR 57845.


To generate a diff of this commit:
cvs rdiff -u -r1.812 -r1.813 src/sys/dev/usb/usbdevs

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



CVS commit: src/sys/dev/usb

2024-01-13 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat Jan 13 15:22:41 UTC 2024

Modified Files:
src/sys/dev/usb: usbdevs.h usbdevs_data.h

Log Message:
Regen


To generate a diff of this commit:
cvs rdiff -u -r1.804 -r1.805 src/sys/dev/usb/usbdevs.h \
src/sys/dev/usb/usbdevs_data.h

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



CVS commit: src/sys/dev/usb

2024-01-13 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat Jan 13 15:26:36 UTC 2024

Modified Files:
src/sys/dev/usb: ums.c

Log Message:
Add workaround for Microsoft Sculpt Wireless keyboard/mouse.

>From M. Boerschig in PR 57845.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/usb/ums.c

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



CVS commit: src/sys/dev/usb

2024-01-13 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat Jan 13 15:26:36 UTC 2024

Modified Files:
src/sys/dev/usb: ums.c

Log Message:
Add workaround for Microsoft Sculpt Wireless keyboard/mouse.

>From M. Boerschig in PR 57845.


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/sys/dev/usb/ums.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/dev/usb/ums.c
diff -u src/sys/dev/usb/ums.c:1.104 src/sys/dev/usb/ums.c:1.105
--- src/sys/dev/usb/ums.c:1.104	Thu Jul 20 20:00:34 2023
+++ src/sys/dev/usb/ums.c	Sat Jan 13 15:26:36 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: ums.c,v 1.104 2023/07/20 20:00:34 mrg Exp $	*/
+/*	$NetBSD: ums.c,v 1.105 2024/01/13 15:26:36 hgutch Exp $	*/
 
 /*
  * Copyright (c) 1998, 2017 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.104 2023/07/20 20:00:34 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.105 2024/01/13 15:26:36 hgutch Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -224,6 +224,7 @@ ums_attach(device_t parent, device_t sel
 			fixpos = 24;
 			break;
 		case USB_PRODUCT_MICROSOFT_24GHZ_XCVR80:
+		case USB_PRODUCT_MICROSOFT_24GHZ_XCVR90:
 			fixpos = 40;
 			woffset = sc->sc_ms.hidms_loc_z.size;
 			break;



CVS commit: src/sys/arch/evbppc/wii/dev

2024-01-27 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat Jan 27 17:44:37 UTC 2024

Modified Files:
src/sys/arch/evbppc/wii/dev: wiifb.c

Log Message:
Add support for "PAL" (576i) mode on Wii.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbppc/wii/dev/wiifb.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/evbppc/wii/dev/wiifb.c
diff -u src/sys/arch/evbppc/wii/dev/wiifb.c:1.4 src/sys/arch/evbppc/wii/dev/wiifb.c:1.5
--- src/sys/arch/evbppc/wii/dev/wiifb.c:1.4	Tue Jan 23 00:13:37 2024
+++ src/sys/arch/evbppc/wii/dev/wiifb.c	Sat Jan 27 17:44:37 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: wiifb.c,v 1.4 2024/01/23 00:13:37 jmcneill Exp $ */
+/* $NetBSD: wiifb.c,v 1.5 2024/01/27 17:44:37 hgutch Exp $ */
 
 /*-
  * Copyright (c) 2024 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wiifb.c,v 1.4 2024/01/23 00:13:37 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wiifb.c,v 1.5 2024/01/27 17:44:37 hgutch Exp $");
 
 #include 
 #include 
@@ -86,6 +86,13 @@ static const struct wiifb_mode wiifb_mod
 		.height = 480,
 		.lines = 525,
 	},
+	[WIIFB_MODE_INDEX(VI_DCR_FMT_PAL, 1)] = {
+		.name = "PAL 576i",
+		.width = 640,
+		.height = 574,
+		.lines = 625,
+	},
+
 };
 #define WIIFB_NMODES	__arraycount(wiifb_modes)
 
@@ -229,6 +236,15 @@ wiifb_set_mode(struct wiifb_softc *sc, u
 		WR4(sc, VI_VTE, 0x00060030);
 		WR4(sc, VI_BBOI, 0x81d881d8);
 		WR4(sc, VI_BBEI, 0x81d881d8);
+	} else if (modeidx == WIIFB_MODE_INDEX(VI_DCR_FMT_PAL, 1)) {
+		/* PAL 576i */
+		WR2(sc, VI_VTR, 0x11f5);
+		WR4(sc, VI_HTR0, 0x4b6a01b0);
+		WR4(sc, VI_HTR1, 0x02f85640);
+		WR4(sc, VI_VTO, 0x00010023);
+		WR4(sc, VI_VTE, 0x0024);
+		WR4(sc, VI_BBOI, 0x4d2b4d6d);
+		WR4(sc, VI_BBEI, 0x4d8a4d4c);
 	} else {
 		/*
 		 * Display mode is not supported. Blink the slot LED to



CVS commit: src/sys/arch/evbppc/wii/dev

2024-01-27 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat Jan 27 17:44:37 UTC 2024

Modified Files:
src/sys/arch/evbppc/wii/dev: wiifb.c

Log Message:
Add support for "PAL" (576i) mode on Wii.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbppc/wii/dev/wiifb.c

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



CVS commit: src

2023-04-27 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Thu Apr 27 20:55:27 UTC 2023

Modified Files:
src/distrib/sets/lists/comp: md.amd64
src/external/gpl3/binutils/usr.bin/ld: Makefile

Log Message:
Unbreak creation of i386 PIEs on amd64.

Functional patch by RVP;  set lists updated accordingly.

This fixes PR toolchain/57380.


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.38 -r1.39 src/external/gpl3/binutils/usr.bin/ld/Makefile

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



CVS commit: src

2023-04-27 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Thu Apr 27 20:55:27 UTC 2023

Modified Files:
src/distrib/sets/lists/comp: md.amd64
src/external/gpl3/binutils/usr.bin/ld: Makefile

Log Message:
Unbreak creation of i386 PIEs on amd64.

Functional patch by RVP;  set lists updated accordingly.

This fixes PR toolchain/57380.


To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.38 -r1.39 src/external/gpl3/binutils/usr.bin/ld/Makefile

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/comp/md.amd64
diff -u src/distrib/sets/lists/comp/md.amd64:1.295 src/distrib/sets/lists/comp/md.amd64:1.296
--- src/distrib/sets/lists/comp/md.amd64:1.295	Mon Jan  9 14:37:50 2023
+++ src/distrib/sets/lists/comp/md.amd64	Thu Apr 27 20:55:27 2023
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.295 2023/01/09 14:37:50 christos Exp $
+# $NetBSD: md.amd64,v 1.296 2023/04/27 20:55:27 hgutch Exp $
 ./usr/include/amd64comp-c-include
 ./usr/include/amd64/ansi.h			comp-c-include
 ./usr/include/amd64/aout_machdep.h		comp-c-include
@@ -1440,30 +1440,44 @@
 ./usr/libdata/ldscripts/elf_i386.xce		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_i386.xd		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_i386.xdc		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_i386.xdce		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_i386.xde		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_i386.xdw		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_i386.xdwe		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_i386.xe		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_i386.xn		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_i386.xr		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_i386.xs		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_i386.xsc		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_i386.xsce		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_i386.xse		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_i386.xsw		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_i386.xswe		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_i386.xu		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_i386.xw		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_i386.xwe		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.x		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xbn		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xc		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xce		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xd		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xdc		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_iamcu.xdce		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_iamcu.xde		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xdw		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_iamcu.xdwe		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_iamcu.xe		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xn		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xr		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xs		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xsc		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xsce		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_iamcu.xse		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xsw		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_iamcu.xswe		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xu		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_iamcu.xw		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_iamcu.xwe		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_k1om.x		comp-obsolete	obsolete,binutils=239
 ./usr/libdata/ldscripts/elf_k1om.x		comp-util-bin		binutils=234
 ./usr/libdata/ldscripts/elf_k1om.xbn		comp-obsolete	obsolete,binutils=239
@@ -1523,15 +1537,22 @@
 ./usr/libdata/ldscripts/elf_x86_64.xce		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_x86_64.xd		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_x86_64.xdc		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_x86_64.xdce		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_x86_64.xde		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_x86_64.xdw		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_x86_64.xdwe		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_x86_64.xe		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_x86_64.xn		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_x86_64.xr		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_x86_64.xs		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_x86_64.xsc		comp-util-bin		binutils
 ./usr/libdata/ldscripts/elf_x86_64.xsce		comp-util-bin		binutils
+./usr/libdata/ldscripts/elf_x86_64.xse		comp-util-bin		binutils
 ./usr/libdata/ldscrip

CVS commit: src/usr.bin/script

2023-05-09 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Tue May  9 15:43:39 UTC 2023

Modified Files:
src/usr.bin/script: script.c

Log Message:
Reset SIGCHLD handler to SIG_DFL.

If run with "-c", both child and parent script processes will handle
SIGCHLD resulting in a possible duplicate "Script done" line in the
output.  This fixes bin/54514.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/script/script.c

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



CVS commit: src/usr.bin/script

2023-05-09 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Tue May  9 15:43:39 UTC 2023

Modified Files:
src/usr.bin/script: script.c

Log Message:
Reset SIGCHLD handler to SIG_DFL.

If run with "-c", both child and parent script processes will handle
SIGCHLD resulting in a possible duplicate "Script done" line in the
output.  This fixes bin/54514.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.bin/script/script.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/script/script.c
diff -u src/usr.bin/script/script.c:1.33 src/usr.bin/script/script.c:1.34
--- src/usr.bin/script/script.c:1.33	Sun Feb 13 19:40:14 2022
+++ src/usr.bin/script/script.c	Tue May  9 15:43:39 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: script.c,v 1.33 2022/02/13 19:40:14 christos Exp $	*/
+/*	$NetBSD: script.c,v 1.34 2023/05/09 15:43:39 hgutch Exp $	*/
 
 /*
  * Copyright (c) 1980, 1992, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)script.c	8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: script.c,v 1.33 2022/02/13 19:40:14 christos Exp $");
+__RCSID("$NetBSD: script.c,v 1.34 2023/05/09 15:43:39 hgutch Exp $");
 #endif /* not lint */
 
 #include 
@@ -192,6 +192,7 @@ main(int argc, char *argv[])
 		fail();
 	}
 	if (child == 0) {
+		(void)xsignal(SIGCHLD, SIG_DFL);
 		subchild = child = fork();
 		if (child == -1) {
 			warn("fork");



CVS commit: src/crypto/external/bsd/openssl/lib

2023-05-27 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat May 27 20:51:22 UTC 2023

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto: Makefile
src/crypto/external/bsd/openssl/lib/libssl: Makefile

Log Message:
Explicitly run openssl's "gen" script in a shell

The script has permissions 755 in the repo but ends up with permissions
644 in the source sets, therefore we cannot invoke it simply as
path/to/gen .


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 \
src/crypto/external/bsd/openssl/lib/libcrypto/Makefile
cvs rdiff -u -r1.17 -r1.18 \
src/crypto/external/bsd/openssl/lib/libssl/Makefile

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



CVS commit: src/crypto/external/bsd/openssl/lib

2023-05-27 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sat May 27 20:51:22 UTC 2023

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto: Makefile
src/crypto/external/bsd/openssl/lib/libssl: Makefile

Log Message:
Explicitly run openssl's "gen" script in a shell

The script has permissions 755 in the repo but ends up with permissions
644 in the source sets, therefore we cannot invoke it simply as
path/to/gen .


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 \
src/crypto/external/bsd/openssl/lib/libcrypto/Makefile
cvs rdiff -u -r1.17 -r1.18 \
src/crypto/external/bsd/openssl/lib/libssl/Makefile

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

Modified files:

Index: src/crypto/external/bsd/openssl/lib/libcrypto/Makefile
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/Makefile:1.32 src/crypto/external/bsd/openssl/lib/libcrypto/Makefile:1.33
--- src/crypto/external/bsd/openssl/lib/libcrypto/Makefile:1.32	Thu May 25 19:12:06 2023
+++ src/crypto/external/bsd/openssl/lib/libcrypto/Makefile	Sat May 27 20:51:22 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2023/05/25 19:12:06 riastradh Exp $
+#	$NetBSD: Makefile,v 1.33 2023/05/27 20:51:22 hgutch Exp $
 
 # RCSid:
 #	Id: Makefile,v 1.33 1998/11/11 11:53:53 sjg Exp
@@ -279,7 +279,7 @@ x509v3.h
 .for i in ${GENH}
 $i: $i.in
 	${_MKTARGET_CREATE}
-	${.CURDIR}/gen ${.ALLSRC} > ${.TARGET}
+	${HOST_SH} ${.CURDIR}/gen ${.ALLSRC} > ${.TARGET}
 .endfor
 
 .include 

Index: src/crypto/external/bsd/openssl/lib/libssl/Makefile
diff -u src/crypto/external/bsd/openssl/lib/libssl/Makefile:1.17 src/crypto/external/bsd/openssl/lib/libssl/Makefile:1.18
--- src/crypto/external/bsd/openssl/lib/libssl/Makefile:1.17	Thu May 25 19:12:06 2023
+++ src/crypto/external/bsd/openssl/lib/libssl/Makefile	Sat May 27 20:51:22 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2023/05/25 19:12:06 riastradh Exp $
+#	$NetBSD: Makefile,v 1.18 2023/05/27 20:51:22 hgutch Exp $
 
 # RCSid:
 #	Id: Makefile,v 1.33 1998/11/11 11:53:53 sjg Exp
@@ -58,7 +58,7 @@ ssl.h
 .for i in ${GENH}
 $i: $i.in
 	${_MKTARGET_CREATE}
-	${.CURDIR}/../libcrypto/gen ${.ALLSRC} > ${.TARGET}
+	${HOST_SH} ${.CURDIR}/../libcrypto/gen ${.ALLSRC} > ${.TARGET}
 .endfor
 
 .include 



CVS commit: src

2023-05-30 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Tue May 30 19:05:05 UTC 2023

Modified Files:
src/external/apache2/llvm/autoconf/include/llvm/Config: config.h.in
src/tools/llvm-lib/libLLVMSupport: Makefile

Log Message:
Fix LLVM build with host gcc 13

Building LLVM with a host gcc 13 fails and suggests including 
in external/apache2/llvm/dist/llvm/include/llvm/Support/Signals.h .
Instead of this, joerg@ suggested not modifying the llvm vendor branch
but instead working around this in our LLVM build infrastructure.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/apache2/llvm/autoconf/include/llvm/Config/config.h.in
cvs rdiff -u -r1.1 -r1.2 src/tools/llvm-lib/libLLVMSupport/Makefile

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



CVS commit: src

2023-05-30 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Tue May 30 19:05:05 UTC 2023

Modified Files:
src/external/apache2/llvm/autoconf/include/llvm/Config: config.h.in
src/tools/llvm-lib/libLLVMSupport: Makefile

Log Message:
Fix LLVM build with host gcc 13

Building LLVM with a host gcc 13 fails and suggests including 
in external/apache2/llvm/dist/llvm/include/llvm/Support/Signals.h .
Instead of this, joerg@ suggested not modifying the llvm vendor branch
but instead working around this in our LLVM build infrastructure.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/apache2/llvm/autoconf/include/llvm/Config/config.h.in
cvs rdiff -u -r1.1 -r1.2 src/tools/llvm-lib/libLLVMSupport/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/apache2/llvm/autoconf/include/llvm/Config/config.h.in
diff -u src/external/apache2/llvm/autoconf/include/llvm/Config/config.h.in:1.2 src/external/apache2/llvm/autoconf/include/llvm/Config/config.h.in:1.3
--- src/external/apache2/llvm/autoconf/include/llvm/Config/config.h.in:1.2	Sun May 30 01:56:46 2021
+++ src/external/apache2/llvm/autoconf/include/llvm/Config/config.h.in	Tue May 30 19:05:04 2023
@@ -3,6 +3,10 @@
 #ifndef CONFIG_H
 #define CONFIG_H
 
+#ifdef __cplusplus
+#include 
+#endif
+
 /* Exported configuration */
 #include "llvm/Config/llvm-config.h"
 

Index: src/tools/llvm-lib/libLLVMSupport/Makefile
diff -u src/tools/llvm-lib/libLLVMSupport/Makefile:1.1 src/tools/llvm-lib/libLLVMSupport/Makefile:1.2
--- src/tools/llvm-lib/libLLVMSupport/Makefile:1.1	Sun Feb  6 01:14:16 2011
+++ src/tools/llvm-lib/libLLVMSupport/Makefile	Tue May 30 19:05:05 2023
@@ -1,3 +1,5 @@
-#	$NetBSD: Makefile,v 1.1 2011/02/06 01:14:16 joerg Exp $
+#	$NetBSD: Makefile,v 1.2 2023/05/30 19:05:05 hgutch Exp $
+
+CPPFLAGS.Signals.cpp+=	-include llvm/Config/config.h
 
 .include 



CVS commit: src/usr.bin/calendar/calendars

2023-06-09 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Fri Jun  9 20:27:29 UTC 2023

Modified Files:
src/usr.bin/calendar/calendars: calendar.netbsd

Log Message:
Add riscv port

Took the date of the first public announcement on port-riscv
of something usable (qemu).


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/calendar/calendars/calendar.netbsd

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



CVS commit: src/usr.bin/calendar/calendars

2023-06-09 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Fri Jun  9 20:27:29 UTC 2023

Modified Files:
src/usr.bin/calendar/calendars: calendar.netbsd

Log Message:
Add riscv port

Took the date of the first public announcement on port-riscv
of something usable (qemu).


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/calendar/calendars/calendar.netbsd

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/calendar/calendars/calendar.netbsd
diff -u src/usr.bin/calendar/calendars/calendar.netbsd:1.48 src/usr.bin/calendar/calendars/calendar.netbsd:1.49
--- src/usr.bin/calendar/calendars/calendar.netbsd:1.48	Sun Aug  7 19:37:15 2022
+++ src/usr.bin/calendar/calendars/calendar.netbsd	Fri Jun  9 20:27:28 2023
@@ -45,6 +45,7 @@
 05/12   NetBSD 1.4 released, 1999
 05/12   NetBSD/hp300 port started, 1993
 05/12	NetBSD 9.2 released, 2021
+05/13   NetBSD/riscv port started, 2023
 05/14   NetBSD/cesfic port started, 2001
 05/15   NetBSD/macppc port started, 1998
 05/20   NetBSD 1.2.1 released, 1997



CVS commit: src/external/gpl3/gcc.old/dist/gcc/cp

2024-04-24 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Wed Apr 24 16:48:30 UTC 2024

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/cp: cfns.h

Log Message:
Fix gcc build on FreeBSD 14 (and possibly other systems using clang >= 16).

Pointed out by Eirik Øverby.

OK mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/cp/cfns.h

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



CVS commit: src/external/gpl3/gcc.old/dist/gcc/cp

2024-04-24 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Wed Apr 24 16:48:30 UTC 2024

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/cp: cfns.h

Log Message:
Fix gcc build on FreeBSD 14 (and possibly other systems using clang >= 16).

Pointed out by Eirik Øverby.

OK mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/external/gpl3/gcc.old/dist/gcc/cp/cfns.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.old/dist/gcc/cp/cfns.h
diff -u src/external/gpl3/gcc.old/dist/gcc/cp/cfns.h:1.11 src/external/gpl3/gcc.old/dist/gcc/cp/cfns.h:1.12
--- src/external/gpl3/gcc.old/dist/gcc/cp/cfns.h:1.11	Mon Feb 20 02:11:23 2023
+++ src/external/gpl3/gcc.old/dist/gcc/cp/cfns.h	Wed Apr 24 16:48:29 2024
@@ -60,7 +60,7 @@ public:
 };
 
 inline unsigned int
-libc_name::hash (register const char *str, register unsigned int len)
+libc_name::hash (const char *str, unsigned int len)
 {
   static const unsigned short asso_values[] =
 {
@@ -91,7 +91,7 @@ libc_name::hash (register const char *st
   1488, 1488, 1488, 1488, 1488, 1488, 1488, 1488, 1488, 1488,
   1488, 1488, 1488, 1488, 1488, 1488, 1488
 };
-  register int hval = len;
+  int hval = len;
 
   switch (hval)
 {
@@ -118,7 +118,7 @@ libc_name::hash (register const char *st
 }
 
 const struct libc_name_struct *
-libc_name::libc_name_p (register const char *str, register unsigned int len)
+libc_name::libc_name_p (const char *str, unsigned int len)
 {
   enum
 {
@@ -1116,15 +1116,15 @@ libc_name::libc_name_p (register const c
 
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
 {
-  register int key = hash (str, len);
+  int key = hash (str, len);
 
   if (key <= MAX_HASH_VALUE && key >= 0)
 {
-  register int index = lookup[key];
+  int index = lookup[key];
 
   if (index >= 0)
 {
-  register const char *s = wordlist[index].name;
+  const char *s = wordlist[index].name;
 
   if (*str == *s && !strcmp (str + 1, s + 1))
 return &wordlist[index];



CVS commit: src/share/mk

2024-06-15 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sun Jun 16 00:03:53 UTC 2024

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

Log Message:
Unbreak generation of share/info/dir

install-info refuses to operate on 0 byte files.  When __infoinstall
is run the first time in a build, an empty ${INFODIRFILE} is created
via touch.  As install-info leaves this file untouched, we are left
with a 0 byte file at the end.  For subsequent __infostall runs the
only difference is that ${INFODIRFILE} already exists as a 0 byte
file, so no new one is created.

Fix by deleting ${INFODIRFILE} in the loop (with the lock held) if it
is a 0 byte file.  In this case also don't bother with calling
install-info -r.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/share/mk/bsd.info.mk

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



CVS commit: src/share/mk

2024-06-15 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sun Jun 16 00:03:53 UTC 2024

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

Log Message:
Unbreak generation of share/info/dir

install-info refuses to operate on 0 byte files.  When __infoinstall
is run the first time in a build, an empty ${INFODIRFILE} is created
via touch.  As install-info leaves this file untouched, we are left
with a 0 byte file at the end.  For subsequent __infostall runs the
only difference is that ${INFODIRFILE} already exists as a 0 byte
file, so no new one is created.

Fix by deleting ${INFODIRFILE} in the loop (with the lock held) if it
is a 0 byte file.  In this case also don't bother with calling
install-info -r.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/share/mk/bsd.info.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.info.mk
diff -u src/share/mk/bsd.info.mk:1.43 src/share/mk/bsd.info.mk:1.44
--- src/share/mk/bsd.info.mk:1.43	Mon May  1 20:22:18 2023
+++ src/share/mk/bsd.info.mk	Sun Jun 16 00:03:52 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.info.mk,v 1.43 2023/05/01 20:22:18 christos Exp $
+#	$NetBSD: bsd.info.mk,v 1.44 2024/06/16 00:03:52 hgutch Exp $
 
 .include 
 
@@ -45,6 +45,8 @@ __infoinstall: .USE
 	@[ -f ${INFODIRFILE} ] || touch ${INFODIRFILE}; 		\
 	while ! ln ${INFODIRFILE} ${INFODIRFILE}.lock 2> /dev/null;	\
 		do sleep 1; done;	\
+	[ $$(${TOOL_STAT} -qf '%z' ${INFODIRFILE}) -eq 0 ] && 		\
+	rm -f ${INFODIRFILE} || 	\
 	${TOOL_INSTALL_INFO} -d ${INFODIRFILE} -r ${.TARGET} 2> /dev/null; \
 	${TOOL_INSTALL_INFO} -d ${INFODIRFILE} ${.TARGET};		\
 	${TOOL_SORTINFO} < ${INFODIRFILE} > ${INFODIRFILE}.tmp;		\



CVS commit: src/external/gpl3

2024-06-15 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sun Jun 16 00:12:33 UTC 2024

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/doc: gcc.info gcc.texi
src/external/gpl3/gcc/dist/gcc/doc: gcc.info gcc.texi

Log Message:
Fix broken gcc.info file

sortinfo (called during builds in order to sort share/info/dir) trips over
this linebreak and leaves a broken file behind.  As a result, share/info/dir
is effectively cleared out when installing gcc.info and at the end of the
build will only contain whatever got added after gcc.info.

With this, the "man" set is reproducible again.

Fixes PR/58336.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gcc.old/dist/gcc/doc/gcc.info
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gcc.old/dist/gcc/doc/gcc.texi
cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gcc/dist/gcc/doc/gcc.info
cvs rdiff -u -r1.1.1.13 -r1.2 src/external/gpl3/gcc/dist/gcc/doc/gcc.texi

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



CVS commit: src/external/gpl3

2024-06-15 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sun Jun 16 00:12:33 UTC 2024

Modified Files:
src/external/gpl3/gcc.old/dist/gcc/doc: gcc.info gcc.texi
src/external/gpl3/gcc/dist/gcc/doc: gcc.info gcc.texi

Log Message:
Fix broken gcc.info file

sortinfo (called during builds in order to sort share/info/dir) trips over
this linebreak and leaves a broken file behind.  As a result, share/info/dir
is effectively cleared out when installing gcc.info and at the end of the
build will only contain whatever got added after gcc.info.

With this, the "man" set is reproducible again.

Fixes PR/58336.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/external/gpl3/gcc.old/dist/gcc/doc/gcc.info
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gcc.old/dist/gcc/doc/gcc.texi
cvs rdiff -u -r1.17 -r1.18 src/external/gpl3/gcc/dist/gcc/doc/gcc.info
cvs rdiff -u -r1.1.1.13 -r1.2 src/external/gpl3/gcc/dist/gcc/doc/gcc.texi

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.old/dist/gcc/doc/gcc.info
diff -u src/external/gpl3/gcc.old/dist/gcc/doc/gcc.info:1.14 src/external/gpl3/gcc.old/dist/gcc/doc/gcc.info:1.15
--- src/external/gpl3/gcc.old/dist/gcc/doc/gcc.info:1.14	Fri Jul 14 19:46:29 2023
+++ src/external/gpl3/gcc.old/dist/gcc/doc/gcc.info	Sun Jun 16 00:12:32 2024
@@ -26,8 +26,7 @@ START-INFO-DIR-ENTRY
 * gcov: (gcc) Gcov.'gcov'--a test coverage program.
 * gcov-tool: (gcc) Gcov-tool.  'gcov-tool'--an offline gcda profile processing program.
 * gcov-dump: (gcc) Gcov-dump.  'gcov-dump'--an offline gcda and gcno profile dump tool.
-* lto-dump: (gcc) lto-dump.'lto-dump'--Tool for
-dumping LTO object files.
+* lto-dump: (gcc) lto-dump.'lto-dump'--Tool for dumping LTO object files.
 END-INFO-DIR-ENTRY
 
  This file documents the use of the GNU compilers.

Index: src/external/gpl3/gcc.old/dist/gcc/doc/gcc.texi
diff -u src/external/gpl3/gcc.old/dist/gcc/doc/gcc.texi:1.12 src/external/gpl3/gcc.old/dist/gcc/doc/gcc.texi:1.13
--- src/external/gpl3/gcc.old/dist/gcc/doc/gcc.texi:1.12	Mon Feb 20 02:11:24 2023
+++ src/external/gpl3/gcc.old/dist/gcc/doc/gcc.texi	Sun Jun 16 00:12:32 2024
@@ -68,8 +68,7 @@ Texts being (a) (see below), and with th
 * gcov: (gcc) Gcov.@command{gcov}---a test coverage program.
 * gcov-tool: (gcc) Gcov-tool.  @command{gcov-tool}---an offline gcda profile processing program.
 * gcov-dump: (gcc) Gcov-dump.  @command{gcov-dump}---an offline gcda and gcno profile dump tool.
-* lto-dump: (gcc) lto-dump.@command{lto-dump}---Tool for
-dumping LTO object files.
+* lto-dump: (gcc) lto-dump.@command{lto-dump}---Tool for dumping LTO object files.
 @end direntry
 This file documents the use of the GNU compilers.
 @sp 1

Index: src/external/gpl3/gcc/dist/gcc/doc/gcc.info
diff -u src/external/gpl3/gcc/dist/gcc/doc/gcc.info:1.17 src/external/gpl3/gcc/dist/gcc/doc/gcc.info:1.18
--- src/external/gpl3/gcc/dist/gcc/doc/gcc.info:1.17	Sun Jul 30 05:51:33 2023
+++ src/external/gpl3/gcc/dist/gcc/doc/gcc.info	Sun Jun 16 00:12:32 2024
@@ -26,8 +26,7 @@ START-INFO-DIR-ENTRY
 * gcov: (gcc) Gcov.'gcov'--a test coverage program.
 * gcov-tool: (gcc) Gcov-tool.  'gcov-tool'--an offline gcda profile processing program.
 * gcov-dump: (gcc) Gcov-dump.  'gcov-dump'--an offline gcda and gcno profile dump tool.
-* lto-dump: (gcc) lto-dump.'lto-dump'--Tool for
-dumping LTO object files.
+* lto-dump: (gcc) lto-dump.'lto-dump'--Tool for dumping LTO object files.
 END-INFO-DIR-ENTRY
 
  This file documents the use of the GNU compilers.

Index: src/external/gpl3/gcc/dist/gcc/doc/gcc.texi
diff -u src/external/gpl3/gcc/dist/gcc/doc/gcc.texi:1.1.1.13 src/external/gpl3/gcc/dist/gcc/doc/gcc.texi:1.2
--- src/external/gpl3/gcc/dist/gcc/doc/gcc.texi:1.1.1.13	Sun Jul 30 05:21:02 2023
+++ src/external/gpl3/gcc/dist/gcc/doc/gcc.texi	Sun Jun 16 00:12:33 2024
@@ -68,8 +68,7 @@ Texts being (a) (see below), and with th
 * gcov: (gcc) Gcov.@command{gcov}---a test coverage program.
 * gcov-tool: (gcc) Gcov-tool.  @command{gcov-tool}---an offline gcda profile processing program.
 * gcov-dump: (gcc) Gcov-dump.  @command{gcov-dump}---an offline gcda and gcno profile dump tool.
-* lto-dump: (gcc) lto-dump.@command{lto-dump}---Tool for
-dumping LTO object files.
+* lto-dump: (gcc) lto-dump.@command{lto-dump}---Tool for dumping LTO object files.
 @end direntry
 This file documents the use of the GNU compilers.
 @sp 1



CVS commit: src/share/mk

2024-06-16 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sun Jun 16 21:11:53 UTC 2024

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

Log Message:
Simplify test for 0 byte file size

pointed out by kre@


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/share/mk/bsd.info.mk

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



CVS commit: src/share/mk

2024-06-16 Thread Harold Gutch
Module Name:src
Committed By:   hgutch
Date:   Sun Jun 16 21:11:53 UTC 2024

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

Log Message:
Simplify test for 0 byte file size

pointed out by kre@


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/share/mk/bsd.info.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.info.mk
diff -u src/share/mk/bsd.info.mk:1.44 src/share/mk/bsd.info.mk:1.45
--- src/share/mk/bsd.info.mk:1.44	Sun Jun 16 00:03:52 2024
+++ src/share/mk/bsd.info.mk	Sun Jun 16 21:11:53 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.info.mk,v 1.44 2024/06/16 00:03:52 hgutch Exp $
+#	$NetBSD: bsd.info.mk,v 1.45 2024/06/16 21:11:53 hgutch Exp $
 
 .include 
 
@@ -45,8 +45,7 @@ __infoinstall: .USE
 	@[ -f ${INFODIRFILE} ] || touch ${INFODIRFILE}; 		\
 	while ! ln ${INFODIRFILE} ${INFODIRFILE}.lock 2> /dev/null;	\
 		do sleep 1; done;	\
-	[ $$(${TOOL_STAT} -qf '%z' ${INFODIRFILE}) -eq 0 ] && 		\
-	rm -f ${INFODIRFILE} || 	\
+	! [ -s ${INFODIRFILE} ] && rm -f ${INFODIRFILE} ||		\
 	${TOOL_INSTALL_INFO} -d ${INFODIRFILE} -r ${.TARGET} 2> /dev/null; \
 	${TOOL_INSTALL_INFO} -d ${INFODIRFILE} ${.TARGET};		\
 	${TOOL_SORTINFO} < ${INFODIRFILE} > ${INFODIRFILE}.tmp;		\