Chapter 32 of Secure Architectures with OpenBSD shows you how to tweak/compile the kernel
https://www.amazon.com/gp/product/0321193660