Date: Mon, 20 Aug 2018 19:33:32 +0200 From: Dimitry Andric <dim@FreeBSD.org> To: "Rodney W. Grimes" <freebsd-rwg@pdx.rh.CN85.dnsmgr.net> Cc: blubee blubeeme <gurenchan@gmail.com>, FreeBSD Current <freebsd-current@freebsd.org>, Brooks Davis <brooks@freebsd.org> Subject: Re: building LLVM threads gets killed Message-ID: <4ECEE41C-E1FF-4B6A-A138-3BDDB6552A7D@FreeBSD.org> In-Reply-To: <201808201426.w7KEQo9j074809@pdx.rh.CN85.dnsmgr.net> References: <201808201426.w7KEQo9j074809@pdx.rh.CN85.dnsmgr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 = <freebsd-rwg@pdx.rh.CN85.dnsmgr.net> wrote: >=20 >> On 20 Aug 2018, at 05:01, blubee blubeeme <gurenchan@gmail.com> = 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4ECEE41C-E1FF-4B6A-A138-3BDDB6552A7D>