CVS commit: src

2021-04-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Apr  8 22:18:27 UTC 2021

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/usr.bin/xlint: check-expect.lua
src/tests/usr.bin/xlint/lint1: Makefile t_integration.sh
src/usr.bin/xlint/lint1: err.c externs1.h lex.c
Added Files:
src/tests/usr.bin/xlint/lint1: feat_stacktrace.c feat_stacktrace.exp

Log Message:
lint: in code from included files, print stack trace

Previously, the standard NetBSD build generated several lint warnings in
lhash.h from OpenSSL, without providing any hint as to which file
actually included that header.  In cases like these, lint now interprets
the line number information in the preprocessor output from GCC to
reconstruct the exact include path to the file in question.

The program check-expect.lua had to be rewritten almost completely since
it assumed that all diagnostics would come from the main file.  In all
existing tests, this was true, but these tests did not cover all cases
that occurred in practice.  Now it records the complete location of the
diagnostic instead of just the line number.


To generate a diff of this commit:
cvs rdiff -u -r1.1037 -r1.1038 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/check-expect.lua
cvs rdiff -u -r1.39 -r1.40 src/tests/usr.bin/xlint/lint1/Makefile \
src/tests/usr.bin/xlint/lint1/t_integration.sh
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/feat_stacktrace.c \
src/tests/usr.bin/xlint/lint1/feat_stacktrace.exp
cvs rdiff -u -r1.103 -r1.104 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.101 -r1.102 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/xlint/lint1/lex.c

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1037 src/distrib/sets/lists/tests/mi:1.1038
--- src/distrib/sets/lists/tests/mi:1.1037	Mon Apr  5 02:05:47 2021
+++ src/distrib/sets/lists/tests/mi	Thu Apr  8 22:18:26 2021
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1037 2021/04/05 02:05:47 rillig Exp $
+# $NetBSD: mi,v 1.1038 2021/04/08 22:18:26 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -6181,6 +6181,8 @@
 ./usr/tests/usr.bin/xlint/lint1/d_typefun.c			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_typename_as_var.c		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_zero_sized_arrays.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/feat_stacktrace.c		tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/feat_stacktrace.exp		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_000.c			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_000.exp			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/msg_001.c			tests-usr.bin-tests	compattestfile,atf

Index: src/tests/usr.bin/xlint/check-expect.lua
diff -u src/tests/usr.bin/xlint/check-expect.lua:1.7 src/tests/usr.bin/xlint/check-expect.lua:1.8
--- src/tests/usr.bin/xlint/check-expect.lua:1.7	Mon Apr  5 01:35:34 2021
+++ src/tests/usr.bin/xlint/check-expect.lua	Thu Apr  8 22:18:27 2021
@@ -1,5 +1,5 @@
 #!  /usr/bin/lua
--- $NetBSD: check-expect.lua,v 1.7 2021/04/05 01:35:34 rillig Exp $
+-- $NetBSD: check-expect.lua,v 1.8 2021/04/08 22:18:27 rillig Exp $
 
 --[[
 
@@ -25,57 +25,67 @@ local function load_lines(fname)
   return lines
 end
 
+
 local function load_expect_comments_from_c(fname, errors)
 
   local lines = load_lines(fname)
   if lines == nil then return nil, nil end
 
-  local comment_linenos = {}
-  local comments_by_lineno = {}
-  local function add_expectation(lineno, msg)
-if comments_by_lineno[lineno] == nil then
-  table.insert(comment_linenos, lineno)
-  comments_by_lineno[lineno] = {}
+  local pp_fname = fname
+  local pp_lineno = 0
+  local comment_locations = {}
+  local comments_by_location = {}
+
+  local function add_expectation(offset, message)
+local location = ("%s(%d)"):format(pp_fname, pp_lineno + offset)
+if comments_by_location[location] == nil then
+  table.insert(comment_locations, location)
+  comments_by_location[location] = {}
 end
-local trimmed_msg = msg:match("^%s*(.-)%s*$")
-table.insert(comments_by_lineno[lineno], trimmed_msg)
+local trimmed_msg = message:match("^%s*(.-)%s*$")
+table.insert(comments_by_location[location], trimmed_msg)
   end
 
-  for lineno, line in ipairs(lines) do
+  for phys_lineno, line in ipairs(lines) do
 
 for offset, comment in line:gmatch("/%* expect([+%-]%d+): (.-) %*/") do
-  add_expectation(lineno + tonumber(offset), comment)
+  add_expectation(tonumber(offset), comment)
 end
 
 for comment in line:gmatch("/%* expect: (.-) %*/") do
-  add_expectation(line

CVS commit: src/external/bsd/elftoolchain/dist/common

2021-04-08 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Thu Apr  8 19:37:43 UTC 2021

Modified Files:
src/external/bsd/elftoolchain/dist/common: elfdefinitions.h

Log Message:
Update Elftoolchain 'common/elfdefinitions.h' to upstream r3943.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/elftoolchain/dist/common/elfdefinitions.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/bsd/elftoolchain/dist/common/elfdefinitions.h
diff -u src/external/bsd/elftoolchain/dist/common/elfdefinitions.h:1.5 src/external/bsd/elftoolchain/dist/common/elfdefinitions.h:1.6
--- src/external/bsd/elftoolchain/dist/common/elfdefinitions.h:1.5	Sun Mar  7 14:53:59 2021
+++ src/external/bsd/elftoolchain/dist/common/elfdefinitions.h	Thu Apr  8 19:37:43 2021
@@ -1,7 +1,5 @@
-/*	$NetBSD: elfdefinitions.h,v 1.5 2021/03/07 14:53:59 jkoshy Exp $	*/
-
 /*-
- * Copyright (c) 2010 Joseph Koshy
+ * Copyright (c) 2010,2021 Joseph Koshy
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,2969 +23,12 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * Id: elfdefinitions.h 3916 2020-12-12 11:26:53Z jkoshy
- */
-
-/*
- * These definitions are based on:
- * - The public specification of the ELF format as defined in the
- *   October 2009 draft of System V ABI.
- *   See: http://www.sco.com/developers/gabi/latest/ch4.intro.html
- * - The May 1998 (version 1.5) draft of "The ELF-64 object format".
- * - Processor-specific ELF ABI definitions for sparc, i386, amd64, mips,
- *   ia64, powerpc, and RISC-V processors.
- * - The "Linkers and Libraries Guide", from Sun Microsystems.
+ * Id: elfdefinitions.h 3942 2021-04-05 12:16:03Z jkoshy
  */
 
 #ifndef _ELFDEFINITIONS_H_
 #define _ELFDEFINITIONS_H_
 
-#include 
-
-/*
- * Types of capabilities.
- */
-
-#define	_ELF_DEFINE_CAPABILITIES()\
-_ELF_DEFINE_CA(CA_SUNW_NULL,	0,	"ignored")		\
-_ELF_DEFINE_CA(CA_SUNW_HW_1,	1,	"hardware capability")	\
-_ELF_DEFINE_CA(CA_SUNW_SW_1,	2,	"software capability")
-
-#undef	_ELF_DEFINE_CA
-#define	_ELF_DEFINE_CA(N, V, DESCR)	N = V ,
-enum {
-	_ELF_DEFINE_CAPABILITIES()
-	CA__LAST__
-};
-
-/*
- * Flags used with dynamic linking entries.
- */
-
-#define	_ELF_DEFINE_DYN_FLAGS()	\
-_ELF_DEFINE_DF(DF_ORIGIN,   0x1,			\
-	"object being loaded may refer to $ORIGIN")		\
-_ELF_DEFINE_DF(DF_SYMBOLIC, 0x2,			\
-	"search library for references before executable")	\
-_ELF_DEFINE_DF(DF_TEXTREL,  0x4,			\
-	"relocation entries may modify text segment")		\
-_ELF_DEFINE_DF(DF_BIND_NOW, 0x8,			\
-	"process relocation entries at load time")		\
-_ELF_DEFINE_DF(DF_STATIC_TLS,   0x10,			\
-	"uses static thread-local storage")			\
-_ELF_DEFINE_DF(DF_1_BIND_NOW,   0x1,			\
-	"process relocation entries at load time")		\
-_ELF_DEFINE_DF(DF_1_GLOBAL, 0x2,			\
-	"unused")		\
-_ELF_DEFINE_DF(DF_1_GROUP,  0x4,			\
-	"object is a member of a group")			\
-_ELF_DEFINE_DF(DF_1_NODELETE,   0x8,			\
-	"object cannot be deleted from a process")		\
-_ELF_DEFINE_DF(DF_1_LOADFLTR,   0x10,			\
-	"immediate load filtees")\
-_ELF_DEFINE_DF(DF_1_INITFIRST,  0x20,			\
-	"initialize object first")\
-_ELF_DEFINE_DF(DF_1_NOOPEN, 0x40,			\
-	"disallow dlopen()")	\
-_ELF_DEFINE_DF(DF_1_ORIGIN, 0x80,			\
-	"object being loaded may refer to $ORIGIN")		\
-_ELF_DEFINE_DF(DF_1_DIRECT, 0x100,			\
-	"direct bindings enabled")\
-_ELF_DEFINE_DF(DF_1_INTERPOSE,  0x400,			\
-	"object is interposer")	\
-_ELF_DEFINE_DF(DF_1_NODEFLIB,   0x800,			\
-	"ignore default library search path")			\
-_ELF_DEFINE_DF(DF_1_NODUMP, 0x1000,			\
-	"disallow dldump()")	\
-_ELF_DEFINE_DF(DF_1_CONFALT,0x2000,			\
-	"object is a configuration alternative")		\
-_ELF_DEFINE_DF(DF_1_ENDFILTEE,  0x4000,			\
-	"filtee terminates filter search")			\
-_ELF_DEFINE_DF(DF_1_DISPRELDNE, 0x8000,			\
-	"displacement relocation done")\
-_ELF_DEFINE_DF(DF_1_DISPRELPND, 0x1,			\
-	"displacement relocation pending")
-#undef	_ELF_DEFINE_DF
-#define	_ELF_DEFINE_DF(N, V, DESCR)	N = V ,
-enum {
-	_ELF_DEFINE_DYN_FLAGS()
-	DF__LAST__
-};
-
-
-/*
- * Dynamic linking entry types.
- */
-
-#define	_ELF_DEFINE_DYN_TYPES()		\
-_ELF_DEFINE_DT(DT_NULL, 0, "end of array")			\
-_ELF_DEFINE_DT(DT_NEEDED,   1, "names a needed library")	\
-_ELF_DEFINE_DT(DT_PLTRELSZ, 2,	\
-	"size in bytes of associated relocation entries")		\
-_ELF_DEFINE_DT(DT_PLTGOT,   3,	\
-	"address associated with the procedure linkage table")		\
-_ELF_DEFINE_DT(DT_HASH, 4,	\
-	"address of the symbol hash table")\
-_ELF_DEFINE_DT(DT_STRTAB,   5,	\
-	"address of the string table")	\
-_ELF_DEFINE_DT(DT_SYMTAB,   

CVS commit: src/tests/usr.bin/xlint/lint1

2021-04-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Apr  8 19:31:51 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_247.c

Log Message:
tests/lint: refine comment and function name in test for pointer cast

In a typical NetBSD build, there are about 100,000 lint warnings.  About
50,000 of them are warning 247.  About 38,000 of these are from OpenSSL
and may be fixed by now.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/msg_247.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_247.c
diff -u src/tests/usr.bin/xlint/lint1/msg_247.c:1.10 src/tests/usr.bin/xlint/lint1/msg_247.c:1.11
--- src/tests/usr.bin/xlint/lint1/msg_247.c:1.10	Thu Apr  8 19:20:54 2021
+++ src/tests/usr.bin/xlint/lint1/msg_247.c	Thu Apr  8 19:31:51 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_247.c,v 1.10 2021/04/08 19:20:54 rillig Exp $	*/
+/*	$NetBSD: msg_247.c,v 1.11 2021/04/08 19:31:51 rillig Exp $	*/
 # 3 "msg_247.c"
 
 // Test for message: pointer cast from '%s' to '%s' may be troublesome [247]
@@ -85,8 +85,8 @@ cast_to_void_pointer_then_to_char_pointe
  * first member.  C guarantees that the pointer to the first member is at the
  * same address as the pointer to the whole struct.
  *
- * Seen in external/mpl/bind/dist/lib/isc/mem.c for struct isc_mem and
- * isc__mem.
+ * Seen in external/mpl/bind/dist/lib/isc/mem.c for 'struct isc_mem' and
+ * 'struct isc__mem'.
  */
 
 struct counter {
@@ -101,7 +101,7 @@ struct counter_impl {
 void *allocate(void);
 
 struct counter *
-new_type_interface(void)
+counter_new(void)
 {
 	struct counter_impl *impl = allocate();
 	impl->public_part.count = 12345;



CVS commit: src

2021-04-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Apr  8 19:20:55 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_247.c msg_247.exp
src/usr.bin/xlint/lint1: tree.c

Log Message:
lint: don't warn about cast between pointers to compatible structs


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/xlint/lint1/msg_247.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_247.exp
cvs rdiff -u -r1.271 -r1.272 src/usr.bin/xlint/lint1/tree.c

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_247.c
diff -u src/tests/usr.bin/xlint/lint1/msg_247.c:1.9 src/tests/usr.bin/xlint/lint1/msg_247.c:1.10
--- src/tests/usr.bin/xlint/lint1/msg_247.c:1.9	Thu Apr  8 19:08:17 2021
+++ src/tests/usr.bin/xlint/lint1/msg_247.c	Thu Apr  8 19:20:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_247.c,v 1.9 2021/04/08 19:08:17 rillig Exp $	*/
+/*	$NetBSD: msg_247.c,v 1.10 2021/04/08 19:20:54 rillig Exp $	*/
 # 3 "msg_247.c"
 
 // Test for message: pointer cast from '%s' to '%s' may be troublesome [247]
@@ -112,7 +112,10 @@ new_type_interface(void)
 void
 counter_increment(struct counter *counter)
 {
-	/* expect+1: 247 */
+	/*
+	 * Before tree.c 1.272 from 2021-04-08, lint warned about the cast
+	 * from 'struct counter' to 'struct counter_impl'.
+	 */
 	struct counter_impl *impl = (struct counter_impl *)counter;
 	impl->saved_count = impl->public_part.count;
 	impl->public_part.count++;

Index: src/tests/usr.bin/xlint/lint1/msg_247.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_247.exp:1.6 src/tests/usr.bin/xlint/lint1/msg_247.exp:1.7
--- src/tests/usr.bin/xlint/lint1/msg_247.exp:1.6	Thu Apr  8 19:08:17 2021
+++ src/tests/usr.bin/xlint/lint1/msg_247.exp	Thu Apr  8 19:20:54 2021
@@ -1,3 +1,2 @@
 msg_247.c(31): warning: pointer cast from 'pointer to struct Other' to 'pointer to struct ' may be troublesome [247]
 msg_247.c(70): warning: pointer cast from 'pointer to struct Other' to 'pointer to signed char' may be troublesome [247]
-msg_247.c(116): warning: pointer cast from 'pointer to struct counter' to 'pointer to struct counter_impl' may be troublesome [247]

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.271 src/usr.bin/xlint/lint1/tree.c:1.272
--- src/usr.bin/xlint/lint1/tree.c:1.271	Tue Apr  6 21:59:58 2021
+++ src/usr.bin/xlint/lint1/tree.c	Thu Apr  8 19:20:54 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.271 2021/04/06 21:59:58 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.272 2021/04/08 19:20:54 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.271 2021/04/06 21:59:58 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.272 2021/04/08 19:20:54 rillig Exp $");
 #endif
 
 #include 
@@ -2023,11 +2023,22 @@ check_pointer_integer_conversion(op_t op
 }
 
 static bool
-should_warn_about_pointer_cast(const type_t *tp, tspec_t nst,
-			   const tnode_t *tn, tspec_t ost)
+should_warn_about_pointer_cast(const type_t *ntp, tspec_t nst,
+			   const tnode_t *otn, tspec_t ost)
 {
+	/*
+	 * Casting a pointer to 'struct S' to a pointer to another struct that
+	 * has 'struct S' as its first member is ok, see msg_247.c, 'struct
+	 * counter'.
+	 */
+	if (nst == STRUCT && ost == STRUCT &&
+	ntp->t_subt->t_str->sou_first_member != NULL &&
+	ntp->t_subt->t_str->sou_first_member->s_type ==
+	otn->tn_type->t_subt)
+		return false;
+
 	if (nst == STRUCT || nst == UNION)
-		if (tp->t_subt->t_str != tn->tn_type->t_subt->t_str)
+		if (ntp->t_subt->t_str != otn->tn_type->t_subt->t_str)
 			return true;
 
 	if (nst == CHAR || nst == UCHAR)



CVS commit: src/tests/usr.bin/xlint/lint1

2021-04-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Apr  8 19:08:17 UTC 2021

Modified Files:
src/tests/usr.bin/xlint/lint1: msg_247.c msg_247.exp

Log Message:
tests/lint: add test for struct pointer cast


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/xlint/lint1/msg_247.c
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_247.exp

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

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_247.c
diff -u src/tests/usr.bin/xlint/lint1/msg_247.c:1.8 src/tests/usr.bin/xlint/lint1/msg_247.c:1.9
--- src/tests/usr.bin/xlint/lint1/msg_247.c:1.8	Tue Mar 30 15:05:05 2021
+++ src/tests/usr.bin/xlint/lint1/msg_247.c	Thu Apr  8 19:08:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg_247.c,v 1.8 2021/03/30 15:05:05 rillig Exp $	*/
+/*	$NetBSD: msg_247.c,v 1.9 2021/04/08 19:08:17 rillig Exp $	*/
 # 3 "msg_247.c"
 
 // Test for message: pointer cast from '%s' to '%s' may be troublesome [247]
@@ -75,3 +75,45 @@ cast_to_void_pointer_then_to_char_pointe
 {
 	return (char *)(void *)arg;
 }
+
+
+/*
+ * When implementing types that have a public part that is exposed to the user
+ * (in this case 'struct counter') and a private part that is only visible to
+ * the implementation (in this case 'struct counter_impl'), a common
+ * implementation technique is to use a struct in which the public part is the
+ * first member.  C guarantees that the pointer to the first member is at the
+ * same address as the pointer to the whole struct.
+ *
+ * Seen in external/mpl/bind/dist/lib/isc/mem.c for struct isc_mem and
+ * isc__mem.
+ */
+
+struct counter {
+	int count;
+};
+
+struct counter_impl {
+	struct counter public_part;
+	int saved_count;
+};
+
+void *allocate(void);
+
+struct counter *
+new_type_interface(void)
+{
+	struct counter_impl *impl = allocate();
+	impl->public_part.count = 12345;
+	impl->saved_count = 12346;
+	return &impl->public_part;
+}
+
+void
+counter_increment(struct counter *counter)
+{
+	/* expect+1: 247 */
+	struct counter_impl *impl = (struct counter_impl *)counter;
+	impl->saved_count = impl->public_part.count;
+	impl->public_part.count++;
+}

Index: src/tests/usr.bin/xlint/lint1/msg_247.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_247.exp:1.5 src/tests/usr.bin/xlint/lint1/msg_247.exp:1.6
--- src/tests/usr.bin/xlint/lint1/msg_247.exp:1.5	Fri Mar 26 16:59:19 2021
+++ src/tests/usr.bin/xlint/lint1/msg_247.exp	Thu Apr  8 19:08:17 2021
@@ -1,2 +1,3 @@
 msg_247.c(31): warning: pointer cast from 'pointer to struct Other' to 'pointer to struct ' may be troublesome [247]
 msg_247.c(70): warning: pointer cast from 'pointer to struct Other' to 'pointer to signed char' may be troublesome [247]
+msg_247.c(116): warning: pointer cast from 'pointer to struct counter' to 'pointer to struct counter_impl' may be troublesome [247]



CVS commit: src/doc

2021-04-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  8 19:06:57 UTC 2021

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new services and protocols


To generate a diff of this commit:
cvs rdiff -u -r1.1789 -r1.1790 src/doc/3RDPARTY
cvs rdiff -u -r1.2792 -r1.2793 src/doc/CHANGES

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.1789 src/doc/3RDPARTY:1.1790
--- src/doc/3RDPARTY:1.1789	Tue Apr  6 23:38:50 2021
+++ src/doc/3RDPARTY	Thu Apr  8 15:06:57 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1789 2021/04/07 03:38:50 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1790 2021/04/08 19:06:57 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1458,12 +1458,13 @@ Imported to src/common/dist/zlib and sha
 Remember to run cleantags
 
 Package:	services, protocols
-Version:	2019-10-09 (services), 2017-10-13 (protocols)
-Current Vers:	2019-10-09 (services), 2017-10-13 (protocols)
+Version:	2021-04-07 (services), 2021-02-26 (protocols)
+Current Vers:	2021-04-07 (services), 2021-02-26 (protocols)
 Maintainer:	IANA
 Archive Site:	http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt (services)
 Archive Site:	http://www.iana.org/assignments/protocol-numbers/protocol-numbers.txt (protocols)
 Home Page:	http://www.iana.org/
+Date: 		2021-04-08
 Mailing List:
 Responsible:	christos
 License:	None

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2792 src/doc/CHANGES:1.2793
--- src/doc/CHANGES:1.2792	Tue Apr  6 23:38:50 2021
+++ src/doc/CHANGES	Thu Apr  8 15:06:57 2021
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2792 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2793 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -347,3 +347,5 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		[rin 20210402]
 	acpi(4): Updated ACPICA to 20210331. [christos 20210403]
 	libevent: Import libevent 2.1.12 [christos 20210406]
+	services(5), protocols(5): Pull iana-generated services and protocols.
+		[christos 20210408]



CVS commit: src/etc

2021-04-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  8 19:03:43 UTC 2021

Modified Files:
src/etc: protocols services

Log Message:
refresh with latest


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/etc/protocols
cvs rdiff -u -r1.102 -r1.103 src/etc/services

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

diffs are larger than 1MB and have been omitted


CVS commit: src/sys/dev/mca

2021-04-08 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Apr  8 17:36:33 UTC 2021

Modified Files:
src/sys/dev/mca: if_we_mca.c

Log Message:
update comment about the 'quirk' in we_mca_init_hook() - actually that is
just interrupt enable bit, so not a quirk at all; NFCI

info passed by Valery Ushakov from a guy running https://www.os2museum.com/wp/


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/mca/if_we_mca.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/mca/if_we_mca.c
diff -u src/sys/dev/mca/if_we_mca.c:1.21 src/sys/dev/mca/if_we_mca.c:1.22
--- src/sys/dev/mca/if_we_mca.c:1.21	Mon Apr 28 20:23:53 2008
+++ src/sys/dev/mca/if_we_mca.c	Thu Apr  8 17:36:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_we_mca.c,v 1.21 2008/04/28 20:23:53 martin Exp $	*/
+/*	$NetBSD: if_we_mca.c,v 1.22 2021/04/08 17:36:33 jdolecek Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_we_mca.c,v 1.21 2008/04/28 20:23:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_we_mca.c,v 1.22 2021/04/08 17:36:33 jdolecek Exp $");
 
 #include 
 #include 
@@ -302,11 +302,9 @@ void
 we_mca_init_hook(struct we_softc *wsc)
 {
 	/*
-	 * This quirk really needs to be here, at least for WD8003W/A. Without
-	 * this, the card doesn't send any interrupts in 16bit mode. The quirk
+	 * Enable interrupts. This is required for at least WD8003W/A, without
+	 * this, the card doesn't send any interrupts in 16bit mode. The code
 	 * was taken from Linux smc-mca.c driver.
-	 * I do not know why it's necessary. I don't want to know. It works
-	 * and that is enough for me.
 	 */
 	bus_space_write_1(wsc->sc_asict, wsc->sc_asich, WE_LAAR, 0x04);
 	wsc->sc_laar_proto |= 0x04;



CVS commit: [netbsd-9] src/doc

2021-04-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  8 15:22:31 UTC 2021

Modified Files:
src/doc [netbsd-9]: CHANGES-9.2

Log Message:
Ticket #1245


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.64 -r1.1.2.65 src/doc/CHANGES-9.2

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

Modified files:

Index: src/doc/CHANGES-9.2
diff -u src/doc/CHANGES-9.2:1.1.2.64 src/doc/CHANGES-9.2:1.1.2.65
--- src/doc/CHANGES-9.2:1.1.2.64	Tue Apr  6 18:08:53 2021
+++ src/doc/CHANGES-9.2	Thu Apr  8 15:22:30 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.2,v 1.1.2.64 2021/04/06 18:08:53 martin Exp $
+# $NetBSD: CHANGES-9.2,v 1.1.2.65 2021/04/08 15:22:30 martin Exp $
 
 A complete list of changes from the NetBSD 9.1 release to the NetBSD 9.2
 release:
@@ -2927,3 +2927,10 @@ bin/ps/print.c	1.133
 	column header is specified.
 	[simonb, ticket #1244]
 
+crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c 1.12
+crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/modes.inc delete
+
+	Disable the assembly version of GHASH for 32 bit sparc, the code
+	requires a sparcv9 cpu.
+	[christos, ticket #1245]
+



CVS commit: [netbsd-9] src/crypto/external/bsd/openssl

2021-04-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  8 15:21:42 UTC 2021

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/modes [netbsd-9]: gcm128.c
Removed Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc [netbsd-9]:
modes.inc

Log Message:
Pull up following revision(s) (requested by christos in ticket #1245):

crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/modes.inc: file 
removal
crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c: revision 1.12

Disable again the assembly version of gcm_ghash_4bit for the 32 bit sparc
since it uses ldx/stx.

Do not pretend we have GHASH asm code


To generate a diff of this commit:
cvs rdiff -u -r1.6.2.2 -r1.6.2.3 \
src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c
cvs rdiff -u -r1.3.16.1 -r0 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/modes.inc

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/dist/crypto/modes/gcm128.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c:1.6.2.2 src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c:1.6.2.3
--- src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c:1.6.2.2	Sat Mar 27 14:35:09 2021
+++ src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c	Thu Apr  8 15:21:42 2021
@@ -689,13 +689,15 @@ void gcm_ghash_v8(u64 Xi[2], const u128 
 #  endif
 # elif defined(__sparc__) || defined(__sparc)
 #  include "sparc_arch.h"
-#  define GHASH_ASM_SPARC
-#  define GCM_FUNCREF_4BIT
+#  if defined(__arch64__)
+#   define GHASH_ASM_SPARC
+#   define GCM_FUNCREF_4BIT
 extern unsigned int OPENSSL_sparcv9cap_P[];
 void gcm_init_vis3(u128 Htable[16], const u64 Xi[2]);
 void gcm_gmult_vis3(u64 Xi[2], const u128 Htable[16]);
 void gcm_ghash_vis3(u64 Xi[2], const u128 Htable[16], const u8 *inp,
 size_t len);
+#  endif /* __arch64__ */
 # elif defined(OPENSSL_CPUID_OBJ) && (defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC))
 #  include "ppc_arch.h"
 #  define GHASH_ASM_PPC



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

2021-04-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  8 15:06:50 UTC 2021

Removed Files:
src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc: modes.inc

Log Message:
Do not pretend we have GHASH asm code


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r0 \
src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/modes.inc

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



CVS commit: src/distrib/sets/lists/comp

2021-04-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Apr  8 13:04:02 UTC 2021

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
Add usr/include/elfdefinitions.h and usr/include/sys/elfdefinitions.h


To generate a diff of this commit:
cvs rdiff -u -r1.2377 -r1.2378 src/distrib/sets/lists/comp/mi

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/mi
diff -u src/distrib/sets/lists/comp/mi:1.2377 src/distrib/sets/lists/comp/mi:1.2378
--- src/distrib/sets/lists/comp/mi:1.2377	Wed Mar 10 13:30:34 2021
+++ src/distrib/sets/lists/comp/mi	Thu Apr  8 13:04:01 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2377 2021/03/10 13:30:34 simonb Exp $
+#	$NetBSD: mi,v 1.2378 2021/04/08 13:04:01 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -807,6 +807,7 @@
 ./usr/include/dns_sd.hcomp-mdns-include	mdns
 ./usr/include/dwarf.hcomp-c-include
 ./usr/include/elf.hcomp-c-include
+./usr/include/elfdefinitions.h			comp-c-include
 ./usr/include/endian.hcomp-c-include
 ./usr/include/err.hcomp-c-include
 ./usr/include/errno.hcomp-c-include
@@ -3068,6 +3069,7 @@
 ./usr/include/sys/domain.h			comp-c-include
 ./usr/include/sys/drvctlio.h			comp-c-include
 ./usr/include/sys/dvdio.h			comp-c-include
+./usr/include/sys/elfdefinitions.h		comp-c-include
 ./usr/include/sys/endian.h			comp-c-include
 ./usr/include/sys/envsys.h			comp-c-include
 ./usr/include/sys/errno.h			comp-c-include



CVS commit: src/crypto/external/bsd/openssl/dist/crypto/modes

2021-04-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  8 12:31:49 UTC 2021

Modified Files:
src/crypto/external/bsd/openssl/dist/crypto/modes: gcm128.c

Log Message:
Disable again the assembly version of gcm_ghash_4bit for the 32 bit sparc
since it uses ldx/stx.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c

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/dist/crypto/modes/gcm128.c
diff -u src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c:1.11 src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c:1.12
--- src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c:1.11	Thu Mar 25 14:51:19 2021
+++ src/crypto/external/bsd/openssl/dist/crypto/modes/gcm128.c	Thu Apr  8 08:31:49 2021
@@ -689,13 +689,15 @@ void gcm_ghash_v8(u64 Xi[2], const u128 
 #  endif
 # elif defined(__sparc__) || defined(__sparc)
 #  include "sparc_arch.h"
-#  define GHASH_ASM_SPARC
-#  define GCM_FUNCREF_4BIT
+#  if defined(__arch64__)
+#   define GHASH_ASM_SPARC
+#   define GCM_FUNCREF_4BIT
 extern unsigned int OPENSSL_sparcv9cap_P[];
 void gcm_init_vis3(u128 Htable[16], const u64 Xi[2]);
 void gcm_gmult_vis3(u64 Xi[2], const u128 Htable[16]);
 void gcm_ghash_vis3(u64 Xi[2], const u128 Htable[16], const u8 *inp,
 size_t len);
+#  endif /* __arch64__ */
 # elif defined(OPENSSL_CPUID_OBJ) && (defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC))
 #  include "ppc_arch.h"
 #  define GHASH_ASM_PPC



CVS commit: src/lib

2021-04-08 Thread Joseph Koshy
Module Name:src
Committed By:   jkoshy
Date:   Thu Apr  8 08:10:30 UTC 2021

Modified Files:
src/lib: Makefile

Log Message:
Redo r1.288: traverse the complete imported Elftoolchain tree during a build.


To generate a diff of this commit:
cvs rdiff -u -r1.289 -r1.290 src/lib/Makefile

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

Modified files:

Index: src/lib/Makefile
diff -u src/lib/Makefile:1.289 src/lib/Makefile:1.290
--- src/lib/Makefile:1.289	Tue Apr  6 21:13:04 2021
+++ src/lib/Makefile	Thu Apr  8 08:10:30 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.289 2021/04/06 21:13:04 jkoshy Exp $
+#	$NetBSD: Makefile,v 1.290 2021/04/08 08:10:30 jkoshy Exp $
 #	from: @(#)Makefile	5.25.1.1 (Berkeley) 5/7/91
 
 .include 
@@ -62,7 +62,7 @@ SUBDIR+=	../external/bsd/am-utils/lib
 
 SUBDIR+=	../external/bsd/flex/lib
 SUBDIR+=	../external/bsd/tre/lib
-SUBDIR+=	../external/bsd/elftoolchain/lib/libelf
+SUBDIR+=	../external/bsd/elftoolchain	# libelf and libdwarf
 SUBDIR+=	../external/bsd/liblzf/lib
 SUBDIR+=	../external/bsd/libpcap/lib
 



CVS commit: src/libexec/httpd

2021-04-08 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Thu Apr  8 07:02:12 UTC 2021

Modified Files:
src/libexec/httpd: bozohttpd.c cgi-bozo.c

Log Message:
bozohttpd: fix argument type for functions from 

Found by the recently added check to lint (message 342).

ok mrg@


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.53 -r1.54 src/libexec/httpd/cgi-bozo.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/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.129 src/libexec/httpd/bozohttpd.c:1.130
--- src/libexec/httpd/bozohttpd.c:1.129	Sun Apr  4 18:14:26 2021
+++ src/libexec/httpd/bozohttpd.c	Thu Apr  8 07:02:11 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.129 2021/04/04 18:14:26 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.130 2021/04/08 07:02:11 rillig Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -1110,7 +1110,7 @@ handle_redirect(bozo_httpreq_t *request,
 		 */
 		if (sep) {
 			for (s = url; s != sep;) {
-if (!isalnum((int)*s) &&
+if (!isalnum((unsigned char)*s) &&
 *s != '+' && *s != '-' && *s != '.')
 	break;
 if (++s == sep) {

Index: src/libexec/httpd/cgi-bozo.c
diff -u src/libexec/httpd/cgi-bozo.c:1.53 src/libexec/httpd/cgi-bozo.c:1.54
--- src/libexec/httpd/cgi-bozo.c:1.53	Sat Feb 27 12:36:46 2021
+++ src/libexec/httpd/cgi-bozo.c	Thu Apr  8 07:02:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgi-bozo.c,v 1.53 2021/02/27 12:36:46 mrg Exp $	*/
+/*	$NetBSD: cgi-bozo.c,v 1.54 2021/04/08 07:02:12 rillig Exp $	*/
 
 /*	$eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -289,7 +289,8 @@ parse_search_string(bozo_httpreq_t *requ
 			goto parse_err;
 		while (*s) {
 			/* check if it's unreserved */
-			if (isalpha((int)*s) || isdigit((int)*s) ||
+			if (isalpha((unsigned char)*s) ||
+			isdigit((unsigned char)*s) ||
 			strchr(UNRESERVED_CHAR, *s)) {
 s++;
 continue;
@@ -299,8 +300,8 @@ parse_search_string(bozo_httpreq_t *requ
 			if (*s == '%') {
 if (s[1] == '\0' || s[2] == '\0')
 	goto parse_err;
-if (!isxdigit((int)s[1]) ||
-!isxdigit((int)s[2]))
+if (!isxdigit((unsigned char)s[1]) ||
+!isxdigit((unsigned char)s[2]))
 	goto parse_err;
 s += 3;
 continue;
@@ -517,8 +518,8 @@ bozo_process_cgi(bozo_httpreq_t *request
 		strcpy(t, "HTTP_");
 		t += strlen(t);
 		for (s2 = headp->h_header; *s2; t++, s2++)
-			if (islower((unsigned)*s2))
-*t = toupper((unsigned)*s2);
+			if (islower((unsigned char)*s2))
+*t = toupper((unsigned char)*s2);
 			else if (*s2 == '-')
 *t = '_';
 			else