Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Oct 2012 03:02:12 GMT
From:      Richard Yao <ryao@gentoo.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/172894: Out-of-tree kernel module compilation with GNU xargs in $PATH
Message-ID:  <201210200302.q9K32Clh084121@red.freebsd.org>
Resent-Message-ID: <201210200310.q9K3A1GU086237@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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 hackers@FreeBSD.org 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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210200302.q9K32Clh084121>