From nobody Sun Aug 04 21:31:46 2024 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WcXpD07sbz5T4Xd for ; Sun, 04 Aug 2024 21:32:04 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic310-21.consmr.mail.gq1.yahoo.com (sonic310-21.consmr.mail.gq1.yahoo.com [98.137.69.147]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WcXpC06Lqz4thg for ; Sun, 4 Aug 2024 21:32:02 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=gAJYAihZ; dmarc=pass (policy=reject) header.from=yahoo.com; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.147 as permitted sender) smtp.mailfrom=marklmi@yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1722807120; bh=0GPM9MTbiDSsLhTOtKRVk6FM6riMipDVzpTzZYGaUio=; h=From:Subject:Date:References:To:In-Reply-To:From:Subject:Reply-To; b=gAJYAihZtyGYsnAN/CuOOtatE+D5wyXuKMJ7lCswfzmXAPqHOEvR9lj/iWagHpqNDWzgfqXB7/Dxb8BabIQ3LWNBcH5vFuJO7eEmHp3hmT718RDOAhJn5opK1ym3Er6TAXYQUjKvvfhdWVfq2IAmcbBc9clQhLci6ORgpSOE5bCEc76y/myxfAMsY7lSb2kG8HMPzTWR/pue75KHNOdtuCNaGZALyzsytjpt81Hp+qcr3iM1x0f5tJ5mwrlYcrsRk+PWoROBeHs9qL9vplVhD1syGfjZ2EfMfqRs9MWgSBGONTTmYNoPsw9mqfDrQpeGB+n5Tr+FqTfSZVzSMl+mfA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1722807120; bh=RN44O14VJT1wk6Yf2eHxSIeMPM3rBelnkeh30dW014v=; h=X-Sonic-MF:From:Subject:Date:To:From:Subject; b=qmkKhfYnjGcbMBGZ+i69cNC/nxoLeMvSaSPlwUcAPVrmUHyr4bB/YTUPE08lCLZvah7ewkkADJh1BePCNMYVJc6ezTY43uzD/Mv6gnEP8DbITRONX2Xej+A+eYRDLJgtYS00LCOFmAZcQ17XGSJ0I3W/PNoR7ccCBF6I19vBs8jQxNW1ubxsxjS8seUaTnykQhCQpkEsgPjYxOT1SYqa6vUSjy5sB+7xh6609RU4mZc5CkxBtsIQxEeh0lQov/d+fXn7VghJQNfZNnMhJ0Fz2zKxM2AmbwUt7kTBesjJtXQ+9GTYtLIIG8aW7u0RDtwiT7a/p97CiNVaKuknBHSYeg== X-YMail-OSG: bazRWWQVM1mnrYvvjgOJy68zUDSlDGGXRM1EsLLZ07TBYJItwGpe3O9rhZhc3rz 4Tl02KoX19X0zhfJ7u9ftutjBH0sFT13E74UJtqtosntHuDWuabJQQlNc3ia7SCSKUjjqFt3gXGr jonLBGhS_DKru5vkFedEe7oGfBiWbcgAfjzOuEvsPY0XYBVyHfyuRTySaMtSMRYp0Pw6VhSBHyi6 g9gPLlcUD9V9D295szpwZ6aYZ6DRlIjJHgDLA1XYpQfuih.DULSch1BD54D3z9fy1.AkUwoR7kEJ J5B60gI81HFLZ8p9ZjYyuyhY8bHP3EayzA0Hq4.oSuHzVjXf_wmGecsvwlPapzKvuvpW3VZyuTPS hYrir.bDJALXIh3WJPdlkNZmAq7LV6SEGHXwrGHT4eKTT9HLP1kBaRKHr6eVLM95blgiyk_FrzFd EVJYHdfRVEI824brfkNppYpbbcpokl.SM8QB_BQoUDNOGKPlkyBq2w5CsMZESVN6d5qYY_uNSFWH CEDiJRZI4er5I8w8gXkL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dIkDq.Rg8WiEbrv14rQFsxrjMC6PQ0PeOvAaz..drcNIopXxms ADB195_aLZwW6kkVltY9MbEYNBK7AXsc58I.XfNhEW305bRjpp4JjNOp_xmkQZwJaIfB4_7etqNW lnx3lxS3rHnT7KiUJhILNkdCN8O7Z1BnNzozcdw7wETNxCgT9ANCHXcYUDfhl8YzxuVNLJV4gvzg eS8jMmKAqgQBg8utzjPCx7GgTa3coA46LLJfFXuY1w_So8cFXJDX38KzJyVTIjbglrKWRJ5nKhzN IaimIlu_HY3SL1tpYuyD2z4NtelD.x0nhke6woZwbc6gRl5367CLcpRETkM.eZuWNw0WAdx63YQ1 XNtgnnUXFW15egBt49g0_0c.HYUQ4v16a4W58nwc5tQ8xd7g7oUrK.5_XJwRntiWARBaPbj4XF1z dtfGXRkzX24QXvjiWECUb_KijWNZKAFa.H4MR4rZdZdAY09uRRxMR.KVpgwYfhGK1cBvjktwn8xi 7SbuJI1IIbAXEKLZYvENd.e1PRzhw98iJbiz_9dEXW7OATR64w_Yn2FGpyTa4B_VGwdibY7M5IEH 4T8P01sfuBedkWrq1scCowyT9r4Mxi33H2JQO6YYE.BlDhv5EfuhxVXrg3UZNK5BYN4pvtgHc8he j0i19RPfDMrR3RJaJ89ny4Ax0kkrL_eXKbpiF3pNcCbCvm2lK2C_bMUb27wt_WXn23KVIB8dWVws - X-Sonic-MF: X-Sonic-ID: 650892d7-656d-4f0f-ba3c-19b4b0ab02d3 Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.gq1.yahoo.com with HTTP; Sun, 4 Aug 2024 21:32:00 +0000 Received: by hermes--production-gq1-5d95dc458-4hqnr (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 0470da286e7b568efe5e6afb36867c85; Sun, 04 Aug 2024 21:31:57 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: Any known way to build devel/llvm* ( such as devel/llvm19 ) with --threads=1 for its linker activity during the build? Date: Sun, 4 Aug 2024 14:31:46 -0700 References: <4FFD603F-E67C-4B62-B91B-8BE365EAA050@yahoo.com> To: FreeBSD Toolchain , FreeBSD ARM List In-Reply-To: <4FFD603F-E67C-4B62-B91B-8BE365EAA050@yahoo.com> Message-Id: <82E78798-C376-45C4-80FE-96AD14229419@yahoo.com> X-Mailer: Apple Mail (2.3774.600.62) X-Spamd-Bar: -- X-Spamd-Result: default: False [-3.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; FREEMAIL_FROM(0.00)[yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; APPLE_MAILER_COMMON(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.69.147:from]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.147:from] X-Rspamd-Queue-Id: 4WcXpC06Lqz4thg On Aug 3, 2024, at 23:07, Mark Millard wrote: > My recent attempts to build devel/llvm18 and devel/llvm19 in an armv7 = context (native or aarch64-as-armv7) have had /usr/bin/ld failures that = stop the build and report as: >=20 > LLVM ERROR: out of memory > Allocation failed >=20 > (no system OOM activity or notices, so just a process = size/fragmentation issue, or so I would expect). >=20 > On native armv7 I also had rust 1.79.0 fail that way so --but = aarch64-as-armv7 built it okay. >=20 > I'm curious if --threads=3D1 use for the linker might allow the = devel/llvm* builds to complete at this point. Similarly for rust. (top = showed that the ld activity was multi-threaded.) >=20 > Note: The structure of the poudriere-devel based native build attempts = is historical and it used to work. Similarly for the aarch64-as-armv7 = based build attempts. For now I'd just be exploring changes that might = allow much of my historical overall structure to still work. But I = expect that things are just growing to the point building is starting to = be problematical with process address spaces that are bounded by a limit = somewhat under 4 GiBytes. >=20 >=20 > Native armv7 was a 2 GiByte OrangePi+ 2ed (4 cores) that had > at boot time: >=20 > AVAIL_RAM+SWAP =3D=3D 1958Mi+3685Mi =3D=3D 5643Mi >=20 > and later had "Max(imum)Obs(erved)" figures: >=20 > Mem: . . ., > 1728Mi MaxObsActive, 275192Ki MaxObsWired, 1952Mi = MaxObs(Act+Wir+Lndry) >=20 > Swap: 3685Mi Total, . . ., > 1535Mi MaxObsUsed, 3177Mi MaxObs(Act+Lndry+SwapUsed), > 3398Mi MaxObs(A+Wir+L+SU), 3449Mi (A+W+L+SU+InAct) >=20 >=20 > The aarch64-as-armv7 was a Win DevKit 2023 that has 8 cores and: >=20 > AVAIL_RAM+SWAP =3D=3D 31311Mi+120831Mi =3D=3D 152142Mi >=20 > So lots of 4 GiByte or smaller processes would fit. >=20 Absent finding a way to get --threads=3D1 to be what is used, I made the following crude way to test, built it, installed it in the armv7 directory tree used for aarch64-as-armv7, and then started an aarch64-as-armv7 test of building devel/llvm19 to see what the consequences are (leading whitespace details might not be preserved): # git -C /usr/main-src/ diff contrib/llvm-project/ diff --git a/contrib/llvm-project/lld/ELF/Driver.cpp = b/contrib/llvm-project/lld/ELF/Driver.cpp index 8b2c32b15348..299daf7dd6fa 100644 --- a/contrib/llvm-project/lld/ELF/Driver.cpp +++ b/contrib/llvm-project/lld/ELF/Driver.cpp @@ -1587,6 +1587,9 @@ static void readConfigs(opt::InputArgList &args) { arg->getValue() + "'"); parallel::strategy =3D hardware_concurrency(threads); config->thinLTOJobs =3D v; + } else if (sizeof(void*) <=3D 4) { + log("set maximum concurrency to 1, specify --threads=3D to = change"); + parallel::strategy =3D hardware_concurrency(1); } else if (parallel::strategy.compute_thread_count() > 16) { log("set maximum concurrency to 16, specify --threads=3D to = change"); parallel::strategy =3D hardware_concurrency(16); Basically, if the process address space has to be "small", avoid any default memory use tradeoffs that multi-threading the linker might involve --even if that means taking more time. We will see if: [00:00:33] [07] [00:00:00] Building devel/llvm19@default | = llvm19-19.1.0.r1 still fails to build as armv7 vs. if the change leads it to manage to build as armv7. =3D=3D=3D Mark Millard marklmi at yahoo.com