Cross-building FreeBSD core...

Brooks Davis brooks at freebsd.org
Mon Jun 9 18:50:39 UTC 2014


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/10. 
> > Specifically, I wanted to try to build a full amd64 buildworld and
> > buildkernel on a sparc64.
> > 
> >   I found https://wiki.freebsd.org/A_Brief_Guide_To_Cross_Compiling_FreeBSD
> > 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:
> > 
> > ===> 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=gnu99
> > -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-sign
> > -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/make_ke
> > ys.c ./make_keys keys.list > init_keytry.h
> > ./make_keys: Exec format error
> > *** Error code 126
> > 
> > 
> >   Is this a bug that needs to be fixed in the build system, or something I
> > did wrong to perform the build?
> > 
> >   I effectively did:
> > 
> > make buildworld TARGET=amd64 TARGET_ARCH=amd64
> > MAKEOBJDIRPREFIX=/home/cross/obj.amd64
> 
> I don't know if it's still the case, but MAKEOBJDIRPREFIX used to have to be 
> set before calling make, ie something more like:
> env MAKEOBJDIRPREFIX=/home/cross/obj.amd64 make buildworld TARGET=amd64 
> TARGET_ARCH=amd64

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 326 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20140609/4afce0ef/attachment.sig>


More information about the freebsd-stable mailing list