DF-5358 / build.log
# DF-5358 PoC build on guest (stock kernel), /root/df5358, root: # printf "KMOD=\tpmxtest\nSRCS=\tpmxtest.c\n.include <bsd.kmod.mk>\n" > Makefile # make # cc -O2 -o pmx_user pmx_user.c # (full module link line; -Werror clean) cc -O2 -pipe -D_KERNEL -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wold-style-definition -Wmissing-include-dirs -Wno-pointer-sign -Winit-self -Wundef -Wno-unused-but-set-variable -std=gnu11 -Werror -DKLD_MODULE -nostdinc -I. -Idragonfly -I/root/df5358/forwarder_x86_64/include -Idragonfly/../include -I/usr/include -Wold-style-declaration -fno-common -ffreestanding -fno-stack-protector -fno-strict-aliasing -fno-strict-overflow -fno-asynchronous-unwind-tables -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -mno-fp-ret-in-387 -mindirect-branch=thunk-inline -c pmxtest.c cc -Wl,--build-id=sha1 -nostdlib -Wl,--hash-style=sysv -r -Wl,-d -o pmxtest.ko pmxtest.o # result: pmxtest.ko (5016 bytes), pmx_user (9192 bytes) # patched-kernel build: see fix_build.log (make -j6 nativekernel + installkernel, INSTALL_DONE, rc=0)