vi(1): Tweak and clean up Makefile
- Group -D__REGEX_PRIVATE with -I${SRCDIR}/regex
- Update config.h to define USE_WIDECHAR, which aligns with the vendor
generated one.
test: Use snapshot testing for cryptoapi/cryptodev
The tests I wrote for cryptoapi where based on comparing the results
against the results of cryptodev - if they match, the test succeeds. But
as I am planning to remove cryptodev, this test methodology no longer
works.
Instead, store the test input data in fixtures.csv and run the test case
for each input. The generated output should then match the
expected_output.md in order for the tests to pass. This simplifies
adding new test fixtures and allows for re-generating the
expected_output.md.
sys/conf: continue to build kernel despite removal of devices
Commit 980dc6f5ee469df858eb285322bf689882073b07 removed the hifn(4),
safe(4), ubsec(4) and padlock(4) drivers. With this change, every
KERNELCONF that still refers to any of those devices or related options
like for example "device hifn" or "options HIFN_RNDTEST" would no longer
build.
Obsolete these devices and emit a warning, but do not break the build.
Suggested-by: Aaron Li
arcmsr.h: Include sys/bus.h header
The "arcmsr.h" header file uses types like bus_space_handle_t defined in
"sys/bus.h", but it does not include the "sys/bus.h" header itself. This
can cause build breakage elsewhere.
The build of "usr.bin/kdump" depends on the auto-generated file
"ioctl.c" created by the "mkioctls" script. Within the generated
"ioctl.c" file, various header files are included. Some of these header
files (namely "arcmsr.h") might depend on the order in which the header
files are included or depend on other header files being included before
themselves.
In the process of removing cryptodev, I noticed build breakage of kdump
when "sys/cryptodev.h" is removed. This is because "sys/cryptodev.h"
includes "sys/bus.h" and is placed before the include of "arcmsr.h"
(within the auto-generated "ioctl.c"). So removing "sys/cryptodev.h"
would lead to type definitions from "arcmsr.h" refering to yet undefined
types from "sys/bus.h".
libexec/customcc: Fix a wrong variable name
Obviously, the variable for C++ compiler should be ${CUSTOM_CXXFLAGS}
instead of ${CUSTOM_CFLAGS}. This bug was introduced in commit
571f588a5c6622ead0ed757b2884a76bb45bdb56.
libexec/customcc: Fix bug with the `[ -n ${X} ]` conditional
Before this fix, command `CCVER=xxx cc --version` failed with a strange
error:
```
exec: --version: not found
```
which was given by this customcc wrapper script. The expected error
should be:
```
xxx_CC undefined, see compilers.conf(5)
```
It turned out this was caused by the `[ -n ${X} ]` conditional: `[ -n ]`
evaluates to *true*, while `[ -n "" ]` evaulates to *false*.
Interestingly, both `[ -z ]` and `[ -z "" ]` evaulates to *false*. The
original version of this wrapper used `[ -z ${X} ]` style and it worked
fine, but commit 571f588a5c6622ead0ed757b2884a76bb45bdb56 changed it to
`[ -n ${X} ]` style and thus broke it.
nrelease: Simplify the setting of disklabel packid/label
The packid (i.e., label name) can be directly set upon the label
creation; no need to edit the disklabel dump file.
kernel: Fix GPT partition start/end check in gptinit()
The GPT partition ending LBA is inclusive, so it's valid to have a GPT
partition with start == end, i.e., the partition size is 1 block. Fix
gptinit() to support this case. In addition, improve the kprintf()
debug message to show the value of start and ending LBAs.
objformat.1: Document the fallback behavior to use external compilers
When objformat(1) cannot find any of /usr/libexec/<ccver>/prog, it will
fallback to use /usr/libexec/custom/prog to access external compilers
defined by compilers.conf(5).
mk/sys.mk: Explain a bit more about ${WORLD_ALTCOMPILER}
It was introduced in commit 8d7da4247e43eb2bbe924d08f6a40ef80d742515 for
supporting multiple alternative compilers.
objformat(1): Simplify cmds handling code
* Set 'cmd=NULL' for the last cmds element, and the loop until it,
avoiding the NELEM() macro and <sys/param.h> inclusion.
* The 'cmds' variable cannot be NULL, so remove the unnecessary 'if'
tests.
libexec/customcc: Fix a wrong variable name
Obviously, the variable for C++ compiler should be ${CUSTOM_CXXFLAGS}
instead of ${CUSTOM_CFLAGS}. This bug was introduced in commit
571f588a5c6622ead0ed757b2884a76bb45bdb56.
libexec/customcc: Document why pre-determine INCPREFIX/MACHARCH/MACHREL
This change was made in commit 571f588a5c6622ead0ed757b2884a76bb45bdb56
to improve the wrapper script efficiency.
libexec/customcc: Fix bug with the `[ -n ${X} ]` conditional
Before this fix, command `CCVER=xxx cc --version` failed with a strange
error:
```
exec: --version: not found
```
which was given by this customcc wrapper script. The expected error
should be:
```
xxx_CC undefined, see compilers.conf(5)
```
It turned out this was caused by the `[ -n ${X} ]` conditional: `[ -n ]`
evaluates to *true*, while `[ -n "" ]` evaulates to *false*.
Interestingly, both `[ -z ]` and `[ -z "" ]` evaulates to *false*. The
original version of this wrapper used `[ -z ${X} ]` style and it worked
fine, but commit 571f588a5c6622ead0ed757b2884a76bb45bdb56 changed it to
`[ -n ${X} ]` style and thus broke it.
Remove remaining module files: hifn.ko, padlock.ko, safe.ko, ubsec.ko
These kernel modules were removed in commit
980dc6f5ee469df858eb285322bf689882073b07 but these files were missed
there.