Commit Graph

21106 Commits

Author SHA1 Message Date
christos b756f940a7 move MD2Transform first. 2024-01-26 21:34:01 +00:00
nros 7690962a14 Add the long double math functions recently added from FreeBSD to their related man pages 2024-01-26 19:27:29 +00:00
ryoon b5a7c060d0 Fix inverted logic for weak alias
* Fix gfortran from pkgsrc/lang/gcc10 and pkgsrc/math/coinmp, for example.
2024-01-26 12:32:49 +00:00
christos ff905cdb8e add the script I used to convert the FreeBSD code. 2024-01-24 04:14:07 +00:00
christos 85f5e301f5 fix nested extern warnings 2024-01-23 17:24:38 +00:00
christos 3f3b0ded09 move inclusion of <machine/ieee.h> to the ieee source files instead of
including it in math_private.h which is also used by the vax which is not ieee.
2024-01-23 15:45:07 +00:00
christos 89f106fbc2 handle sizeof(off_t) > sizeof(size_t) 2024-01-23 15:32:54 +00:00
christos 37feec7425 Add vax 2024-01-23 15:32:18 +00:00
christos 72f355ee42 fix vax build (unused variable) 2024-01-23 15:31:58 +00:00
christos 844ea6ac6a more annotation for powerpc 2024-01-23 12:23:34 +00:00
kre 10af4d8cb4 Bump libm minor rev (libm.so.0.13 -> libm.so.0.14) after addition of
all the long double functions (with actual implementations).
2024-01-22 15:19:38 +00:00
kre fcd5401592 Simply an overly complex way of saying "0 or 1" into a cleaner version.
While here add a commment about how the __i386__ magic LD80C macro
might no longer work on all other arch's as well (if someone can verify
that it still does, or can fix it so that it still works on i386, but
also works everywhere else, then please remove that XXX comment.
The issue I am (perhaps imagining) is the (uint32_t) cast.
2024-01-22 14:26:18 +00:00
kre 1bb3b9e157 This set of changes seem to be sufficient to make at least the
amd64 port build again after the long double math function infusion
from yesterday.

Feel free (without consulting me, I'm just hacking about) to revert
any of this and do it a better way.

Note: this is not intended to be complete, in particular, in <math.h>
I added prototypes only for the functions that are needed for a
successful build, not all of the new ones...
2024-01-22 12:15:19 +00:00
uwe af45bdc82c snprintb(3): restore empty string in snprintb_m example
Restore the empty string at the end of snprintb_m output that was
accidentally removed along with empty string placeholders in the
format strings.  While here, move that example to be next to its
snprintb counterpart.
2024-01-22 00:11:21 +00:00
uwe 635b447434 snprintb(3): update mmap example
Bring over the prettier version of the mmap format string that we have
in the header file for some time now.  Clarify that the final NUL of
the new format string is supplied by the compiler, g/c explicit final
\0 from the example that had it.
2024-01-21 23:57:49 +00:00
uwe 56fe87ce20 snprintb(3): try to improve narration
Try to make the narration more coherent.  Make the old and new
syntaxes easy to distinguish and go out of our way to highlight that
the old syntax uses 1-based bit positions.
2024-01-21 23:44:30 +00:00
rillig cebd2029a2 snprintb.3: remove empty string literals from examples
Suggested by uwe@, as gaps in bitmasks are quite common and thus
shouldn't clutter the code.
2024-01-21 22:06:46 +00:00
rillig 1d4fa4e59b snprintb.3: fix examples
The first example broke the format string at boundaries that didn't
highlight the structure of the format string and also didn't make it
clear that a few bits were omitted from having descriptions.

The second example contained an off-by-one error for SIXTEEN, which was
actually FIFTEEN.

The snprintb_m example repeated the above off-by-one error, and its
output was shown wrong, due to concatenated escape sequences.
2024-01-21 21:31:23 +00:00
christos cfe182f36b Bring in more long double functions from FreeBSD. 2024-01-21 18:53:15 +00:00
kre c3aea5f47d Unwrap a line which wasn't wrapped before it had an __UNCONST() added
to it, and now that that is gone again, doesn't need wrapping any more.

That line is now unaltered from what it was 3 revs ago (bit for bit).

NFC.
2024-01-21 12:58:10 +00:00
christos dba48cb953 fix more alpha 2024-01-21 00:43:34 +00:00
christos f863b8a944 fix alpha, grr. 2024-01-21 00:35:57 +00:00
christos 0c834cb523 generate strtou.3 from strtoi.3, grammar police 2024-01-20 16:45:07 +00:00
christos 258f56e039 Make the first argument of ip6_str2scopeid const, instead of __UNCONST.
Thanks kre@. While here s/u_int32_t/uint32_t/
2024-01-20 16:18:56 +00:00
christos f1987b28c8 PR/57828: Alejandro Colomar: Prioritize test for ERANGE before testing for
fully consuming the string. Adjust strtonum(3) to behave as before. Document
the order of the tests and sync the man pages (I should really autogenerate
one of the two man pages...)
2024-01-20 16:13:39 +00:00
christos ace5b9b5fe Catch up with all the lint warnings since exit on warning was disabled.
Disable 'missing header declaration' and 'nested extern' warnings for now.
2024-01-20 14:52:45 +00:00
christos a34711bbb2 Add missing headers 2024-01-19 19:55:03 +00:00
christos 9ba017e662 more extern decls 2024-01-19 19:31:41 +00:00
christos a88bd0da18 declare _libc_init() in header. 2024-01-19 19:22:17 +00:00
christos cd771ab073 add lint flags for compiler_rt 2024-01-19 18:45:01 +00:00
christos 689fdc5827 add some const 2024-01-19 18:41:38 +00:00
christos 2072232780 Add lint flags for jemalloc 2024-01-19 18:41:30 +00:00
rin b1652dc39b fixunstf[sd]i_ieee754: Explicitly include stddef.h for size_t
Fix build for mips{,n}64. Note that stddef.h has been implicitly
included via eabi.h for aarch64, on the other hand.
2024-01-05 09:41:58 +00:00
christos 4be2f99d7b tidy up some extern declarations 2024-01-03 18:41:53 +00:00
christos 53e64a7779 pass lint. 2024-01-02 19:27:26 +00:00
christos 559c967b97 Import tzcode 2023d:
localtime.c no longer mishandles TZif files that contain a single
    transition into a DST regime.  Previously, it incorrectly assumed
    DST was in effect before the transition too.  (Thanks to Alois
    Treindl for debugging help.)

    localtime.c's timeoff no longer collides with OpenBSD 7.4.

    The C code now uses _Generic only if __STDC_VERSION__ says the
    compiler is C11 or later.

    tzselect now optionally reads zonenow.tab, to simplify when
    configuring only for timestamps dated from now on.

    tzselect no longer creates temporary files.

    tzselect no longer mishandles the following:

      Spaces and most other special characters in BUGEMAIL, PACKAGE,
      TZDIR, and VERSION.

      TZ strings when using mawk 1.4.3, which mishandles regular
      expressions of the form /X{2,}/.

      ISO 6709 coordinates when using an awk that lacks the GNU
      extension of newlines in -v option-arguments.

      Non UTF-8 locales when using an iconv command that lacks the GNU
      //TRANSLIT extension.

    zic no longer mishandles data for Palestine after the year 2075.
    Previously, it incorrectly omitted post-2075 transitions that are
    predicted for just before and just after Ramadan.  (Thanks to Ken
    Murchison for debugging help.)

    zic now works again on Linux 2.6.16 and 2.6.17 (2006).
2023-12-23 20:48:38 +00:00
jklos b56afa4dc8 Fix building with M68040 and M68060 options. 2023-12-21 06:32:20 +00:00
mrg 6b3ee451d6 make malloc_usable_size() visible with old jemalloc.
it's in <malloc.h> and applications like firefox expect it.

XXX: pullup-10
2023-12-13 23:53:50 +00:00
mlelstv 2d9177bfbe pathconf needs to return EINVAL when the variable is invalid
or cannot be associated with a file. This also needs to be true
when the node doesn't implement the pathconf function at all.
2023-12-11 12:42:18 +00:00
kre 9473af8f9a Fix yet another wording (editing) botch noticed by uwe@ 2023-12-07 23:42:28 +00:00
uwe b03d4c66a4 zic(8): missed a .Ql 2023-12-07 23:21:21 +00:00
kre 058a868134 Fix a couple of (not very likely) memory leaks, reported by enh@google.com
who attributed them:

  the malloc one was reported to Android (as
  https://android-review.googlesource.com/c/platform/bionic/+/2856549)
  by wuhaitao3 <wuhaitao3@xiaomi.corp-partner.google.com>; Chris Ferris
  <cferris@google.com> then spotted the goto nospc one.
2023-12-07 22:33:49 +00:00
kre c62a59b56e Fix a wording botch noticed by uwe@ (and one more smaller one), and
a few more markup issues.   While here, consistemntly use minus when
minus is meant, rather that just using a hyphen.
2023-12-07 20:13:37 +00:00
riastradh 57b4a3d756 pthread: Document the setstack vs setguardsize bug.
Suggest the safe, compatible workaround.
2023-12-07 16:55:01 +00:00
uwe 2f0b3b676b zic(8): more markup fixes
Still need to go over the tables.
2023-12-07 16:16:03 +00:00
kre 82a0628ec4 A couple more (relatively minor) markup fixes. 2023-12-06 21:45:11 +00:00
kre 52b305fe69 More markup fixes. This man page remains exceedingly ugly (particularly
relating to vertical space - which often is missing where it would be
better if it weren't, or is present and wasteful/ugly).
2023-12-06 21:42:01 +00:00
christos 8b64b36896 PR/57757: Izumi Tsutsui: Fix markup errors 2023-12-06 20:01:44 +00:00
riastradh 20941a42e9 pthread: Don't adjust user-allocated stack addresses by guardsize.
PR lib/57721

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-11-28 02:54:33 +00:00
christos 82eb5ce2b3 Restore original code now that the broken test has been fixed. 2023-11-27 19:46:14 +00:00
christos d5d5b72237 minimize diffs with FreeBSD. 2023-11-19 18:57:11 +00:00
christos 4e48317f57 don't expose extra symbols. 2023-11-15 03:35:04 +00:00
christos 21fd2bf912 provide materialized functions for the ssp overriden inlines 2023-11-15 03:15:28 +00:00
rin 79de40626c libc/compiler_rt: Consistently use LIBC_MACHINE_{ARCH,CPU}
Instead of MACHINE_{ARCH,CPU}, respectively.

With this change, unnecessary comparetf2.c is no longer
compiled in for 32-bit compat libc on aarch64.
2023-11-09 07:29:26 +00:00
simonb bcb621d402 Add
#include <cdbr.h>
to the synopsis.
2023-10-27 04:05:55 +00:00
riastradh 91811c4fb2 mremap(2): Use .Lk for links in text.
.%U is only for links in reference sections.
2023-10-25 18:23:10 +00:00
simonb d750207ba0 Add _SC_AVPHYS_PAGES.
getconf(1) add this and SC_PHYS_PAGES.
libc: Use vm.uvmexp2 over vm.meter is it's twice as fast on my setup.
getconf.3: Tidy up wording for SC_PHYS_PAGES.
2023-10-25 08:19:34 +00:00
jschauma a374ef689d document S_ISWHT, sort these macros 2023-10-15 20:37:04 +00:00
ad a3628a9150 A few more branch hints. 2023-10-14 19:39:33 +00:00
ad 57fcbaebb4 Cherry pick a fix from FreeBSD:
commit 80bc871bdd4a8254ce19a65a54c8c918dd3ddd11
Author: Konstantin Belousov <kib@FreeBSD.org>
Date:   Sat Sep 12 18:16:46 2009 +0000

    MFC r196861:
    Handle zero size for posix_memalign. Return NULL or unique address
    according to the 'V' option.
2023-10-14 19:38:51 +00:00
ad 13122b2822 Cherry pick a fix from FreeBSD:
commit 52d7a117c0fe8bd0226d964f4272131700035f12
Author: Jason Evans <jasone@FreeBSD.org>
Date:   Thu Aug 14 17:03:29 2008 +0000

    Re-order the terms of an expression in arena_run_reg_dalloc() to correctly
    detect whether the integer division table is large enough to handle the
    divisor.  Before this change, the last two table elements were never used,
    thus causing the slow path to be used for those divisors.
2023-10-14 19:37:24 +00:00
ad a52713e5b5 Fix a bug in the rbtree conversion. 2023-10-14 19:36:17 +00:00
mrg 744309c52c fix compile error on 32-bit platforms. 2023-10-14 06:29:10 +00:00
ad 562025fdfe Convert to use Matt Thomas's rbtree, which the env code probably already
pulls into libc.  amd64 object size before and after:

	   text    data     bss     dec     hex filename
	  21001      88     365   21454    53ce jemalloc.po
	  14991     184     429   15604    3cf4 jemalloc.po

libmicro on AMD Athlon Silver 3050e comparing this and the revision before
previous (i.e. the old code, versus arena changes + rbtree changes):

	exit_10_nolibc	135.168300	128.07790[   +5.5%]
        fork_100        180.539040      149.63721[  +20.7%]
        fork_1000       200.421650      167.09660[  +19.9%]
	mallocT2_10	0.132920	0.13317[   -0.2%]
	mallocT2_100	0.136350	0.13635[   +0.0%]
	mallocT2_100k	0.258690	0.26641[   -3.0%]
	mallocT2_10k	0.223340	0.22733[   -1.8%]
	mallocT2_1k	0.137170	0.14254[   -3.9%]
	malloc_10	0.100540	0.10849[   -7.9%]
	malloc_100	0.107290	0.10753[   -0.2%]
	malloc_100k	0.193560	0.19355[   +0.0%]
	malloc_10k	0.173250	0.17454[   -0.7%]
	malloc_1k	0.113490	0.11335[   +0.1%]
2023-10-13 20:57:30 +00:00
ad bf5f78d57d Minor changes to jemalloc100 (the old one that only vax etc currently uses).
- Don't use TLS nor pretend to hash out arenas to reduce lock contention,
  because NetBSD uses thr_curcpu() to choose arena (i.e. per-CPU arenas).

- In a single threaded process, don't prepare "ncpus" worth of arenas,
  allocate only one.

- Use getpagesize() since it caches the return.

- Sprinkle branch hints.

- Make MALLOC_TRACE and MALLOC_DEBUG work again.
2023-10-13 19:30:28 +00:00
skrll ea952cb848 Consistently pass 0 as first and ignored argument to sigprocmask in the
setjmp implementations.

NFCI.
2023-10-11 09:12:20 +00:00
skrll 1068717982 Trailing whitespace 2023-10-11 06:15:36 +00:00
blymn 8fb09d041c Correct the fd closed check so we actually check the outfd as per
the comment.  Thanks for jdc@netbsd.org for catching this one.
2023-10-09 21:14:29 +00:00
he 0274baaaaf libm Makefile: add fma() functions for mips.
This pushed the ramdisk size, so that needed to be bumped as well.
Otherwise, there were no build issues for either 32 or 64 bit mips.
Sort-of OK'ed by simonb@.
2023-10-08 13:47:51 +00:00
rin 7c76c2272e Drop -O[01] hacks for vax; no longer necessary for patched GCC 10
PR port-vax/57646: Import major vax toolchain fix by Kalvis Duckmanton

XXXRO: GCC 12 may require hacks for a while, but it turned out that
GCC 12 should be treated differently from older versions; a lot of new
files need -O[01] flags, while some may no longer require it.

I will take a look later.

Note that these hacks are not required if Kalvis's patches for GCC 12
are applied.

Keep doc/HACKS entries for a while (will be sync with update for GCC 12).

diff --git a/crypto/external/bsd/openssh/lib/Makefile b/crypto/external/bsd/openssh/lib/Makefile
index 96a93f5e396..4e38be1b642 100644
--- a/crypto/external/bsd/openssh/lib/Makefile
+++ b/crypto/external/bsd/openssh/lib/Makefile
@@ -117,12 +117,6 @@ COPTS.${f}.c+=	-Wno-pointer-sign
 # XXX
 COPTS.channels.c+=	-fno-strict-aliasing

-# XXX
-.if ${MACHINE} == "vax"
-COPTS.poly1305.c+=	-O0
-COPTS.umac.c+=		-O0
-.endif
-
 COPTS.hostfile.c+=	${CC_WNO_FORMAT_TRUNCATION}
 COPTS.sshkey.c+=	${CC_WNO_FORMAT_TRUNCATION}
 COPTS.cipher.c+=	-Wno-error=deprecated-declarations
diff --git a/distrib/utils/x_ping/Makefile b/distrib/utils/x_ping/Makefile
index f1c452a0d60..8ee77580a3f 100644
--- a/distrib/utils/x_ping/Makefile
+++ b/distrib/utils/x_ping/Makefile
@@ -12,10 +12,6 @@ CPPFLAGS+=	-I${SRCDIR} -DCRUNCHOPS
 DPADD=		${LIBM}
 LDADD=		-lm

-.if ${MACHINE_ARCH} == "vax"
-COPTS.ping.c=-O0
-.endif
-
 .include <bsd.prog.mk>

 .PATH:		${SRCDIR}
diff --git a/external/apache2/argon2/lib/libargon2/Makefile.inc b/external/apache2/argon2/lib/libargon2/Makefile.inc
index d3f4470c6c7..6a1dd146d7d 100644
--- a/external/apache2/argon2/lib/libargon2/Makefile.inc
+++ b/external/apache2/argon2/lib/libargon2/Makefile.inc
@@ -16,7 +16,3 @@ CFLAGS+=	-pthread
 LDADD+=-lpthread
 DPADD+=${LIBPTHREAD}
 .endif
-
-.if ${MACHINE} == "vax"
-COPTS.blake2b.c+=	-O0
-.endif
diff --git a/external/bsd/jemalloc/lib/Makefile.inc b/external/bsd/jemalloc/lib/Makefile.inc
index 2f524358f46..d5da774f293 100644
--- a/external/bsd/jemalloc/lib/Makefile.inc
+++ b/external/bsd/jemalloc/lib/Makefile.inc
@@ -53,12 +53,6 @@ COPTS.ctl.c+=-Wno-error=stack-protector
 COPTS.stats.c+=-Wno-error=stack-protector
 COPTS.tcache.c+=-Wno-error=stack-protector

-.if ${MACHINE_ARCH} == "vax"
-# in merge_overlapping_regs, at regrename.c
-COPTS.arena.c+=-O0
-COPTS.extent.c+=-O0
-.endif
-
 SRCS+=${JEMALLOC_SRCS}

 jemalloc.d jemalloc.pico jemalloc.o jemalloc.ln jemalloc.po jemalloc.go: \
diff --git a/external/bsd/mdocml/lib/libmandoc/Makefile b/external/bsd/mdocml/lib/libmandoc/Makefile
index 40d7e29ae88..dfd3077a2c7 100644
--- a/external/bsd/mdocml/lib/libmandoc/Makefile
+++ b/external/bsd/mdocml/lib/libmandoc/Makefile
@@ -39,11 +39,6 @@ tbl_opts.c

 MAN=	mandoc.3

-# XXX
-.if ${MACHINE} == "vax"
-COPTS.mdoc_macro.c+=-O0
-.endif
-
 COPTS.man_validate.c+=-Wno-error=array-bounds

 .include <bsd.lib.mk>
diff --git a/external/gpl3/binutils.old/lib/libbfd/Makefile b/external/gpl3/binutils.old/lib/libbfd/Makefile
index 03477232b55..74a354532fa 100644
--- a/external/gpl3/binutils.old/lib/libbfd/Makefile
+++ b/external/gpl3/binutils.old/lib/libbfd/Makefile
@@ -41,10 +41,6 @@ CPPFLAGS+=	-I${.CURDIR}/arch/${BFD_MACHINE_ARCH} -I${DIST}/include -I. \
 		-DDEBUGDIR=\"${DEBUGDIR}\" -DLIBDIR=\"${LIBDIR}\" \
 		-DBINDIR=\"${BINDIR}\"

-.if (${BFD_MACHINE_ARCH} == "vax")
-CPPFLAGS.elf.c +=	-O0
-.endif
-
 COPTS.pei-x86_64.c+=	-Wno-stack-protector
 COPTS.elfxx-mips.c+=	-Wno-stack-protector
 COPTS.elf.c+=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-overflow :}
diff --git a/external/gpl3/binutils/lib/libbfd/Makefile b/external/gpl3/binutils/lib/libbfd/Makefile
index 00cb2b20081..a3f0c25fd35 100644
--- a/external/gpl3/binutils/lib/libbfd/Makefile
+++ b/external/gpl3/binutils/lib/libbfd/Makefile
@@ -41,10 +41,6 @@ CPPFLAGS+=	-I${.CURDIR}/arch/${BFD_MACHINE_ARCH} -I${DIST}/include -I. \
 		-DDEBUGDIR=\"${DEBUGDIR}\" -DLIBDIR=\"${LIBDIR}\" \
 		-DBINDIR=\"${BINDIR}\"

-.if (${BFD_MACHINE_ARCH} == "vax")
-CPPFLAGS.elf.c +=	-O0
-.endif
-
 COPTS.pei-x86_64.c+=	-Wno-stack-protector
 COPTS.elfxx-mips.c+=	-Wno-stack-protector
 COPTS.elf.c+=		${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-overflow :}
diff --git a/external/gpl3/gcc.old/lib/Makefile.sanitizer b/external/gpl3/gcc.old/lib/Makefile.sanitizer
index efd36ae4bee..5173a5109a0 100644
--- a/external/gpl3/gcc.old/lib/Makefile.sanitizer
+++ b/external/gpl3/gcc.old/lib/Makefile.sanitizer
@@ -88,22 +88,3 @@ COPTS+=-fno-builtin -fno-exceptions -fno-rtti -funwind-tables

 # Can't profile without it`
 #-fomit-frame-pointer
-
-.if ${MACHINE_ARCH} == "vax"
-COPTS.sanitizer_allocator.cc += -O1
-COPTS.sanitizer_common.cc += -O1
-COPTS.sanitizer_common_libcdep.cc += -O1
-COPTS.sanitizer_coverage_libcdep.cc += -O1
-COPTS.sanitizer_coverage_mapping_libcdep.cc += -O1
-COPTS.sanitizer_deadlock_detector1.cc += -O1
-COPTS.sanitizer_mac.cc += -O1
-COPTS.sanitizer_netbsd.cc += -O1
-COPTS.sanitizer_posix.cc += -O1
-COPTS.sanitizer_printf.cc += -O1
-COPTS.sanitizer_procmaps_common.cc += -O1
-COPTS.sanitizer_stackdepot.cc += -O1
-COPTS.sanitizer_symbolizer_libcdep.cc += -O1
-COPTS.sanitizer_symbolizer_report.cc += -O1
-COPTS.ubsan_diag.cc += -O1
-COPTS.ubsan_init.cc += -O1
-.endif
diff --git a/external/gpl3/gcc.old/lib/libasan/Makefile b/external/gpl3/gcc.old/lib/libasan/Makefile
index 1e6f9608abe..3da7bbf2f58 100644
--- a/external/gpl3/gcc.old/lib/libasan/Makefile
+++ b/external/gpl3/gcc.old/lib/libasan/Makefile
@@ -49,14 +49,6 @@ LIBDPLIBS+= m  ${NETBSDSRCDIR}/lib/libm
 LIBDPLIBS+= pthread ${NETBSDSRCDIR}/lib/libpthread
 CPPFLAGS+=-DCAN_SANITIZE_UB=0

-.if ${MACHINE_ARCH} == "vax"
-COPTS.asan_allocator.cc += -O1
-COPTS.asan_report.cc += -O1
-COPTS.sanitizer_file.cc += -O1
-COPTS.ubsan_diag.cc += -O1
-COPTS.ubsan_init.cc += -O1
-.endif
-
 .if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
 COPTS.asan_interceptors.cc += -O1
 .endif
diff --git a/external/gpl3/gcc.old/lib/liblsan/Makefile b/external/gpl3/gcc.old/lib/liblsan/Makefile
index 4578544a9a8..ddb7981077c 100644
--- a/external/gpl3/gcc.old/lib/liblsan/Makefile
+++ b/external/gpl3/gcc.old/lib/liblsan/Makefile
@@ -16,11 +16,6 @@ LSAN_SRCS+= \
 	lsan_linux.cc \
 	lsan_thread.cc

-.if ${MACHINE_ARCH} == "vax"
-COPTS.lsan_allocator.cc += -O1
-COPTS.sanitizer_file.cc += -O1
-.endif
-
 LIB=	lsan
 SRCS+=	${LSAN_SRCS}
 LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
diff --git a/external/gpl3/gcc.old/lib/libubsan/Makefile b/external/gpl3/gcc.old/lib/libubsan/Makefile
index 2e2faca7b1c..9de82550d14 100644
--- a/external/gpl3/gcc.old/lib/libubsan/Makefile
+++ b/external/gpl3/gcc.old/lib/libubsan/Makefile
@@ -26,10 +26,6 @@ UBSAN_SRCS= \
 COPTS.${_s}.cc+=-frtti
 .endfor

-.if ${MACHINE_ARCH} == "vax"
-COPTS.sanitizer_file.cc += -O1
-.endif
-
 LIB=	ubsan
 SRCS+=	${UBSAN_SRCS}
 LIBDPLIBS+= m ${NETBSDSRCDIR}/lib/libm
diff --git a/external/gpl3/gcc.old/usr.bin/cc1/Makefile b/external/gpl3/gcc.old/usr.bin/cc1/Makefile
index c55e292ee8e..ff12a5be524 100644
--- a/external/gpl3/gcc.old/usr.bin/cc1/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/cc1/Makefile
@@ -46,17 +46,6 @@ CPPFLAGS.default-c.c+=	-I${BACKENDOBJ}
 BUILDSYMLINKS+= ${GNUHOSTDIST}/gcc/config/sh/sh-c.cc sh-c.c
 .endif

-.if ${MACHINE_CPU} == "vax"
-COPTS.c-decl.c+=-O0
-COPTS.c-typeck.c+=-O0
-COPTS.c-array-notation.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1-checksum.c+=-O0
-.endif
-
 .if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
 COPTS.c-common.c+=-O3
 .endif
diff --git a/external/gpl3/gcc.old/usr.bin/cc1obj/Makefile b/external/gpl3/gcc.old/usr.bin/cc1obj/Makefile
index 3123ee0d60b..aab82ad3448 100644
--- a/external/gpl3/gcc.old/usr.bin/cc1obj/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/cc1obj/Makefile
@@ -44,16 +44,8 @@ COPTS.objc-act.c+=			-Wno-stack-protector
 COPTS.objc-gnu-runtime-abi-01.c+=	-Wno-stack-protector
 COPTS.objc-next-runtime-abi-01.c+=	-Wno-stack-protector

-.if ${MACHINE_ARCH} == "vax"
-COPTS.c-decl.c+=-O0
-COPTS.c-typeck.c+=-O0
-COPTS.c-array-notation.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1obj-checksum.c+=-O0
-.endif
+COPTS.c-cppbuiltin.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error=format-overflow :}
+COPTS.c-typeck.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} == 8:? -Wno-error=format-overflow :}

 .if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
 COPTS.c-common.c+=-O3
diff --git a/external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile b/external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile
index b9c108251c5..e04e8fc7f53 100644
--- a/external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/cc1objplus/Makefile
@@ -69,18 +69,6 @@ COPTS.objc-act.c+=			-Wno-stack-protector
 COPTS.objc-gnu-runtime-abi-01.c+=	-Wno-stack-protector
 COPTS.objc-next-runtime-abi-01.c+=	-Wno-stack-protector

-.if ${MACHINE_ARCH} == "vax"
-COPTS.c-decl.c+=-O0
-COPTS.c-typeck.c+=-O0
-COPTS.c-array-notation.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1obj-checksum.c+=-O0
-COPTS.decl.c+=-O0
-.endif
-
 .if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
 COPTS.c-common.c+=-O3
 .endif
diff --git a/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile b/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile
index 7936efd3a5e..7c54559e21a 100644
--- a/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/cc1plus/Makefile
@@ -31,23 +31,6 @@ CHECKSUM_OBJS= ${LIBBACKTRACEOBJ}/libbacktrace.a \

 CFLAGS+=	-Wno-error=stack-protector

-.if ${MACHINE_ARCH} == "vax"
-COPTS.call.c+=-O0
-COPTS.decl.c+=-O0
-COPTS.typeck2.c+=-O0
-COPTS.class.c+=-O0
-COPTS.typeck.c+=-O0
-COPTS.init.c+=-O0
-COPTS.semantics.c+=-O0
-COPTS.mangle.c+=-O0
-COPTS.constexpr.c+=-O0
-COPTS.c-common.c+=-O0
-COPTS.c-ada-spec.c+=-O0
-COPTS.cilk.c+=-O0
-COPTS.c-ubsan.c+=-O0
-COPTS.cc1plus-checksum.c+=-O0
-.endif
-
 .if ${MACHINE_ARCH} == "mipseb" || ${MACHINE_ARCH} == "mipsel"
 COPTS.c-common.c+=-O3
 .endif
diff --git a/external/gpl3/gcc.old/usr.bin/gcc/Makefile b/external/gpl3/gcc.old/usr.bin/gcc/Makefile
index 7a66d77ffc7..a5a4b1c3adf 100644
--- a/external/gpl3/gcc.old/usr.bin/gcc/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/gcc/Makefile
@@ -25,9 +25,6 @@ ${SRCS}: ${GCCARCH}/defs.mk
 .include <bsd.info.mk>

 COPTS.gcc.c=	-Wno-stack-protector
-.if ${MACHINE_ARCH} == "vax"
-COPTS.dse.c=	-O1
-.endif

 .PATH: ${DIST}/gcc ${DIST}/gcc/doc ${DIST}/gcc/c

diff --git a/external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile b/external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile
index 751d1513eec..33aeb1c9898 100644
--- a/external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/libdecnumber/Makefile
@@ -14,10 +14,6 @@ SRCS=		decNumber.c decContext.c decimal32.c decimal64.c decimal128.c
 CPPFLAGS+=	-I${.CURDIR}/arch/${GCC_MACHINE_ARCH} -I${DIST}/libdecnumber
 CPPFLAGS+=	-I${DIST}/libgcc

-.if ${MACHINE_ARCH} == "vax"
-COPTS.decNumber.c=-O0
-.endif
-
 .include <bsd.lib.mk>

 # Force using C++ for this
diff --git a/external/gpl3/gcc.old/usr.bin/lto-dump/Makefile b/external/gpl3/gcc.old/usr.bin/lto-dump/Makefile
index 90f44a9fcf6..fd251464fb7 100644
--- a/external/gpl3/gcc.old/usr.bin/lto-dump/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/lto-dump/Makefile
@@ -24,11 +24,6 @@ COPTS.lto-common.c+=	-Wno-stack-protector
 .include "../Makefile.backtrace"
 .include "../Makefile.libdecnumber"

-.if ${MACHINE_ARCH} == "vax"
-COPTS.lto-lang.c+=-O0
-COPTS.lto-symtab.c+=-O0
-.endif
-
 LDADD+=	${LIBIBERTY} ${LIBMPC} ${LIBMPFR} ${LIBGMP} -lintl -lz -lm
 DPADD+=	${LIBIBERTY} ${LIBMPC} ${LIBMPFR} ${LIBGMP} ${LIBINTL} ${LIBZ} ${LIBM}

diff --git a/external/gpl3/gcc.old/usr.bin/lto1/Makefile b/external/gpl3/gcc.old/usr.bin/lto1/Makefile
index 4c49161a64c..340d3c6124f 100644
--- a/external/gpl3/gcc.old/usr.bin/lto1/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/lto1/Makefile
@@ -21,11 +21,6 @@ COPTS.lto-common.c+=	-Wno-stack-protector
 .include "../Makefile.libcpp"
 .include "../Makefile.libdecnumber"

-.if ${MACHINE_ARCH} == "vax"
-COPTS.lto-lang.c+=-O0
-COPTS.lto-symtab.c+=-O0
-.endif
-
 LDADD+= ${LIBIBERTYOBJ}/libiberty.a
 DPADD+= ${LIBIBERTYOBJ}/libiberty.a
 LDADD+=	${LIBIBERTY} ${LIBMPC} ${LIBMPFR} ${LIBGMP} -lintl -lz -lm
diff --git a/external/gpl3/gdb.old/lib/libdecnumber/Makefile b/external/gpl3/gdb.old/lib/libdecnumber/Makefile
index bcd4ae5b222..ce28811526b 100644
--- a/external/gpl3/gdb.old/lib/libdecnumber/Makefile
+++ b/external/gpl3/gdb.old/lib/libdecnumber/Makefile
@@ -18,10 +18,6 @@ CPPFLAGS+=	-I${.CURDIR}/arch/${GDB_MACHINE_ARCH} \

 SRCS=		${G_OBJS:.o=.c} ${G_SOURCES}

-.if ${MACHINE_ARCH} == "vax"
-COPTS.decNumber.c=-O0
-.endif
-
 .PATH: ${DIST}/libdecnumber ${DIST}/libdecnumber/dpd

 .include <bsd.lib.mk>
diff --git a/external/gpl3/gdb/lib/libdecnumber/Makefile b/external/gpl3/gdb/lib/libdecnumber/Makefile
index c95d36e3dfa..e3169865304 100644
--- a/external/gpl3/gdb/lib/libdecnumber/Makefile
+++ b/external/gpl3/gdb/lib/libdecnumber/Makefile
@@ -18,10 +18,6 @@ CPPFLAGS+=	-I${.CURDIR}/arch/${GDB_MACHINE_ARCH} \

 SRCS=		${G_OBJS:.o=.c} ${G_SOURCES}

-.if ${MACHINE_ARCH} == "vax"
-COPTS.decNumber.c=-O0
-.endif
-
 .PATH: ${DIST}/libdecnumber ${DIST}/libdecnumber/dpd ${DIST}/libdecnumber/bid

 .include <bsd.lib.mk>
diff --git a/external/gpl3/gdb/lib/libgdb/Makefile b/external/gpl3/gdb/lib/libgdb/Makefile
index b87a515d13a..c118c363975 100644
--- a/external/gpl3/gdb/lib/libgdb/Makefile
+++ b/external/gpl3/gdb/lib/libgdb/Makefile
@@ -66,12 +66,6 @@ CFLAGS:=		${CXXFLAGS} -std=gnu++17 -Wno-error=stack-protector

 ada-exp.c: ada-lex.c

-.if ${MACHINE} == "vax"
-. if ${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8
-COPTS.read.c+=	-O0
-. endif
-.endif
-
 # These are generated by implicit rules and are not easy to generate
 CLEANDIRFILES+= \
 	ada-exp.c ada-lex.c \
diff --git a/external/mit/xorg/lib/gallium.old/Makefile b/external/mit/xorg/lib/gallium.old/Makefile
index 55b2fe3d1c1..bfa40c8974f 100644
--- a/external/mit/xorg/lib/gallium.old/Makefile
+++ b/external/mit/xorg/lib/gallium.old/Makefile
@@ -1211,10 +1211,6 @@ SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHL
 COPTS+=	${${ACTIVE_CC} == "clang":? -Wa,-Av8plus  :}
 .endif

-.if ${MACHINE_ARCH} == "vax"
-COPTS.nir.c += -O1
-.endif
-
 # XXXGCC12
 .if ${MACHINE_ARCH} == "m68k"
 COPTS.st_glsl_to_tgsi.cpp += -O1
diff --git a/external/mit/xorg/lib/gallium/Makefile b/external/mit/xorg/lib/gallium/Makefile
index 6778a8c11c8..9f1422080fe 100644
--- a/external/mit/xorg/lib/gallium/Makefile
+++ b/external/mit/xorg/lib/gallium/Makefile
@@ -1428,10 +1428,6 @@ SYMLINKS+= gallium_dri.so.${SHLIB_MAJOR}.debug ${DRIDEBUGDIR}/${_d}_dri.so.${SHL
 COPTS+=	${${ACTIVE_CC} == "clang":? -Wa,-Av8plus  :}
 .endif

-.if ${MACHINE_ARCH} == "vax"
-COPTS.nir.c += -O1
-.endif
-
 COPTS.u_atomic.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 10:? -Wno-builtin-declaration-mismatch :}

 .include <bsd.lib.mk>
diff --git a/external/mit/xorg/lib/libX11/Makefile.libx11 b/external/mit/xorg/lib/libX11/Makefile.libx11
index e103d9ace12..0e55c2a4732 100644
--- a/external/mit/xorg/lib/libX11/Makefile.libx11
+++ b/external/mit/xorg/lib/libX11/Makefile.libx11
@@ -471,11 +471,6 @@ COPTS.OpenDis.c+=	-Wno-error	# XXX xf86bigfstr.h
 COPTS.XlibInt.c+=	-Wno-error	# XXX xcmiscstr.h
 COPTS.XKBBind.c+=	-Wno-deprecated-declarations	# uses XKeycodeToKeysym

-# XXX
-.if ${MACHINE} == "vax"
-COPTS.lcWrap.c+=	-O0
-.endif
-
 CWARNFLAGS.clang+=	-Wno-string-plus-int

 .include "${NETBSDSRCDIR}/external/mit/xorg/tools/makekeys/Makefile.makekeys"
diff --git a/games/gomoku/Makefile b/games/gomoku/Makefile
index e86a63aaea7..678537066ed 100644
--- a/games/gomoku/Makefile
+++ b/games/gomoku/Makefile
@@ -9,10 +9,6 @@ LDADD=	-lcurses -lterminfo
 HIDEGAME=hidegame
 CPPFLAGS+=	${DEBUG:D-DDEBUG}

-.if ${MACHINE} == "vax"
-COPTS.pickmove.c += -O0
-.endif
-
 #WARNS=		6	# would produce warnings about small integer types
 LINTFLAGS+=	-w	# treat warnings as errors
 LINTFLAGS+=	-T	# strict bool mode
diff --git a/games/phantasia/Makefile b/games/phantasia/Makefile
index e9c53f23ae5..b919dac17c6 100644
--- a/games/phantasia/Makefile
+++ b/games/phantasia/Makefile
@@ -52,7 +52,3 @@ map: map.c
 	./map | plot > /dev/tty

 .include <bsd.prog.mk>
-
-.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
-COPTS.misc.c+=	-O0
-.endif
diff --git a/lib/i18n_module/UTF7/Makefile b/lib/i18n_module/UTF7/Makefile
index 712c1515d42..7136f7f0cc3 100644
--- a/lib/i18n_module/UTF7/Makefile
+++ b/lib/i18n_module/UTF7/Makefile
@@ -3,6 +3,3 @@
 SRCPRE=citrus_
 .include <bsd.lib.mk>

-.if ${MACHINE_ARCH} == "vax" && defined(HAVE_GCC)
-COPTS.citrus_utf7.c+=	-O0
-.endif
diff --git a/lib/libbz2/Makefile b/lib/libbz2/Makefile
index b2aea1e04b0..e60a2862d48 100644
--- a/lib/libbz2/Makefile
+++ b/lib/libbz2/Makefile
@@ -15,11 +15,6 @@ SRCS=		blocksort.c huffman.c crctable.c randtable.c compress.c \
 INCS=		bzlib.h
 INCSDIR=	/usr/include

-# XXX huffman.c gets mis-compiled with 2.95.3
-.if ${MACHINE_ARCH} == "vax"
-COPTS+=		-O0
-.endif
-
 COPTS+=		${CC_WNO_IMPLICIT_FALLTHROUGH}

 # XXX blocksort.c gets mis-compiled with 4.1
diff --git a/lib/libc/gdtoa/Makefile.inc b/lib/libc/gdtoa/Makefile.inc
index 132686fc33d..609da919803 100644
--- a/lib/libc/gdtoa/Makefile.inc
+++ b/lib/libc/gdtoa/Makefile.inc
@@ -44,10 +44,3 @@ SRCS+=	dmisc.c \
 .if ${MACHINE_ARCH} != "vax"
 SRCS+=	strtord.c
 .endif
-
-# XXX revisit with newer GCC.
-# Ensure numbers like 0xffff319f5fa95963 print correctly
-# ("999999999999999.98", not garbage like "?A>C>@>C:BA;A><.:<")
-.if ${MACHINE_ARCH} == "vax" && defined(HAVE_GCC)
-COPTS.misc.c+=	-O0
-.endif
diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile
index cb3f89d6d09..e9c8be820da 100644
--- a/lib/libcrypt/Makefile
+++ b/lib/libcrypt/Makefile
@@ -30,9 +30,6 @@ SRCS+=		crypt-argon2.c
 SRCS+=		${src}
 COPTS.${src}+=	-fvisibility=hidden
 .  endfor
-.  if ${MACHINE} == "vax"
-COPTS.blake2b.c+=	-O0
-.  endif
 .endif

 WARNS?=	5
diff --git a/libexec/ld.elf_so/Makefile b/libexec/ld.elf_so/Makefile
index f5baae1e883..24f7e1121e5 100644
--- a/libexec/ld.elf_so/Makefile
+++ b/libexec/ld.elf_so/Makefile
@@ -141,10 +141,6 @@ CPPFLAGS+=	-DRTLD_DEFAULT_LIBRARY_PATH=\"${SHLIBDIR}:${LIBDIR}\"
 COPTS.rtld.c+=	-Wno-stack-protector
 COPTS.symbol.c+=-Wno-stack-protector

-.if ${MACHINE_CPU} == "vax"
-COPTS.rtld.c+=	-O0
-.endif
-
 LDADD+=		-Wl,--version-script=${.CURDIR}/symbols.map
 LDADD+=		-L${CLIBOBJ} -L${DESTDIR}${LIBDIR}
 .if ${MKPICLIB} != "no"
diff --git a/sbin/fsck_ffs/Makefile.common b/sbin/fsck_ffs/Makefile.common
index 765638b2801..824e3bf2628 100644
--- a/sbin/fsck_ffs/Makefile.common
+++ b/sbin/fsck_ffs/Makefile.common
@@ -36,7 +36,3 @@ COPTS.ffs_appleufs.c+=	-Wno-pointer-sign
 .if ${MACHINE_ARCH} == "m68000"
 COPTS.pass1.c+=	-fno-tree-fre -fno-tree-lrs
 .endif
-.if ${MACHINE_ARCH} == "vax"
-COPTS.pass1.c+=	-O0
-COPTS.inode.c+=	-O0
-.endif
diff --git a/sbin/fsdb/Makefile b/sbin/fsdb/Makefile
index c039f73a1eb..3b0331e5880 100644
--- a/sbin/fsdb/Makefile
+++ b/sbin/fsdb/Makefile
@@ -39,12 +39,6 @@ COPTS.${f}.c+=	-Wno-pointer-sign
 COPTS.pass1.c+=	-fno-tree-fre -fno-tree-lrs
 .endif

-.if ${MACHINE_ARCH} == "vax"
-COPTS.pass1.c+=	-O0
-COPTS.inode.c+=	-O0
-COPTS.fsdb.c+=	-O0
-.endif
-
 CWARNFLAGS.gcc+=	${CC_WNO_ADDRESS_OF_PACKED_MEMBER}

 .include <bsd.prog.mk>
diff --git a/sbin/newfs_ext2fs/Makefile b/sbin/newfs_ext2fs/Makefile
index 40a44b9a038..ecfdbff4d3a 100644
--- a/sbin/newfs_ext2fs/Makefile
+++ b/sbin/newfs_ext2fs/Makefile
@@ -20,8 +20,4 @@ DPADD+=${LIBPROP}

 .PATH:	${NETBSDSRCDIR}/sys/ufs/ext2fs ${FSCK}

-.if ${MACHINE_ARCH} == "vax"
-COPTS.mke2fs.c=-O0
-.endif
-
 .include <bsd.prog.mk>
diff --git a/sbin/ping/Makefile b/sbin/ping/Makefile
index 4f33501ea7a..1f7f56e3ea5 100644
--- a/sbin/ping/Makefile
+++ b/sbin/ping/Makefile
@@ -12,8 +12,4 @@ CPPFLAGS+=	-DIPSEC
 LDADD+= -lipsec
 DPADD+= ${LIBIPSEC}

-.if ${MACHINE_ARCH} == "vax"
-COPTS.ping.c=-O0
-.endif
-
 .include <bsd.prog.mk>
diff --git a/sys/arch/vax/conf/Makefile.vax b/sys/arch/vax/conf/Makefile.vax
index cf095d54a86..c483eaa644a 100644
--- a/sys/arch/vax/conf/Makefile.vax
+++ b/sys/arch/vax/conf/Makefile.vax
@@ -34,7 +34,6 @@ GENASSYM_CONF=	${VAX}/vax/genassym.cf
 CPPFLAGS+=	-D_VAX_INLINE_
 AFLAGS+=	-x assembler-with-cpp -fno-pic
 CFLAGS+=	-fno-pic
-COPTS.wsmux.c+=	${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 9:? -O1 :}


 ##
diff --git a/sys/lib/libsa/Makefile b/sys/lib/libsa/Makefile
index 718c97ce857..4ef3840c753 100644
--- a/sys/lib/libsa/Makefile
+++ b/sys/lib/libsa/Makefile
@@ -96,7 +96,3 @@ SRCS+=	ufs.c
 lib${LIB}.o:: ${OBJS:O} __buildstdlib

 CPPFLAGS+=	-Wno-pointer-sign
-
-.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
-COPTS.bootp.c+=	-O0
-.endif
diff --git a/sys/lib/libz/Makefile b/sys/lib/libz/Makefile
index 6945c0da6c6..61fb7d4f652 100644
--- a/sys/lib/libz/Makefile
+++ b/sys/lib/libz/Makefile
@@ -25,7 +25,3 @@ CLEANFILES+= lib${LIB}.o
 .include <bsd.lib.mk>

 lib${LIB}.o:: ${OBJS:O} __buildstdlib
-
-.if defined(HAVE_GCC) && ${MACHINE_ARCH} == "vax"
-COPTS.inftrees.c+=	-O0
-.endif
diff --git a/sys/modules/lfs/Makefile b/sys/modules/lfs/Makefile
index 962538821a5..ea8f187e160 100644
--- a/sys/modules/lfs/Makefile
+++ b/sys/modules/lfs/Makefile
@@ -18,9 +18,4 @@ SRCS+=	ulfs_bmap.c ulfs_dirhash.c ulfs_inode.c ulfs_lookup.c \

 WARNS=	3

-.if ${MACHINE} == "vax"
-# GCC 6.5 and 7.4 cannot compile this with -DDIAGNOSTIC and -O2/-O1
-COPTS.lfs_inode.c+=	-O0
-.endif
-
 .include <bsd.kmodule.mk>
diff --git a/sys/rump/fs/lib/liblfs/Makefile b/sys/rump/fs/lib/liblfs/Makefile
index abade3767d9..68b74c62502 100644
--- a/sys/rump/fs/lib/liblfs/Makefile
+++ b/sys/rump/fs/lib/liblfs/Makefile
@@ -17,9 +17,6 @@ SRCS+=	ulfs_bmap.c ulfs_dirhash.c ulfs_extattr.c 			\


 CFLAGS+=        -DLFS_KERNEL_RFW
-.if ${MACHINE_ARCH} == "vax"
-COPTS.lfs_inode.c+=-O0
-.endif

 .include <bsd.lib.mk>
 .include <bsd.klinks.mk>
diff --git a/usr.sbin/mtrace/Makefile b/usr.sbin/mtrace/Makefile
index aef09db6198..9c125c15265 100644
--- a/usr.sbin/mtrace/Makefile
+++ b/usr.sbin/mtrace/Makefile
@@ -12,10 +12,6 @@ PROG=	mtrace
 SRCS=	igmp.c inet.c kern.c mtrace.c
 MAN=	mtrace.8

-.if ${MACHINE_ARCH} == "vax"
-COPTS.mtrace.c=-O0
-.endif
-
 BINMODE=4555
 BINOWN= root

diff --git a/external/gpl3/gcc.old/usr.bin/backend/Makefile b/external/gpl3/gcc.old/usr.bin/backend/Makefile
index d69a26fe619..99e881c783d 100644
--- a/external/gpl3/gcc.old/usr.bin/backend/Makefile
+++ b/external/gpl3/gcc.old/usr.bin/backend/Makefile
@@ -533,68 +533,9 @@ COPTS.insn-recog.c+=-Wno-error

 .if ${GCC_MACHINE_ARCH} == "vax"
 CPPFLAGS+=-I${.CURDIR}/../../lib/libgcc/libgcov/arch/${GCC_MACHINE_ARCH}
-COPTS.builtins.c+=-O0
-COPTS.calls.c+=-O0
-COPTS.convert.c+=-O0
-COPTS.data-streamer-out.c+=-O0
-COPTS.dse.c+=-O0					# XXX port-vax/51967
-COPTS.dwarf2out.c+=-O0
-COPTS.expmed.c+=-O0
-COPTS.expr.c+=-O0 -Wno-error=tautological-compare
-COPTS.fixed-value.c+=-O0
-COPTS.fold-const.c+=-O0
-COPTS.generic-match.c+=-O0
-COPTS.gimple-fold.c+=-O0
-COPTS.gimple-match.c+=-O0
-COPTS.gimple-ssa-strength-reduction.c+=-O0
-COPTS.gimple-ssa-warn-restrict.c+=-O0
-COPTS.gimple.c+=-O0
-COPTS.internal-fn.c+=-O0
-COPTS.lto-streamer-out.c+=-O0
-COPTS.omp-low.c+=-O0
-COPTS.predict.c+=-O0
-COPTS.range-op.cc+=-O0
-COPTS.recog.c+=-O0
-COPTS.sanopt.c+=-O0
-COPTS.stmt.c+=-O0
-COPTS.stor-layout.c+=-O0
-COPTS.targhooks.c+=-O0
-COPTS.tree-affine.c+=-O0
-COPTS.tree-cfg.c+=-O0
-COPTS.tree-data-ref.c+=-O0
-COPTS.tree-eh.c+=-O0
-COPTS.tree-if-conv.c+=-O0
-COPTS.tree-object-size.c+=-O0
-COPTS.tree-parloops.c+=-O0
-COPTS.tree-predcom.c+=-O0
-COPTS.tree-pretty-print.c+=-O0
-COPTS.tree-ssa-alias.c+=-O0
-COPTS.tree-ssa-ccp.c+=-O0
-COPTS.tree-ssa-forwprop.c+=-O0
-COPTS.tree-ssa-loop-ivopts.c+=-O0
-COPTS.tree-ssa-loop-manip.c+=-O0
-COPTS.tree-ssa-loop-niter.c+=-O0
-COPTS.tree-ssa-math-opts.c+=-O0
-COPTS.tree-ssa-phiopt.c+= -O0
-COPTS.tree-ssa-pre.c+=-O0
-COPTS.tree-ssa-reassoc.c+=-O0
-COPTS.tree-ssa-strlen.c+=-O0
-COPTS.tree-ssa-uninit.c+=-O0
-COPTS.tree-ssa.c+=-O0
-COPTS.tree-switch-conversion.c+=-O0
-COPTS.tree-vect-data-refs.c+=-O0
-COPTS.tree-vect-loop-manip.c+=-O0
-COPTS.tree-vect-loop.c+=-O0
-COPTS.tree-vect-patterns.c+=-O0
-COPTS.tree-vect-stmts.c+=-O0
-COPTS.tree-vrp.c+=-O0
-COPTS.tree.c+=-O0
-COPTS.ubsan.c+=-O0
-COPTS.varasm.c+=-O0
-COPTS.vr-values.c+=-O0
-COPTS.web.c+=-O0
-COPTS.wide-int-range.cc+=-O0
-COPTS.wide-int.cc+=-O0
+
+COPTS.expmed.c+=-Wno-error=tautological-compare
+COPTS.expr.c+=-Wno-error=tautological-compare
 .else
 COPTS.tree.c=	${${ACTIVE_CC} == "clang" :? -O0 :}
 .endif
2023-10-07 12:15:49 +00:00
blymn 95dcd6ac86 Fix for install/56467
Set x to 0 before calling scroll based on a  proposed fix by RVP (thanks!)
2023-10-05 06:15:03 +00:00
martin d5535d78b7 Fix padding for formats with mutliple padded values.
PR lib/57633, fix from FreeBSD.
2023-09-28 10:03:41 +00:00
riastradh 5e725db5ff pam_krb5: Fix PR lib/57631.
Loose ends in the fix for NetBSD-SA2023-006 that weren't caught by
review or, somehow, by my own testing.  Evidently we need automatic
tests for this pam business.

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-09-28 02:31:04 +00:00
martin 3fd84419c8 PR kern/57626: instead of an (arbitrary) FAKE_PAGE_SHIFT (and always
using 4k pages), query the hypervisor for the real page size of the host
kernel and use that for architectures that do not have compile time
constant page sizes.
2023-09-24 09:33:26 +00:00
shm 6f4b1613b1 Fix memory leak in getent()
Memory was not freed if record was not found
2023-09-21 13:46:12 +00:00
christos 89098d2011 Update tzcode from 2022g to 2023c:
Release 2023c - 2023-03-28 12:42:14 -0700

Release 2023b - 2023-03-23 19:50:38 -0700

Release 2023a - 2023-03-22 12:39:33 -0700

  Changes to code

    You can now tell tzselect local time, to simplify later choices.
    Select the 'time' option in its first prompt.

    You can now compile with -DTZNAME_MAXIMUM=N to limit time zone
    abbreviations to N bytes (default 255).  The reference runtime
    library now rejects POSIX-style TZ strings that contain longer
    abbreviations, treating them as UTC.  Previously the limit was
    platform dependent and abbreviations were silently truncated to
    16 bytes even when the limit was greater than 16.

    The code by default is now designed for C99 or later.  To build in
    a C89 environment, compile with -DPORT_TO_C89.  To support C89
    callers of the tzcode library, compile with -DSUPPORT_C89.  The
    two new macros are transitional aids planned to be removed in a
    future version, when C99 or later will be required.

    The code now builds again on pre-C99 platforms, if you compile
    with -DPORT_TO_C89.  This fixes a bug introduced in 2022f.

    On C23-compatible platforms tzcode no longer uses syntax like
    'static [[noreturn]] void usage(void);'.  Instead, it uses
    '[[noreturn]] static void usage(void);' as strict C23 requires.
    (Problem reported by Houge Langley.)

    The code's functions now constrain their arguments with the C
    'restrict' keyword consistently with their documentation.
    This may allow future optimizations.

    zdump again builds standalone with ckdadd and without setenv,
    fixing a bug introduced in 2022g.  (Problem reported by panic.)

    leapseconds.awk can now process a leap seconds file that never
    expires; this might be useful if leap seconds are discontinued.

  Changes to commentary

    tz-link.html has a new section "Coordinating with governments and
    distributors".  (Thanks to Neil Fuller for some of the text.)

    To improve tzselect diagnostics, zone1970.tab's comments column is
    now limited to countries that have multiple timezones.

    Note that leap seconds are planned to be discontinued by 2035.
2023-09-16 18:40:26 +00:00
rin eab3f8e648 libc/arch: Fix copy-paste; or1k, powerpc64, riscv are not powerpc ;) 2023-09-14 03:58:50 +00:00
rin ea48808d5f libpthread/Makefile: trailing whitespace 2023-09-14 03:17:02 +00:00
dholland bd3bb89429 ctime.3: fix merge mistake
The paragraphs about the *_r and *_z/rz functions belong at the end of
the section (or somewhere like that), not affixed to the description of
difftime in the middle of the list of functions.
2023-09-12 21:56:05 +00:00
uwe 01a19e2f71 sparc_v8.S: fix v8 .mul/.umul versions to conform to psABI
Both .mul and .umul are defined to return the most significant 32 bits
of the result in %o1, but v8 multiplication instructions put them in
%y.  Move them to %o1.  Nothing in the gcc generated code depends on
this, but hand-written assembly can rely on this and e.g. Self does.
2023-09-11 12:00:45 +00:00
christos 03645a16a3 PR/57609: Carl Engvall: Add salen checks but accept larger sizes
(upto sockaddr_storage)
2023-09-08 18:17:41 +00:00
ad 340135473f raise() has understood threads for a long time, don't reimplment it. 2023-09-07 19:59:20 +00:00
riastradh 83df26257c pam_ksu(8): Allow homedir access during kuserok.
Otherwise, the default kuserok logic to look at ~targetuser/.k5login
would be blocked by the security measure to thwart NetBSD-SA2023-005.

(There are other ways, e.g. setting SYSTEM-K5LOGIN in /etc/krb5.conf
so the file is /etc/k5login.d/user instead of ~user/.k5login, but
that's not the default configuration and there are plenty of
deployments that rely on ~user/.k5login today.)

I reviewed libkrb5 for homedir access checks.  There are three:

1. krb5_config_parse_file_multi, called only by:
   - verify_krb5_conf -- not relevant
   - krb5_config_parse_file -- not used here as far as I can tell,
     only by libhdb ldap logic and test code in heimdal
   - krb5_set_config_files -- used here only via krb5_init_context,
     which is done at this point

2. plugin_get_hosts in krbhst.c, used to look up hosts for KDC I/O,
   which shouldn't be happening at this point, so this is almost
   certainly unreachable; also it only appears to control whether
   some old plugin API can be used, long after we have read the krb5
   config controlling which plugins are available, so this is
   probably harmless

3. krb5_kuserok, which is the one we want to allow

Note: This will have to be updated again in the next Heimdal update,
which eliminates the global homedir access flag in favour of making
the default per-context homedir access flag conditional on !issuid.

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-09-07 11:27:57 +00:00
riastradh 40ca0b4614 lib: Handle various external lib directories with build_install.
This way, update builds track shlib major bumps correctly.

For example, suppose you had built Heimdal's libkrb5.so.27 and
libgssapi.so.11 linked against it, and then you updated past the recent
shlib major bump raising them to libkrb5.so.28 and libgssapi.so.12.

Without this change, the build will make the following sequence of
targets (interleaved with some others):

1. make dependall in libkrb5
2. make dependall in libgssapi
3. make install in libkrb5
4. make install in libgssapi

The existing .WAIT tags in SUBDIR ensure that (1) happens before (2)
and (3) happens before (4).  Unfortunately, this sequence is wrong,
because it will produce the following effect:

1. make dependall in libkrb5 builds libkrb5.so.28
2. make dependall in libgssapi builds libgssapi.so.12, linked against
   libkrb5.so.27
3. make install in libkrb5 installs libkrb5.so.28
4. make install in libgssapi installs libgssapi.so.12

Why the out-of-date libkrb5.so.27 in step (2)?  Because we just pass
-L${DESTDIR}/usr/lib -lkrb5 to the linker (or the equivalent with
--sysroot and implied -L/usr/lib), and ${DESTDIR}/usr/lib still has
only libkrb5.so.27 by the time of step (2), not libkrb5.so.28.

Now any applications that link against libkrb5.so _and_ libgssapi.so
will get libkrb5.so.28 and libgssapi.so.12 -- but transitively, via
libgssapi.so.12, they will also get libkrb5.so.27, which is a recipe
for disaster.

Splicing the Heimdal library subdirectories into lib/Makefile, as
this does, ensures that we run make dependall _and_ make install in
libkrb5 _before_ make dependall in libgssapi, giving the following
correct sequence:

1. make dependall in libkrb5 builds libkrb5.so.28
2. make install in libkrb5 installs libkrb5.so.28
3. make dependall in libgssapi builds libgssapi.so.12, linked against
   libkrb5.so.28
4. make install in libgssapi installs libgssapi.so.12

Note that LIBDPLIBS isn't enough here, as implemented.  LIBDPLIBS
ensures that the incremental build will remake libgssapi.so.  But it
doesn't ensure that the new libkrb5.so.28 is available before then,
so it doesn't prevent this problem.

We use the same mechanism for crypto/external/bsd/openssl/lib
already; this just extends it to other external library collections.

As an alternative, in principle perhaps we could teach LIBDPLIBS to
ensure that libkrb5.so comes out of the libkrb5 objdir, and not out
of ${DESTDIR}/usr/lib.  But that requires some work to make happen,
and make it reliable, whereas this approach we've already confirmed
works without other adverse consequences (besides leaving
grody-looking mechanism lying around) for the libcrypto major bump
already.  We need to get this pulled up to the branch so all the
other major bumps it required are handled correctly by update builds.

XXX pullup-10
2023-09-06 23:44:42 +00:00
ad 22b5550884 Node that aarch64 implements CAS. 2023-09-06 20:17:42 +00:00
riastradh 4604ab506a */shlib_version: Ensure a boring line between RCS id and all else.
This makes cherry-picks easier by avoiding conflicts between the RCS
id and the interesting changes.
2023-09-06 12:48:15 +00:00
mrg c580d690fa apply -Wno-dangling-pointer to callcontext.c.
puffs_cc_getcc() uses a mask against a stack variable to find the
struct puffs_cc stashed below the stack, triggering the dangling
pointer problem.
2023-09-05 00:12:14 +00:00
mrg 407611763a apply ${CC_WNO_STRINGOP_OVERFLOW} for crypt.c.
init_perm() takes a larger array than IE3264[] is, but it doesn't use more
for this instance.
2023-09-04 23:00:48 +00:00
mrg 0ad391080c fix pointer vs array function definition issues.
for the backend End and Data functions, use "char buf[HASH_STRLEN]"
instead of "char *buf", to match the public functions.

fixes GCC 12 warning.
2023-09-04 20:51:39 +00:00
riastradh 3587d6f89c libc_aligned, libc_fp: Add missing close-paren.
Did this ever work?
2023-09-04 18:16:53 +00:00
riastradh 76060e8bb2 libss, liblwres: Delete makefiles for long-dead external libraries.
No functional change intended -- these haven't been used in years.
2023-09-04 18:16:42 +00:00
riastradh ad69f62aa2 Recursively revbump all dependents of libcrypto.
Otherwise any existing software linked against the openssl11
libcrypto.so.14 and any of these libraries will suddenly start
pulling in libcrypto.so.15 at the same time, leading to mayhem in the
address space.

PR lib/57603

XXX pullup-10
2023-09-04 18:12:44 +00:00
mrg 377714d879 avoid array-bounds issues by using more complete types.
also, don't cast to a type that includes an extra, unused, member.

while here, replace the hard coded offsets in setjmp.S and some
asserts in longjmp.c with assym.h and shared structures for all
the movings parts, and asserts based upon those structures.

avoids GCC 12 warnings.
2023-09-03 21:41:45 +00:00
christos d5c6fca106 - cast GETNEXT to unsigned where it is being promoted to int to prevent
sign-extension (really it would have been better for PEEK*() and GETNEXT()
  to return unsigned char; this would have removed a ton of (uch) casts, but
  it is too intrusive for now).
- fix an isalpha that should have been iswalpha
2023-08-30 20:37:24 +00:00
rin 916b154777 libkvm: whitespace 2023-08-23 14:00:11 +00:00
rin 6c2fafb153 libexecinfo: whitespace, missing RCSID, no binary changes 2023-08-23 12:24:59 +00:00
rin c0141d3aff lib/Makefile: Hook libgmp also for MKGDB=yes build
Now, gdb 13 can be built by clang, at least on amd64.
2023-08-20 02:07:54 +00:00
andvar e616cf290c s/logigally/logically/. 2023-08-17 14:21:18 +00:00
rin 12ff6354c6 libcrypt: trailing white space 2023-08-14 02:22:35 +00:00
riastradh 03840421c9 vis(3): Per KNF, sys/param.h comes before sys/types.h.
Which is nice because that's also lexicographic.
2023-08-13 15:20:37 +00:00
riastradh dbb433e7d2 vis(3): Need <stdint.h> for SIZE_MAX, per C standard.
From Kyle Evans <kevans@FreeBSD.org>.

Followup to PR lib/57573.

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-08-13 15:19:24 +00:00
riastradh 5f1a044720 vis(3): Sort includes. No functional change intended.
Prompted by PR lib/57573.

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-08-13 15:19:13 +00:00
riastradh 45c2d29183 strncpy(3): More on how strlcpy is not a safe strncpy replacement. 2023-08-13 11:27:22 +00:00
wiz dde43aa723 memcpy: consistency in prototype and fix sentence 2023-08-13 04:20:07 +00:00
riastradh 8a22324f3b vis(3): Fix one more buffer overrun in an edge case.
PR lib/57573

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-08-12 12:48:52 +00:00
riastradh 6d340e9776 vis(3): Fix main part of PR lib/57573.
From Kyle Evans <kevans@FreeBSD.org>.

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-08-12 12:48:37 +00:00
riastradh c0d7be47dd vis(3): Avoid potential arithmetic overflow in maxolen.
Can't easily prove that this overflow is impossible, so let's add a
check.

Prompted by PR lib/57573.

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-08-12 12:48:17 +00:00
riastradh 5bc0959c19 vis(3): Call wcslen(start) only once.
It had better not change between these two times!

Prompted by PR lib/57573.

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-08-12 12:48:01 +00:00
riastradh 4476814b92 vis(3): Avoid arithmetic overflow before calloc(3).
Prompted by PR lib/57573.

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-08-12 12:47:17 +00:00
riastradh 0da31b0324 vis(3): Make mbslength unsigned.
Sprinkle assertions and comments justifying the proposition that it
would never go negative if signed.

Obviates need to worry about mblength > SSIZE_MAX.

Prompted by PR lib/57573.

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-08-12 12:46:50 +00:00
riastradh 292538aef5 vis(3): Make maxolen unsigned size_t, not ssize_t.
It is initialized once either to *dlen, which is unsigned size_t, or
to wcslen(start) * MB_MAX_LEN + 1, and wcslen returns unsigned size_t
too.  So there appears to have never been any reason for this to be
signed.

Part of PR lib/57573.

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-08-12 12:46:33 +00:00
riastradh 8663f611f9 strncpy(3): Fix column sizing. 2023-08-11 21:32:26 +00:00
riastradh f9ab7ea1fa strlcpy(3): Tweak markup. 2023-08-11 21:30:32 +00:00
riastradh 1e1d50bc3a strlcpy(3), strncpy(3): Omit needless (void) casts in examples.
The return values are not critical.
2023-08-11 21:20:39 +00:00
riastradh 13b8c448a3 strcpy(3), strlcpy(3), strncpy(3): Just say `byte', not `character'. 2023-08-11 21:17:16 +00:00
riastradh 312767bb97 strncpy(3): Tiny wording tweak. 2023-08-11 21:12:10 +00:00
riastradh 59f2c9f1d8 strncpy(3): Reword to make sentence structure parallel. 2023-08-11 21:11:21 +00:00
riastradh 0c12668de1 strncpy(3): Fix typo -- stpncpy, not stpcpy which is different. 2023-08-11 21:10:26 +00:00
riastradh 71bfa8b23f strncpy(3): Take another whack at clarifying this.
Emphasize the fixed-buffer nature of it, and that NUL-termination is
neither required on input nor guaranteed on output.
2023-08-11 21:09:11 +00:00
riastradh f6905a9fb3 strlcpy(3): Nix stray space between `NUL' and `-terminating'. 2023-08-11 16:34:28 +00:00
uwe cfbafd895b strlcpy(3): don't use \*[Ge] for >= - it's wrong for source code
In the PostScript output it produces the single mathematical "greater
or equal" symbol, not the ">=".
2023-08-11 16:06:10 +00:00
riastradh 86913c27a1 strcpy(3): Note that strlcpy(3) is a safer replacement for strcpy(3).
Suggest snprintf("%s") as a more portable alternative too.

Note that both strlcpy and snprintf still require the input to be
NUL-terminated.
2023-08-11 16:05:56 +00:00
riastradh 8d073134df strncpy(3): Rework the example in an attempt to improve exposition. 2023-08-11 16:04:25 +00:00
riastradh 970f82730a strncpy(3): Note strcpy(3) man page revision this forked from. 2023-08-11 15:37:55 +00:00
riastradh 79c9375f5b strcpy(3), strlcpy(3), strncpy(3): Use `.Tn NUL' for the zero byte.
Let's be consistent within these man pages.  (If someone else really
likes the unpronounceable `.Ql \e0' better, that's fine, you can go
through and systematically change all the man pages to use that after
we're done clarifying strcpy(3), strncpy(3), and strlcpy(3).)
2023-08-11 15:36:17 +00:00
uwe 21d6631bb6 strncpy(3): markup tweaks
NUL is a character name, not a defined name, use .Tn
.Ns has implicit .No effect
Use \*q for ASCII quotes (.Dq uses fancy typographical ones)
2023-08-11 13:18:24 +00:00
uwe ea622231f9 strncpy(3): use .Sm off/on around a fancy expression to avoid lots of Ns 2023-08-11 13:10:59 +00:00
ryoon 7bd94317cb Install strncpy.3 to fix build 2023-08-11 13:07:17 +00:00
riastradh dfb89f3791 strncpy(3): Slightly more consistency about NUL vs '\0' in the text. 2023-08-11 12:26:59 +00:00
riastradh 6a5dfcb3ba strncpy(3): Qualify example of strlcpy(3) with a major caveat. 2023-08-11 11:51:54 +00:00
riastradh d3fccc7122 strncpy(3), stpncpy(3): Split man page out of strcpy(3), stpcpy(3).
These are for substantively different purposes (fixed-width fields
with optional NUL padding vs NUL-terminated strings), so they don't
belong together.

Be more specific about the security issues.
2023-08-11 09:39:39 +00:00
riastradh f69a667415 strlcpy(3): Rework man page to clarify relation to strncpy(3).
Add caveats explaining when strlcpy(3) and strlcat(3) are dangerously
inadequate or inappropriate.

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-08-11 08:15:30 +00:00
mrg 45c979d21c remove the -O0 force for _int_strtod_l() and GCC 9, it's fixed in GCC 10 and 12.
this was triggering sh3 GCC 12 to fail compiles because of ssp.h's memcpy()
frontend having the always_inline attribute that didn't match -O0 or so.

tested with pkgsrc gcc9 to confirm it hangs there, but newer versions are fine.

also known as PR#55668, which now has a real fix (gcc 10 :-).
2023-08-11 06:02:46 +00:00
mrg aec4d439cd avoid various use-after-free issues.
create a ptrdiff_t offset between the start of an allocation region and
some interesting pointer, so it can be adjusted with this offset after
realloc() returns.

found by GCC 12.
2023-08-10 20:38:00 +00:00
riastradh 33ce193df2 libc/resolv/res_debug.c: Minor whitespace fixes. 2023-08-09 07:01:09 +00:00
riastradh b3b6b684eb libnpf(3): No need for weird padding any more.
cdbw_output never needed it at runtime, and the declaration no longer
makes gcc angry about not having it.
2023-08-08 10:36:04 +00:00
riastradh 72254be91c cdbw(3): Make cdbw_output descr parameter type less confusing.
This is a string of _up to_ 16 bytes, used with strncpy(..., 16).
Specifying `const char descr[16]', while formally equivalent to
`const char *descr' in standard C, now provokes the ire of gcc when
the caller does not provide a buffer of at least 16 bytes.
2023-08-08 10:34:08 +00:00
mrg 195e7a0895 avoid uninitialised variable accesses.
if __kernel_rem_pio2() or __kernel_rem_pio2f() are called with "nx" less
than 2, the local variable fq[0] may be accessed uninitialised.

__kernel_rem_pio2() has direct calls with nx = 1, and __kernel_rem_pio2f()
is called with a value starting at 3, but may be decreased to less than 2,
implied by this code , if not actually avoided by the tx[] setup above:
	nx = 3;
	while(tx[nx-1]==zero) nx--;     /* skip zero term */
	n  =  __kernel_rem_pio2f(tx,y,e0,nx,2,two_over_pi);

found by GCC 12.
2023-08-08 06:31:17 +00:00
rin 54684bbd74 libm: Add fma(3) and friends to m68k 2023-08-08 02:09:42 +00:00
riastradh a8b57fa134 libm: Add dummy remainderl and remquol.
These are pretty bad -- these aren't transcendental functions; not
rocket science to make them correctly rounded -- but let's just make
sure they're available in libm for netbsd-10.

XXX pullup-10
2023-08-07 08:54:40 +00:00
andvar 506971ff58 fix typos in comments and one definition, mainly s/sucket/socket/. 2023-08-03 20:45:49 +00:00
rin 03675fcefd Revert CC_WNO_USE_AFTER_FREE from Makefile's (thanks uwe@) 2023-08-03 14:56:36 +00:00
rin 91f8ac6d30 Sprinkle CC_WNO_USE_AFTER_FREE for GCC 12
All of them are blamed for idiom equivalent to:
	newbuf = realloc(buf, size);
	p = newbuf + (p - buf);
2023-08-03 13:36:08 +00:00
nia e6ea867424 Revert addition of epoll to libc until discussion concludes 2023-08-03 12:24:46 +00:00
gutteridge b60029512a select.2: note when pselect(2) was added 2023-08-01 23:33:04 +00:00
andvar 1e7139f024 fix RCSIDs. 2023-08-01 20:09:12 +00:00
christos b515b5959a Add companion mempcpy to wmempcpy, bump. 2023-08-01 17:51:24 +00:00
mrg f386908b27 convert explicit length check before unchecked snprintf() with just a
overflow checked snprintf().  for res_debug.c and res_query.c, convert
from sprintf() to snprintf().

tested scp and rcp fail properly with too-long paths.
tested getaddrinfo fails as expected for too-long domains.
tested dig and ping for similar (res_debug.c/res_query.c).
created a temporary fs with quotas to test edquota with a long EDITOR.
did not test ypserv directly, but it's the same pattern.

avoids GCC 12 snprintf() warnings, and reduces total code size.
2023-08-01 08:47:24 +00:00
mrg 1115bcb541 cdbw_output()'s 3rd argument must be a 16-byte char array, so pad the
string literals passed to it with enough nuls to make this true.

found by GCC 12.
2023-08-01 07:57:17 +00:00
mrg a916878419 pass the struct size to malloc(), not the pointer size.
found by GCC 12.
2023-08-01 07:56:23 +00:00