[LLVMbugs] [Bug 9827] New: some mess in the options passed to Clang during the invocation through llvmc

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 2 08:15:41 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=9827

           Summary: some mess in the options passed to Clang during the
                    invocation through llvmc
           Product: clang
           Version: 2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: codacat at ya.ru
                CC: llvmbugs at cs.uiuc.edu


I am running ArchLinux with following clang and llvm versions:

$ clang -v
clang version 2.9 (tags/RELEASE_29/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ llvmc --version
Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.9
  Optimized build.
  Built Apr 11 2011 (14:36:05).
  Host: x86_64-unknown-linux-gnu
  Host CPU: amdfam10

  Registered Targets:
    (none)

When i try to compile simple hello-world program with command line, i get an
error report:

$ llvmc -clang hello.c
clang -x c hello.c -emit-llvm-bc -o /tmp/llvm_09ut0R/hello.bc 
clang: warning: argument unused during compilation: '-e mit-llvm-bc'
llc -O2 /tmp/llvm_09ut0R/hello.bc -o /tmp/llvm_09ut0R/hello.s 
llc: /tmp/llvm_09ut0R/hello.bc:1:1: error: expected top-level entity
ELF> ... <a lot of unprintable characters>

So it seems, that wrong option is passed to the clang front-end, and it
translates source to the ELF object file instead of LLVM bitcode.

When i translate hello.c to the bitcode manually with:

$ clang -c -emit-llvm hello.c -o hello.bc

And then use llvmc with the bitcode:

$ llvmc -v -clang hello.bc -o hello
llc -O2 hello.bc -o /tmp/llvm_ZEvkLH/hello.s 
as /tmp/llvm_ZEvkLH/hello.s -o /tmp/llvm_ZEvkLH/hello.o 
llvm-ld -native -disable-internalize /tmp/llvm_ZEvkLH/hello.o -o hello

everything works fine.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list