Commit Graph

21178 Commits

Author SHA1 Message Date
christos b0c6c15390 remove #include <ieeefp.h> for i386 now that it is included in math_private.h 2024-04-03 18:53:41 +00:00
christos b3579e8037 need <ieeefp.h> for i386. 2024-04-03 14:54:50 +00:00
kre 0e71e5a0d1 For i386, if ft[sg]etprec() are to be used, ensure there's a
prototype for them in scope (so include <ieeefp.h>)

Might fix the i386 build.
2024-04-03 04:40:23 +00:00
christos d89d80aaff reduce diff with FreeBSD 2024-04-03 01:51:01 +00:00
rillig d5bb47fbc4 sparc/fpsetround: fix the nearby signed integer overflow as well
Same as for sparc64 a few days ago.
2024-04-02 20:42:12 +00:00
christos a7add5bb79 fix lint 2024-04-02 20:27:44 +00:00
christos 16095d554f undo accidental commit. 2024-04-02 18:40:50 +00:00
christos 8f219a4edd PR/58054: Martin Husemann: fix bug in expsign extraction and only use the
code for the floating point formats where it works (does not work for 112
bit mantisa in sparc64)
2024-04-02 18:39:51 +00:00
andvar 7f3436c3c9 s/Unfortunatley/Unfortunately/ in comment. 2024-03-30 22:05:07 +00:00
christos 046528e7dc From enh at google dot com in tech-userlevel. Don't limit writes to BUFSIZ,
change the limit to INT_MAX; improves performance dramatically. From:
https://github.com/apple-oss-distributions/Libc/commit/\
c5a3293354e22262702a3add5b2dfc9bb0b93b85\
#diff-3b844a19cfb0aab1a23f7fbc457d3bce7453513730c489a72f66ff89d6557ff3
2024-03-29 22:39:41 +00:00
rillig 7529cf7879 libm/s_logl: suppress lint warnings
Seen on sparc64.
2024-03-26 20:12:47 +00:00
christos 5a13a6eee6 fix insert key (Xose Vazquez Perez) 2024-03-26 18:02:04 +00:00
andvar 132b98a088 Fix few typos in comments. 2024-03-22 19:45:22 +00:00
andvar 4a3e2a8295 s/Cannnot/Cannot/ in error message. 2024-03-22 19:36:56 +00:00
uwe e610bdf867 sysconf(3): a few more markup fixes 2024-03-21 22:27:55 +00:00
uwe 57b3fcda6d sysconf(3): the _SC constants are .Dv 2024-03-21 22:21:40 +00:00
uwe 3b8ede1ce6 sysconf(3): NUL is not a defined variable 2024-03-21 22:17:27 +00:00
uwe afd5650391 sysconf(3): POSIX text doesn't capitalize "option". 2024-03-21 22:14:29 +00:00
wiz 42c4efb6b4 Fix NUL/NULL confusion.
One of these was reported by Mouse in PR 58058.
2024-03-21 14:48:01 +00:00
rillig aabd8f68ba sparc64/fpsetround: avoid shifting into the sign bit
Lint had warned about the constant expression '0x03 << 30' but not about
the structurally equal nonconstant expression '(rnd_dir & 0x03) << 30'.

No binary change.
2024-03-20 06:15:39 +00:00
riastradh eea7d4e0e0 strptime(3): Declare digit d as time_t.
This doesn't make a semantic difference -- d can only take on the ten
values {0,1,2,3,4,5,6,7,8,9}, and the arithmetic with it later all
comes out the same whether the type is unsigned or time_t, even if
time_t were int32_t instead of int64_t.

But it pacifies overzealous compilers used by downstream users of
this code.  And while it's silly to use a much wider type (64-bit
signed) than is needed here to store a single digit, it doesn't
really hurt either (32-bit unsigned is much larger than needed too).

PR lib/58041
2024-03-18 16:15:24 +00:00
andvar a5c0af2445 Add missing "e" in few words, in comments and one log message. 2024-03-17 21:48:01 +00:00
andvar bb2336b065 s/argumment/argument/ in documentation. 2024-03-17 21:37:53 +00:00
riastradh 7b531fef3d strptime(3): Reduce unnecessary indentation.
Post-fix tidying.

No functional change intended.

PR lib/58041
2024-03-16 00:16:21 +00:00
riastradh 5f253fa591 strptime(3): Avoid arithmetic overflow.
PR lib/58041
2024-03-16 00:06:45 +00:00
jakllsch be561d813d Sync with OpenBSD 2024-03-14 15:39:23 +00:00
jakllsch 8f746c3921 Remove Reserved usages and ranges thereof
Helps align with future merge
2024-03-14 15:27:22 +00:00
jakllsch 8fc95d6b5f fix typos 2024-03-14 15:23:52 +00:00
christos 08e65c02f2 fix lint 2024-03-11 23:05:35 +00:00
christos 0e8d0976c1 add casts for compat code where time_t is 32 bits. 2024-03-11 23:03:35 +00:00
rillig fd0bc09974 compiler_rt: allow signed bit shifts for __negv
Standard C defines '1 << 31' as undefined behavior, but
https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html allows
it for GCC.
2024-03-10 18:00:13 +00:00
mlelstv 3fb2741729 Don't use uninitialized variable.
Fixes PR 57895.
2024-03-09 13:48:50 +00:00
christos d57953e9b2 pass lint on sparc64 where int_fast32_t is long. 2024-03-07 20:42:04 +00:00
rillig a15b6e013d snprintb.3: fix typo 2024-02-29 21:08:54 +00:00
rillig 4cf4169998 parsedate.y: remove outdated comment
The number of shift/reduce conflicts has grown to 16.
2024-02-29 20:55:35 +00:00
christos a481444702 appease lint 2024-02-27 15:14:15 +00:00
mrg ee803f2386 revert previous - it doesn't mean what i thought and some builds broke. 2024-02-26 20:16:16 +00:00
mrg 35db73b092 skip sanitizers if MKSANITIZER "no". 2024-02-25 20:25:09 +00:00
christos 7648c0702a fabsl is defined in libc... 2024-02-25 19:26:33 +00:00
mrg 4629208b15 fix some fallout from 32-bit fixes for long double functions.
apply namespace.h to remqou*.  add missing weak aliases for some of them,
and normalise checkf for __weak_alias().

now libm.so seems to only have libc undefined symbols.
2024-02-24 19:32:09 +00:00
christos d0129385d6 add missing symbols for non long double architectures. 2024-02-24 15:16:53 +00:00
christos 4851547888 fix the 32 bit tanl symbol. 2024-02-23 13:42:01 +00:00
rillig 69c5b3b0c1 snprintb: always null-terminate output
Always null-terminate the output in the buffer, even in error cases. The
wording in the manual page has been promising this since 2008. For
snprintb_m, ensure that the output is terminated with two null
characters, to gracefully handle situations in which the caller does not
check whether snprintb returned an error.

If the buffer size is zero, allow the buffer to be a null pointer,
analogous to snprintf.

Fix an out-of-bounds memory read if the bitfmt ends with a '*' directive
(since today).

In the tests, merge the helper functions for snprintb, snprintb_m, as
they were similar enough.

Fix a few 'line_max exceeded' tests, ensuring that they output a '#'
marker, and that the 'complete' tests don't.
2024-02-22 21:04:23 +00:00
rillig d101133e9b snprintb: error out on out-of-bounds bit shifts
Previously, these invoked undefined behavior, now they lead to an early
return. An example of out-of-bounds bit number is in SCZ_PCICTRL_BITS.
Bit fields that extend beyond the msb are still allowed.

Allow 'f' and 'F' to have fields that are 64 bits wide. This only makes
sense when the field starts at bit 0.

Remove the unused 'val_len', it was only needed before snprintb.c 1.20.
2024-02-22 18:26:15 +00:00
rillig aafc9e1277 snprintb.3: sync examples with reality 2024-02-20 20:38:54 +00:00
riastradh fa59e25364 fenv(3): Fix fetestexcept to avoid side effects on trap state.
PR port-amd64/57949
2024-02-20 03:53:48 +00:00
uwe bcbf0090a4 fix typo in comment 2024-02-20 00:09:31 +00:00
rillig fd2741deca mman.h: fix snprintb description for alignment 2^60 2024-02-18 16:55:02 +00:00
kre 7922ccfb13 Revert this part:
strftime %s now uses tm_gmtoff if available.  (Problem and draft
	patch reported by Dag-Erling Smørgrav.)

of the tzcode2924a update.   It is bogus.   The "problem" is/was a simple
misunderstanding of what strftime(%s) is intended to output.  The "fix"
breaks it.
2024-02-18 12:47:08 +00:00
christos f22d611322 Sync with tzcode2024a:
Release 2024a - 2024-02-01 09:28:56 -0800

  Changes to code

    The FROM and TO columns of Rule lines can no longer be "minimum"
    or an abbreviation of "minimum", because TZif files do not support
    DST rules that extend into the indefinite past - although these
    rules were supported when TZif files had only 32-bit data, this
    stopped working when 64-bit TZif files were introduced in 1995.
    This should not be a problem for realistic data, since DST was
    first used in the 20th century.  As a transition aid, FROM columns
    like "minimum" are now diagnosed and then treated as if they were
    the year 1900; this should suffice for TZif files on old systems
    with only 32-bit time_t, and it is more compatible with bugs in
    2023c-and-earlier localtime.c.  (Problem reported by Yoshito
    Umaoka.)

    localtime and related functions no longer mishandle some
    timestamps that occur about 400 years after a switch to a time
    zone with a DST schedule.  In 2023d data this problem was visible
    for some timestamps in November 2422, November 2822, etc. in
    America/Ciudad_Juarez.  (Problem reported by Gilmore Davidson.)

    strftime %s now uses tm_gmtoff if available.  (Problem and draft
    patch reported by Dag-Erling Smørgrav.)

  Changes to build procedure

    The leap-seconds.list file is now copied from the IERS instead of
    from its downstream counterpart at NIST, as the IERS version is
    now in the public domain too and tends to be more up-to-date.
    (Thanks to Martin Burnicki for liaisoning with the IERS.)

  Changes to documentation

    The strftime man page documents which struct tm members affect
    which conversion specs, and that tzset is called.  (Problems
    reported by Robert Elz and Steve Summit.)
2024-02-17 14:54:47 +00:00
uwe 02f7676d3a getnameinfo(3): fix/prettify markup 2024-02-16 22:50:33 +00:00
rillig 6f937561f5 snprintb: rename buflen to bufsize, following the wording in snprintf 2024-02-15 22:48:58 +00:00
jkoshy 262fc961f4 Document the NI_NUMERICSCOPE flag.
PR lib/57832
2024-02-15 15:08:23 +00:00
andvar 48491f9819 Fix few more typos in comments and log message:
s/butoon/button/
s/BUTTOM/BOTTOM/
s/communicaiton/communication/
s/recevice/receive/
s/regiion/region/
2024-02-11 10:36:40 +00:00
andvar 1cd43426d5 Fix various typos in comments, log messages and documentation. 2024-02-10 18:43:51 +00:00
andvar a10c2cec39 fix various typos in comments and log messages. 2024-02-10 09:21:51 +00:00
andvar 5b075dd729 s/psuedo/pseudo/ in comments. 2024-02-10 08:36:03 +00:00
andvar 100a3398b8 fix spelling mistakes, mainly in comments and log messages. 2024-02-09 22:08:30 +00:00
uwe 7a0d941daa signal(3): mention old signal(2) syscall in HISTORY 2024-02-09 17:24:44 +00:00
andvar 82bba4e936 fix various typos in comments. 2024-02-05 21:46:04 +00:00
andvar 5f232faffc s/interrrupt/interrupt/ in comment and editline(3) man page. 2024-02-04 18:47:27 +00:00
uwe 641a20f456 getrawpartition(3): reword to clarify return value, use .Pq
"'a' == 0" is, stricly speaking false, and since 'a' is an int, it's
not immediately clear if it's 'a' or 0 that is returned.  Try to
clarify this.
2024-02-04 18:44:54 +00:00
mrg 2026b7285b update my email address. 2024-02-04 05:43:05 +00:00
rillig 6c33a09efd mblen.3: clean up wording and grammar 2024-02-03 10:55:38 +00:00
andvar f22ed7e5e6 fix various typos in comments. 2024-02-02 22:00:32 +00:00
andvar 82befdcba0 s/shold/should/ 2024-02-02 21:52:22 +00:00
jkoshy 0d507d87e3 Make the err(3) manual clearer to read.
- Mention that the 'fmt' argument to these functions holds
  a printf(3)-like format specification.
- Clarify that the err()/warn()/errc()/warnc() family of functions
  will append an additional error message to the output.
- Add whitespace to separate paragraphs describing distinct
  concepts.
- Move the sentence mentioning the final output newline to
  a less ambiguous location within the text.
- Add a cross-reference to printf(3).
2024-02-02 21:16:41 +00:00
rillig d4c87e8aca snprintb.3: fix examples, clean up wording
In the examples using hex escape sequences, there must be a delimiter
between the escape sequence and the following description if the
description starts with [A-Fa-f], as hex escape sequences are not
limited in length.

Distinguish between a 'directive' (bit + length + description) and a
'description' (only the text).

The fmt parameter is not a string, as strings only reach to the first
'\0' byte, but the new-style format may include additional '\0' as bit
numbers.
2024-02-01 22:18:34 +00:00
christos d44ba2bb3d fix i386 lint 2024-01-27 17:58:36 +00:00
ryoon 64b41b2639 Enable asinl, acosl, logl, coshl, tanhl, atanhl, asinhl and acoshl
* Fix pkgsrc/math/py-numpy and pkgsrc/graphics/py-matplotlib, for example.
2024-01-27 05:50:42 +00:00
wiz aa79da5767 Fix typo 2024-01-26 23:41:55 +00:00
nros d65853d276 sinhf is in the same manual page as sinh not sin 2024-01-26 22:01:40 +00:00
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