From owner-freebsd-arm@FreeBSD.ORG Sat Jan 3 03:43:12 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CB628109 for ; Sat, 3 Jan 2015 03:43:12 +0000 (UTC) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 418DB222A for ; Sat, 3 Jan 2015 03:43:11 +0000 (UTC) Received: by mail-lb0-f177.google.com with SMTP id b6so15634143lbj.36 for ; Fri, 02 Jan 2015 19:43:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=59/3V0E/X0KaDC+yg9AaL1lnfCE9MkjOjUtVsjEFt7M=; b=UJ16XjLMNg20Hk+4+ENeHDCWy24ABArp9g4+bA8z62DcCKzcXryLCa72M6ZYy+MyX/ 4ewWSfox4a5GlVPUcj4brZcatM6/hMpXM8Le/1j1gruQoq674CBRb8fO/OLLqCDxlWUM AkvRHwvvqDzLIwiMNOT8mQOklp3m6q+7cidxKHzNL713WYniaEtOvPxrSXPnQTqMXSxy dPkV2hrW78yZnIMXDxsJgOt4kPu2EGlV/7XriSLTu21CrcZG+hkMnd8DaT39Qb6+1G89 cu5rqz6EFDRPGZMHc4UpeHubviaj9g7j3wyV7FF+RTgiPivZIN87utPlzu4eG37ig3Yz 83sA== X-Gm-Message-State: ALoCoQnFCvjzEIzsyjPSOSl/YZJuSXRe9IxNgO4v/6yJx4NGog3qnCGFyX+EXoRU90LmPIVa11v6 X-Received: by 10.152.21.134 with SMTP id v6mr79396150lae.13.1420256589321; Fri, 02 Jan 2015 19:43:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.142.198 with HTTP; Fri, 2 Jan 2015 19:42:28 -0800 (PST) X-Originating-IP: [74.60.193.70] In-Reply-To: References: From: Jeremy Brown Date: Fri, 2 Jan 2015 22:42:28 -0500 Message-ID: Subject: Re: Cross-Compiling RPi Ports From amd64 Using Native Toolchain To: freebsd-arm@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Jan 2015 03:43:12 -0000 One additional thing: I checked my toolchain and did see that some of my programs (ar, as, cc, gcc, ld, ranlib) are statically linked, whereas the rest are dynamically linked, including cpp and nm which also gave me the ELF interpreter error. So I'll change my question somewhat - if I use the command given on the qemu page (env -u TARGET -u TARGET_ARCH make -j 4 toolchain) instead of the one provided by crochet (make XDEV=3D${XDEV} XDEV_ARCH=3D${XDEV_ARCH} WITH_GCC=3D1 WITH_GCC_BOOTSTRAP=3D1 WITHOUT_CLANG= =3D1 WITHOUT_CLANG_BOOTSTRAP=3D1 WITHOUT_CLANG_IS_CC=3D1 WITHOUT_TESTS=3D1 xdev)= , would I be more likely to succeed in cross-compiling my ports and will I be able to use this toolchain to build the kernel and world with crochet? -Jeremy On Fri, Jan 2, 2015 at 6:06 PM, Jeremy Brown wrote= : > I followed the steps crochet made me do, so my setup is a bit different t= han what is shown on that page - I used make xdev instead of make toolchain= assuming the commands were equivalent, but if not please let me know. > > I was left with tools in two places - /usr/armv6-freebsd and /usr/obj/arm= v6-freebsd. It seems most of the important elements such as the compilation= tools are in the former location, with only sourcefiles in the latter. > > I have to copy the tools over into /usr/armv6-freebsd in the chroot and n= ot /usr/obj because my version of gcc doesn't pick up on other directories = to search, should I just copy /usr/obj/armv6-freebsd/usr/src/tmp to /usr/ar= mv6-freebsd in the chroot? > > When I would try to set the environment variables make would never pick t= hem up - I would try either modifying /root/.profile and use sh as my shell= or modifying /root/.cshrc and using csh as my shell. Thankfully, the host'= s PATH would overwrite the PATH in the chroot, so I could add /usr/armv6-fr= eebsd to my path and make would pick up the new tools. > > Also, since building the ports is to be scripted, I'm using make from the= host using DESTDIR to set up a chroot, is there some superior way to do th= is? > > -Jeremy > > >* I managed to use crochet and the QemuUserModeHowTo to build some > *>* ports for the RPi. What bit me in the process was that the "Cross > *>* Building Using The Host Cross Compiler" section had to be followed > *>* to a T - in particular, the built cross toolchain in > *>* /usr/obj/usr/src/tmp must be moved to /usr/obj > *>* wholesale, the local headers symlink made, and the cross-CC > *>* environment variables set up. The error in #2 above seems to > *>* indicate that the cross tool is not statically linked, so maybe the > *> > * wrong toolchain is in use.* > >