Commit Graph

21178 Commits

Author SHA1 Message Date
skrll 95bbc8c712 Annotate the RISC-V signal trampoline with CFI attributes. 2024-05-30 15:56:43 +00:00
christos 2e795eb86e Improve robustness (from kre@) 2024-05-29 13:35:12 +00:00
christos 5c694b5ef7 handle library names that contain a period. 2024-05-28 16:20:34 +00:00
skrll 8a296fe039 Change MIPS to RISC-V. 2024-05-28 06:57:03 +00:00
uwe 463a9e2dfe curses: init old_mode to 1 (normal visible cursor)
PR bin/58090: Ctrl-Z, fg makes blinking cursor in vi
ok blymn@
2024-05-27 14:30:43 +00:00
martin 5d83fcdc53 Use double quotes to include the local ./Makefile.hash 2024-05-20 09:48:42 +00:00
christos 95f35978fa finish renaming __dup3110 to __dup3100 2024-05-20 01:33:39 +00:00
christos 679926ade6 Rename dup3110 to dup3100 to match historical practice for NetBSD-11,
because we already have kevent100. Fix compat_dup3 to belong in compat_100
not compat_110.
2024-05-20 01:30:33 +00:00
christos 381b1356d0 version dup3 2024-05-19 22:25:47 +00:00
christos 2fc12b4c2a Amend for oldfd == newfd returning EINVAL in dup3 2024-05-19 16:04:46 +00:00
uwe a9c500b2e8 curses: constify newterm() and setterm() arguments
newterm() argument is const in the spec, so this fixes our
conformance.

setterm() is not in the spec, but it's natural and in ncurses its
argument is const too, so follow suit.

Doesn't change the ABI, so no bump required.

ok blymn@
2024-05-17 23:32:50 +00:00
christos 5336283700 When calling el_line make sure that we call the resizing function
callback because el_line updates the legacy LineInfo structure and
we need to notify that the cached copy of the the buffer has changed.
Of course the resizing function can call el_line itself to update
the buffer, so prevent recursion. Bug found by Peter Rufer at Arista.
2024-05-17 02:59:08 +00:00
riastradh 70dffce551 riscv: Make feraiseexcept actually raise the given exceptions.
Doing

	fexcept_t ex = 0;
	fesetexceptflag(&ex, excepts);

has the effect of _clearing_ all the exceptions in excepts.  Using
fesetexceptflag doesn't make this easier, because we would have to
record which exceptions were already raised.  So just set the fflags
bits in the fcsr register directly.
2024-05-17 02:11:07 +00:00
riastradh 689d59067a riscv: More shiftiness reduction around FCSR in libc. 2024-05-16 01:02:35 +00:00
riastradh 143bae62f3 riscv: Nix shifting around FRRM and FSRM in libc too.
These read and write the floating-point rounding mode directly, not
the whole floating-point control and status register.
2024-05-16 00:56:11 +00:00
riastradh 6f685adcb6 usleep(3): Note the historical rake that was stepped upon.
PR 58184
2024-05-15 13:12:04 +00:00
riastradh 906e271cb3 modfl(3): Fix conversion from FreeBSD.
LDBL_MANL_SIZE is spelled EXT_FRACLBITS -- and not EXT_FRACHBITS.

PR lib/58237: modfl returns wrong answers on ld128 architectures
2024-05-15 00:02:56 +00:00
andvar e4ebea9efd fix recently committed typos by msaitoh in few more places, as well as few more.
mainly s/contigous/contiguous/ and s/miliseconds/milliseconds/ in comments.
2024-05-14 19:00:43 +00:00
riastradh 26e8a868b4 libm: Fix powerpc64 build.
- Include fenv.c and fma(3) symbols (which just use the FMADD
  instruction).
- Note the .FN symbols in libm for the asm functions.  The FN symbols
  point at the function _descriptors_; the .FN symbols point at the
  first instruction of the function.

XXX Unclear why we have the .FN symbols for asm functions but not for
C functions.  I'm not sure we should be exporting them.
2024-05-14 14:34:35 +00:00
uwe 43b4276855 curses_input(3): bump date for define_key() change 2024-05-14 10:40:41 +00:00
uwe deeae7c15b curses_termcap(3): fullname() termbuf argument is const 2024-05-14 10:38:16 +00:00
uwe 97b9891f11 curse: constify define_key() argument
define_key() is ncurses extension and ncurses defines its first
argument as "const char *".  Follow suit.

PR lib/58254
2024-05-14 10:22:48 +00:00
rillig e79ba06d10 libc/hdtoa: suppress lint warning about possible accuracy loss
on sparc64: hdtoa.c(340): warning: conversion from 'unsigned long'
    to 'char' may lose accuracy [132]
2024-05-13 21:17:24 +00:00
msaitoh 8ae6144b33 s/of of/of/ in comment. 2024-05-13 00:01:52 +00:00
msaitoh 6d9e6faaad s/Firey/Fiery/ in comment. 2024-05-12 23:58:18 +00:00
msaitoh 51508882aa s/unitialized/uninitialized/ 2024-05-12 23:55:57 +00:00
rillig 7370a14da5 libc/pwcache.c: remove stray semicolon from do-while-0 macro 2024-05-12 10:58:58 +00:00
riastradh 806be69ba7 hypotl(3): Fix includes and macros.
1. Need <math.h> for __HAVE_LONG_DOUBLE.
2. Need <machine/ieee.h> for struct ieee_ext_u &c.
3. EXT_FRACLBITS, not LDBL_MANL_SIZE.

PR lib/58245: hypotl is broken on ld128 ports
2024-05-11 20:09:47 +00:00
skrll 9f63894909 Do the '#if FCSR_FMASK == 0' thing that fpgetmask.c does for consistency. 2024-05-11 07:40:18 +00:00
riastradh bcaa0f35c3 nexttoward(3): Fix high-word test on small positive subnormals.
By this point in the logic, x can't be zero, so it's either positive
or negative.

The high word hx, however, can be zero, when x is a small positive
subnormal.  This means x is a small positive subnormal, so if x > y
we are computing nextDown, and if x < y we are computing nextUp.

hx is a (signed 32-bit) integer, not a double floating-point number,
so it's a little silly to compare hx > 0.0.  But that on its own
isn't enough to trigger the bug because all signed 32-bit integers
can be represented by double on all NetBSD architectures.

PR lib/58236
2024-05-11 02:07:53 +00:00
wiz 598b1af8b9 Document that freeaddrinfo(NULL) dumps core.
A source code comment already said this, but it's easier to
find in a man page.
2024-05-09 21:28:00 +00:00
riastradh 9aa4064b35 libm: No divtc3.c or multc3.c in sparc64's compat sparc library.
compat/sparc64/sparc/bsd.sparc.mk doesn't define LIBC_MACHINE_CPU,
only LIBC_MACHINE_ARCH, so when the compat build gets to this
conditional, LIBC_MACHINE_CPU is just MACHINE_CPU, i.e., sparc64.

Since there's no `sparc64el' or `sparc64hf-el' that we need to
canonicalize by MACHINE_ARCH -> MACHINE_CPU, just use
LIBC_MACHINE_ARCH here.
2024-05-09 19:54:38 +00:00
riastradh 210c9d72b1 libm: Add frexpf and frexpl on VAX.
These are trivial subroutines, not symbol aliases, for separate
reasons:

- frexpf has a different ABI from frexp (float vs double argument)

- frexp is defined in libc, not libm, so although long double is the
  same as double, frexpl can't be an alias in libm of a symbol
  defined in libc
2024-05-09 14:42:09 +00:00
riastradh 12802f72f7 Revert various broken changes to printf %La (hldtoa).
This reverts:

hdtoa.c 1.12 (PR/56247: Greg A. Woods: printf("%La", LDBL_MIN) dumps core)
hdtoa.c 1.11 (fix tyop)
hdtoa.c 1.10 (Via enh at google dot com in tech-userlevel. Fix handling of
    EXT_FRAC{H,L}BITS (although we don't need to since we don't have them).)

The underlying motivation for this change was that when ld128 is
decomposed into 4x32 words, this hldtoa logic is broken.

But we don't decompose ld128 into 4x32 words; we decompose it into
6x64 words.

And the change, which was supposed to be a noop in our case of 2x64
words (or similar for x87 80-bit floating-point), broke it to the
point of causing buffer overruns (PR 56247) which when worked around
led to just incorrect output output (PR 56937).

If we want to make the #ifdefs for 4x32 words work, that's fine, but
we absolutely must have automatic test cases to detect this kind of
regression because %La formatting is extremely important for
diagnosing details of floating-point data since it doesn't involve
rounding in binary formats.  For now I've added some trivial tests;
there is a more extensive test suite inside gdtoa that we need to
wire up before anyone tries any other shenanigans in this code.

PR lib/56937: printf(3) long double %a formatting is broken
2024-05-09 12:24:24 +00:00
riastradh 08858db306 libm: Define ilogbl as alias for ilogb on vax.
PR 57881
2024-05-09 12:18:48 +00:00
riastradh 5499b93eb2 libm: Split expected symbols in mips further by 32-bit vs 64-bit.
32-bit has binary64 long double, same as double; 64-bit has binary128
long double, which is implemented with a few more symbols in libm
(which should maybe be hidden internal symbols, but let's get this
diagnostic measure in the build working before we think about
possibly deleting private symbols).
2024-05-09 00:04:23 +00:00
riastradh 8e8afff063 libm: Record expected symbols for sh3. 2024-05-08 23:28:31 +00:00
riastradh c0a4905dd8 libm: Split expected symbols on arm and mips by hard/soft float. 2024-05-08 23:28:07 +00:00
riastradh 078777ba38 libm: Add rintl, rintf to non-IEEE754 architectures.
While here, delete #ifdef to handle ns32k -- I don't think that's
gonna be relevant any time soon; in case you hadn't noticed, the
world has moved on from ns32k to vax by now.

PR 57881
2024-05-08 02:08:11 +00:00
riastradh 51f70d1537 libm: ldbl_dummy.c is no longer needed -- nix it. 2024-05-08 01:58:52 +00:00
riastradh 81421ada3b libm: Don't export symbol `pio4' from s_cosl.c.
This appears to have been added unintentionally in the recent FreeBSD
long double update, and never went out in a release.
2024-05-08 01:42:23 +00:00
riastradh 9ff0c4291d libm: Do the weak alias dance for sin/cos/tan/finite{,f}.
tan isn't used internally, but it's confusing for it to be treated
differently from sin and cos, and there's no harm in doing the dance
unnecessarily.
2024-05-08 01:40:26 +00:00
riastradh b6653282bf libm/arch/m68k: Do the weak alias dance for finite.
This is used internally.
2024-05-08 01:05:25 +00:00
riastradh 62e6bb72de libm/arch/mc68881: Do the weak alias dance for sin, cos, tan.
These are used internally.
2024-05-08 01:04:40 +00:00
riastradh 62841561df libm/arch/vax: Do the weak alias dance for finite, finitef.
These are used internally.
2024-05-08 01:04:24 +00:00
riastradh 89f1761863 libm/arch/i387: Do the weak alias dance for finite and finitef.
These are used internally by some things.
2024-05-08 01:04:03 +00:00
riastradh 06a9ffe262 libm: Add expected symbols for m68k.
Not sure if this'll work for all ports -- we might need to split it
up finer-grained by different m68k flavours -- but let's give it a
try and see what breaks.
2024-05-07 23:13:32 +00:00
riastradh 5f4c33f35e lib/libm/arch/m68060: regen 2024-05-07 22:51:19 +00:00
riastradh f349ddea9b lib/libm/m68060/makeas.sh: Delimit symbols with END.
This way we get symbol sizes in the ELF output.
2024-05-07 22:30:16 +00:00
riastradh 9750c027c7 lib/libm/arch/m68060/makeas.sh: Create public weak aliases.
Use _foo for internal names, and weak alias foo when it's public like
sin/cos/tan.
2024-05-07 22:29:53 +00:00