From owner-freebsd-bugs@FreeBSD.ORG Sat Oct 20 03:10:01 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA8A6A1C for ; Sat, 20 Oct 2012 03:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.FreeBSD.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id 924A18FC0A for ; Sat, 20 Oct 2012 03:10:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9K3A1W9086238 for ; Sat, 20 Oct 2012 03:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9K3A1GU086237; Sat, 20 Oct 2012 03:10:01 GMT (envelope-from gnats) Resent-Date: Sat, 20 Oct 2012 03:10:01 GMT Resent-Message-Id: <201210200310.q9K3A1GU086237@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Richard Yao Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8B917C7 for ; Sat, 20 Oct 2012 03:02:12 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id A1A128FC14 for ; Sat, 20 Oct 2012 03:02:12 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q9K32CaR084122 for ; Sat, 20 Oct 2012 03:02:12 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id q9K32Clh084121; Sat, 20 Oct 2012 03:02:12 GMT (envelope-from nobody) Message-Id: <201210200302.q9K32Clh084121@red.freebsd.org> Date: Sat, 20 Oct 2012 03:02:12 GMT From: Richard Yao To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/172894: Out-of-tree kernel module compilation with GNU xargs in $PATH X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2012 03:10:01 -0000 >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: