Commit Graph

10476 Commits

Author SHA1 Message Date
hgutch d9afbe107f Fix LLVM build with host gcc 13
Building LLVM with a host gcc 13 fails and suggests including <cstdint>
in external/apache2/llvm/dist/llvm/include/llvm/Support/Signals.h .
Instead of this, joerg@ suggested not modifying the llvm vendor branch
but instead working around this in our LLVM build infrastructure.
2023-05-30 19:05:04 +00:00
andvar 3532fe7de5 mdnsd(8): restore fixes for PR bin/46758, lost on resolving merge conflicts.
Original commit message from Roy Marples:
"Derive our primary interface and address by trying to connect to an
address in the TEST-NET-2 network as noted in RFC5737 instead of using
the 1.1.1.1 address. Also, use port 7 (echo) for better style.
Fixes PR bin/46758 thanks to Lloyd Parkes."

pullups needed for netbsd-9, netbsd-10.
2023-05-29 21:16:58 +00:00
lukem 775257d3af deprecate remnants of MKCRYPTO
MKCRYPTO was removed by riastradh@ on 2017-05-22,
so remove references to it in comments.
2023-05-28 11:00:03 +00:00
andvar 95bdbe7c60 reapply changes for the built-in drop-privs support by tsarna.
this commit doesn't reapply "dumping of the unicast server list
to the DumpStateLog debugging output" enhancement.
It doesn't build anymore, no idea how to rewrite.
Should fix PR 57442. Needs pull-ups for netbsd-9, netbsd-10.
2023-05-27 17:58:58 +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
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
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
christos a9e41cffe3 quote { to make regcomp happy 2023-05-24 14:34:16 +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
riastradh 68e2407866 dtrace_fbt: Read and write instructions appropriately-endian on arm.
arm is a little more complicated because it has three cases:
- big-endian data, big-endian instructions
- big-endian data, little-endian instructions
- little-endian data, little-endian instructions
2023-05-22 15:12:54 +00:00
lukem 0ab65e79ce gcc: fix build with clang++ HOST_CXX
Define HOSTPROG_CXX before .include anything that brings in bsd.own.mk.
This ensures that HOST_DBG (etc) gets assigned before HOST_CFLAGS
and HOST_CXXFLAGS is created.

backend: .include <bsd.init.mk> much earlier, as per the other directories.
Fixes backend build when using clang++ as the host compiler (e.g., macOS),
because backend host tools are now built with -O.
Inspired by https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255760

Note that gcc.old/Makefile.prog may be mis-used because it defines HOSTPROG_CXX
and this Makefile fragment is included after bsd.*.mk in other Makefiles,
but they seem to build ok so leaving it alone for now.

Fixes PR toolchain/57014
2023-05-19 23:28:20 +00:00
lukem cf4db277d4 Fix passing -j NNN to gmake
Use a more restrictive pattern to extract -j NNN from MAKEFLAGS
into GMAKE_J_ARGS, to avoid false positives when the source directory
has "-j" in the path (e.g "amd64-job-000012" or "src-j9999").
Previously this could pass either -"-j" or "-j BIGNUM" to gmake
and result in "vfork: Resource temporarily unavailable" failures.

PR misc/54456
2023-05-19 10:42:34 +00:00
riastradh 6abe226d43 libfido2: Needs -Wno-error=pointer-sign on arm. 2023-05-13 13:04:03 +00:00
christos 6e67422f16 Handle OpenSSL-3.x 2023-05-12 02:26:48 +00:00
christos 7ed2aff630 Handle OpenSSL-3.x 2023-05-11 16:18:31 +00:00
gutteridge e7e70c198d atf-check.1 & atf-sh.1: remove references to -h option
These had their -h option removed in the ATF 0.19 release, but these
references in the man pages weren't (mostly) removed upstream until
a later commit (that hasn't been released).
2023-05-10 22:14:54 +00:00
riastradh d89e5c8159 dtrace_fbt: Read and write instruction words in little-endian.
Step toward making this work on aarch64eb.
2023-05-09 21:29:07 +00:00
christos b3ddc61d04 Handle OpenSSL-3.x 2023-05-09 20:55:39 +00:00
christos 6d3d964ef4 Handle OpenSSL-3.x 2023-05-09 20:51:14 +00:00
christos 72781fabb5 Handle OpenSSL-3.x 2023-05-09 20:39:24 +00:00
christos 3b53ecd493 Handle OpenSSL-3.x 2023-05-09 15:02:59 +00:00
christos 7e65eca671 Handle OpenSSL-3.x 2023-05-09 14:31:55 +00:00
christos dd778eebe6 deal with OpenSSL-3.x 2023-05-09 14:08:18 +00:00
christos dfe7b6ae9d accommodate OpenSSL-3.x 2023-05-09 01:21:09 +00:00
christos 616ffa0105 Handle OpenSSL-3.x 2023-05-08 23:45:52 +00:00
christos 50dfd7d5ed Elide OpenSSL-3 deprecation warning 2023-05-08 21:20:29 +00:00
skrll be56099062 RISC-V mknative and build support for gdb.old 2023-05-08 20:57:34 +00:00
skrll 06dfa8449c RISC-V mknative and build support. 2023-05-08 20:56:19 +00:00
skrll 528da60089 Missed a file in the RISC-V support commit 2023-05-08 07:38:48 +00:00
skrll 75b842b847 RISC-V support that works on QEMU with a single hart.
Thanks for Simon Burge for plic(4).
2023-05-07 12:41:45 +00:00
hgutch 6d7231e655 Unbreak creation of i386 PIEs on amd64.
Functional patch by RVP;  set lists updated accordingly.

This fixes PR toolchain/57380.
2023-04-27 20:55:27 +00:00
roy a3a592bb82 dhcpcd: Fix non INET6 builds.
Thanks to J. Hannken-Illjes for the fix.
2023-04-27 13:21:59 +00:00
nikita 29be5f3f57 lua: fix ftb in lstrlib.c for clang
(error: enumeration values 'Knumber' and 'Kdouble' not handled in switch [-Werror,-Wswitch])
2023-04-23 20:52:39 +00:00
nikita 7535478ee0 lua: formatting in lvm.c 2023-04-22 19:41:15 +00:00
nikita 160c9084ef lua: fix formating diff to upstream in ldo.h 2023-04-21 17:48:06 +00:00
nikita 4fd395ecb3 lua: fix ftb in lvm.c 2023-04-21 17:31:33 +00:00
roy 74820ea053 Merge changes 2023-04-21 16:54:26 +00:00
roy 794dfa7744 Update to dhcpcd-10.0.1 with the following changes:
* privsep: keep resources open rather than open/close
 * dhcp6: OPTION_NTP_SERVER is now preferred over OPTION_SNTP_SERVER
 * Misc bug fixes mainly around privsep for many platforms.
 * Fix for reading the some BSD routing table entries.
 * Fix reading authtokens from config.

Big new release, mainly around better privsep process management
which allows us to detect when they exit unexpectedly.
2023-04-21 16:52:28 +00:00
nikita a384b59408 lua: mention patches with commit IDs in README.import for now. 2023-04-18 14:07:03 +00:00
nikita 79fd713a55 lua: apply upstream bugfix for "Loading a corrupted binary file can segfault." 2023-04-17 21:17:57 +00:00
nikita d08cb505c1 lua: apply upstream bugfix for "Wrong line in error message for arithmetic errors."
It also causes 'L->top' to be wrong when the error happens,
triggering an 'assert'.
2023-04-17 20:37:43 +00:00
nikita cf02d049ea lua: apply ustream bugfix for "C-stack overflow with deep nesting of coroutine.close." 2023-04-17 20:33:12 +00:00
nikita d5cb192484 lua: apply upstream bugfix for "'utf8.codes' does not raise an error on spurious continuation bytes." 2023-04-17 20:27:40 +00:00
nikita 7ae600e361 lua: apply upstream bugfix for "GC not setting a proper target for next cycle after a full collection in generational mode." 2023-04-17 20:17:58 +00:00
nikita 29dfad4c22 lua: apply upstream bugfix for "'break' may not properly close variable in a 'for' loop."
Function 'leaveblock' was generating "break" label before removing
variables from the closing block. If 'createlabel' created a 'close'
instruction (which it did when matching a goto/break that exited
the scope of an upvalue), that instruction would use the wrong level.
2023-04-17 20:07:32 +00:00
nikita 6c647b8126 lua: aply upstream bugfix for "'lua_settop' may use a pointer to stack invalidated by 'luaF_close'." 2023-04-17 19:54:19 +00:00
nikita b045a66584 lua: apply upstream bugfix for "Lua-stack overflow when C stack overflows while
handling an error." (CVE-2022-33099)

 Save stack space while handling errors

Because error handling (luaG_errormsg) uses slots from EXTRA_STACK,
and some errors can recur (e.g., string overflow while creating an
error message in 'luaG_runerror', or a C-stack overflow before calling
the message handler), the code should use stack slots with parsimony.

This commit fixes the bug "Lua-stack overflow when C stack overflows
while handling an error".
2023-04-17 19:35:36 +00:00