Commit Graph

306427 Commits

Author SHA1 Message Date
rillig fe6f732478 tests/lint: show that in C23 mode, bool is not yet defined
The tests in C11 and C23 mode look the same right now but will change
soon.

The warnings in the C11 test disappeared because after the first error,
warnings about unused variables are suppressed by check_variable_usage,
as they are often wrong.
2024-05-07 19:32:35 +00:00
tsutsui 609bb2da52 Rename ${PROGAOUT} -> ${PROGELF} to reflect reality. 2024-05-07 19:24:32 +00:00
sjg 696821dd99 make: all command line overrides go in .MAKEOVERRIDES
Not all variables that start with '.' are internals,
and unless they are explicitly flagged as internal should go
into .MAKEOVERRIDES

Update varname-dot-makeoverrides to check this.

Also avoid using SCOPE_CMDLINE when ReadOnly will do.
2024-05-07 18:26:22 +00:00
riastradh 13d778abc5 libm/arch/vax: Expose atan2l.
PR port-vax/57881: vax libm is missing various symbols
2024-05-07 15:49:33 +00:00
christos 385d1021b7 also mention kpause(9) here. 2024-05-07 15:40:15 +00:00
riastradh af6c922c55 math.h: Move declarations under appropriate namespace tests.
Not sure about _REENTRANT, but if gamma_r and lgamma_r go under that
(even if _NETBSD_SOURCE isn't defined), then lgammal_r probably
should too.
2024-05-07 15:17:35 +00:00
riastradh 4336c6aedd libm/arch/vax: Use STRONG_ALIAS, not ALTENTRY.
STRONG_ALIAS copies the symbol size and type, so it avoids warnings
like this:

/home/riastradh/netbsd/10/obj.vax/tooldir/bin/../lib/gcc/vax--netbsdelf/10.5.0/../../../../vax--netbsdelf/bin/ld: warning: type and size of dynamic symbol `ldexpl' are not defined
2024-05-07 15:15:31 +00:00
riastradh 2a580023ad libm/arch/vax: Use END to delimit symbol definitions.
This way we get sizes and, likely, slightly better debug info about
PCs inside these symbols.
2024-05-07 15:15:09 +00:00
martin ce6107da93 Add manhtml set 2024-05-07 14:53:59 +00:00
riastradh 557aa1ae1a tests/lib/libm/t_bit: Expand and tidy.
1. Instead of calling out VAX by name, use #ifdef NAN.

2. Verify signbit works on long double on all architectures, not just
   those with __HAVE_LONG_DOUBLE which means long double is _larger_
   than double.

3. Minor formatting tidying.
2024-05-06 18:41:23 +00:00
riastradh 9da594439c tests/lib/libc/stdlib/t_strtod: Spruce up and nix needless #ifdefs. 2024-05-06 18:39:36 +00:00
riastradh 10d47f3307 tests/lib/libm/t_modf: Use isinf(INFINITY) to detect inf support.
Apparently VAX defines the INFINITY macro even though it's not
actually an infinity and isinf returns zero for it.
2024-05-06 18:35:59 +00:00
tsutsui 401b67f6cc Misc cosmetic changes for mostly readability.
- KNF and add some newlines per blocks
- define and use proper bintobcd() macro
- make local functions and variables static

The same uboot.lif binaries are generated.
2024-05-06 18:08:49 +00:00
riastradh 30aeb9cc52 tests/lib/libc/gen/t_floatunditf: Nix __HAVE_LONG_DOUBLE conditional.
Conversion from uint64_t to long double should work on all ports,
including those where long double is the same as double, i.e., where
__HAVE_LONG_DOUBLE is undefined.

Instead, conditionalize the test cases on how many bits of precision
long double has in the significand, according to LDBL_MANT_DIG.  The
conditionals here should handle binary128, powerpc double-dekker
(~106-bit precision), x86 extended precision (80-bit), m68k extended
precision (80-bit), and VAX D (56-bit).
2024-05-06 17:53:43 +00:00
skrll 8c835d3895 Trailing whitespace 2024-05-06 15:59:53 +00:00
riastradh 49e81414d0 tests/lib/libm/t_sincos: Nix __HAVE_LONG_DOUBLE conditionals.
sincosl is supposed to be there even if long double is double, as is
the case when __HAVE_LONG_DOUBLE is undefined.
2024-05-06 15:53:46 +00:00
riastradh 18bbefc87a libm: Expose sincosl on vax.
PR 57881
2024-05-06 15:52:52 +00:00
riastradh 742590c903 tests/lib/libm/t_scalbn: Nix __HAVE_LONG_DOUBLE conditionals.
If long double is the same as double, i.e., __HAVE_LONG_DOUBLE is
undefined, these tests should still pass, since they don't rely on
extra precision beyond double.
2024-05-06 15:49:31 +00:00
riastradh d36ac80d42 tests/lib/libm/t_precision: Nix __HAVE_LONG_DOUBLE conditionals.
long double and LDBL_EPSILON work even on architectures where long
double is the same as double, i.e., where the confusingly named
__HAVE_LONG_DOUBLE is not defined.
2024-05-06 15:46:31 +00:00
riastradh 26b22dc580 tests/lib/libm/t_cos: Fix comment about necessity of volatile. 2024-05-06 15:45:20 +00:00
riastradh 3d20dd055f tests/lib/libm/t_cos: Nix __HAVE_LONG_DOUBLE.
cosl should always be defined even on architectures where long double
is the same as double so the confusingly named __HAVE_LONG_DOUBLE is
not defined.
2024-05-06 15:44:08 +00:00
riastradh 840e85b4fd tests/lib/libm/t_cabsl: Nix __HAVE_LONG_DOUBLE conditionals.
__HAVE_LONG_DOUBLE just means long double is different from double.
This test should always pass on all ports, even if long double is the
same as double; it doesn't test any additional precision.
2024-05-06 15:40:55 +00:00
riastradh bfbeee7805 libm: Expose sinl, cosl, tanl on vax.
While here, make sin, cos, and tan be weak aliases for internal
symbols _sin, _cos, and _tan; likewise sinf, cosf, tanf.

PR 57881
2024-05-06 15:33:04 +00:00
riastradh 9263853839 tests/usr.bin/mtree/t_sets.sh: atf_fail, not atf_tc_fail 2024-05-06 14:38:28 +00:00
tsutsui adfd220df8 Fix "stray level 1 interrupt" panic by pressing keys during autoconf(9).
Also explicitly initialize sc->sc_status = HIL_STATUS_BUSY in hil_attach().

Previously hil_intr(9) returned immediately during 'cold', but
all interrupts are enabled at the end of configure() (actually
in MD cpu_configure()) and cold is cleared in confiugre2()
after configure(), so there is a small window when hil interrupts
can be triggered during cold.

It looks there is no problem to process hil_intr() before
hil_attach_deferre() is called via configure2() because
we already check 'sc->sc_status != HIL_STATUS_BUSY' on
processing a kthread.

Note this seems also to appease the similar panic on mame's hp9k370
emulation (though mame's emulation around DMAC looks still incomplete).

Should be pulled up to netbsd-10 and netbsd-9.
2024-05-06 13:27:49 +00:00
riastradh e21ed88e62 tests/lib/libc/setjmp/t_sigstack: Add missing comment for 1.10.
PR lib/57946
2024-05-06 12:11:03 +00:00
mrg b1d1e928c0 use objcopy's --compress-debug-sections when creating debug files.
this reduces the size of the installed files by over half in most cases,
though the debug set size doesn't really change much (which looks like
close to 1GB of space on amd64 with xdebug installed, similar on arm64,
and about 600MB without xdebug.)

tested by running GDB on a few things, seems just as functional, on amd64,
arm64, and slightly on riscv64.

(first attempt for this feature used "gcc -gz=zlib", but that ends up
making CTF unhappy, but fortunately this works in binutils to create
the .debug files separate to any ctf usage of the main file.)
2024-05-06 08:43:36 +00:00
mrg 465b033192 mark more libpam* with pam. 2024-05-06 08:38:51 +00:00
skrll 5a0167f5d2 Improve the comment. 2024-05-06 07:29:30 +00:00
skrll fbd0dae415 Fix 32bit UVMHIST builds 2024-05-06 07:18:19 +00:00
skrll d2c36e3e86 arm has been fixed 2024-05-06 06:58:00 +00:00
skrll ababa08f7d arm longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.

While here:

- Move the botched sp and lr tests earlier.

PR lib/57946
2024-05-06 06:57:32 +00:00
macallan dfd1081321 sprinkle rump, gcc=12 etc.
Now sparc64 with HAVE_GCC=12 and MKRUMP=no builds again
2024-05-06 06:06:40 +00:00
mrg 59f75f88a6 mark libpam* as being part of pam. 2024-05-06 05:27:46 +00:00
riastradh 8ae9996403 tests/lib/libm/t_modf: Check sign of modf on infinities too.
Normally I don't like CHECK(A && B) and favour CHECK(A); CHECK(B)
instead, so you can see which one failed, but in this case the inputs
are displayed anyway so we don't lose anything unless the
floating-point printer is broken.
2024-05-06 02:21:39 +00:00
riastradh a2c1cc7d5e tests/lib/libm/t_modf.c: Expand modf/modff/modfl tests.
1. Exercise more edge cases around the largest exponent that can
   represent non-integers.

2. - Verify modf can handle all cases modff can.
   - Veriy modf can handle some cases modff can't.
   - Verify modfl can handle all cases modf or modff can.
   - If long double isn't just double, verify modfl can handle some
     cases modf and modff can't.

3. Check infinities and NaN.

4. Verify oddness, i.e., modf(-x) = -modf(x).

5. Display more useful diagnostics in case any of this goes wrong.
2024-05-06 00:54:02 +00:00
riastradh 2b70237da2 tests/lib/libm/t_fe_round.c: Work around likely ia64 bug in gcc. 2024-05-05 23:08:53 +00:00
riastradh 3822903a53 libm: long double is just double on hppa, so don't use s_rintl.c.
PR misc/58054
2024-05-05 22:52:19 +00:00
riastradh 47b5b183dd libm: If long double is double, nexttowardl is nextafter.
long double nexttowardl(long double, long double);
double nextafter(double, double);
2024-05-05 22:10:06 +00:00
riastradh 633172aec9 makeinfo: Avoid ambiguous bracelessness.
/home/source/ab/HEAD-llvm/src/external/gpl2/texinfo/dist/makeinfo/index.c:526:5: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
    else if ((*elt1)->defining_line > (*elt2)->defining_line)
    ^
/home/source/ab/HEAD-llvm/src/external/gpl2/texinfo/dist/makeinfo/index.c:531:5: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
    else if ((*elt1)->entry_number > (*elt2)->entry_number)
    ^
2024-05-05 15:26:20 +00:00
riastradh 7dfe87249e mesa: Build with -Wno-error=typedef-redefinition.
While here, use CWARNFLAGS.clang instead of an explicit conditional.

In file included from 110_blorp_exec.c:33:
In file included from /home/source/ab/HEAD-llvm/xsrc/external/mit/MesaLib/dist/src/intel/blorp/blorp_genX_exec.h:27:
In file included from /home/source/ab/HEAD-llvm/xsrc/external/mit/MesaLib/dist/src/intel/blorp/blorp_priv.h:30:
/home/source/ab/HEAD-llvm/xsrc/external/mit/MesaLib/dist/src/compiler/nir/nir.h:3840:3: error: redefinition of typedef 'nir_shader' is a C11 feature [-Werror,-Wtypedef-redefinition]
} nir_shader;
  ^
/home/source/ab/HEAD-llvm/xsrc/external/mit/MesaLib/dist/src/intel/compiler/brw_compiler.h:41:27: note: previous definition is here
typedef struct nir_shader nir_shader;
                          ^
2024-05-05 15:25:31 +00:00
riastradh f0c134c7b7 aarch64/sljit_machdep.h: Make this work in compat32 context.
Should fix clang build of compat32 eabi libsljit:

dependall ===> compat/arm/eabi/../../../lib/../external/bsd/sljit/lib
In file included from /home/source/ab/HEAD-llvm/src/sys/external/bsd/sljit/dist/sljit_src/sljitLir.c:1678:
/home/source/ab/HEAD-llvm/src/sys/external/bsd/sljit/dist/sljit_src/sljitNativeARM_64.c:142:54: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
        FAIL_IF(push_inst(compiler, MOVK | RD(dst) | (((imm >> 32) & 0xffff) << 5) | (2 << 21)));
                                                            ^  ~~
2024-05-05 15:18:10 +00:00
riastradh 17f9eb725b libm: No s_rintl.c on mips32.
This is only for machines where long double is not double.

Not 100% sure this is the right criterion, but there's a good chance
it is.
2024-05-05 14:53:22 +00:00
riastradh b544c4974f tests/lib/libm/t_next: Fix stub on VAX.
Tested building the wrong tree, oops.
2024-05-05 14:34:58 +00:00
riastradh df931a7810 tests/lib/libm/t_next: Disable this test on VAX.
But leave a replacement xfail test that fails unconditionally, to
leave a reminder in the tests of PR 57881: vax libm is missing
various symbols.
2024-05-05 14:29:38 +00:00
riastradh 55bbe7aeb3 libm/s_nexttowardf.c: Handle __HAVE_LONG_DOUBLE, LDBL_IMPLICIT_NBIT.
We should arrange to just have LDBL_NBIT unconditionally defined in the
appropriate MD header file, and make LDBL_IMPLICIT_NBIT an alias for
LDBL_NBIT==0.  But for now this will do.
2024-05-05 14:06:47 +00:00
riastradh f8bd6e11b1 libm: Make s_nexttowardf.c work when long double is double.
Seems likely that there are other parts of libm which would benefit
from being defined unconditionally in terms of ieee_ext_u, with
ieee_ext_u as an alias for ieee_double_u, in this scenario.  But I
haven't gone looking yet.
2024-05-05 11:38:03 +00:00
riastradh 816699395b libm: long double is just double on arm, so don't use s_rintl.c.
PR misc/58054
2024-05-05 11:07:49 +00:00
tsutsui 4588b9bf16 Fix integer overflow of strtol(3) for "loadpoint" address on ILP32 hosts.
This strtol(3) was introduced in rev 1.12 for PR/57909 after netbsd-10,
but it returns LONG_MAX (0x7FFFFFFF) for 0xFFF00000 on ILP32 hosts and
the wrong loadpoint causes "NOT ENOUGH MEMORY" error by the BOOTROMs
on loading uboot.lif on (at least) my 9000/360 and 9000/425t.
2024-05-05 07:36:37 +00:00
riastradh b129f29edd tests/lib/libm: Test nextafter/nexttoward and variants.
The tests are fairly trivial but should work without any conditionals
about floating-point formats.
2024-05-05 02:53:01 +00:00