While *most* projects need only DEP_MACHINE for host, there is always
an exception. So we allow for TARGET_SPEC_VARS.host to be a subset of
TARGET_SPEC_VARS. The default will *just work* for most projects.
We set DEP_TARGET_SPEC_VARS and hence DEP_TARGET_SPEC based on
DEP_MACHINE. Allow for M_dep_qual_fixes.host to be different too and
take care to apply the right set.
The cylinder group header structure ended with `u_int8_t cg_space[1]'
representing the beginning of the inode bitmap array. Some architectures
like the i386 rounded this up to a 4-byte boundry while other
architectures like the amd64 rounded it up to an 8-byte boundry.
Thus sizeof(struct cg) was four bytes bigger on an amd64 machine
than on an i386 machine. If a filesystem created on an i386 machine
was moved to an amd64 machine, the size of the cylinder group
calculated by the CGSIZE macro would appear to grow by four bytes.
Filesystems whose cylinder groups were exactly equal to the block
size on an i386 machine would appear to have a cylinder group that
was four bytes too big when moved to an amd64 machine. Note that
although the structure appears to be too big, it in fact is fine.
It is just the calaculation of its size that is in error.
The fix is to remove the cg_space element from the cylinder-group
structure so that the calculated size of the structure is the same
size on all architectures.
Reported by: Tijl Coosemans
Tested by: Tijl Coosemans and Peter Holm
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
!a != !b -> a != b; this part was lifted from NetBSD, and I clearly did
not reconsider that these are bools (I'm guessing they were ints in an
earlier iteration of the NetBSD implementation).
while we're here, it should be easy to see that we've covered all of the
cases but let's add in an __assert_unreachable() to make it easier on
the eyes.
Reported by: jrtc27
One test is suitable to be hooked up to the build, so I've done this
here. The other test lives in tools/regression because failure is a
bit more subjective -- generally, one runs it for some unbounded amount
of time and observe if it eventually exits because two threads acquired
the same mutex.
Reviewed by: imp, mmel
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D39668
Add another undefined instruction handler for compat32 and watch out for
SWP/SWPB instructions.
SWP/SWPB were deprecated in ARMv6 and declared obsolete in ARMv7, but
this implementation is motivated by some proprietary software that still
uses SWP/SWPB. Because it's deprecated, emulation is pushed back behind
a sysctl that defaults to OFF in GENERIC so that it doesn't potentially
adversely affect package builds; it's unknown whether software may test
for a functional swp/swpb instruction with the desire of using it later,
so we err on the side of caution to ensure we don't end up with swp/swpb
use in freebsd/arm packages (which are built on aarch64).
The EMUL_SWP config option may be used to enable emulation by default in
environments where emulation is desired and won't really be turned off.
Reviewed by: andrew, mmel (both earlier version)
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D39667
This change is a prerequisite for netlink conversion.
No functional changes intended.
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D40033
MFC after: 2 weeks
It is primarily used for adding scopeid to the IPv6 link-local
sockaddrs. Having proper sockaddrs after parsing minimises the
possibility of human mistake when using the parsing.
MFC after: 2 weeks
Instead of reyling on locale-sensitive output which can be mangled when e-mailed
use consistently ISO 8601 format which contains the same information as '-T'.
PR: 271240
MFC After: 3 days
tools/tools/epfe/epfe.pl was a perl script that formerly generated some
printing example files from content in a very old version of the handbook.
Reported by: wblock
To avoid clobbering of any registers by the trampoline code use Linux
way to call signal handlers. I.e., we are out from the kernel right into
the signal handler, put return address from the signal handler into the
link register.
The mysterious NOP is required for some unwinders (e.g. libc++) that
unconditionally subtract one from the result of _Unwind_GetIP() in order
to identify the calling function.
MFC after: 1 week
To allow unwinders to go througth a previous to sigreturn frame we should
properly emulate the trampoline frame record which should points to the
previous frame and set the trampoline frame pointer to the emulated frame
before calling signal handler.
MFC after: 1 week
An Aarch64 sigreturn trampoline frame can't currently be described in
a DWARF .eh_frame section, because Aarch64 does not define a register
number for PC and provide no direct way to encode PC of the previous
frame. Instead, unwinders (libgcc, gdb, libunwind) detect the sigreturn
frame by looking for the sigreturn instruction. If a sigreturn frame is
detected, unwinders restores all the gprs, SP and PC by assuming that
sp points to an rt_sigframe Linux kernel struct
When entering the kernel, the link register (lr) contains the return
address of the previous frame, the exception link register (elr) contains
the address of the next instruction after the one which generated the
exception, i.e., PC.
MFC after: 1 week
Add more comments to explain what and why.
Ensure OBJROOT ends in / or - (/ preferred).
Export OBJTOP if level > 0
this avoids the issue with bmake/unit-tests.
Check if we have to override MAKEOBJDIR
and if so, put it into env correctly.
Fixes: df9974197e ("Add description of WITH_META_ERROR_TARGET")
Fixes: 2b519b1707 ("Update description of WITH_DIRDEPS_BUILD")
Fixes: 722cfce5f4 ("Fix typo and use .Fx in WITH_DIRDEPS_BUILD")
Sponsored by: The FreeBSD Foundation
Relevant/interesting changes:
o parse.c: don't print null filename in stack traces
o for.c: skip syntactically wrong .for loops
o var.c: allow for :gmtime=${mtime}
add :mtime[=timestamp] where timestamp is used if stat(2)
fails, if :mtime=error stat(2) failure causes error.
o make.1: fix documentation of .PREFIX to match reality and POSIX
o unit-tests: improved var-scope-local
Rather than define the TARGETS and TARGET_ARCHES in src/Makefile
put them in sys.machine.mk so they can also be leveraged by
non-top-level builds.
We have TARGET_MACHINE_LIST as the list of MACHINES we build for.
For each MACHINE we have a MACHINE_ARCH_LIST_${MACHINE}
and the first entry of each list is used as default for
MACHINE_ARCH_${MACHINE}
We can now remove a bunch of MACHINE_ARCH.* handling from
local.sys.dirdeps*mk
Reviewed by: imp
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D40083
UEFI device path may be path to one device, or concatenated list of instances
to different devices (textually represented as comma separated list).
Provide generic function to get next instance from device path.
Returns next instance or end node.
The use case is like:
EFI_DEVICE_PATH *node = (EFI_DEVICE_PATH *)buf;
while (!IsDevicePathEnd(node)) {
process(node);
node = efi_devpath_next_instance(node);
}
Where buf is pointing to either single device path or
concatenated list of device paths (such as from ConIn or ConOut).
Reviewers: imp
Differential Revision: https://reviews.freebsd.org/D40081
Summary:
The intention of the original author (I assume) was to add this logic
for testing. This removes the debug statement so it no longer shows up
in calls to `status`.
MFC after: 2 weeks
MFC with: 0661f9389
Reviewers: kevans
Subscribers: imp
Differential Revision: https://reviews.freebsd.org/D40055
Commit e32fecd0c2 intended to skip installing all but one copy of
each loader variant's help file, but accidentally skipped all copies for
the userboot help file. (Other loaders install help files via the _simp
variant, but there is is no userboot_simp.)
PR: 271178
Fixes: e32fecd0c2 ("loader: install help files only once")
Sponsored by: The FreeBSD Foundation
After removing the -FreeBSD and -NetBSD, we're left with a nuber of
BSD-2-Clause AND BSD-2-Clause, so tidy that up.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix