Index: lang/rust/Makefile =================================================================== --- lang/rust/Makefile +++ lang/rust/Makefile @@ -142,6 +142,16 @@ ${WRKSRC}/src/bootstrap/install.rs do-configure: +# Sanity check that the running kernel was built with the necessary +# syscall compat option. +.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1200000 + @${PRINTF} '#include \n#include \n#include \n\ + int main(void) { return syscall(SYS_freebsd11_mknod, "", 0, 0) < 0 && errno == ENOSYS; }' | \ + ${CC} -o ${WRKSRC}/compat11_canary -xc - && ${WRKSRC}/compat11_canary || (\ + ${ECHO_MSG} "=> Sanity check failed: kernel is missing COMPAT_FREEBSD11"; \ + ${ECHO_MSG} "=> Aborting build"; \ + ${FALSE}) +.endif @${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml @${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'extended=true' >> ${WRKSRC}/config.toml