Ubuntu

-emit-llvm makes invalid bytecode

Reported by innominate on 2011-02-03
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
dragonegg (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: dragonegg

when I had package llvm-gcc-4.5 I had the following problem:
$ llvm-gcc -O3 -emit-llvm hello.c -c -o hello.b
$ lli hello.bc
   lli: error loading program 'hello.bc': Invalid bitcode signature

I went back to llvm-gcc-4.2 and got expected results
$ llvm-gcc-4.2 -O3 -emit-llvm hello.c -c -o hello.b
$ lli hello.bc
   hello world

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: llvm-gcc-4.5 (not installed)
ProcVersionSignature: Ubuntu 2.6.35-25.44-generic 2.6.35.10
Uname: Linux 2.6.35-25-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Wed Feb 2 19:16:02 2011
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100427.1)
ProcEnviron:
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: dragonegg

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dragonegg (Ubuntu):
status: New → Confirmed
LCID Fire (lcid-fire) wrote :

It actually ignores _-emit-llvm_ completely. Which makes llvm-gcc pretty useless.

michael, liao (michael-hliao) wrote :

It's because that plugin (dragonegg) is built against 4.5.3,which mismatches the gcc version (4.5.4). Just rebuild dragonegg on 11.10 solve this issue.

michael, liao (michael-hliao) wrote :

ignore the last post, it just remove the warning "Potential incompatible plugin version. GCC: 4.5.3. Expected: 4.5.4" but still cannot emit bc file.

michael, liao (michael-hliao) wrote :

ok, I see the difference, it's not bug at all. as dragonegg uses different option to trigger LLVM IR generation. You need use '-flto' to generate LLVM IR instead of the previous '-emit-llvm'.

Sylvestre Ledru (sylvestre) wrote :

Thanks for the feedback. Closing then.

Changed in dragonegg (Ubuntu):
status: Confirmed → Invalid
buse (buse-yilmaz) wrote :

I have the same problem:

ubuntu 11.10 64 bit llvm3.0 dragonEgg3.0 llvm-gcc-4.6

http://stackoverflow.com/questions/9447318/im-getting-llvm-gcc-potential-incompatible-plug-in-version

Then when I try

buse@buseZenbook:~$ llvm-gcc -flto hello.c -c -o hello.bc
Potential incompatible plugin version. GCC: 4.6. Expected: 4.6.1
Defines 'dragonegg_disable_version_check' as env variable to remove this warning
Please note that unexpected errors might occur.
/tmp/ccUI7YSa.s: Assembler messages:
/tmp/ccUI7YSa.s:1: Error: junk at end of line, first unrecognized character is `e'
/tmp/ccUI7YSa.s:2: Error: no such instruction: `target triple="x86_64--linux-gnu"'
/tmp/ccUI7YSa.s:4: Error: no such instruction: `module asm "\09.ident\09\22GCC: (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1 LLVM: exported\22"'
/tmp/ccUI7YSa.s:6: Error: junk at end of line, first unrecognized character is `@'
/tmp/ccUI7YSa.s:8: Error: no such instruction: `define i32@main(...)nounwind uwtable ssp{'
/tmp/ccUI7YSa.s:10: Error: junk at end of line, first unrecognized character is `%'
/tmp/ccUI7YSa.s:11: Error: junk at end of line, first unrecognized character is `%'
/tmp/ccUI7YSa.s:12: Error: junk at end of line, first unrecognized character is `%'
/tmp/ccUI7YSa.s:13: Error: no such instruction: `br label %"2"'
/tmp/ccUI7YSa.s:15: Error: junk at end of line, first unrecognized character is `"'
/tmp/ccUI7YSa.s:15: Error: bad expression
/tmp/ccUI7YSa.s:15: Error: junk at end of line, first unrecognized character is `e'
/tmp/ccUI7YSa.s:16: Error: junk at end of line, first unrecognized character is `%'
/tmp/ccUI7YSa.s:17: Error: no such instruction: `store i32 0,i32* %memtmp,align 1'
/tmp/ccUI7YSa.s:18: Error: no such instruction: `br label %return'
/tmp/ccUI7YSa.s:20: Error: bad expression
/tmp/ccUI7YSa.s:20: Error: junk at end of line, first unrecognized character is `"'
/tmp/ccUI7YSa.s:21: Error: junk at end of line, first unrecognized character is `%'
/tmp/ccUI7YSa.s:22: Error: operand size mismatch for `ret'
/tmp/ccUI7YSa.s:23: Error: junk at end of line, first unrecognized character is `}'
/tmp/ccUI7YSa.s:25: Error: no such instruction: `declare i32@puts(i8*)'

Hence -flto didn't work in my case.

buse (buse-yilmaz) on 2012-02-26
Changed in dragonegg (Ubuntu):
status: Invalid → Incomplete
Nicola (nicolamondello) wrote :

try llvm-clang, to me it works

Launchpad Janitor (janitor) wrote :

[Expired for dragonegg (Ubuntu) because there has been no activity for 60 days.]

Changed in dragonegg (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers