From owner-freebsd-ports@freebsd.org Tue Oct 10 06:22:39 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 30480E25C77 for ; Tue, 10 Oct 2017 06:22:39 +0000 (UTC) (envelope-from tarjei99@gmail.com) Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com [IPv6:2607:f8b0:4003:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1AFA6E90D for ; Tue, 10 Oct 2017 06:22:38 +0000 (UTC) (envelope-from tarjei99@gmail.com) Received: by mail-oi0-x234.google.com with SMTP id j126so43441636oia.10 for ; Mon, 09 Oct 2017 23:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XBzhlV4VhCQehsE6ZYCyq5guX0PU47vMkHiAzWSunuY=; b=sXpnrdUMjnIydGPpYrHWNiHTf3D+KbNOYX2ev+k6hXLU0u1tF8x0z4lPV44SRjiW/6 JUp01u26cNOpRFQQLODY0005wY+JGG0N4jDLWcWw+NuykMm9CbGTqEt9iGLAO3Y1NITt 6PhAKqRPMD+bxbxJTUgWjXenjlN3iuecO46bL6awRiBIqtdvZeC3LUVSL78os3Dh+VwU kQ0IGL0U5B7Wd+gbFdlzGmpsI5AJs7IaiRREmw16/m5Br7QPGxMNxxtCxWpJ6Mi2aWHC dVhLBawvS1xrqKt/+QByIpwtloDqnNB7qjpx3H/YtdNPRj6nVxK7V15oPEGvb5CO0mux 2HeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XBzhlV4VhCQehsE6ZYCyq5guX0PU47vMkHiAzWSunuY=; b=fKcm0QUOWLLW5RVxJeab5x6PyFySkKmMsN9TXcKAjTRu+FqgAGQIJMmwXMfU4WAN/r 4h4+FIcvakSSJCtOH6BMitAMGo9ztlC0c0LoSR++1FwPcrk/tvo8s6jM3/yPR8OKKWo9 b4JEXHUIhbfoTQOdKquOsmhqEWmjFdOFWlagCXUnRduC0+ztGxEBqaRMa62sE+26ik66 aIqvYcfnVF/hyB0hWuTzu65ncehxHizpNhdq6Ft/TmiPHt/2IEcvIGWRy+R/xzZtyZl+ zXakqu5JNACAoNmo4bYhoK925zX+trDFEGvIzWX+rMFsDwniHm2RVariP5bJ/WiWQyj3 0QMg== X-Gm-Message-State: AMCzsaXooLLBkfOHIVAMDBYdML4kW7qlV7eBMTuFv2jPiYN9P973yWnt pH+buddzCqqGNwTcpgPyT0qFPY0kKGsU2UxSs3Y= X-Google-Smtp-Source: AOwi7QC0e11VekNm0mjfHpFLJUed44ZfLvxVQfGzaMiCg1dECQjiCLXBfAY+ZxRM/SFJW00ZVq6ahN5eRCt4/igIhZE= X-Received: by 10.157.41.153 with SMTP id n25mr858828otb.32.1507616558024; Mon, 09 Oct 2017 23:22:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.35.182 with HTTP; Mon, 9 Oct 2017 23:22:37 -0700 (PDT) In-Reply-To: <0E044060-82AF-4CCA-953C-3616E76B33C3@dsl-only.net> References: <0E044060-82AF-4CCA-953C-3616E76B33C3@dsl-only.net> From: Tarjei Jensen Date: Tue, 10 Oct 2017 08:22:37 +0200 Message-ID: Subject: Re: Cross compiling GCC for aarch64 To: Mark Millard Cc: FreeBSD Ports Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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 06:22:39 -0000 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 : > > > 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. > > > I had trouble following this. I had to look up > "Canadian Cross", which I found in: > > https://en.wikipedia.org/wiki/Cross_compiler > > Canadian Cross has 3 "machines": A, B, and C. > > (A) is used to bootstrap a compiler/toolchain > to run native on (B). (This can have multiple > stages, including a cross compile stage.) > > (B) is used to bootstrap a cross compiler/toolchain > to run on (B) to produce materials for (C). > > (C) runs the output from (B)'s cross compiler > but normally does not have its own self-hosted > compiler/toolchain or any cross compilers. > > If I read what you wrote correctly you are looking > more for (B) and (C) not being distinct. > > Or am I wrong and you want(?): > > (A) to be a amd64 (i386?) FreeBSD 11.1 context > > (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 > > (C) to be aarch64 FreeBSD 12 having its own > compiler for targeting itself [copied from > (B)]. > > ? > > === > Mark Millard > markmi at dsl-only.net > > >From the first paragraph : It is about cross compiling gcc from ports so that it will work on aarch64 FreeBSD 12-CURRENT. I have a working cross compiler.