When VECTX is enabled as a kernel option and non-EFI loaders are built, many reads will fail due to the mis-match of whether LOADER_VERIEXEC_VECTX or not in readin.h. Source that includes bootstrap.h must ensure the kernel option agrees with the compile time CFLAGS in the various make related files.
Tested with the EFI and i386 loaders.
This adds console.c to the SRCS for libi386.a, which causes link failures:
===> i386/zfsboot (all) [...] ld: error: duplicate symbol: getchar >>> defined at cons.c:127 (/usr/src/stand/i386/common/cons.c:127) >>> cons.o:(getchar) >>> defined at console.c:105 (/usr/src/stand/common/console.c:105) >>> console.o:(.text.getchar+0x0) in archive /usr/obj/usr/src/amd64.amd64/stand/i386/libi386/libi386.a
Those two getchar functions are completely different.
Instead of including loader.mk in these new places, refactor the VERIEXEC-related variables into a new file named veriexec.mk, and include that instead.