From nobody@FreeBSD.org  Fri Mar 15 23:30:51 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 7C3E275A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 15 Mar 2013 23:30:51 +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 6E17E61A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 15 Mar 2013 23:30:51 +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 r2FNUpxo070916
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 15 Mar 2013 23:30:51 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r2FNUoDL070915;
	Fri, 15 Mar 2013 23:30:50 GMT
	(envelope-from nobody)
Message-Id: <201303152330.r2FNUoDL070915@red.freebsd.org>
Date: Fri, 15 Mar 2013 23:30:50 GMT
From: Godfrey van der Linden <gvdl@mac.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: kmod.mk: EXPORT_SYMS make variable is broken for more than one symbol
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         177008
>Category:       kern
>Synopsis:       [kmod.mk] [patch] EXPORT_SYMS make variable is broken for more than one symbol
>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:   Fri Mar 15 23:40:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Mon May 20 03:34:07 UTC 2013
>Originator:     Godfrey van der Linden
>Release:        r249341
>Organization:
Juniper Networks, Inc
>Environment:
N/A
>Description:
src/sys/modules/mii/Makefile defines


EXPORT_SYMS=	mii_attach	\
		mii_bitbang_readreg \
		mii_bitbang_sync \
		mii_bitbang_writereg \
		mii_mediachg	\
		mii_pollstat	\
		mii_tick

But no symbols are actually exported, they are all local..
>How-To-Repeat:
cd src
make build-kernel

Run nm -g miibus.ko from where ever it lives in the obj tree.
>Fix:
One liner to src/sys/conf/kmod.mk and add TR executable to sys.mk:


$ svn diff share/mk sys/conf > /tmp/fbsd-1.txt 
Index: share/mk/sys.mk
===================================================================
--- share/mk/sys.mk	(revision 249341)
+++ share/mk/sys.mk	(working copy)
@@ -144,6 +144,8 @@
 
 SHELL		?=	sh
 
+TR		?=	tr
+
 YACC		?=	yacc
 .if defined(%POSIX)
 YFLAGS		?=
Index: sys/conf/kmod.mk
===================================================================
--- sys/conf/kmod.mk	(revision 249341)
+++ sys/conf/kmod.mk	(working copy)
@@ -210,7 +210,7 @@
 .if ${EXPORT_SYMS} == NO
 	:> export_syms
 .elif !exists(${.CURDIR}/${EXPORT_SYMS})
-	echo ${EXPORT_SYMS} > export_syms
+	${ECHO} ${EXPORT_SYMS} | ${TR} ' ' '\n' > export_syms
 .else
 	grep -v '^#' < ${EXPORT_SYMS} > export_syms
 .endif


>Release-Note:
>Audit-Trail:
>Unformatted:
