Commit Graph

10487 Commits

Author SHA1 Message Date
lukem 305799b10f libarchive: fail if name_max is 0
Add error handling to the USE_READDIR_R code paths that set name_max
from struct statfs or statvfs; if the determined name_max == 0
then return an error.

Avoids a crash in tree_dir_next_posix() when the calculation of
dirent_size from name_max is too small for the memory allocated
for struct dirent.

Submitted to upstream in pull request
	https://github.com/libarchive/libarchive/pull/1903

Should fix PR bin/56080
2023-06-10 12:46:32 +00:00
nikita bdda0531de lua: resolve import conflicts 2023-06-08 21:12:08 +00:00
lukem d56c4e4749 llvm tool build: fix warning
-std=c++14 is for HOST_CXXFLAGS not HOST_CPPFLAGS.

Fixes: cc1: warning: command-line option '-std=c++14' is valid for C++/ObjC++ but not for C
2023-06-04 17:48:05 +00:00
lukem bd392dcb93 adapt to ${CC_WNO_STRINGOP_OVERFLOW}
Use ${CC_WNO_STRINGOP_OVERFLOW} instead of
the older style more complex expressions.

Remove workarounds if they were only for gcc < 10.
2023-06-03 21:33:01 +00:00
lukem 58beaa2b43 adapt to ${CC_WNO_MAYBE_UNINITIALIZED}
Use ${CC_WNO_MAYBE_UNINITIALIZED} instead of
the older style more complex expressions.

Remove workarounds if they were for a specific
version of gcc < 10.
2023-06-03 21:31:45 +00:00
lukem 230c41e44c adapt to ${CC_WNO_IMPLICIT_FALLTHROUGH}
Use ${CC_WNO_IMPLICIT_FALLTHROUGH} instead of
the older style more complex expressions.
2023-06-03 21:30:20 +00:00
lukem 39588391d2 dhcp: remove gcc 8 workaround
(if it's needed, add it back using ${CC_WNO_FORMAT_OVERFLOW})
2023-06-03 21:27:11 +00:00
lukem 2075f2d0bf ipmon: remove duplicate warning suppression 2023-06-03 21:26:52 +00:00
lukem a9a927dd92 adapt to ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
Simplify CWARNFLAGS to use ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
which works for both clang and gcc, and remove compiler-specific
equivalents.
2023-06-03 21:26:27 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
lukem f937c412f3 bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBER
Provide a single variable
	CC_WNO_ADDRESS_OF_PACKED_MEMBER
with options for both clang and gcc, to replace
	CLANG_NO_ADDR_OF_PACKED_MEMBER
	CC_NO_ADDR_OF_PACKED_MEMBER
	GCC_NO_ADDR_OF_PACKED_MEMBER

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 08:52:53 +00:00
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