From owner-freebsd-stable@FreeBSD.ORG Mon Jun 9 18:50:39 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE5FB829 for ; Mon, 9 Jun 2014 18:50:39 +0000 (UTC) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C5682568 for ; Mon, 9 Jun 2014 18:50:37 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.7/8.14.7) with ESMTP id s59IoNwI003325; Mon, 9 Jun 2014 13:50:23 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.7/8.14.7/Submit) id s59IoMMi003324; Mon, 9 Jun 2014 13:50:22 -0500 (CDT) (envelope-from brooks) Date: Mon, 9 Jun 2014 13:50:22 -0500 From: Brooks Davis To: Peter Wemm Subject: Re: Cross-building FreeBSD core... Message-ID: <20140609185022.GD94040@lor.one-eyed-alien.net> References: <2158607.RZmBJ56eyy@overcee.wemm.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yEPQxsgoJgBvi8ip" Content-Disposition: inline In-Reply-To: <2158607.RZmBJ56eyy@overcee.wemm.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-stable@freebsd.org, Chris Ross X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jun 2014 18:50:39 -0000 --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 08, 2014 at 09:01:18PM -0700, Peter Wemm wrote: > On Sunday 08 June 2014 23:05:25 Chris Ross wrote: > > So, I was investigating the notion of cross-building FreeBSD stable/1= 0.=20 > > Specifically, I wanted to try to build a full amd64 buildworld and > > buildkernel on a sparc64. > >=20 > > I found https://wiki.freebsd.org/A_Brief_Guide_To_Cross_Compiling_Fre= eBSD > > which I knew was a little old, but tried it. It failed in "stage 4.2: > > building libraries", after quite a long time, eventually failing in: > >=20 > > =3D=3D=3D> lib/ncurses/ncurses (obj,depend,all,install) > > [....] > > cc -o make_keys -O2 -pipe -I. > > -I/home/cross/obj.amd64/usr/src/lib/ncurses/ncurses/../ncurses > > -I/usr/src/lib/ncurses/ncurses/../ncurses > > -I/usr/src/lib/ncurses/ncurses/../ncurses > > -I/usr/src/lib/ncurses/ncurses/../../../contrib/ncurses/include > > -I/usr/src/lib/ncurses/ncurses/../../../contrib/ncurses/ncurses -Wall > > -DNDEBUG -DHAVE_CONFIG_H -DFREEBSD_NATIVE -DTERMIOS -std=3Dgnu99 > > -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall > > -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes > > -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-si= gn > > -Wno-empty-body -Wno-string-plus-int -Wno-tautological-compare > > -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function > > -Wno-enum-conversion > > /usr/src/lib/ncurses/ncurses/../../../contrib/ncurses/ncurses/tinfo/mak= e_ke > > ys.c ./make_keys keys.list > init_keytry.h > > ./make_keys: Exec format error > > *** Error code 126 > >=20 > >=20 > > Is this a bug that needs to be fixed in the build system, or somethin= g I > > did wrong to perform the build? > >=20 > > I effectively did: > >=20 > > make buildworld TARGET=3Damd64 TARGET_ARCH=3Damd64 > > MAKEOBJDIRPREFIX=3D/home/cross/obj.amd64 >=20 > I don't know if it's still the case, but MAKEOBJDIRPREFIX used to have to= be=20 > set before calling make, ie something more like: > env MAKEOBJDIRPREFIX=3D/home/cross/obj.amd64 make buildworld TARGET=3Damd= 64=20 > TARGET_ARCH=3Damd64 It is. Setting MAKEOBJDIRPREFIX as a make argument means it can't be changed and apparently that ability is used somewhere in the bootstrap process. The symptoms are bizzare and you end up with a cross built make_keys in the native tools path. Adding a seatbelt to detect this case and fail is on my todo list. -- Brooks --yEPQxsgoJgBvi8ip Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iKYEARECAGYFAlOWAe1fFIAAAAAALgAoaXNzdWVyLWZwckBub3RhdGlvbnMub3Bl bnBncC5maWZ0aGhvcnNlbWFuLm5ldDY1NUQ1MTlDMjZBNzgyRTcyNTI5OUJGMDVE OEU4QkU5RjIzODFBRDQACgkQXY6L6fI4GtQXZQCeNKcfBWaDAjfXWF/dzxImKabK dEsAnjywtDr/1cVsaS4+Tb1M18nYTxTZ =8yP7 -----END PGP SIGNATURE----- --yEPQxsgoJgBvi8ip--