>Number:         172894
>Category:       kern
>Synopsis:       Out-of-tree kernel module compilation with GNU xargs in $PATH
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 20 03:10:01 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Richard Yao
>Release:        FreeBSD 9.1-BETA1
>Organization:
Gentoo BSD Team
>Environment:
FreeBSD freebsd 9.1-BETA1 FreeBSD 9.1-BETA1 #0: Fri Jul 20 21:39:23 EDT 2012    
 root@freebsd:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
I was 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 was 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.

This report was originally submitted to [email protected] three months ago. 
Eitan Adler requested that I file a problem report.
>How-To-Repeat:
1. Install Gentoo Prefix
2. Start Prefix Shell  (to put GNU xargs in $PATH)
3. Try building an out-of-tree kernel module.
>Fix:
--- /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

>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to