From owner-freebsd-mips@FreeBSD.ORG Sat Jan 4 19:35:21 2014 Return-Path: Delivered-To: freebsd-mips@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 2BF34AEA for ; Sat, 4 Jan 2014 19:35:21 +0000 (UTC) Received: from mail-oa0-x232.google.com (mail-oa0-x232.google.com [IPv6:2607:f8b0:4003:c02::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA7281AC7 for ; Sat, 4 Jan 2014 19:35:20 +0000 (UTC) Received: by mail-oa0-f50.google.com with SMTP id n16so17579967oag.9 for ; Sat, 04 Jan 2014 11:35:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=vBUuNEmN29ziDG+fBgcAFFEgDP40BxPi/XxttKCVbKk=; b=RQXzzwy9mcss6LZMJKpwug7ufqQQaEsEmgWwnq7FBFUegSesR7FMEaPGDgw9nQOdq5 zdZTFGQ43iakaLoP/tpyEnOZYW5+zzEokzuld89tTV6PONaYQoxNA+EtCgCzhNfhMiUp YP/tpvSKD/s6FSO2bOCINCclUQlklvGtUxTtp1K3nv1eWFZ1GYo1MspkO2j/k8W96U05 gySHPYFXBMm2+p1Ebh7pe5KqC0Hk3fxscZkDU5tcmJSWuw32+WNfAHQgBe7GKNWzbb4C ctFd12mLT2x8N5Sb0qGDOjJrVH52KDQxYpehq8VI+v0l7ATCzOJ09bd/Mkf6fr9dEZzZ c80g== MIME-Version: 1.0 X-Received: by 10.60.34.3 with SMTP id v3mr113937oei.67.1388864119998; Sat, 04 Jan 2014 11:35:19 -0800 (PST) Sender: ndorfman@gmail.com Received: by 10.60.36.9 with HTTP; Sat, 4 Jan 2014 11:35:19 -0800 (PST) Date: Sat, 4 Jan 2014 14:35:19 -0500 X-Google-Sender-Auth: 79wLovBCVJ-vmMv9e-XaxCZ4HUc Message-ID: Subject: Couple of snags cross-installing after cross-compiling From: Nathan Dorfman To: freebsd-mips@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Sat, 04 Jan 2014 19:35:21 -0000 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 b= uild machine, and it seems to be working well, just two small snafus along the w= ay. 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, not 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/usr= /bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/legacy/bin:= /usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src= /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 ar= ound this, all that's needed is rm -rf $WORLDTMP. The install proceeds using the tools in /bin and /usr/bin. I also tried changing the definition of WORLDTM= P 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 $WORLDTM= P, but can I just point it at the entire freshly built world, /usr/obj/usr/src= , instead? In any case, for the time being, with the wrong-arch $WORLDTMP not there, installkernel succeeds and installworld proceeds to fail slightly la= ter, 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 consi= sts 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 the first place? It's behind $WORLDTMP in the path, so under normal circumstanc= es, 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 someone = who does! Anyway, after adding strip to ITOOLS, installworld also succeeds, and life = is good. Thanks, -nd.