Commit Graph

301171 Commits

Author SHA1 Message Date
riastradh 91fcf17482 openssl: CWARNFLAGS, not COPTS, for -Wno-error=...
COPTS gets put too early, so these are cancelled out by -W flags
added later by bsd.sys.mk.  (How did this ever work???)
2023-05-25 19:12:51 +00:00
riastradh 7c8b150a94 openssl: Note that -Wno-error=char-subscripts likely masks real bugs. 2023-05-25 19:12:42 +00:00
riastradh 06e60785a0 openssl: Consolidate new CWARNFLAGS.clang stuff in Makefile.openssl. 2023-05-25 19:12:06 +00:00
kre a83f9264e8 pathadj() is required to succeed. If it cannot, simply issuing a
warning and continuing is not good enough.  Change the warning to
an error (and hence immediate exit) instead, that's all we can do.

Problem pointed out by tlaronde@polynum.com

XXX - pullup -10 (others?)
2023-05-25 17:37:05 +00:00
kre d736f87f8e If it isn't possible to determine the realpath() of ".", then simply
give up on attempting to resolve any relative path - there's no hope.
2023-05-25 17:24:17 +00:00
christos 0ca4a2096b add a little const to help clang 2023-05-25 17:20:14 +00:00
riastradh acf361f7fc openssl: Suppress clang warnings for using string literals as char *.
Not sure this is actually forbidden by the C standard.  There may be
bugs lurking here, but OpenSSL uses this extensively, so let's just
get the build going again.
2023-05-25 16:05:27 +00:00
riastradh f68d28ccb5 openssl: Nix trailing whitespace in build goo.
No functional change intended.
2023-05-25 15:52:28 +00:00
riastradh 2a673dcfdb libpthread: New pthread__smt_wait to put CPU in low power for spin.
This is now distinct from pthread__smt_pause, which is for spin lock
backoff with no paired wakeup.

On Arm, there is a single-bit event register per CPU, and there are two
instructions to manage it:

- wfe, wait for event -- if event register is clear, enter low power
  mode and wait until event register is set; then exit low power mode
  and clear event register

- sev, signal event -- sets event register on all CPUs (other
  circumstances like interrupts also set the event register and cause
  wfe to wake)

These can be used to reduce the power consumption of spinning for a
lock, but only if they are actually paired -- if there's no sev, wfe
might hang indefinitely.  Currently only pthread_spin(3) actually
pairs them; the other lock primitives (internal lock, mutex, rwlock)
do not -- they have spin lock backoff loops, but no corresponding
wakeup to cancel a wfe.

It may be worthwhile to teach the other lock primitives to pair
wfe/sev, but that requires some performance measurement to verify
it's actually worthwhile.  So for now, we just make sure not to use
wfe when there's no sev, and keep everything else the same -- this
should fix severe performance degredation in libpthread on Arm
without hurting anything else.

No change in the generated code on amd64 and i386.  No change in the
generated code for pthread_spin.c on arm and aarch64 -- changes only
the generated code for pthread_lock.c, pthread_mutex.c, and
pthread_rwlock.c, as intended.

PR port-arm/57437

XXX pullup-10
2023-05-25 14:30:02 +00:00
riastradh 21ee6fc127 libpthread: Use __nothing, not /* nothing */, for empty macros.
No functional change intended -- just safer to do it this way in case
the macros are used in if branches or comma expressions.

PR port-arm/57437 (pthread__smt_pause/wake issue)

XXX pullup-10
2023-05-25 14:29:45 +00:00
lukem 6c5a5d5e6d osnet: on macOS, use <mach/boolean.h> for boolean_t
macOS/x86_64 defines boolean_t as 'unsigned int' not 'int',
which causes a build issue with tools/ctfmerge on that host
after my recent fixes for macOS semaphores.
So use the <mach/boolean.h> instead of a local typedef ifdef __APPLE__.

May fix a macOS/x86_64 build issue reported by cjep@.
Builds fine on NetBSD/amd64 or macOS/arm.

Note: this compat stuff is clunky, and based on the commit log,
annoyingly error prone. A newer sync of osnet from upstream /may/
improve a lot of these compat typedef workarounds for solaris types...
2023-05-25 13:18:44 +00:00
jschauma cdcf39f501 revert my previous commit as there is no agreement on it being either desired
or appropriate
2023-05-25 12:57:37 +00:00
lukem f64554c801 ctfmerge: fix macOS semaphore implementation, part 2
dispatch_semaphore_signal() doesn't return an error, just an
indicator of whether a thread was woken or not, so there's
no need to fail on non-zero return.
2023-05-25 12:53:56 +00:00
riastradh 358e900576 amdgpu: Fix mostly harmless merge botch.
Avoids confusing error message that should have been confined to an
error branch.
2023-05-25 12:07:43 +00:00
skrll 210f59dd29 Fix CLKF_INTR so that not all time is shown as being spent in interrupts. 2023-05-25 06:17:18 +00:00
uwe 1abf64cb1c chflags(1): fix wrong markup in previous 2023-05-25 01:31:27 +00:00
jschauma 1ddd11122e Briefly describe the 'arch' and 'nodump' flags. 2023-05-24 22:33:17 +00:00
christos c700643e72 use strchr 2023-05-24 22:14:31 +00:00
lukem ab6e6d445d m4 -g: { and } aren't supported in patsubst() or regexp()
When running in -g (GNU m4) emulation, patsubst() and regexp()
use the GNU m4 emacs-like regexes as implemented by gnulib,
which don't support {..} intervals.
When converting a GNU m4 regex to a POSIX ERE, escape raw { and }.

Autoconf relies on the GNU m4 regex behaviour.

See:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Redefined-M4-Macros.html
- https://www.gnu.org/software/gnulib/manual/html_node/emacs-regular-expression-syntax.html

This fixes the tools/compat/configure regen.

PR toolchain/57431
2023-05-24 21:58:19 +00:00
lukem f1834a6f03 revert previous: autoconf doesn't use EREs
autoconf relies upon GNU m4 emacs-style regexs, which
don't support intervals so don't escape these.
A fix to usr.bin/m4 -g (GNU m4 emulation) is incoming.
2023-05-24 21:49:38 +00:00
riastradh 28811d5ecf entropy(9): Avoid race between rnd_add_data and ioctl(RNDCTL).
XXX pullup-10
2023-05-24 20:22:23 +00:00
riastradh b8bfbde6e8 entropy(9): On flags change, cancel any scheduled consolidation.
We've been instructed to lose confidence in existing entropy sources,
so let's make sure to re-gather enough entropy before the next
consolidation can happen, in case some of what would be counted in
consolidation is from those entropy sources.

XXX pullup-10
2023-05-24 20:22:12 +00:00
christos 562596981f match the new compiler warning 2023-05-24 20:02:34 +00:00
christos c59fd10753 no more md5 for you. 2023-05-24 18:22:05 +00:00
bouyer d4c91cd62f introduce imx6sx_platform_bootstrap(), which calls imx_platform_bootstrap()
and then checks for an "arm,cortex-a9-twd-timer" compatible entry in the
fdt. If not present, create one so that a9ptmr will attach.
We need this entry as this is the only timer we support for this platform,
but the upstream imx6sx.dtsi is missing the entry for it (and all A9 CPUs
have it anyway).

Thanks to Jared McNeill for advices and review.
2023-05-24 16:43:40 +00:00
christos a9e41cffe3 quote { to make regcomp happy 2023-05-24 14:34:16 +00:00
lukem b0682b2387 CHANGES: rm SHAREDSTRINGS, mkstr, xstr 2023-05-24 13:09:53 +00:00
lukem 8e5c6bed5f obsolete mkstr(1) and xstr(1)
These were only used on PDP-11 for two programs we don't ship,
and have been obsolete since the VAX days.

xstr never worked in the build.sh cross-build environment (22 years), or
parallel make environment (nearly 28 years), didn't work in the orignal 386bsd
import, and has never been needed in NetBSD as we don't have the older BSD
programs (pascal, pre-nvi ex) that needed mkstr/xstr on PDP-11.

PR toolchain/35964
2023-05-24 13:00:14 +00:00
lukem 7a543a5f74 deprecate SHAREDSTRINGS build option
Hasn't worked for at least 20 years (and never in the cross-build environment,
nor did it work with parallel make), and has never been needed in NetBSD as we
don't have the older BSD programs (pascal, pre-nvi ex) that needed mkstr/xstr
on PDP-11.

PR toolchain/35964
2023-05-24 10:07:16 +00:00
riastradh 320f2e6f88 efi(4): Fix logic to handle buffer sizing.
Can't KASSERT(datasize <= databufsize) because the caller is allowed
to pass in a too-small size and get ERR_BUFFER_TOO_SMALL back, with
the actual size returned so it can resize its buffer.  So just clamp
the size to the smaller of what the caller provided and what the
firwmare provided, instead of asserting anything.

PR kern/57076

XXX pullup-10
2023-05-24 00:02:51 +00:00
lukem 9ba055b472 ctfmerge tool fixes might need a clean tools build 2023-05-23 20:26:52 +00:00
lukem aa9ef682cf ctfmerge: pthread error handling. macos host fixes 2023-05-23 20:24:24 +00:00
lukem 0589c2d76d tools/compat: regen for dispatch_semaphore_create 2023-05-23 20:22:11 +00:00
lukem 55152776e1 tools/compat: MAKEVERBOSE support in regen 2023-05-23 20:20:54 +00:00
lukem 4080c3a3f0 autoconf: AC_FUNC_ALLOCA(): add local fix for BSD support
Add local fix to AC_FUNC_ALLOCA() to include <stdlib.h> on BSD:
 # elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
 #   include <stdlib.h>

This change avoids regen losing this change in tools/compat/configure
that was added in rev 1.75 on 2013-03-05 of tools/compat/configure,
and subsequent commits that keep re-adding these lines back
manually (e.g., rev 1.97 on 2019-06-22 of tools/compat/configure)

XXX: Arguably this could be fixed in a separate way to allow us to
use an unmodified modern autoconf in the future ?
2023-05-23 20:15:58 +00:00
hannken 7dbe9c7c08 Set PID path back to "/var/run/unbound.pid" so rc scripts work again.
Ok: Christos Zoulas

PR bin/57242 unbound rc.d script does not work with chrooted unbound
2023-05-23 20:07:21 +00:00
lukem 6eddcd88c5 ctfmerge: fix macOS semaphore implementation
Use dispatch_semaphore_create() if present instead of sem_init().

macOS doesn't actually implement sem_init() (et al)
(even though it provides the prototypes as deprecated).
This was detected by the previous commit to ctfmerge
that added error handling.

Implement ctfmerge's barrier operations in terms of
dispatch(3) APIs such as dispatch_semaphore_create() (et al).

Update tools/compat/configure.ac to find dispatch_semaphore_create().

Fixes ctfmerge on macOS hosts.

Inspired by https://stackoverflow.com/a/27847103.
2023-05-23 19:53:24 +00:00
lukem badca804fd ctfmerge: error check sem_*() and pthread_*() APIs
terminate() if sem_*() returns -1 or pthread_*() returns != 0.
(Set errno from pthread_*() so terminate() prints the strerror message).

Note: Failing on errors instead of ignoring them helps identify
reasons for intermittent failures, such as those on macOS host builds:
  ERROR: nbctfmerge: barrier_init: sem_init(bar_sem): Function not implemented
2023-05-23 18:54:58 +00:00
rillig cc79972fb6 indent: separate code for handling enums from the lexer
The lexer's responsibility is to generate tokens, it's not supposed to
update the parser state.  Centralize the state transitions that control
indentation of enum constants to keep the lexer code clean.

Skip comments, newlines and preprocessing lines when updating the parser
state for enum constants and for '*' in declarations.
2023-05-23 18:16:28 +00:00
rillig e9b5780b33 indent: fix indentation of struct declarations 2023-05-23 16:53:57 +00:00
rillig fe5b389b2f indent: split debug output into paragraphs
The paragraphs separate the different processing steps: getting a token
from the lexer, processing the token, updating the parser state, sending
a finished line to the output.
2023-05-23 12:12:29 +00:00
christos 66d0962ffc centralize the warnings, try to fix clang 2023-05-23 12:05:10 +00:00
christos 5442314cf2 centralie warnings 2023-05-23 12:04:42 +00:00
rillig 18ce8f52a9 indent: extract processing of a single token to separate function
No functional change.
2023-05-23 11:37:23 +00:00
andvar eb8ea79cc8 s/configuratin/configuration/ in comment, from Brad Harder (bch) by email. 2023-05-23 10:22:42 +00:00
macallan 75a2a32db9 use macros compatible with xf86-video-suncg14 to issue SX instructions
much more readable, alignment weirdness is handled automatically and code is
interchangable
2023-05-23 10:20:12 +00:00
riastradh 9a508ab194 autoconf(9): Omit config_detach kernel lock assertion too for now.
like in config_attach_pseudo, this assertion almost certainly
indicates real bugs, but let's try to get the tests back and running
again before addressing those.
2023-05-23 08:16:43 +00:00
rillig fadc996fc6 indent: fix spacing around '*' in declarations 2023-05-23 06:43:19 +00:00
rillig 756425c686 indent: fix spacing in declarations in for loops 2023-05-23 06:35:01 +00:00
rillig 3368225913 tests/indent: add code snippets found in make and lint1 2023-05-23 06:18:00 +00:00