From owner-freebsd-mips@FreeBSD.ORG Sun Jan 5 01:30:28 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2DBCD31 for ; Sun, 5 Jan 2014 01:30:28 +0000 (UTC) Received: from mail-qe0-x234.google.com (mail-qe0-x234.google.com [IPv6:2607:f8b0:400d:c02::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7CD531337 for ; Sun, 5 Jan 2014 01:30:28 +0000 (UTC) Received: by mail-qe0-f52.google.com with SMTP id ne12so17187395qeb.39 for ; Sat, 04 Jan 2014 17:30:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=ZuF3FIUbuAdaQWaqhSjN69KD4+XjgMoXCNv3zyV3tHo=; b=JgX+hwEvh62IMjgpxhFV11LZhxtjCGUFDhTLPanNkKrbEe8hkJbwd2Vj8iIKwKJwtP II4XO86EYj4Dmm/BBrsaEwrPE41tRJgR+0Itsg1z4hH02BcojHImtPh1F3Fya29nEpAG 1N6XBhh6tSdxtqTix09Hrq9wUrANehlY7heGOZfqrzsCX39DB6kezgEqOnCUxaG9V3hy gvD40KJieCZ4r63KlBrrkZZ+waO/CxcEsR2Lf+9rq7FDkCc8DRWLNY4leIrJyquj2y21 cX7kJa3xb3/xQlVQkgYqpYE3QVxBlpx0b30ejjEhjSYyvH/+gypX8Nla7cybjHcNha6p ubLA== MIME-Version: 1.0 X-Received: by 10.49.76.66 with SMTP id i2mr171246959qew.35.1388885427593; Sat, 04 Jan 2014 17:30:27 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.52.8 with HTTP; Sat, 4 Jan 2014 17:30:27 -0800 (PST) In-Reply-To: References: Date: Sat, 4 Jan 2014 17:30:27 -0800 X-Google-Sender-Auth: n9luYRBiNouqU35ZLbVqWGYCC0M Message-ID: Subject: Re: Couple of snags cross-installing after cross-compiling From: Adrian Chadd To: Nathan Dorfman Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2014 01:30:28 -0000 Hi! Cool! would you mind filing a PR with this information? I think your analysis (strip -> ITOOLS) is correct. Thanks! -a On 4 January 2014 11:35, Nathan Dorfman wrote: > Hello all, > > I have a small FreeBSD/mips machine (the EdgeRouter Lite), and I want to > cross-build world and kernel on my larger amd64 machine, then install the > result on the target system. I'm doing this by exporting via NFS from the= build > machine, and it seems to be working well, just two small snafus along the= way. > Hopefully this isn't considered crazy and unsupported, because it almost > works. :) > > Note: this is releng/10 (r260251), not head. > > The only trouble is that buildworld produces a toolchain for the host, no= t > target, machine in $WORLDTMP, which is first in the PATH for subsequent > commands. So, when installkernel is run on the mips64 target, it tries to > execute those amd64 binaries: > > -------------------------------------------------------------- > >>> Installing kernel ERL > -------------------------------------------------------------- > cd /usr/obj/usr/src/sys/ERL; [...] > PATH=3D/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/u= sr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/legacy/bi= n:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/s= rc/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin > make KERNEL=3Dkernel install > > cc: Exec format error > make[2]: "/usr/src/share/mk/bsd.compiler.mk" line 9: warning: "cc > --version" returned non-zero status > [...] > > If for some reason installworld is run first, it fails similarly. To get = around > this, all that's needed is rm -rf $WORLDTMP. The install proceeds using t= he > tools in /bin and /usr/bin. I also tried changing the definition of WORLD= TMP in > Makefile.inc1 from just 'tmp' to 'tmp.$(MACHINE_ARCH)' before running the > buildworld, and that works to stop this error before it occurs. > > This probably isn't right since I think I want to be running new, not > previously installed, binaries here. There's no cross-compiling of $WORLD= TMP, > but can I just point it at the entire freshly built world, /usr/obj/usr/s= rc, > instead? In any case, for the time being, with the wrong-arch $WORLDTMP n= ot > there, installkernel succeeds and installworld proceeds to fail slightly = later, > with this: > > =3D=3D=3D> lib/libc (install) > install -C -o root -g wheel -m 444 libc.a /usr/lib > install -C -o root -g wheel -m 444 libc_p.a /usr/lib > install -s -o root -g wheel -m 444 -fschg -S libc.so.7 /lib > install: exec(strip): No such file or directory > > Here, the default system path (/usr/bin, etc.) is not in the PATH; it con= sists > only of the various subdirs of $WORLDTMP, followed by one new directory > /tmp/install.3aqj2XwQ. I noticed that this path was only just created by = a > preceding step, and easily fixed the error by adding strip to the list of > ITOOLS=3D in Makefile.inc1. > > Here's what's confusing: why does that /tmp/install directory exist in th= e > first place? It's behind $WORLDTMP in the path, so under normal circumsta= nces, > it wouldn't be used. I began to suspect that might be unintentional, but = I > don't know much about the FreeBSD build system, so I'd like to ask someon= e who > does! > > Anyway, after adding strip to ITOOLS, installworld also succeeds, and lif= e is > good. > > Thanks, > -nd. > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org"