From owner-freebsd-hackers@FreeBSD.ORG Wed May 1 16:45:13 2013 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 19406C92 for ; Wed, 1 May 2013 16:45:13 +0000 (UTC) (envelope-from alfred@ixsystems.com) Received: from mail.iXsystems.com (newknight.ixsystems.com [206.40.55.70]) by mx1.freebsd.org (Postfix) with ESMTP id 01A7D1862 for ; Wed, 1 May 2013 16:45:12 +0000 (UTC) Received: from localhost (mail.ixsystems.com [10.2.55.1]) by mail.iXsystems.com (Postfix) with ESMTP id 8ABD884CD for ; Wed, 1 May 2013 09:45:12 -0700 (PDT) Received: from mail.iXsystems.com ([10.2.55.1]) by localhost (mail.ixsystems.com [10.2.55.1]) (maiad, port 10024) with ESMTP id 03559-07 for ; Wed, 1 May 2013 09:45:12 -0700 (PDT) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.iXsystems.com (Postfix) with ESMTPSA id CC43384B7 for ; Wed, 1 May 2013 09:45:09 -0700 (PDT) Message-ID: <51814686.2060805@ixsystems.com> Date: Wed, 01 May 2013 09:44:54 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: hackers@freebsd.org Subject: potential future proofing fix for aicasm build. X-Mailman-Approved-At: Wed, 01 May 2013 18:29:19 +0000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 May 2013 16:45:13 -0000 Hey folks, I took a shot at fixing this issue with building aicasm as part of "buildkernel" of an older 9.0 src on a machine running HEAD. aicasm.o: In function `__getCurrentRuneLocale': > /usr/include/runetype.h:96: undefined reference to `_ThreadRuneLocale' The issue seems to be two-fold: 1) Paths are not fully set to pick up the bootstrap tools needed to build. 2) include files use the host's instead of the build trees. The first problem is fixed by changing setting of PATH from "${BPATH}:${PATH}" to ${TMPPATH}. The second is fixed by using -nostdinc and setting strict include paths using -I directives to the compiler: CFLAGS="-nostdinc -I${WORLDTMP}/usr/include -I. -I${KERNSRCDIR}/dev/aic7xxx/aicasm" Can I get review on this patch? https://gist.github.com/anonymous/5493734 Inline: diff --git a/Makefile.inc1 b/Makefile.inc1 index e850cda..785e3180 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -830,17 +830,18 @@ buildkernel: @echo ">>> stage 2.3: build tools" @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; \ - PATH=${BPATH}:${PATH} \ + PATH=${TMPPATH} \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \ + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF CFLAGS="-nostdinc -I${WORLDTMP}/usr/include -I. -I${KERNSRCDIR}/dev/aic7xxx/aicasm" \ -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) .for target in obj depend all + @echo "---- aicasm: ${target} ----" cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ - PATH=${BPATH}:${PATH} \ + PATH=${TMPPATH} \ MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target} + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF CFLAGS="-nostdinc -I${WORLDTMP}/usr/include -I. -I${KERNSRCDIR}/dev/aic7xxx/aicasm" ${target} .endfor .endif .if !defined(NO_KERNELDEPEND)