Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Jun 2014 13:50:22 -0500
From:      Brooks Davis <brooks@freebsd.org>
To:        Peter Wemm <peter@wemm.org>
Cc:        freebsd-stable@freebsd.org, Chris Ross <cross+freebsd@distal.com>
Subject:   Re: Cross-building FreeBSD core...
Message-ID:  <20140609185022.GD94040@lor.one-eyed-alien.net>
In-Reply-To: <2158607.RZmBJ56eyy@overcee.wemm.org>
References:  <FB1DB8CA-F1D1-4339-B238-F08704EDDA75@distal.com> <2158607.RZmBJ56eyy@overcee.wemm.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140609185022.GD94040>