From owner-freebsd-hackers@FreeBSD.ORG Thu May 2 07:19:40 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 C0088928 for ; Thu, 2 May 2013 07:19:40 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8783E1930 for ; Thu, 2 May 2013 07:19:40 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::98c3:879b:d55:f476] (unknown [IPv6:2001:7b8:3a7:0:98c3:879b:d55:f476]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 61F815C45; Thu, 2 May 2013 09:19:32 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: potential future proofing fix for aicasm build. From: Dimitry Andric In-Reply-To: <51814686.2060805@ixsystems.com> Date: Thu, 2 May 2013 09:19:27 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <51814686.2060805@ixsystems.com> To: Alfred Perlstein X-Mailer: Apple Mail (2.1503) Cc: hackers@freebsd.org 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: Thu, 02 May 2013 07:19:40 -0000 On May 1, 2013, at 18:44, Alfred Perlstein wrote: > 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. >=20 > aicasm.o: In function `__getCurrentRuneLocale': > = /usr/include/runetype.h:96: undefined reference to `_ThreadRuneLocale' I don't understand this error message... It seems like a linker error, = but it also seems to refer to an incorrect include file? Is this during = linking or compiling? > The issue seems to be two-fold: >=20 > 1) Paths are not fully set to pick up the bootstrap tools needed to = build. What do you mean, exactly? In r230622 I explicitly set the PATH to = ${BPATH}:${PATH}, which should be enough to pick up the bootstrap tools. = This is exactly the same path used to build the bootstrap-tools stage = itself. The kernel bootstrap tools (only aicasm, really) should be = built by the host compiler, not the cross-tools compiler. > 2) include files use the host's instead of the build trees. >=20 > The first problem is fixed by changing setting of PATH from = "${BPATH}:${PATH}" to ${TMPPATH}. >=20 > The second is fixed by using -nostdinc and setting strict include = paths using -I directives to the compiler: >=20 > CFLAGS=3D"-nostdinc -I${WORLDTMP}/usr/include -I. = -I${KERNSRCDIR}/dev/aic7xxx/aicasm" I don't think this is correct, as aicasm should be compiled by the host = compiler, and linked with the host libc. So if you start including = headers from the source directory, there will be a mismatch between what = those headers declare, and what is available in the host libc.