Index: lang/rust/Makefile =================================================================== --- lang/rust/Makefile +++ lang/rust/Makefile @@ -142,6 +142,17 @@ ${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 + @${SYSCTL} -q kern.conftxt | ${SORT} -u | ${AWK} '\ + $$2 == "COMPAT_FREEBSD11" { i++ } \ + END { if (NR > 0 && i < 1) { \ + print "=> Sanity check failed: kernel is missing COMPAT_FREEBSD11"; \ + print "=> Aborting build"; \ + exit 1 \ + } }' +.endif @${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml @${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'extended=true' >> ${WRKSRC}/config.toml