From owner-freebsd-ports@freebsd.org Tue Oct 10 09:15:51 2017 Return-Path: Delivered-To: freebsd-ports@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 CFDB0E2A3D5 for ; Tue, 10 Oct 2017 09:15:51 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-18.reflexion.net [208.70.210.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C1C773E26 for ; Tue, 10 Oct 2017 09:15:50 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 30461 invoked from network); 10 Oct 2017 09:15:48 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 10 Oct 2017 09:15:48 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Tue, 10 Oct 2017 05:15:48 -0400 (EDT) Received: (qmail 16782 invoked from network); 10 Oct 2017 09:15:48 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 10 Oct 2017 09:15:48 -0000 Received: from [192.168.1.26] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 727F5EC7EA3; Tue, 10 Oct 2017 02:15:47 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: Cross compiling GCC for aarch64 From: Mark Millard In-Reply-To: Date: Tue, 10 Oct 2017 02:15:46 -0700 Cc: FreeBSD Ports Content-Transfer-Encoding: quoted-printable Message-Id: <0136AF00-0DFA-4764-8CFC-28D10421420A@dsl-only.net> References: <0E044060-82AF-4CCA-953C-3616E76B33C3@dsl-only.net> To: Tarjei Jensen X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 09:15:51 -0000 On 2017-Oct-9, at 11:22 PM, Tarjei Jensen wrote: >> On Mon, Oct 9, 2017 at 11:26 PM, Mark Millard wrote: >> Tarjei Jensen tarjei99 at gmail.com wrote on >> Mon Oct 9 17:16:41 UTC 2017 : >>=20 >> > This does NOT concern making a cross compiler. It is about cross = compiling >> > gcc from ports so that it will work on aarch64 FreeBSD 12-CURRENT. >> > >> > I have managed to create my own ports which allow me to use gcc6 as = a cross >> > compiler on x86 Freebsd 11.1 with aarch64 FreeBSD 12-CURRENT being = the >> > target. It seems to work fine. >> > >> > The problem is that I want the GNU Ada compiler (gnat). It requires = a >> > working Ada compiler to compile parts of the compiler. There is a = gcc6-aux >> > pkg and port which uses v11 binaries. However it does *not* work on = FreeBSD >> > 12. It can compile, but the resulting executables does not work. = And the >> > gdb skills needed to find out why is simply beyond me. >> > >> > As I understand, what I am attempting is called a Canadian Cross. >> > >> > My plan would be to use the ports system to do this. e.g. by doing = a "make >> > build". Create a tarball of the result and unpack on the target = system and >> > do a "make install". Or make a pkg. Whatever works. >> > >> > I seem to have found the parameters to use for running the = configure >> > script, but I would very much like to use the ports way. >> > >> > Can anybody explain or point to an article which explains how to = use the >> > Canadian Cross to cross compile gcc? >> > >> > Suggestions and pointers to documentation are very much = appreciated. >>=20 >>=20 >> I had trouble following this. I had to look up >> "Canadian Cross", which I found in: >>=20 >> https://en.wikipedia.org/wiki/Cross_compiler >>=20 >> Canadian Cross has 3 "machines": A, B, and C. >>=20 >> (A) is used to bootstrap a compiler/toolchain >> to run native on (B). (This can have multiple >> stages, including a cross compile stage.) >>=20 >> (B) is used to bootstrap a cross compiler/toolchain >> to run on (B) to produce materials for (C). >>=20 >> (C) runs the output from (B)'s cross compiler >> but normally does not have its own self-hosted >> compiler/toolchain or any cross compilers. >>=20 >> If I read what you wrote correctly you are looking >> more for (B) and (C) not being distinct. >>=20 >> Or am I wrong and you want(?): >>=20 >> (A) to be a amd64 (i386?) FreeBSD 11.1 context >>=20 >> (B) to be amd64(?) FreeBSD 12 for >> cross compiling to aarch64 FreeBSD 12 >> and used to produce an aarch64 compiler >> for use on aarch64 FreeBSD 12 >>=20 >> (C) to be aarch64 FreeBSD 12 having its own >> compiler for targeting itself [copied from >> (B)]. >>=20 >> ? >=20 > =46rom the first paragraph : > It is about cross compiling gcc from ports so that it will work on = aarch64 FreeBSD 12-CURRENT.=20 >=20 > I have a working cross compiler. You also wrote (see earlier above): >> Can anybody explain or point to an article which explains how to use = the >> Canadian Cross to cross compile gcc? That and "I have a working cross compiler" together still leaves me just as confused for how the "Canadian Cross" pattern is supposed to be involved, at least for the description I found of what the phrase refers to. Two stages of producing cross compilers (A->B and B->C) seemed essential to what is described as the pattern involved. Clearly I'm to be of no help for this. Sorry to have wasted your time. =3D=3D=3D Mark Millard markmi at dsl-only.net