Cross build of i386 on 7.0 fails

John Baldwin jhb at freebsd.org
Mon Jan 28 15:09:16 PST 2008


On Friday 25 January 2008 06:00:16 pm Steven Hartland wrote:
> 
> ----- Original Message ----- 
> From: "John Baldwin" <jhb at freebsd.org>
> > On Friday 25 January 2008 10:36:14 am Steven Hartland wrote:
> >> I'm sure I must be missing something simple but I've searched google
> >> and the mail archives and cant find the answer to this.
> >> 
> >> When trying to build i386 targets in amd64 buildkernel fails with the
> >> following:-
> >> > make buildkernel TARGET=i386
> >> ....
> >> >>> stage 3.1: making dependencies
> >> ...
> >> /usr/src/sys/i386/i386/genassym.c:1: error: -mpreferred-stack-boundary=2 
is 
> > not between 4 and 12
> >> 
> >> What I think is happening is that something is still working as though
> >> I want amd64 bins and hence the error. Is this the case? What am I
> >> missing?
> > 
> > Did you do 'make TARGET=i386 kernel-toolchain' (or buildworld or 
toolchain) 
> > first?
> 
> Nope, that fixed it thanks a lot!
> 
> On standard builds that step seems to be done automatically? So is there
> a missing dependency / check when cross building?

Well, standard builds are allowed to fall back to using the regular tools on 
the box (e.g. /usr/bin/make).  Perhaps that shouldn't happen for 
cross-builds.  cc'ing ru@ as he would know better about that than I.  Maybe 
TMPPATH should just be STRICTTMPPATH if TARGET is set?

> Now I know that option searching for kernel-toolchain turned up the 
information
> in "man build" which seems to have similar but more info than the header 
of:-
> /usr/src/Makefile
> 
> It might be nice to have a reference "man build" in the header to help 
others
> who try to do the same thing and ensure they don't hit the same brick wall I
> did.

Something like this perhaps?  (ru@, I'll leave it to you to figure out a 
better way/place to do this):

Index: Makefile
===================================================================
RCS file: /usr/cvs/src/Makefile,v
retrieving revision 1.344
diff -u -r1.344 Makefile
--- Makefile    13 Dec 2007 00:08:02 -0000      1.344
+++ Makefile    28 Jan 2008 21:09:04 -0000
@@ -75,6 +75,8 @@
 # developer convenience only.  They are intentionally not documented and
 # completely subject to change without notice.
 #
+# For more information, see the build(7) manual page.
+#
 TGTS=  all all-man buildenv buildenvvars buildkernel buildworld \
        check-old check-old-dirs check-old-files check-old-libs \
        checkdpadd clean cleandepend cleandir \

-- 
John Baldwin


More information about the freebsd-amd64 mailing list