Problems with compiling ARMDisassembler.cpp with clang

Hey all;

I am doing a 2-stage clang-3.0rc3 build and while clang compiles ARMDisassembler.cpp I get;

terminate called after throwing an instance of ‘std::bad_alloc’
what(): std::bad_alloc
Stack dump:
0. Program arguments: /home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/stage1/bin/clang-3.0 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name ARMDisassembler.cpp -pic-level 2 -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -momit-leaf-frame-pointer -g -coverage-file CMakeFiles/LLVMARMDisassembler.dir/ARMDisassembler.cpp.o -resource-dir /home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/stage1/bin/…/lib/clang/3.0 -D _GNU_SOURCE -D NDEBUG -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I /home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/stage2/lib/Target/ARM/Disassembler -I /home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/lib/Target/ARM/Disassembler -I /home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/lib/Target/ARM -I /home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/stage2/lib/Target/ARM -I /home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/stage2/include -I /home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/include -I /home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/stage2/lib/Target/ARM/Disassembler/… -I /home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/lib/Target/ARM/Disassembler/… -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/4.6/…/…/…/…/include/c++/4.6 -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/4.6/…/…/…/…/include/c++/4.6/x86_64-suse-linux -internal-isystem /usr/lib64/gcc/x86_64-suse-linux/4.6/…/…/…/…/include/c++/4.6/backward -internal-isystem /usr/local/include -internal-isystem /home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/stage1/bin/…/lib/clang/3.0/include -internal-externc-isystem /usr/include -O2 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-long-long -pedantic -fconst-strings -fdeprecated-macro -ferror-limit 19 -fmessage-length 0 -fno-rtti -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option -o CMakeFiles/LLVMARMDisassembler.dir/ARMDisassembler.cpp.o -x c++ /home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/lib/Target/ARM/Disassembler/ARMDisassembler.cpp

  1. parser at end of file
  2. Per-module optimization passes
  3. Running pass ‘CallGraph Pass Manager’ on module ‘/home/abuild/rpmbuild/BUILD/llvm-2.9.99.svn20111106/lib/Target/ARM/Disassembler/ARMDisassembler.cpp’.
  4. Running pass ‘Scalar Replacement of Aggregates (SSAUp)’ on function ‘@_ZN4llvmL27decodeNEONDataInstruction32ERNS_6MCInstEjmPKvRKNS_15MCSubtargetInfoE’
    clang-3: error: unable to execute command: Aborted
    clang-3: error: clang frontend command failed due to signal 2 (use -v to see invocation)
    clang-3: note: diagnostic msg: Please submit a bug report to and include command line arguments and all diagnostic information.
    clang-3: note: diagnostic msg: Preprocessed source(s) are located at:
    clang-3: note: diagnostic msg: /tmp/ARMDisassembler-w0Qd8e.ii
    make[2]: *** [lib/Target/ARM/Disassembler/CMakeFiles/LLVMARMDisassembler.dir/ARMDisassembler.cpp.o] Error 254
    make[1]: *** [lib/Target/ARM/Disassembler/CMakeFiles/LLVMARMDisassembler.dir/all] Error 2
    make: *** [all] Error 2
    error: Bad exit status from /var/tmp/rpm-tmp.POjuHk (%build)

Seems to be clang is going out of memory while compiling this file, the building VM has 2GB RAM and gcc 4.6 compiles it fine.

Any ideas?

Regards,
ismail

Try adding another GB of RAM to your VM. And file a bug.

-Eli