From owner-freebsd-ports@freebsd.org  Thu Mar 30 21:04:23 2017
Return-Path: <owner-freebsd-ports@freebsd.org>
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 D869BD26E9C;
 Thu, 30 Mar 2017 21:04:23 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
 bits)) (Client CN "tensor.andric.com",
 Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 8F8011A7D;
 Thu, 30 Mar 2017 21:04:23 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from [IPv6:2001:470:7a58::6071:fd3d:eb67:3bb1] (unknown
 [IPv6:2001:470:7a58:0:6071:fd3d:eb67:3bb1])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by tensor.andric.com (Postfix) with ESMTPSA id A3B98150F0;
 Thu, 30 Mar 2017 23:04:20 +0200 (CEST)
From: Dimitry Andric <dim@FreeBSD.org>
Message-Id: <7C9A1030-E489-489C-A17B-4981DE429FEA@FreeBSD.org>
Content-Type: multipart/signed;
 boundary="Apple-Mail=_592CEB00-EFD3-48EB-AA9E-58C9F49FC2FF";
 protocol="application/pgp-signature"; micalg=pgp-sha1
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
Subject: Re: FYI: what it takes for RAM+swap to build devel/llvm40 with 4
 processors or cores and WITH__DEBUG= (powerpc64 example)
Date: Thu, 30 Mar 2017 23:04:15 +0200
In-Reply-To: <20170330175519.GA34411@spindle.one-eyed-alien.net>
Cc: Alexey Dokuchaev <danfe@FreeBSD.org>,
 FreeBSD Current <freebsd-current@freebsd.org>,
 FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>,
 FreeBSD Toolchain <freebsd-toolchain@freebsd.org>,
 FreeBSD Ports <freebsd-ports@freebsd.org>,
 Johannes M Dieterich <jmd@FreeBSD.org>, Matthew Rezny <rezny@FreeBSD.org>
To: Brooks Davis <brooks@freebsd.org>
References: <3EDEF0B7-59C5-4648-9737-6682E18645BC@dsl-only.net>
 <39C60316-F905-490D-B0AB-BC24D7F351A2@dsl-only.net>
 <7F94CE59-D2CC-4D6F-B1CD-FF3D1F8EDCE7@FreeBSD.org>
 <20170330170648.GA38004@FreeBSD.org>
 <B2BA1E9F-3B85-46AC-8FAF-32054D675102@FreeBSD.org>
 <20170330175519.GA34411@spindle.one-eyed-alien.net>
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 <freebsd-ports.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-ports>,
 <mailto:freebsd-ports-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-ports/>
List-Post: <mailto:freebsd-ports@freebsd.org>
List-Help: <mailto:freebsd-ports-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-ports>,
 <mailto:freebsd-ports-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 30 Mar 2017 21:04:24 -0000


--Apple-Mail=_592CEB00-EFD3-48EB-AA9E-58C9F49FC2FF
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

On 30 Mar 2017, at 19:55, Brooks Davis <brooks@freebsd.org> wrote:
>=20
> On Thu, Mar 30, 2017 at 07:26:19PM +0200, Dimitry Andric wrote:
...
>>=20
>> As said, this is because of WITH_DEBUG.  Don't use that for the llvm
>> ports, for now.  It will also allow you to build them with much less =
RAM
>> in the machine: especially linking can take multiple GB when =
debuginfo
>> is enabled, and optimization is off.
>=20
> I'm looking into improving WITH_DEBUG.

I stole the following method from graphics/darktable:

Index: devel/llvm40/Makefile
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- devel/llvm40/Makefile	(revision 436685)
+++ devel/llvm40/Makefile	(working copy)
@@ -236,6 +236,11 @@ NOT_FOR_ARCH=3D	ia64

 .include <bsd.port.pre.mk>

+.if defined(WITH_DEBUG)
+CMAKE_BUILD_TYPE=3D	RelWithDebInfo
+STRIP=3D
+.endif
+
 _CRTLIBDIR=3D	=
${LLVM_PREFIX:S|${PREFIX}/||}/lib/clang/${LLVM_RELEASE}/lib/freebsd
 .if ${ARCH} =3D=3D "amd64"
 _COMPILER_RT_LIBS=3D \

This appears to work for me.


> P.S. Somewhat off topice, but related.  FAIR WARNING: the days of
> self-hosted 32-bit systems are numbered.  Switching to lld from our
> ancient BFD linker will probably buy us some time, but I'd be =
surprised
> if you will be able to build LLVM+CLANG with a 2GB address space in 5
> years.  The sooner people make their peace with this, the better.

Yes, with that above RelWithDebInfo change, GNU ld tends to use ~5G of
memory to link the larger llvm executables, so that is definitely beyond
i386, even if you run it in a jail on an amd64 host.

And if you would want to use link time optimization, the requirements
will increase even more...

-Dimitry


--Apple-Mail=_592CEB00-EFD3-48EB-AA9E-58C9F49FC2FF
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.30

iEYEARECAAYFAljdctQACgkQsF6jCi4glqOAPACg7xTJA7vHB7TjgbXTSEJIZWYZ
IncAoIDyrx2mNKWkPlV8Xathqx4p1FY9
=4mOQ
-----END PGP SIGNATURE-----

--Apple-Mail=_592CEB00-EFD3-48EB-AA9E-58C9F49FC2FF--