From owner-freebsd-current@freebsd.org Mon Aug 20 14:53:56 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 0D103107093F for ; Mon, 20 Aug 2018 14:53:56 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8BFC970C66; Mon, 20 Aug 2018 14:53:55 +0000 (UTC) (envelope-from gurenchan@gmail.com) Received: by mail-it0-x235.google.com with SMTP id g141-v6so20776934ita.4; Mon, 20 Aug 2018 07:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tVE5CLxlT5Y0x2W3RYHAbtJr5opGGzrE+DaODmcg4fM=; b=YZxbryrsPktXE1wiHAQ8EhrlIwtZjueEBg3k7keIFpbhHNW40Th6xoJ684C8c9Zv1c 9aJ268diuYzOp0o5NwzuB27MaW7dcvNMf0csyE1//XE7bZWKrZk3FQ3IsF3Jfgp+0URV UfyuZDm0ZfpoOttRvz3kTY3ZS8zy/M05es1R3jnHIuSUnqQHAT0qD/iTfIUXRZQFjZz8 HadOUh0HUAbGKOHuMyMf6ZiPx7sl6ccOcVj9jYbHdG4uo3VVjixPayEuk44RrePS62/n IN6sPHDFvX8Vg9YDdwyFgUaeIMZDLOpglq7ql6YXaV967umjuWAq04hlhUFMxr/tMfb4 Gt+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tVE5CLxlT5Y0x2W3RYHAbtJr5opGGzrE+DaODmcg4fM=; b=gyntEFrURISGvPkrKuNWPWGH2mAnzb8f2YwKYJlnLkzAiAZIi9Pv9FTLqi8qwQ5U7A xO4fRFnGF/vBoE0UAe+/GcFPgfWdlEBV9o1vKdoWgRaKy6KsmROIVE0vFqKSFvp8/75I tjSjf0ldAc/KkVb9Gs9sJNE8lXths9OlqKejyNYbP59qSjq1wK6FcUwoYNrlzz6Ek+SZ stTkJx4HkEyPZhuiVXvilrJlAUNtTGTFrP1pFsxtkd1nc0XGKOxBHzudjkQ2crI/8WMV feUa11rAhQwyASH9Fkd2FFlJYRz2m5J6SORJn8/pf16rsKPV1goP8oQAcbOgJZSFWlz9 n81Q== X-Gm-Message-State: AOUpUlFOsHvD5OQDlCCynonTOrhh+qaK/Ea6lp2PlZFEImYRb0K0O7Vs kbVVI1tL3vOUCwuS70zhbxciXV7i4PQEMW9dErS9tg== X-Google-Smtp-Source: AA+uWPwCx+yqk83N/6O6NwFRssTr8LtcNJlJJytm4qeqcI6ej3KfuxyVxED1b84OUeqHXkMc5B69iCF6+jmEtP4TAh8= X-Received: by 2002:a24:d0d6:: with SMTP id m205-v6mr495778itg.89.1534776835084; Mon, 20 Aug 2018 07:53:55 -0700 (PDT) MIME-Version: 1.0 References: <201808201426.w7KEQo9j074809@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201808201426.w7KEQo9j074809@pdx.rh.CN85.dnsmgr.net> From: blubee blubeeme Date: Mon, 20 Aug 2018 22:53:43 +0800 Message-ID: Subject: Re: building LLVM threads gets killed To: freebsd-rwg@pdx.rh.cn85.dnsmgr.net Cc: Dimitry Andric , FreeBSD current , Brooks Davis Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 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 14:53:56 -0000 On Mon, Aug 20, 2018 at 10:26 PM Rodney W. Grimes < freebsd-rwg@pdx.rh.cn85.dnsmgr.net> wrote: > > On 20 Aug 2018, at 05:01, blubee blubeeme wrote: > > > > > > 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 > > ... > > > llvm/build % ninja -j8 > > > [2408/2473] Building CXX object > > > lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o > > > FAILED: lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o > > > /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D__STDC_CONSTANT_MACROS > > > -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Passes > -I../lib/Passes > > > -Iinclude -I../include -isystem /usr/local/include -fPIC > > > -fvisibility-inlines-hidden -Werror=date-time > > > -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra > > > -Wno-unused-parameter -Wwrite-strings -Wcast-qual > > > -Wmissing-field-initializers -pedantic -Wno-long-long > > > -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor > > > -Wstring-conversion -fdiagnostics-color -g -fno-exceptions > -fno-rtti -MD > > > -MT lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o -MF > > > lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o.d -o > > > lib/Passes/CMakeFiles/LLVMPasses.dir/PassBuilder.cpp.o -c > > > ../lib/Passes/PassBuilder.cpp > > > c++: error: unable to execute command: Killed > > > > 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: > > > > -D LLVM_PARALLEL_LINK_JOBS:STRING="1" > > > > That will limit the amount of parallel link jobs to 1, even if you > > specify -j 8 to gmake or ninja. > > > > Brooks, it would not be a bad idea to always use this CMake flag in the > > llvm ports. :) > > And this may also fix the issues that all the small > memory (aka, RPI*) buliders are facing when trying > to do -j4? > > > -- > Rod Grimes > rgrimes@freebsd.org Someone mentioned earlier that debug builds cause a lot of memory usage and it's true that I am building with debug. I couldn't grab the relevant text from top but the posted was after everything settled down. The memory situation got so bad that xserver died and I was booted to terminal. I saw ld.lld using up to 12GB of ram for each process, that will definitely use up 32GB of ram. I can't avoid building w/ debug symbols since I have to debug the program are there any other options other than building with only 1 thread? Reason being even when I set gmake -j1 the problem comes just a lot later during linking stage. Best, Owen