From owner-freebsd-current@freebsd.org Mon Aug 20 17:33:47 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32B211076657 for ; Mon, 20 Aug 2018 17:33:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (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 A61BC78760; Mon, 20 Aug 2018 17:33:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from coleburn.home.andric.com (coleburn.home.andric.com [192.168.0.15]) (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 259DA39F26; Mon, 20 Aug 2018 19:33:45 +0200 (CEST) From: Dimitry Andric Message-Id: <4ECEE41C-E1FF-4B6A-A138-3BDDB6552A7D@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_6ADE5990-1E46-4E8D-BFB1-AC2177E2A668"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: building LLVM threads gets killed Date: Mon, 20 Aug 2018 19:33:32 +0200 In-Reply-To: <201808201426.w7KEQo9j074809@pdx.rh.CN85.dnsmgr.net> Cc: blubee blubeeme , FreeBSD Current , Brooks Davis To: "Rodney W. Grimes" References: <201808201426.w7KEQo9j074809@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.9.1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Aug 2018 17:33:47 -0000 --Apple-Mail=_6ADE5990-1E46-4E8D-BFB1-AC2177E2A668 Content-Type: multipart/mixed; boundary="Apple-Mail=_7B8AAAE0-4E90-421F-A983-8D414354B4E9" --Apple-Mail=_7B8AAAE0-4E90-421F-A983-8D414354B4E9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 20 Aug 2018, at 16:26, Rodney W. Grimes = wrote: >=20 >> On 20 Aug 2018, at 05:01, blubee blubeeme = wrote: >>>=20 >>> I am running current compiling LLVM60 and when it comes to linking >>> basically all the processes on my computer gets killed; Chrome, = Firefox and >>> some of the LLVM threads as well ... >=20 >> It is running out of RAM while running multiple parallel link jobs. = If >> you are building using WITH_DEBUG, turn that off, it consumes large >> amounts of memory. If you must have debug info, try adding the >> following flag to the CMake command line: >>=20 >> -D LLVM_PARALLEL_LINK_JOBS:STRING=3D"1" >>=20 >> That will limit the amount of parallel link jobs to 1, even if you >> specify -j 8 to gmake or ninja. >>=20 >> Brooks, it would not be a bad idea to always use this CMake flag in = the >> llvm ports. :) >=20 > And this may also fix the issues that all the small > memory (aka, RPI*) buliders are facing when trying > to do -j4? Possibly, as linking is usually the most memory-consuming part of the build process (and more so, if debugging is enabled). Are there build logs available somewhere for those RPI builders? I have attached a patch for most of the llvm ports, which sets the LLVM_PARALLEL_LINK_JOBS CMake flag during the configure phase. -Dimitry --Apple-Mail=_7B8AAAE0-4E90-421F-A983-8D414354B4E9 Content-Disposition: attachment; filename=devel__llvm-all-parallel-link-jobs-1.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="devel__llvm-all-parallel-link-jobs-1.diff" Content-Transfer-Encoding: 7bit Index: devel/llvm-cheri/Makefile =================================================================== --- devel/llvm-cheri/Makefile (revision 477662) +++ devel/llvm-cheri/Makefile (working copy) @@ -36,6 +36,7 @@ STACK_ALIGN?= -mstack-alignment=32 CMAKE_INSTALL_PREFIX= ${LLVM_PREFIX} CMAKE_ARGS+= -DLLVM_BUILD_LLVM_DYLIB=ON \ -DLLVM_DEFAULT_TARGET_TRIPLE=cheri-unknown-freebsd +CMAKE_ARGS+= -DLLVM_PARALLEL_LINK_JOBS=1 USE_GITHUB= yes GH_ACCOUNT= CTSRD-CHERI Index: devel/llvm-devel/Makefile =================================================================== --- devel/llvm-devel/Makefile (revision 477662) +++ devel/llvm-devel/Makefile (working copy) @@ -46,6 +46,7 @@ CMAKE_ARGS+= -DLLVM_HOST_TRIPLE=${CONFIGURE_TARGET # we need to either change the whole man-shuffle below, or simply # redefine CMAKE_INSTALL_MANDIR CMAKE_ARGS+= -DCMAKE_INSTALL_MANDIR:PATH="share/man" +CMAKE_ARGS+= -DLLVM_PARALLEL_LINK_JOBS=1 USE_GITHUB= yes GH_ACCOUNT= llvm-mirror Index: devel/llvm38/Makefile =================================================================== --- devel/llvm38/Makefile (revision 477662) +++ devel/llvm38/Makefile (working copy) @@ -42,6 +42,7 @@ CMAKE_ARGS= # we need to either change the whole man-shuffle below, or simply # redefine CMAKE_INSTALL_MANDIR CMAKE_ARGS+= -DCMAKE_INSTALL_MANDIR:PATH="share/man" +CMAKE_ARGS+= -DLLVM_PARALLEL_LINK_JOBS=1 OPTIONS_DEFINE= CLANG DOCS EXTRAS LIT LLD LLDB OPTIONS_DEFINE_amd64= GOLD OPENMP Index: devel/llvm40/Makefile =================================================================== --- devel/llvm40/Makefile (revision 477662) +++ devel/llvm40/Makefile (working copy) @@ -47,6 +47,7 @@ CMAKE_ARGS+= -DLLVM_HOST_TRIPLE=${CONFIGURE_TARGET # we need to either change the whole man-shuffle below, or simply # redefine CMAKE_INSTALL_MANDIR CMAKE_ARGS+= -DCMAKE_INSTALL_MANDIR:PATH="share/man" +CMAKE_ARGS+= -DLLVM_PARALLEL_LINK_JOBS=1 OPTIONS_DEFINE= CLANG DOCS EXTRAS LIT LLD LLDB OPTIONS_DEFINE_amd64= COMPILER_RT GOLD OPENMP Index: devel/llvm50/Makefile =================================================================== --- devel/llvm50/Makefile (revision 477662) +++ devel/llvm50/Makefile (working copy) @@ -47,6 +47,7 @@ CMAKE_ARGS+= -DLLVM_HOST_TRIPLE=${CONFIGURE_TARGET # we need to either change the whole man-shuffle below, or simply # redefine CMAKE_INSTALL_MANDIR CMAKE_ARGS+= -DCMAKE_INSTALL_MANDIR:PATH="share/man" +CMAKE_ARGS+= -DLLVM_PARALLEL_LINK_JOBS=1 OPTIONS_DEFINE= CLANG DOCS EXTRAS LIT LLD LLDB OPTIONS_DEFINE_amd64= COMPILER_RT GOLD OPENMP Index: devel/llvm60/Makefile =================================================================== --- devel/llvm60/Makefile (revision 477662) +++ devel/llvm60/Makefile (working copy) @@ -47,6 +47,7 @@ CMAKE_ARGS+= -DLLVM_HOST_TRIPLE=${CONFIGURE_TARGET # we need to either change the whole man-shuffle below, or simply # redefine CMAKE_INSTALL_MANDIR CMAKE_ARGS+= -DCMAKE_INSTALL_MANDIR:PATH="share/man" +CMAKE_ARGS+= -DLLVM_PARALLEL_LINK_JOBS=1 OPTIONS_DEFINE= CLANG DOCS EXTRAS LIT LLD LLDB OPTIONS_DEFINE_amd64= COMPILER_RT GOLD OPENMP Index: devel/llvm70/Makefile =================================================================== --- devel/llvm70/Makefile (revision 477662) +++ devel/llvm70/Makefile (working copy) @@ -47,6 +47,7 @@ CMAKE_ARGS+= -DLLVM_HOST_TRIPLE=${CONFIGURE_TARGET # we need to either change the whole man-shuffle below, or simply # redefine CMAKE_INSTALL_MANDIR CMAKE_ARGS+= -DCMAKE_INSTALL_MANDIR:PATH="share/man" +CMAKE_ARGS+= -DLLVM_PARALLEL_LINK_JOBS=1 OPTIONS_DEFINE= CLANG DOCS EXTRAS LIT LLD LLDB OPTIONS_DEFINE_amd64= COMPILER_RT GOLD OPENMP --Apple-Mail=_7B8AAAE0-4E90-421F-A983-8D414354B4E9-- --Apple-Mail=_6ADE5990-1E46-4E8D-BFB1-AC2177E2A668 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.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCW3r7bAAKCRCwXqMKLiCW o7wPAJ4tMmNVYgpFHsA2jq8rT58mHhD+dACfYo+mPuqiElP2fOpyVHArE5VsLow= =9NYZ -----END PGP SIGNATURE----- --Apple-Mail=_6ADE5990-1E46-4E8D-BFB1-AC2177E2A668--