CVS commit: src/usr.bin/rpcgen

2024-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 21:31:35 UTC 2024

Modified Files:
src/usr.bin/rpcgen: rpc_svcout.c

Log Message:
Add prototype for the foo_freeresult() functions used in the thread-safe
versions of the code (Anthony Mallet)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/rpcgen/rpc_svcout.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/rpcgen/rpc_svcout.c
diff -u src/usr.bin/rpcgen/rpc_svcout.c:1.31 src/usr.bin/rpcgen/rpc_svcout.c:1.32
--- src/usr.bin/rpcgen/rpc_svcout.c:1.31	Sat Nov  7 20:59:31 2015
+++ src/usr.bin/rpcgen/rpc_svcout.c	Tue Jun 18 17:31:35 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: rpc_svcout.c,v 1.31 2015/11/08 01:59:31 christos Exp $	*/
+/*	$NetBSD: rpc_svcout.c,v 1.32 2024/06/18 21:31:35 christos Exp $	*/
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  * unrestricted use provided that this legend is included on all tape
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)rpc_svcout.c 1.29 89/03/30 (C) 1987 SMI";
 #else
-__RCSID("$NetBSD: rpc_svcout.c,v 1.31 2015/11/08 01:59:31 christos Exp $");
+__RCSID("$NetBSD: rpc_svcout.c,v 1.32 2024/06/18 21:31:35 christos Exp $");
 #endif
 #endif
 
@@ -353,7 +353,18 @@ write_program(definition *def, const cha
 		pvname(def->def_name, vp->vers_num);
 		f_print(fout, "(struct svc_req *%s, ", RQSTP);
 		f_print(fout, "SVCXPRT *%s);\n", TRANSP);
+
+		if (Mflag) {
+			if (storage != NULL) {
+f_print(fout, "%s ", storage);
+			}
+			f_print(fout, "int ");
+			pvname(def->def_name, vp->vers_num);
+			f_print(fout, "_freeresult"
+			"(SVCXPRT *, xdrproc_t, caddr_t);\n");
+		}
 		f_print(fout, "\n");
+
 		if (storage != NULL) {
 			f_print(fout, "%s ", storage);
 		}



CVS commit: src/usr.bin/rpcgen

2024-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 21:31:35 UTC 2024

Modified Files:
src/usr.bin/rpcgen: rpc_svcout.c

Log Message:
Add prototype for the foo_freeresult() functions used in the thread-safe
versions of the code (Anthony Mallet)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/rpcgen/rpc_svcout.c

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



CVS commit: src/doc

2024-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 19:41:08 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
mention the expsym files


To generate a diff of this commit:
cvs rdiff -u -r1.2013 -r1.2014 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.2013 src/doc/3RDPARTY:1.2014
--- src/doc/3RDPARTY:1.2013	Tue Jun 18 13:29:15 2024
+++ src/doc/3RDPARTY	Tue Jun 18 15:41:08 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.2013 2024/06/18 17:29:15 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.2014 2024/06/18 19:41:08 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1143,8 +1143,8 @@ Notes:
 - configure and build after importing in the import directory
 - check the generated files against the ones in the include directory
   and merge changes
-- copy the toplevel libFOO.ld files to our foo.map linker files (the legacy.ld
-  is in providers/)
+- copy the toplevel libFOO.ld files to our FOO.map linker files (the legacy.ld
+  is in providers/), and sync the FOO.expsym files if there were changes
 - run make in /usr/src/crypto/external/bsd/openssl/lib/libcrypto/man
   to regen man pages.
 - run make in /usr/src/crypto/external/bsd/openssl/lib/libcrypto/arch/*



CVS commit: src/doc

2024-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 19:41:08 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
mention the expsym files


To generate a diff of this commit:
cvs rdiff -u -r1.2013 -r1.2014 src/doc/3RDPARTY

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



CVS commit: src/share/man/man9

2024-06-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jun 18 19:10:50 UTC 2024

Modified Files:
src/share/man/man9: atomic_loadstore.9

Log Message:
atomic_loadstore(9): Clarify relation to __HAVE_ATOMIC64_OPS.

PR kern/58340


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man9/atomic_loadstore.9

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



CVS commit: src/share/man/man9

2024-06-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jun 18 19:10:50 UTC 2024

Modified Files:
src/share/man/man9: atomic_loadstore.9

Log Message:
atomic_loadstore(9): Clarify relation to __HAVE_ATOMIC64_OPS.

PR kern/58340


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man9/atomic_loadstore.9

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

Modified files:

Index: src/share/man/man9/atomic_loadstore.9
diff -u src/share/man/man9/atomic_loadstore.9:1.7 src/share/man/man9/atomic_loadstore.9:1.8
--- src/share/man/man9/atomic_loadstore.9:1.7	Sat Apr  9 23:32:53 2022
+++ src/share/man/man9/atomic_loadstore.9	Tue Jun 18 19:10:50 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: atomic_loadstore.9,v 1.7 2022/04/09 23:32:53 riastradh Exp $
+.\"	$NetBSD: atomic_loadstore.9,v 1.8 2024/06/18 19:10:50 riastradh Exp $
 .\"
 .\" Copyright (c) 2019 The NetBSD Foundation
 .\" All rights reserved.
@@ -544,9 +544,10 @@ must be zero.
 .Pp
 All
 .Nx
-ports support atomic loads and stores on units of data up to 32 bits.
-Some ports additionally support atomic loads and stores on larger
-quantities, like 64-bit quantities, if
+ports support cheap atomic loads and stores on units of data up to 32
+bits.
+Some ports additionally support cheap atomic loads and stores on
+64-bit quantities if
 .Dv __HAVE_ATOMIC64_LOADSTORE
 is defined.
 The macros are not allowed on larger quantities of data than the port
@@ -587,6 +588,24 @@ must be conditional on
 	...
 	mutex_exit(&foo->f_lock);
 .Ed
+.Pp
+Some ports support expensive 64-bit atomic read/modify/write
+operations, but not cheap 64-bit atomic loads and stores.
+For example, the armv7 instruction set includes 64-bit
+.Li ldrexd
+and
+.Li strexd
+loops (load-exclusive, store-conditional) which are atomic on 64-bit
+quantities.
+But the cheap 64-bit
+.Li ldrd / strd
+instructions are only atomic on 32-bit accesses at a time.
+These ports define
+.Dv __HAVE_ATOMIC64_OPS
+but not
+.Dv __HAVE_ATOMIC64_LOADSTORE ,
+since they do not have cheaper 64-bit atomic load/store operations than
+the full atomic read/modify/write operations.
 .Sh C11 COMPATIBILITY
 These macros are meant to follow
 .Tn C11



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

2024-06-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jun 18 18:58:22 UTC 2024

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto: crypto.expsym

Log Message:
openssl: Update crypto.expsym for new symbol.

Since ld doesn't verify any symbols listed in crypto.map are actually
defined in the library, we have crypto.expsym as a separate check
which must be updated when we do export new symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/openssl/lib/libcrypto/crypto.expsym

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/crypto.expsym
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/crypto.expsym:1.1 src/crypto/external/bsd/openssl/lib/libcrypto/crypto.expsym:1.2
--- src/crypto/external/bsd/openssl/lib/libcrypto/crypto.expsym:1.1	Wed Mar 20 13:50:51 2024
+++ src/crypto/external/bsd/openssl/lib/libcrypto/crypto.expsym	Tue Jun 18 18:58:22 2024
@@ -2755,6 +2755,7 @@ OCSP_url_svcloc_new@@OPENSSL_3.0.0
 OPENSSL_3.0.0
 OPENSSL_3.0.3
 OPENSSL_3.0.8
+OPENSSL_3.0.9
 OPENSSL_DIR_end@@OPENSSL_3.0.0
 OPENSSL_DIR_read@@OPENSSL_3.0.0
 OPENSSL_INIT_free@@OPENSSL_3.0.0
@@ -2919,6 +2920,7 @@ OSSL_CMP_MSG_get_bodytype@@OPENSSL_3.0.0
 OSSL_CMP_MSG_http_perform@@OPENSSL_3.0.0
 OSSL_CMP_MSG_it@@OPENSSL_3.0.0
 OSSL_CMP_MSG_read@@OPENSSL_3.0.0
+OSSL_CMP_MSG_update_recipNonce@@OPENSSL_3.0.9
 OSSL_CMP_MSG_update_transactionID@@OPENSSL_3.0.0
 OSSL_CMP_MSG_write@@OPENSSL_3.0.0
 OSSL_CMP_PKIHEADER_free@@OPENSSL_3.0.0



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

2024-06-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jun 18 18:58:22 UTC 2024

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto: crypto.expsym

Log Message:
openssl: Update crypto.expsym for new symbol.

Since ld doesn't verify any symbols listed in crypto.map are actually
defined in the library, we have crypto.expsym as a separate check
which must be updated when we do export new symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/openssl/lib/libcrypto/crypto.expsym

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



CVS commit: src/doc

2024-06-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jun 18 18:55:32 UTC 2024

Modified Files:
src/doc: HACKS

Log Message:
doc/HACKS: Note tsan TLS alignment workaround for PR lib/58349.


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/doc/HACKS

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

Modified files:

Index: src/doc/HACKS
diff -u src/doc/HACKS:1.245 src/doc/HACKS:1.246
--- src/doc/HACKS:1.245	Sun Jun  9 18:55:40 2024
+++ src/doc/HACKS	Tue Jun 18 18:55:32 2024
@@ -1,4 +1,4 @@
-# $NetBSD: HACKS,v 1.245 2024/06/09 18:55:40 mrg Exp $
+# $NetBSD: HACKS,v 1.246 2024/06/18 18:55:32 riastradh Exp $
 #
 # This file is intended to document workarounds for currently unsolved
 # (mostly) compiler bugs.
@@ -1150,3 +1150,17 @@ descr
 	I suspect a GCC bug.
 	The blake2 version is less well studied.
 kcah
+
+hack	gcc: work around alignment limitations in ld.elf_so
+cdate	Mon Jun 17 23:35:52 UTC 2024
+who	riastradh
+file	external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors_posix.cpp : 1.4
+file	src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.cpp : 1.4
+file	external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h : 1.5
+descr
+	ld.elf_so only supports 2*pointer-aligned objects (typically
+	8- or 16-byte) in thread-local storage, but tsan expects
+	cacheline-aligned objects (typically >=64-byte).  To work
+	around this, allocate n + 63 bytes and pick whichever pointer
+	in that interval is aligned (PR lib/58349).
+kcah



CVS commit: src/doc

2024-06-18 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jun 18 18:55:32 UTC 2024

Modified Files:
src/doc: HACKS

Log Message:
doc/HACKS: Note tsan TLS alignment workaround for PR lib/58349.


To generate a diff of this commit:
cvs rdiff -u -r1.245 -r1.246 src/doc/HACKS

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/libcrypto

2024-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 17:31:17 UTC 2024

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto: crypto.map

Log Message:
sync with latest


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/openssl/lib/libcrypto/crypto.map

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/libcrypto

2024-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 17:31:17 UTC 2024

Modified Files:
src/crypto/external/bsd/openssl/lib/libcrypto: crypto.map

Log Message:
sync with latest


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/crypto/external/bsd/openssl/lib/libcrypto/crypto.map

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/crypto.map
diff -u src/crypto/external/bsd/openssl/lib/libcrypto/crypto.map:1.12 src/crypto/external/bsd/openssl/lib/libcrypto/crypto.map:1.13
--- src/crypto/external/bsd/openssl/lib/libcrypto/crypto.map:1.12	Sat May  6 13:07:22 2023
+++ src/crypto/external/bsd/openssl/lib/libcrypto/crypto.map	Tue Jun 18 13:31:17 2024
@@ -5382,5 +5382,9 @@ OPENSSL_3.0.3 {
 OPENSSL_3.0.8 {
 global:
 OSSL_CMP_CTX_reset_geninfo_ITAVs;
-local: *;
 } OPENSSL_3.0.3;
+OPENSSL_3.0.9 {
+global:
+OSSL_CMP_MSG_update_recipNonce;
+local: *;
+} OPENSSL_3.0.8;



CVS commit: src/doc

2024-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 17:29:15 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
More OpenSSL import notes


To generate a diff of this commit:
cvs rdiff -u -r1.2012 -r1.2013 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.2012 src/doc/3RDPARTY:1.2013
--- src/doc/3RDPARTY:1.2012	Tue Jun 11 22:26:13 2024
+++ src/doc/3RDPARTY	Tue Jun 18 13:29:15 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.2012 2024/06/12 02:26:13 gutteridge Exp $
+#	$NetBSD: 3RDPARTY,v 1.2013 2024/06/18 17:29:15 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1139,10 +1139,18 @@ Notes:
 - Next update to be in crypto/openssl/apache2/openssl/dist, since
   OpenSSL 3.0 was relicensed as Apache2
 - Run openssl2netbsd to get rid of the RCSID identifiers
+- import
+- configure and build after importing in the import directory
+- check the generated files against the ones in the include directory
+  and merge changes
+- copy the toplevel libFOO.ld files to our foo.map linker files (the legacy.ld
+  is in providers/)
 - run make in /usr/src/crypto/external/bsd/openssl/lib/libcrypto/man
   to regen man pages.
 - run make in /usr/src/crypto/external/bsd/openssl/lib/libcrypto/arch/*
   to regen assembly files
+- run openssl speed -evp aes-256-cbc and compare the results with the 
+  autoconf build
 
 Package:	pcc
 Version:	1.1.0.DEVEL 20160208



CVS commit: src/doc

2024-06-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Jun 18 17:29:15 UTC 2024

Modified Files:
src/doc: 3RDPARTY

Log Message:
More OpenSSL import notes


To generate a diff of this commit:
cvs rdiff -u -r1.2012 -r1.2013 src/doc/3RDPARTY

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



Re: CVS commit: src/tools/gcc

2024-06-18 Thread Greg Troxel
Taylor R Campbell  writes:

> How is the host C++ compiler supposed to know that we are asking it to
> compile C++11 and not C++98 or C++17?

The compilation line should pass --std=c++11.  Arguably, any program
that invokes a compiler and does not pass a --std is buggy.  Things only
mostly work because mostly --std=c++17 will compile C++11 programs, and
the tendency is for later compiler versions to have higher default
languages.

In pkgsrc, we have a way to add --std=foo via the wrappers,  to handle
packages that don't do this right (generally, at all).

Is that what you meant, or something else?


CVS commit: src/external/gpl3/gcc

2024-06-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jun 18 14:08:11 UTC 2024

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

Log Message:
README.gcc12: Update powerpc; everything fine for me!

MKX11=yes build succeeds with the latest fix by mrg@.
X11 server and client work just fine on my Power Mac G5.

There's no regression for full ATF runs (except for ubsan requiring
64-bit atomic ops, as reported by port-sparc/58352), for all
sub-architectures: oea, ibm4xx, and booke.

Also, no regression for pkgsrc native build, as far as I can see.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/gpl3/gcc/README.gcc12

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.gcc12
diff -u src/external/gpl3/gcc/README.gcc12:1.23 src/external/gpl3/gcc/README.gcc12:1.24
--- src/external/gpl3/gcc/README.gcc12:1.23	Sun Jun 16 21:49:22 2024
+++ src/external/gpl3/gcc/README.gcc12	Tue Jun 18 14:08:11 2024
@@ -1,4 +1,4 @@
-$NetBSD: README.gcc12,v 1.23 2024/06/16 21:49:22 skrll Exp $
+$NetBSD: README.gcc12,v 1.24 2024/06/18 14:08:11 rin Exp $
 
 
 new stuff:
@@ -57,7 +57,7 @@ mipseb		y	b	y	y	b	y		?	?	?
 mipsel		y	b	y	y	b	y		?	?	?
 mips64eb	y	b	y	y	b	y		?	?	?
 mips64el	y	b	y	y	b	y		?	?	?
-powerpc		y	y	y	y	y	b		?	?	?
+powerpc		y	y	y	y	y	y		y	y	?
 powerpc64	y	?	?	y	b	b		?	?	?
 sh3eb		y	?	y	y	b	y		?	?	?
 sh3el		y	n[20]	y	y	b	y		n[22]	?	?



CVS commit: src/external/gpl3/gcc

2024-06-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jun 18 14:08:11 UTC 2024

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

Log Message:
README.gcc12: Update powerpc; everything fine for me!

MKX11=yes build succeeds with the latest fix by mrg@.
X11 server and client work just fine on my Power Mac G5.

There's no regression for full ATF runs (except for ubsan requiring
64-bit atomic ops, as reported by port-sparc/58352), for all
sub-architectures: oea, ibm4xx, and booke.

Also, no regression for pkgsrc native build, as far as I can see.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/external/gpl3/gcc/README.gcc12

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



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

2024-06-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jun 18 13:35:26 UTC 2024

Modified Files:
src/sys/arch/evbppc/wii: mainbus.c

Log Message:
wii: mainbus_attach: Appease GCC12 -Warray-bounds

GCC12 blames pointer access to 0-th page, [0, 0xfff], with -Warray-bounds.
Silence it by `#pragma GCC` for now.

XXX
map to higher address as we done for, e.g., arm by devmap?

Thanks mrg@ for discussion.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbppc/wii/mainbus.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/mainbus.c
diff -u src/sys/arch/evbppc/wii/mainbus.c:1.3 src/sys/arch/evbppc/wii/mainbus.c:1.4
--- src/sys/arch/evbppc/wii/mainbus.c:1.3	Thu Jan 25 11:47:53 2024
+++ src/sys/arch/evbppc/wii/mainbus.c	Tue Jun 18 13:35:26 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: mainbus.c,v 1.3 2024/01/25 11:47:53 jmcneill Exp $ */
+/* $NetBSD: mainbus.c,v 1.4 2024/06/18 13:35:26 rin Exp $ */
 
 /*
  * Copyright (c) 2002, 2024 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.3 2024/01/25 11:47:53 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.4 2024/06/18 13:35:26 rin Exp $");
 
 #include 
 #include 
@@ -82,11 +82,20 @@ mainbus_attach(device_t parent, device_t
 	struct mainbus_attach_args maa;
 
 	aprint_normal(": Nintendo Wii\n");
+
+	/*
+	 * GCC 12 blames pointer reference to 0-th page, [0, 0xfff].
+	 * XXX map to higher address as done for, e.g., arm by devmap?
+	 */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
 	aprint_debug_dev(self, "mem1 0x%x, mem2 0x%x\n",
 	in32(GLOBAL_MEM1_SIZE), in32(GLOBAL_MEM2_SIZE));
 	aprint_debug_dev(self, "cpu %u, bus %u, vidmode %u\n",
 	in32(GLOBAL_CPU_SPEED), in32(GLOBAL_BUS_SPEED),
 	in32(GLOBAL_CUR_VID_MODE));
+#pragma GCC diagnostic pop
+
 	aprint_debug_dev(self, "ios version 0x%x\n", in32(GLOBAL_IOS_VERSION));
 
 	maa.maa_bst = &wii_mem_tag;



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

2024-06-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jun 18 13:35:26 UTC 2024

Modified Files:
src/sys/arch/evbppc/wii: mainbus.c

Log Message:
wii: mainbus_attach: Appease GCC12 -Warray-bounds

GCC12 blames pointer access to 0-th page, [0, 0xfff], with -Warray-bounds.
Silence it by `#pragma GCC` for now.

XXX
map to higher address as we done for, e.g., arm by devmap?

Thanks mrg@ for discussion.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/evbppc/wii/mainbus.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/aarch64/aarch64

2024-06-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jun 18 13:29:56 UTC 2024

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

Log Message:
aarch64: cpu_getmcontext32: Fix sign compare for ras_lookup(9)

Now, compare with `(void *)-1` is done for x0, instead of w0.
No binary changes except for that.

Found by WARNS=5 build (as a module).


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/aarch64/aarch64/netbsd32_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/netbsd32_machdep.c
diff -u src/sys/arch/aarch64/aarch64/netbsd32_machdep.c:1.24 src/sys/arch/aarch64/aarch64/netbsd32_machdep.c:1.25
--- src/sys/arch/aarch64/aarch64/netbsd32_machdep.c:1.24	Wed Feb  7 04:20:26 2024
+++ src/sys/arch/aarch64/aarch64/netbsd32_machdep.c	Tue Jun 18 13:29:56 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_machdep.c,v 1.24 2024/02/07 04:20:26 msaitoh Exp $	*/
+/*	$NetBSD: netbsd32_machdep.c,v 1.25 2024/06/18 13:29:56 rin Exp $	*/
 
 /*
  * Copyright (c) 2018 Ryo Shimizu
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.24 2024/02/07 04:20:26 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.25 2024/06/18 13:29:56 rin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -424,7 +424,7 @@ cpu_getmcontext32(struct lwp *l, mcontex
 {
 	struct trapframe * const tf = lwp_trapframe(l);
 	__greg32_t *gr = mcp->__gregs;
-	__greg32_t ras_pc;
+	void *ras_pc;
 
 	gr[_REG_R0]  = tf->tf_reg[0];
 	gr[_REG_R1]  = tf->tf_reg[1];
@@ -444,9 +444,9 @@ cpu_getmcontext32(struct lwp *l, mcontex
 	gr[_REG_R15] = tf->tf_pc;
 	gr[_REG_CPSR] = tf->tf_spsr;
 
-	if ((ras_pc = (__greg32_t)(uintptr_t)ras_lookup(l->l_proc,
-	(void *)(uintptr_t)gr[_REG_R15])) != -1) {
-		gr[_REG_R15] = ras_pc;
+	ras_pc = ras_lookup(l->l_proc, (void *)(uintptr_t)gr[_REG_R15]);
+	if (ras_pc != (void *)-1) {
+		gr[_REG_R15] = (__greg32_t)(uintptr_t)ras_pc;
 	}
 	*flagsp |= _UC_CPU;
 



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

2024-06-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jun 18 13:29:56 UTC 2024

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

Log Message:
aarch64: cpu_getmcontext32: Fix sign compare for ras_lookup(9)

Now, compare with `(void *)-1` is done for x0, instead of w0.
No binary changes except for that.

Found by WARNS=5 build (as a module).


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/aarch64/aarch64/netbsd32_machdep.c

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



Re: CVS commit: src/tools/gcc

2024-06-18 Thread Taylor R Campbell
> Date: Mon, 17 Jun 2024 03:01:55 +1000
> from: matthew green 
> 
> "David H. Gutteridge" writes:
> > Module Name:src
> > Committed By:   gutteridge
> > Date:   Sun Jun 16 16:03:30 UTC 2024
> >
> > tools/gcc/Makefile: force std=c++11 for GCC 12 builds
> >
> > GCC >= 11 now requires C++11 to build. Impacted individual components
> > vary whether they test for if std=c++11 is the default or has to be
> > passed. Regardless, our build infrastructure applies its own overrides.
> > Force this setting so that we can still build on NetBSD 8.x hosts (and
> > probably 7.x, too). Build tested on NetBSD 8.3.
> 
> i'm not sure i like this.  the build environment is expected to
> provide a valid compiler, and the above assumes how the compiler
> works.
> 
> if we really want to support this without user-env setup, then
> i think a confiure test (from tools/compat) would be better than
> forcing this option here directly.
> 
> (also note this is not the first time this sort of issue has
> arrived, and we always asked the build-env provider to fix it,
> but i'm not against eg, the configure test idea.)

How is the host C++ compiler supposed to know that we are asking it to
compile C++11 and not C++98 or C++17?

gcc's configure scripts search for a way to pass this information to
the host compiler (e.g., AX_CXX_COMPILE_STDCXX).  I'm fuzzy on how
these are supposed to work but it looks like maybe the existing
configure tests are not getting used for some reason.


CVS commit: src/bin/sh

2024-06-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 18 07:21:31 UTC 2024

Modified Files:
src/bin/sh: jobs.c

Log Message:
Remove the possibility that all jobs won't be cleaned up by "wait"

There was a possibility that in a wait (no options or args) not
all jobs would be cleaned up, which that should be, as such a wait
should not finish (uninterrupted) until everything else is done.

This was unlikely to happen - but it's easy to make sure it doesn't.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/bin/sh/jobs.c

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

Modified files:

Index: src/bin/sh/jobs.c
diff -u src/bin/sh/jobs.c:1.121 src/bin/sh/jobs.c:1.122
--- src/bin/sh/jobs.c:1.121	Sat Jun 15 06:07:14 2024
+++ src/bin/sh/jobs.c	Tue Jun 18 07:21:31 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: jobs.c,v 1.121 2024/06/15 06:07:14 kre Exp $	*/
+/*	$NetBSD: jobs.c,v 1.122 2024/06/18 07:21:31 kre Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)jobs.c	8.5 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: jobs.c,v 1.121 2024/06/15 06:07:14 kre Exp $");
+__RCSID("$NetBSD: jobs.c,v 1.122 2024/06/18 07:21:31 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -705,6 +705,7 @@ waitcmd(int argc, char **argv)
 	int i;
 	int any = 0;
 	int found;
+	int oldwait = 0;
 	char *pid = NULL, *fpid;
 	char **arg;
 	char idstring[20];
@@ -722,6 +723,9 @@ waitcmd(int argc, char **argv)
 		}
 	}
 
+	if (!any && *argptr == 0)
+		oldwait = 1;
+
 	if (pid != NULL) {
 		if (!validname(pid, '\0', NULL))
 			error("invalid name: -p '%s'", pid);
@@ -740,7 +744,7 @@ waitcmd(int argc, char **argv)
 	if (jobs_invalid) {
 		CTRACE(DBG_WAIT, ("builtin wait%s%s in child, invalid jobtab\n",
 		any ? " -n" : "", *argptr ? " pid..." : ""));
-		return (any || *argptr) ? 127 : 0;
+		return oldwait ? 0 : 127;
 	}
 
 	/*
@@ -919,7 +923,7 @@ waitcmd(int argc, char **argv)
 		}
 
 		/* this is to handle "wait" (no args) */
-		if (found == 0 && job->state == JOBDONE) {
+		if (oldwait && job->state == JOBDONE) {
 			VTRACE(DBG_JOBS|DBG_WAIT, ("Cleanup: %d\n", i));
 			freejob(job);
 		}



CVS commit: src/bin/sh

2024-06-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Jun 18 07:21:31 UTC 2024

Modified Files:
src/bin/sh: jobs.c

Log Message:
Remove the possibility that all jobs won't be cleaned up by "wait"

There was a possibility that in a wait (no options or args) not
all jobs would be cleaned up, which that should be, as such a wait
should not finish (uninterrupted) until everything else is done.

This was unlikely to happen - but it's easy to make sure it doesn't.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/bin/sh/jobs.c

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