From owner-freebsd-arch@FreeBSD.ORG Fri Oct 12 17:38:34 2012 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49FD2EDA; Fri, 12 Oct 2012 17:38:34 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from exprod7og103.obsmtp.com (exprod7og103.obsmtp.com [64.18.2.159]) by mx1.freebsd.org (Postfix) with ESMTP id 8AC3E8FC08; Fri, 12 Oct 2012 17:38:32 +0000 (UTC) Received: from P-EMHUB03-HQ.jnpr.net ([66.129.224.36]) (using TLSv1) by exprod7ob103.postini.com ([64.18.6.12]) with SMTP ID DSNKUHhVj8lduav1CikdCBYiHYZg26NK2Oo4@postini.com; Fri, 12 Oct 2012 10:38:33 PDT Received: from magenta.juniper.net (172.17.27.123) by P-EMHUB03-HQ.jnpr.net (172.24.192.33) with Microsoft SMTP Server (TLS) id 8.3.213.0; Fri, 12 Oct 2012 10:36:31 -0700 Received: from chaos.jnpr.net (chaos.jnpr.net [172.24.29.229]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id q9CHaUh79003; Fri, 12 Oct 2012 10:36:30 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from chaos.jnpr.net (localhost [127.0.0.1]) by chaos.jnpr.net (Postfix) with ESMTP id 7097658094; Fri, 12 Oct 2012 10:36:30 -0700 (PDT) To: Subject: Re: Building environment using system headers instead of the in-tree headers In-Reply-To: <50736C5A.1000604@delphij.net> References: <50736C5A.1000604@delphij.net> Comments: In-reply-to: Xin Li message dated "Mon, 08 Oct 2012 17:14:18 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 7.82+cvs; nmh 1.3; GNU Emacs 22.3.1 Date: Fri, 12 Oct 2012 10:36:30 -0700 Message-ID: <20121012173630.7097658094@chaos.jnpr.net> MIME-Version: 1.0 Content-Type: text/plain Cc: peter@freebsd.org, freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 17:38:34 -0000 On Mon, 08 Oct 2012 17:14:18 -0700, Xin Li writes: >As it turns out, this was caused by addition of xlocale functionality >on FreeBSD 9.1, which uses macros and expects some new functions found >in more recent FreeBSD releases. On the other hand, we do not pass >e.g. -I${.CURDIR}/../../include so the header is preferred than system >header. Ideally anything which needs to build for the "host" should be sufficiently portable/generic that it can build on *any* host. There are better ways to tackle this than sprinkling -I${.CURDIR}/../../include everywhere - which only addresses a small fraction of the issue anyway (src/include contains only a fraction of what ends up in /usr/include). I think many/most of these sorts of issues will be neatly addressed by the changes we are planning to introduce to the FreeBSD build. The build infrastructure should understand the difference b/w building for host and target, and the correct -I's added automatically. In the Junos build for example we have the notion of PURE_HOSTPROG. "yes" means the app can build cleanly using only the host env "no" means it needs to use headers (perhaps generated code etc) from the src tree and so picks up additional -I's. By default hostpog's use the host's libs, but that can be overridden when needed (eg. an ATF test being built for the host, but wants to link the lib from the src tree that it is trying to test). --sjg