I am working on a port of a Linux kernel module to FreeBSD. I decided to rebase on FreeBSD 9.1-BETA1. I installed Gentoo Prefix so that I would be able to work on this port in a more familiar development environment.
Unfortunately, there is an issue where /usr/src/sys/conf/kmod.mk invokes xargs with -J, which Gentoo Prefix's GNU xargs does not support. I have written a patch for kmod.mk that will attempt shell substitution in place of xargs when the current command that relies on xargs fails. There are probably other ways of addressing this, but I just would like this to work without requiring a patch to the system sources.
--- /usr/src/sys/conf/kmod.mk.orig 2012-08-02 23:49:09.749192513 -0400
+++ /usr/src/sys/conf/kmod.mk 2012-08-04 08:57:25.719110508 -0400
@@ -217,7 +217,8 @@ ${FULLPROG}: ${OBJS}
grep -v '^#' < ${EXPORT_SYMS} > export_syms
.endif
awk -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET} \
- export_syms | xargs -J% ${OBJCOPY} % ${.TARGET}
+ export_syms | xargs -J% ${OBJCOPY} % ${.TARGET} || \
+ ${OBJCOPY} $(awk -f ${SYSDIR}/conf/kmod_syms.awk ${.TARGET}
export_syms) ${.TARGET}
.endif
.endif
.if !defined(DEBUG_FLAGS) && ${__KLD_SHARED} == no
signature.asc
Description: OpenPGP digital signature

