#!/bin/sh
# DF-<ID> fix-validation build script.
#
# This finding was confirmed via source-only analysis (the bug pattern is
# real but unreachable at runtime on this guest: see VERDICT.md).  The
# reproduction is therefore the absence of the bug pattern in the patched
# source plus a clean -Werror kernel build.  Run this script to rebuild
# the kernel with the fix applied.
set -e
cd /usr/src
# All kernel TUs and modules compile with -Wno-pointer-sign -Werror by
# default (see sys/share/mk/bsd.sys.mk), so a default nativekernel build
# IS the -Werror validation.
make -j6 nativekernel KERNCONF=X86_64_GENERIC 2>&1 | tee /tmp/DF-2069.build.log
test "${PIPESTATUS[0]}" = 0 || exit 1
echo "DF-2069: kernel build rc=0 with -Werror (default CWARNFLAGS)"
