0
votes

I am running oracle VM Virtualbox 4.3.6 on a 64 Bit Windows 7 system.

The VM was created with the Debian i386 7.3 DVD, a fresh install.

LLVM 3.3 was compiled, and then Clang 3.3 was compiled.

Trying to run the clang binary to compile a simple program (int main() {return 1;}) crashes:

Anyone know what gives?

./clang test.c clang-3.3: /home/kzvr/llfi/llvmsrc/lib/IR/Value.cpp:559: void llvm::ValueHandleBase::RemoveFromUseList(): Assertion `VP.getPointer() && VP.getPointer()->HasValueHandle && "Pointer doesn't have a use list!"' failed. 0 clang-3.3 0x0973d62a llvm::sys::PrintStackTrace(_IO_FILE*) + 50 1 clang-3.3 0x0973d87d 2 clang-3.3 0x0973d284 3 0xb7761400 __kernel_sigreturn + 0 4 0xb7761422 __kernel_vsyscall + 2 5 libc.so.6 0xb74c6941 gsignal + 81 6 libc.so.6 0xb74c9d72 abort + 386 7 libc.so.6 0xb74bfb58 __assert_fail + 248 8 clang-3.3 0x096610ad llvm::ValueHandleBase::RemoveFromUseList() + 103 9 clang-3.3 0x08d649f4 10 clang-3.3 0x093085e4 11 clang-3.3 0x09781560 12 clang-3.3 0x0977be5a clang::CodeGen::CodeGenFunction::StartFunction(clang::GlobalDecl, clang::QualType, llvm::Function*, clang::CodeGen::CGFunctionInfo const&, clang::CodeGen::FunctionArgList const&, clang::SourceLocation) + 692 13 clang-3.3 0x0977c929 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 473 14 clang-3.3 0x0978dbc2 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl) + 650 15 clang-3.3 0x0978ae33 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 383 16 clang-3.3 0x0978a849 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 587 17 clang-3.3 0x097909d8 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 252 18 clang-3.3 0x0976d7e6 19 clang-3.3 0x0976c9df 20 clang-3.3 0x09a8d4d6 clang::ParseAST(clang::Sema&, bool, bool) + 484 21 clang-3.3 0x099afde0 clang::ASTFrontendAction::ExecuteAction() + 284 22 clang-3.3 0x0976beca clang::CodeGenAction::ExecuteAction() + 1090 23 clang-3.3 0x099af995 clang::FrontendAction::Execute() + 183 24 clang-3.3 0x0998b9b5 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 559 25 clang-3.3 0x09742469 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 939 26 clang-3.3 0x08878f0b cc1_main(char const*, char const*, char const*, void*) + 624 27 clang-3.3 0x088738a0 main + 523 28 libc.so.6 0xb74b2e46 __libc_start_main + 230 29 clang-3.3 0x08872261 Stack dump: 0. Program arguments: /home/kzvr/llfi/clang/bin/clang-3.3 -cc1 -triple i386-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name test.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -fuse-init-array -target-cpu pentium4 -resource-dir /home/kzvr/llfi/clang/bin/../lib/clang/3.3 -internal-isystem /usr/local/include -internal-isystem /home/kzvr/llfi/clang/bin/../lib/clang/3.3/include -internal-externc-isystem /usr/include/i386-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /home/kzvr/llfi/clang/bin -ferror-limit 19 -fmessage-length 140 -mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties -fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops -o /tmp/test-Gjdo7r.o -x c test.c 1. parser at end of file 2. test.c:1:5: LLVM IR generation of declaration 'main' 3. test.c:1:5: Generating code for declaration 'main' clang-3.3: error: unable to execute command: Aborted clang-3.3: error: clang frontend command failed due to signal (use -v to see invocation) clang version 3.3 (tags/RELEASE_33/final) Target: i386-pc-linux-gnu Thread model: posix clang-3.3: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script. clang-3.3: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-3.3: note: diagnostic msg: /tmp/test-jvuGLK.c clang-3.3: note: diagnostic msg: /tmp/test-jvuGLK.sh clang-3.3: note: diagnostic msg:

2

2 Answers

1
votes

Fixed it...

Recompiled clang passing CMAKE_BUILD_TYPE=RELEASE to cmake...

0
votes

Most probably your clang/llvm was miscompiled by your system gcc. Make sure you're not using any broken gcc from the list: http://llvm.org/docs/GettingStarted.html#broken-versions-of-gcc-and-other-tools