Ubuntu build error


(Gabe Shahbazian) #1

Building swift on Ubuntu and getting the linker failure below. Tried on
both 14.04 and 15.10. Any help greatly appreciated.

Linking CXX executable bin/clang-3.8
FAILED: : && /usr/bin/clang++ -fPIC -fvisibility-inlines-hidden -Wall -W
-Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wmissing-field-initializers -pedantic -Wno-long-long
-Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -fcolor-diagnostics
-fno-common -Woverloaded-virtual -Wno-nested-anon-types -g
-Wl,-allow-shlib-undefined -Wl,--export-dynamic
tools/clang/tools/driver/CMakeFiles/clang.dir/driver.cpp.o
tools/clang/tools/driver/CMakeFiles/clang.dir/cc1_main.cpp.o
tools/clang/tools/driver/CMakeFiles/clang.dir/cc1as_main.cpp.o
tools/clang/tools/driver/CMakeFiles/clang.dir/apinotes_main.cpp.o -o
bin/clang-3.8 lib/libLLVMX86CodeGen.a lib/libLLVMX86AsmPrinter.a
lib/libLLVMX86AsmParser.a lib/libLLVMX86Desc.a lib/libLLVMX86Info.a
lib/libLLVMX86Disassembler.a lib/libLLVMARMCodeGen.a
lib/libLLVMARMAsmPrinter.a lib/libLLVMARMAsmParser.a lib/libLLVMARMDesc.a
lib/libLLVMARMInfo.a lib/libLLVMARMDisassembler.a
lib/libLLVMAArch64CodeGen.a lib/libLLVMAArch64AsmPrinter.a
lib/libLLVMAArch64AsmParser.a lib/libLLVMAArch64Desc.a
lib/libLLVMAArch64Info.a lib/libLLVMAArch64Disassembler.a
lib/libLLVMAnalysis.a lib/libLLVMCodeGen.a lib/libLLVMCore.a
lib/libLLVMipo.a lib/libLLVMInstCombine.a lib/libLLVMInstrumentation.a
lib/libLLVMMC.a lib/libLLVMMCParser.a lib/libLLVMObjCARCOpts.a
lib/libLLVMOption.a lib/libLLVMScalarOpts.a lib/libLLVMSupport.a
lib/libLLVMTransformUtils.a lib/libLLVMVectorize.a lib/libclangBasic.a
lib/libclangAPINotes.a lib/libclangCodeGen.a lib/libclangDriver.a
lib/libclangFrontend.a lib/libclangFrontendTool.a lib/libLLVMX86CodeGen.a
lib/libLLVMX86Desc.a lib/libLLVMX86AsmPrinter.a lib/libLLVMX86Utils.a
lib/libLLVMX86Info.a lib/libLLVMARMDesc.a lib/libLLVMARMAsmPrinter.a
lib/libLLVMARMInfo.a lib/libLLVMAsmPrinter.a lib/libLLVMSelectionDAG.a
lib/libLLVMCodeGen.a lib/libLLVMAArch64Desc.a
lib/libLLVMAArch64AsmPrinter.a lib/libLLVMAArch64Info.a
lib/libLLVMMCDisassembler.a lib/libLLVMAArch64Utils.a lib/libclangCodeGen.a
lib/libLLVMipo.a lib/libLLVMVectorize.a lib/libLLVMInstrumentation.a
lib/libLLVMObjCARCOpts.a lib/libLLVMScalarOpts.a lib/libLLVMInstCombine.a
lib/libLLVMTarget.a lib/libLLVMBitWriter.a lib/libLLVMProfileData.a
lib/libLLVMObject.a lib/libLLVMIRReader.a lib/libLLVMAsmParser.a
lib/libLLVMLinker.a lib/libLLVMTransformUtils.a lib/libLLVMAnalysis.a
lib/libclangRewriteFrontend.a lib/libclangARCMigrate.a
lib/libclangStaticAnalyzerFrontend.a lib/libclangFrontend.a
lib/libclangDriver.a lib/libLLVMOption.a lib/libclangParse.a
lib/libLLVMMCParser.a lib/libclangSerialization.a lib/libclangSema.a
lib/libclangAPINotes.a lib/libLLVMBitReader.a lib/libclangEdit.a
lib/libclangStaticAnalyzerCheckers.a lib/libclangStaticAnalyzerCore.a
lib/libclangAnalysis.a lib/libclangAST.a lib/libclangRewrite.a
lib/libclangLex.a lib/libclangBasic.a lib/libLLVMCore.a lib/libLLVMMC.a
lib/libLLVMSupport.a -lrt -ldl -ltinfo -lpthread -lm
-Wl,-rpath,"\$ORIGIN/../lib" && :
clang: error: unable to execute command: Killed
clang: error: linker command failed due to signal (use -v to see invocation)


(Frederick Kellison-Linn) #2

You may be running out of memory. Run the build script as

  $utils/build-script -Rt -j 1

to cut down on memory usage if all you are interested in is testing that it builds correctly. -R builds the release version, and -j limits the number of parallel build jobs to 1.

FKL

···

On Dec 10, 2015, at 3:23 PM, Gabe Shahbazian via swift-dev <swift-dev@swift.org <mailto:swift-dev@swift.org>> wrote:

Building swift on Ubuntu and getting the linker failure below. Tried on both 14.04 and 15.10. Any help greatly appreciated.

Linking CXX executable bin/clang-3.8
FAILED: : && /usr/bin/clang++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -fcolor-diagnostics -fno-common -Woverloaded-virtual -Wno-nested-anon-types -g -Wl,-allow-shlib-undefined -Wl,--export-dynamic tools/clang/tools/driver/CMakeFiles/clang.dir/driver.cpp.o tools/clang/tools/driver/CMakeFiles/clang.dir/cc1_main.cpp.o tools/clang/tools/driver/CMakeFiles/clang.dir/cc1as_main.cpp.o tools/clang/tools/driver/CMakeFiles/clang.dir/apinotes_main.cpp.o -o bin/clang-3.8 lib/libLLVMX86CodeGen.a lib/libLLVMX86AsmPrinter.a lib/libLLVMX86AsmParser.a lib/libLLVMX86Desc.a lib/libLLVMX86Info.a lib/libLLVMX86Disassembler.a lib/libLLVMARMCodeGen.a lib/libLLVMARMAsmPrinter.a lib/libLLVMARMAsmParser.a lib/libLLVMARMDesc.a lib/libLLVMARMInfo.a lib/libLLVMARMDisassembler.a lib/libLLVMAArch64CodeGen.a lib/libLLVMAArch64AsmPrinter.a lib/libLLVMAArch64AsmParser.a lib/libLLVMAArch64Desc.a lib/libLLVMAArch64Info.a lib/libLLVMAArch64Disassembler.a lib/libLLVMAnalysis.a lib/libLLVMCodeGen.a lib/libLLVMCore.a lib/libLLVMipo.a lib/libLLVMInstCombine.a lib/libLLVMInstrumentation.a lib/libLLVMMC.a lib/libLLVMMCParser.a lib/libLLVMObjCARCOpts.a lib/libLLVMOption.a lib/libLLVMScalarOpts.a lib/libLLVMSupport.a lib/libLLVMTransformUtils.a lib/libLLVMVectorize.a lib/libclangBasic.a lib/libclangAPINotes.a lib/libclangCodeGen.a lib/libclangDriver.a lib/libclangFrontend.a lib/libclangFrontendTool.a lib/libLLVMX86CodeGen.a lib/libLLVMX86Desc.a lib/libLLVMX86AsmPrinter.a lib/libLLVMX86Utils.a lib/libLLVMX86Info.a lib/libLLVMARMDesc.a lib/libLLVMARMAsmPrinter.a lib/libLLVMARMInfo.a lib/libLLVMAsmPrinter.a lib/libLLVMSelectionDAG.a lib/libLLVMCodeGen.a lib/libLLVMAArch64Desc.a lib/libLLVMAArch64AsmPrinter.a lib/libLLVMAArch64Info.a lib/libLLVMMCDisassembler.a lib/libLLVMAArch64Utils.a lib/libclangCodeGen.a lib/libLLVMipo.a lib/libLLVMVectorize.a lib/libLLVMInstrumentation.a lib/libLLVMObjCARCOpts.a lib/libLLVMScalarOpts.a lib/libLLVMInstCombine.a lib/libLLVMTarget.a lib/libLLVMBitWriter.a lib/libLLVMProfileData.a lib/libLLVMObject.a lib/libLLVMIRReader.a lib/libLLVMAsmParser.a lib/libLLVMLinker.a lib/libLLVMTransformUtils.a lib/libLLVMAnalysis.a lib/libclangRewriteFrontend.a lib/libclangARCMigrate.a lib/libclangStaticAnalyzerFrontend.a lib/libclangFrontend.a lib/libclangDriver.a lib/libLLVMOption.a lib/libclangParse.a lib/libLLVMMCParser.a lib/libclangSerialization.a lib/libclangSema.a lib/libclangAPINotes.a lib/libLLVMBitReader.a lib/libclangEdit.a lib/libclangStaticAnalyzerCheckers.a lib/libclangStaticAnalyzerCore.a lib/libclangAnalysis.a lib/libclangAST.a lib/libclangRewrite.a lib/libclangLex.a lib/libclangBasic.a lib/libLLVMCore.a lib/libLLVMMC.a lib/libLLVMSupport.a -lrt -ldl -ltinfo -lpthread -lm -Wl,-rpath,"\$ORIGIN/../lib" && :
clang: error: unable to execute command: Killed
clang: error: linker command failed due to signal (use -v to see invocation)

_______________________________________________
swift-dev mailing list
swift-dev@swift.org <mailto:swift-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-dev


(Johan K. Jensen) #3

I got that error when building on a VM with too little disk space and too
little memory.
How many cores, disk space and memory do you have available?

Do anyone know of some recommended/minimum system requirements?

—Johan

···

On Thu, Dec 10, 2015 at 9:23 PM, Gabe Shahbazian via swift-dev < swift-dev@swift.org> wrote:

Building swift on Ubuntu and getting the linker failure below. Tried on
both 14.04 and 15.10. Any help greatly appreciated.

Linking CXX executable bin/clang-3.8
FAILED: : && /usr/bin/clang++ -fPIC -fvisibility-inlines-hidden -Wall -W
-Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wmissing-field-initializers -pedantic -Wno-long-long
-Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -fcolor-diagnostics
-fno-common -Woverloaded-virtual -Wno-nested-anon-types -g
-Wl,-allow-shlib-undefined -Wl,--export-dynamic
tools/clang/tools/driver/CMakeFiles/clang.dir/driver.cpp.o
tools/clang/tools/driver/CMakeFiles/clang.dir/cc1_main.cpp.o
tools/clang/tools/driver/CMakeFiles/clang.dir/cc1as_main.cpp.o
tools/clang/tools/driver/CMakeFiles/clang.dir/apinotes_main.cpp.o -o
bin/clang-3.8 lib/libLLVMX86CodeGen.a lib/libLLVMX86AsmPrinter.a
lib/libLLVMX86AsmParser.a lib/libLLVMX86Desc.a lib/libLLVMX86Info.a
lib/libLLVMX86Disassembler.a lib/libLLVMARMCodeGen.a
lib/libLLVMARMAsmPrinter.a lib/libLLVMARMAsmParser.a lib/libLLVMARMDesc.a
lib/libLLVMARMInfo.a lib/libLLVMARMDisassembler.a
lib/libLLVMAArch64CodeGen.a lib/libLLVMAArch64AsmPrinter.a
lib/libLLVMAArch64AsmParser.a lib/libLLVMAArch64Desc.a
lib/libLLVMAArch64Info.a lib/libLLVMAArch64Disassembler.a
lib/libLLVMAnalysis.a lib/libLLVMCodeGen.a lib/libLLVMCore.a
lib/libLLVMipo.a lib/libLLVMInstCombine.a lib/libLLVMInstrumentation.a
lib/libLLVMMC.a lib/libLLVMMCParser.a lib/libLLVMObjCARCOpts.a
lib/libLLVMOption.a lib/libLLVMScalarOpts.a lib/libLLVMSupport.a
lib/libLLVMTransformUtils.a lib/libLLVMVectorize.a lib/libclangBasic.a
lib/libclangAPINotes.a lib/libclangCodeGen.a lib/libclangDriver.a
lib/libclangFrontend.a lib/libclangFrontendTool.a lib/libLLVMX86CodeGen.a
lib/libLLVMX86Desc.a lib/libLLVMX86AsmPrinter.a lib/libLLVMX86Utils.a
lib/libLLVMX86Info.a lib/libLLVMARMDesc.a lib/libLLVMARMAsmPrinter.a
lib/libLLVMARMInfo.a lib/libLLVMAsmPrinter.a lib/libLLVMSelectionDAG.a
lib/libLLVMCodeGen.a lib/libLLVMAArch64Desc.a
lib/libLLVMAArch64AsmPrinter.a lib/libLLVMAArch64Info.a
lib/libLLVMMCDisassembler.a lib/libLLVMAArch64Utils.a lib/libclangCodeGen.a
lib/libLLVMipo.a lib/libLLVMVectorize.a lib/libLLVMInstrumentation.a
lib/libLLVMObjCARCOpts.a lib/libLLVMScalarOpts.a lib/libLLVMInstCombine.a
lib/libLLVMTarget.a lib/libLLVMBitWriter.a lib/libLLVMProfileData.a
lib/libLLVMObject.a lib/libLLVMIRReader.a lib/libLLVMAsmParser.a
lib/libLLVMLinker.a lib/libLLVMTransformUtils.a lib/libLLVMAnalysis.a
lib/libclangRewriteFrontend.a lib/libclangARCMigrate.a
lib/libclangStaticAnalyzerFrontend.a lib/libclangFrontend.a
lib/libclangDriver.a lib/libLLVMOption.a lib/libclangParse.a
lib/libLLVMMCParser.a lib/libclangSerialization.a lib/libclangSema.a
lib/libclangAPINotes.a lib/libLLVMBitReader.a lib/libclangEdit.a
lib/libclangStaticAnalyzerCheckers.a lib/libclangStaticAnalyzerCore.a
lib/libclangAnalysis.a lib/libclangAST.a lib/libclangRewrite.a
lib/libclangLex.a lib/libclangBasic.a lib/libLLVMCore.a lib/libLLVMMC.a
lib/libLLVMSupport.a -lrt -ldl -ltinfo -lpthread -lm
-Wl,-rpath,"\$ORIGIN/../lib" && :
clang: error: unable to execute command: Killed
clang: error: linker command failed due to signal (use -v to see
invocation)

_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev


(William Dillon) #4

I’ve been getting that, and a smattering of other memory exhaustion errors in my work with ARM.

I can say that with a reasonable (10-20GB) swap file you should be able to build the release variant (-R) with 2GB or ram. I haven’t been able to successfully build the debug variant with 2GB of ram regardless of the swapfile size (I have 100GB swap partition, of which 67GB is seen by the kernel [24 bits]). By the way, with all 2GB of ram used, about 8GB of swap is used in the debug mode when the build fails due to memory exhaustion.

Hope this helps,
- Will

···

On Dec 10, 2015, at 2:03 PM, Johan Jensen via swift-dev <swift-dev@swift.org <mailto:swift-dev@swift.org>> wrote:

I got that error when building on a VM with too little disk space and too little memory.
How many cores, disk space and memory do you have available?

Do anyone know of some recommended/minimum system requirements?

—Johan

On Thu, Dec 10, 2015 at 9:23 PM, Gabe Shahbazian via swift-dev <swift-dev@swift.org <mailto:swift-dev@swift.org>> wrote:
Building swift on Ubuntu and getting the linker failure below. Tried on both 14.04 and 15.10. Any help greatly appreciated.

Linking CXX executable bin/clang-3.8
FAILED: : && /usr/bin/clang++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -std=c++11 -fcolor-diagnostics -fno-common -Woverloaded-virtual -Wno-nested-anon-types -g -Wl,-allow-shlib-undefined -Wl,--export-dynamic tools/clang/tools/driver/CMakeFiles/clang.dir/driver.cpp.o tools/clang/tools/driver/CMakeFiles/clang.dir/cc1_main.cpp.o tools/clang/tools/driver/CMakeFiles/clang.dir/cc1as_main.cpp.o tools/clang/tools/driver/CMakeFiles/clang.dir/apinotes_main.cpp.o -o bin/clang-3.8 lib/libLLVMX86CodeGen.a lib/libLLVMX86AsmPrinter.a lib/libLLVMX86AsmParser.a lib/libLLVMX86Desc.a lib/libLLVMX86Info.a lib/libLLVMX86Disassembler.a lib/libLLVMARMCodeGen.a lib/libLLVMARMAsmPrinter.a lib/libLLVMARMAsmParser.a lib/libLLVMARMDesc.a lib/libLLVMARMInfo.a lib/libLLVMARMDisassembler.a lib/libLLVMAArch64CodeGen.a lib/libLLVMAArch64AsmPrinter.a lib/libLLVMAArch64AsmParser.a lib/libLLVMAArch64Desc.a lib/libLLVMAArch64Info.a lib/libLLVMAArch64Disassembler.a lib/libLLVMAnalysis.a lib/libLLVMCodeGen.a lib/libLLVMCore.a lib/libLLVMipo.a lib/libLLVMInstCombine.a lib/libLLVMInstrumentation.a lib/libLLVMMC.a lib/libLLVMMCParser.a lib/libLLVMObjCARCOpts.a lib/libLLVMOption.a lib/libLLVMScalarOpts.a lib/libLLVMSupport.a lib/libLLVMTransformUtils.a lib/libLLVMVectorize.a lib/libclangBasic.a lib/libclangAPINotes.a lib/libclangCodeGen.a lib/libclangDriver.a lib/libclangFrontend.a lib/libclangFrontendTool.a lib/libLLVMX86CodeGen.a lib/libLLVMX86Desc.a lib/libLLVMX86AsmPrinter.a lib/libLLVMX86Utils.a lib/libLLVMX86Info.a lib/libLLVMARMDesc.a lib/libLLVMARMAsmPrinter.a lib/libLLVMARMInfo.a lib/libLLVMAsmPrinter.a lib/libLLVMSelectionDAG.a lib/libLLVMCodeGen.a lib/libLLVMAArch64Desc.a lib/libLLVMAArch64AsmPrinter.a lib/libLLVMAArch64Info.a lib/libLLVMMCDisassembler.a lib/libLLVMAArch64Utils.a lib/libclangCodeGen.a lib/libLLVMipo.a lib/libLLVMVectorize.a lib/libLLVMInstrumentation.a lib/libLLVMObjCARCOpts.a lib/libLLVMScalarOpts.a lib/libLLVMInstCombine.a lib/libLLVMTarget.a lib/libLLVMBitWriter.a lib/libLLVMProfileData.a lib/libLLVMObject.a lib/libLLVMIRReader.a lib/libLLVMAsmParser.a lib/libLLVMLinker.a lib/libLLVMTransformUtils.a lib/libLLVMAnalysis.a lib/libclangRewriteFrontend.a lib/libclangARCMigrate.a lib/libclangStaticAnalyzerFrontend.a lib/libclangFrontend.a lib/libclangDriver.a lib/libLLVMOption.a lib/libclangParse.a lib/libLLVMMCParser.a lib/libclangSerialization.a lib/libclangSema.a lib/libclangAPINotes.a lib/libLLVMBitReader.a lib/libclangEdit.a lib/libclangStaticAnalyzerCheckers.a lib/libclangStaticAnalyzerCore.a lib/libclangAnalysis.a lib/libclangAST.a lib/libclangRewrite.a lib/libclangLex.a lib/libclangBasic.a lib/libLLVMCore.a lib/libLLVMMC.a lib/libLLVMSupport.a -lrt -ldl -ltinfo -lpthread -lm -Wl,-rpath,"\$ORIGIN/../lib" && :
clang: error: unable to execute command: Killed
clang: error: linker command failed due to signal (use -v to see invocation)

_______________________________________________
swift-dev mailing list
swift-dev@swift.org <mailto:swift-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-dev

_______________________________________________
swift-dev mailing list
swift-dev@swift.org <mailto:swift-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-dev


(Nick Wellnhofer) #5

Then you're probably building on a 32-bit system and running out of address space. I couldn't complete the LLVM debug build on Linux i386 either.

Nick

···

On 10/12/2015 23:11, William Dillon via swift-dev wrote:

I’ve been getting that, and a smattering of other memory exhaustion errors in
my work with ARM.

I haven’t been able to
successfully build the debug variant with 2GB of ram regardless of the
swapfile size (I have 100GB swap partition, of which 67GB is seen by the
kernel [24 bits]).