Bug 231123

Summary: make buildworld: c++: error: clang frontend command failed due to signal
Product: Base System Reporter: matthias.freitag
Component: armAssignee: freebsd-arm (Nobody) <freebsd-arm>
Status: Closed DUPLICATE    
Severity: Affects Some People CC: marklmi26-fbsd
Priority: ---    
Version: CURRENT   
Hardware: arm   
OS: Any   
Attachments:
Description Flags
run script none

Description matthias.freitag 2018-09-03 17:50:22 UTC
Revision: 338426
make buildworld fails with this error:

c++ -mlong-calls -O -pipe -I/usr/obj/usr/src/arm.armv6/tmp/obj-tools/lib/clang/libllvm -I/usr/src/contrib/llvm/lib/Target/ARM -I/usr/src/lib/clang/include -I/usr/src/contrib/llvm/include -DLLVM_BUILD_GLOBAL_ISEL -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_DEFAULT_TARGET_TRIPLE=\"armv6-unknown-freebsd12.0-gnueabihf\" -DLLVM_HOST_TRIPLE=\"armv6-unknown-freebsd12.0\" -DDEFAULT_SYSROOT=\"/usr/obj/usr/src/arm.armv6/tmp\" -DLLVM_TARGET_ENABLE_ARM -DLLVM_NATIVE_ASMPARSER=LLVMInitializeARMAsmParser -DLLVM_NATIVE_ASMPRINTER=LLVMInitializeARMAsmPrinter -DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeARMDisassembler -DLLVM_NATIVE_TARGET=LLVMInitializeARMTarget -DLLVM_NATIVE_TARGETINFO=LLVMInitializeARMTargetInfo -DLLVM_NATIVE_TARGETMC=LLVMInitializeARMTargetMC -ffunction-sections -fdata-sections -gline-tables-only -MD -MF.depend.Passes_PassBuilder.o -MTPasses/PassBuilder.o -Qunused-arguments -I/usr/obj/usr/src/arm.armv6/tmp/legacy/usr/include  -std=c++11 -fno-exceptions -fno-rtti -gline-tables-only -stdlib=libc++ -Wno-c++11-extensions  -c /usr/src/contrib/llvm/lib/Passes/PassBuilder.cpp -o Passes/PassBuilder.o
c++: error: unable to execute command: Killed
c++: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
Target: armv6-unknown-freebsd12.0-gnueabihf
Thread model: posix
InstalledDir: /usr/bin
c++: note: diagnostic msg: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script.
c++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
c++: note: diagnostic msg: /tmp/PassBuilder-ca5dd3.cpp
c++: note: diagnostic msg: /tmp/PassBuilder-ca5dd3.sh
c++: note: diagnostic msg: 

********************
*** Error code 254

Stop.
make[4]: stopped in /usr/src/lib/clang/libllvm
*** Error code 1

Stop.
make[3]: stopped in /usr/src/lib/clang
*** Error code 1

Stop.
make[2]: stopped in /usr/src
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src
Comment 1 matthias.freitag 2018-09-03 17:51:20 UTC
Created attachment 196820 [details]
run script
Comment 2 matthias.freitag 2018-09-03 17:51:53 UTC
PassBuilder-ca5dd3.cpp is too big, even zipped
Comment 3 Mark Millard 2018-09-03 19:50:08 UTC
See also bugzillas: 227609 230402 230454

See comment #2 of:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230402

for some notes about interpreting a misleading console
message. There is a reference to "out of swap space"
that mis-reports what causes killing, the swap space
may or may not be low.

See Comments #10 through #14 where someone asked for
help and with the help got a build to complete.

Summary:

Building the llvm materials is just memory-space and CPU
intensive and comparatively small-memory machines need FreeBSD
to be tuned for the workload. FreeBSD starts killing processes
if the free RAM stays low for too long but also does not swap
out processes that stay busy on the CPUs. FreeBSD can be tuned
to tolerate low memory longer and use of -j1 builds avoid using
as much memory. It also might be possible to limit the memory
use by lld some.
Comment 4 matthias.freitag 2018-09-03 20:24:15 UTC

*** This bug has been marked as a duplicate of bug 227609 ***