From owner-freebsd-questions@freebsd.org Sun Dec 8 17:17:44 2019 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A7FD1EA4E4 for ; Sun, 8 Dec 2019 17:17:44 +0000 (UTC) (envelope-from carlj@peak.org) Received: from filter02.peak.org (filter02.peak.org [207.55.16.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47WCgq3Dg9z4Smt for ; Sun, 8 Dec 2019 17:17:43 +0000 (UTC) (envelope-from carlj@peak.org) Received: from zmail-mta01.peak.org ([207.55.16.111]) by filter02.peak.org ({c0e096ac-ab76-477d-8a9d-eab3e47a6d30}) via TCP (outbound) with ESMTPS id 20191208171739939_0000 for ; Sun, 08 Dec 2019 09:17:39 -0800 X-RC-FROM: X-RC-RCPT: Received: from localhost (localhost [127.0.0.1]) by zmail-mta01.peak.org (Postfix) with ESMTP id 096F59801B for ; Sun, 8 Dec 2019 09:17:39 -0800 (PST) Received: from zmail-mta01.peak.org ([127.0.0.1]) by localhost (zmail-mta01.peak.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id xpj2pXMhADRH for ; Sun, 8 Dec 2019 09:17:38 -0800 (PST) Received: from mailproxy-lb-05.peak.org (mailproxy-lb-05.peak.org [207.55.17.95]) by zmail-mta01.peak.org (Postfix) with ESMTP id BCD3C9808B for ; Sun, 8 Dec 2019 09:17:38 -0800 (PST) Received: from localhost.localnet ([127.0.0.1] helo=elm.localnet) by elm.localnet with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1ie0Bd-000NvJ-Gf for freebsd-questions@freebsd.org; Sun, 08 Dec 2019 09:17:37 -0800 Received: (from carlj@localhost) by elm.localnet (8.15.2/8.15.2/Submit) id xB8HHafw091964; Sun, 8 Dec 2019 09:17:36 -0800 (PST) (envelope-from carlj) From: Carl Johnson To: freebsd-questions@freebsd.org Subject: Re: Cross-compiling with go for arm on amd64. Possible? References: <20191208082237.GA80246@thismonkey.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Sun, 08 Dec 2019 09:17:36 -0800 In-Reply-To: <20191208082237.GA80246@thismonkey.com> (Scott Aitken's message of "Sun, 8 Dec 2019 19:22:37 +1100") Message-ID: <86pngybutr.fsf@elm.localnet> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-MAG-OUTBOUND: peakinternet.redcondor.net@207.55.16/22 X-Rspamd-Queue-Id: 47WCgq3Dg9z4Smt X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=peak.org; spf=pass (mx1.freebsd.org: domain of carlj@peak.org designates 207.55.16.93 as permitted sender) smtp.mailfrom=carlj@peak.org X-Spamd-Result: default: False [-1.90 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; RCVD_COUNT_FIVE(0.00)[6]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_ALLOW(-0.50)[peak.org,none]; IP_SCORE(-0.00)[asn: 13868(0.03), country: US(-0.05)]; RCVD_IN_DNSWL_LOW(-0.10)[93.16.55.207.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:13868, ipnet:207.55.0.0/17, country:US]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2019 17:17:44 -0000 Scott Aitken writes: >> Scott Aitken writes: >> >> > Hi, >> > >> > So I wanted to install dns/dnscrypt-proxy2 on my Raspberry Pi running FreeBSD >> > 12.0-RELEASE r341666 GENERIC arm. >> > >> > There's no package version, so I tried compiling. Unfortunately that didn't >> > work as the Go dependency ran out of RAM compiling. And there's no package >> > for Go... >> > >> > So I fired up a VM and installed ports-mgmt/poudriere. Set it all up and >> > added dns/dnscrypt-proxy2 to my shopping list... >> > >> > Unfortunately it skipped lang/go: >> > >> > Code: >> > [00:01:14] [01] [00:00:00] Building lang/go | go-1.13.4,1 >> > [00:01:16] [01] [00:00:02] Finished lang/go | go-1.13.4,1: Ignored: fails to >> > build with qemu-user-static >> > [00:01:16] [01] [00:00:02] Skipping dns/dnscrypt-proxy2 | >> > dnscrypt-proxy2-2.0.31_1: Dependent port lang/go | go-1.13.4,1 ignored >> > >> > Apparently Go 1.3 won't compile under the emulator (see PR 221297 for some >> > background. >> > >> > Is it possible for go to cross-compile for arm on amd64? >> >> I don't know about cross-compiling, but I have built go from source on a >> Raspberry Pi 2. In my case I was running 12.1-RELEASE, and I built >> go-1.13.1,1 about 2 weeks ago. My typescript file doesn't show any >> errors, and time showed a 28 minute build time and another 15 minutes to >> create a binary package. That was after installing the go14 binary >> package. >> >> -- >> Carl Johnson carlj@peak.org >> > Hi Carl, > > I had no luck as I said. I killed every daemon I could and simply saw the > memory in top approach zero after about 3 minutes into the build, and then > the core dump. > > Other than OS and compiler options (of which I'm using the default) I can't > think of why you had success whereas I didn't. > > This is my dmesg - are you using the same platform? > > FreeBSD 12.0-RELEASE r341666 GENERIC arm > FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1) > VT: init without driver. > CPU: ARM Cortex-A7 r0p5 (ECO: 0x00000000) > CPU Features: > Multiprocessing, Thumb2, Security, Virtualization, Generic Timer, VMSAv7, > PXN, LPAE, Coherent Walk > Optional instructions: > SDIV/UDIV, UMULL, SMULL, SIMD(ext) > LoUU:2 LoC:3 LoUIS:2 > Cache level 1: > 32KB/64B 4-way data cache WB Read-Alloc Write-Alloc > 32KB/32B 2-way instruction cache Read-Alloc > Cache level 2: > 512KB/64B 8-way unified cache WB Read-Alloc Write-Alloc > real memory = 0 (0 MB) > avail memory = 957149184 (912 MB) > No PSCI/SMCCC call function found > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs I am running 12.1-RELEASE instead of the 12.0-RELEASE that you are running, so that used LLVM 8.0.1 instead of LLVM 6.0.1, but otherwise my dmesg is the same. I had actually used pkg to install go14 instead of building it, and my understanding is that go builds using go14. The other possibility I can think of is that maybe you are using -j4 or similar with make, but I didn't. You might want to try an explicit -j1 when building go to see if that works. I just realized that I had about 1.8GB of swap, so you might need to setup a swap file or partition. I doubt that I used anything close to that 1.8GB, but I never looked to see how much. I hope that helps. -- Carl Johnson carlj@peak.org