From owner-freebsd-arm@freebsd.org Thu Aug 6 02:57:52 2015 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32C529B35B2; Thu, 6 Aug 2015 02:57:52 +0000 (UTC) (envelope-from m.vale@live.com.au) Received: from COL004-OMC4S6.hotmail.com (col004-omc4s6.hotmail.com [65.55.34.208]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "*.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C11D1500; Thu, 6 Aug 2015 02:57:51 +0000 (UTC) (envelope-from m.vale@live.com.au) Received: from COL130-W38 ([65.55.34.200]) by COL004-OMC4S6.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Wed, 5 Aug 2015 19:56:45 -0700 X-TMN: [RjoGN3pMdsG3IktsyQj/V097WMCXkWx2] X-Originating-Email: [m.vale@live.com.au] Message-ID: From: Michael Vale To: Adrian Chadd , "bapt@freebsd.org" , "freebsd-mips@freebsd.org" , "freebsd-arm@freebsd.org" , "freebsd-embedded@freebsd.org" Subject: RE: Multi Arch ELF binary/object compiling, linking and more Date: Thu, 6 Aug 2015 13:26:45 +1030 Importance: Normal In-Reply-To: References: MIME-Version: 1.0 X-OriginalArrivalTime: 06 Aug 2015 02:56:45.0211 (UTC) FILETIME=[879006B0:01D0CFF3] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Aug 2015 02:57:52 -0000 Sorry=2C there is more. I forgot to mention that you can set X_SYSROOT at = the command line so ports can find the appropriate system headers to build = from as a part of your firmware. You can also set DESTDIR to a valid jail = and set CHROOTED to YES (more on that later) or NO=3Dand specify a subdirec= tory within your jail to isolate your compilations from what would be a for= eign HOST environment. Or you can do what I did and edir Warden to create = a mips template built from freebsd sources and push your host environment o= ut into the build environment and have the jail contain only the firmware k= ernel and userland + the results of any ports you compile and install into = that jail with DESTDIR CHROOTED=3Dyes From: m.vale@live.com.au To: adrian@freebsd.org=3B bapt@freebsd.org=3B freebsd-mips@freebsd.org=3B f= reebsd-arm@freebsd.org=3B freebsd-embedded@freebsd.org Subject: Multi Arch ELF binary/object compiling=2C linking and more Date: Thu=2C 6 Aug 2015 13:20:27 +1030 =0A= =0A= =0A= You can try and read my lyrics off of this paper before I lay 'emBut you wo= n't take the sting out these words before I say 'emCause ain't no way I'ma = let you stop me from causing mayhemWhen I say I'ma do something I do it=2CI= don't give a damn what you think=2CI'm doing this for me=2C so fuck the wo= rldFeed it beans=2C it's gassed up=2C if it thinks it's stopping mehttps://= www.youtube.com/watch?v=3Dj5-yKhDd64s Hey=2C Okay here it is. It's not complete yet=2C but I'm throwing it out there wh= ile I have the chance. One can specify the build machine's arch type with ARCH=3D=2C the host (and= in turn the build machine if one is not set) with X_BUILD_FOR=3D and also = finally the target with TARGET=3D. You can choose to set all three to the = same arch as the target=2C or whatever pleases you. Surely if you're smart= and doing some wicked fancy things you can benefit from setting different = archs accordingly=2C if you're accessing these binaries and objects from a = central storage and utilising resources over a network. EDIT: What I forgot to mention is=2C to utilize "cross-compiling" allows on= e to run the same binaries and objects on multiple architectures. So one w= ould think the build variable would have to be one of the machine compiling= the binaries and objects but that is not the case=2C it has other purposes= too. It has been clear in the GNU and FreeBSD way of things that by retai= ning the build variable as the one you compile the binary on and setting th= e HOST variable defines what "other" (sic.) architecture the binaries or ob= ject execute on when infact by setting HOST=2C you also tend to automatical= ly adjust TARGET to suit. The light on this matter is that you can infact = set an intermediate HOST architecture to the TARGET that allows building ta= sks assigned to the BUILD variable=2C 'hosting' and 'operating' on the HOST= architecture and native execution on the TARGET. Don't think for one mome= nt though that you can't set all three BUILD=2C HOST and TARGET to the TARG= ET architecture and use that binary or object as a development utility=2C h= ost or native on the desired platform/architecture. The work is rather complete=2C I've managed to build asterisk=2C kismet and= different X11/Xorg servers and all their dependencies. I haven't begun on slimming down the stage outfits into something suitable = for embedded flashing and packaging. https://www.youtube.com/watch?v=3DBE9CXWV1alg - Michael. =