With O=<dir> option, several kernel headers are under <dir>/include. So stap can't check autoconfs correctly, and fails to compile modules. To avoid this problem, stap needs to use flags macro defined in scripts/Kbuild.include to update KBUILD_CFLAGS.
Created attachment 3623 [details] [PATCH] kernel built with O= option support Here is a patch to fix this issue.
Patch committed.