Bug#610585: llvm-2.7: LLVM bitcode files do not execute directly
Lenard Lindstrom
len-l at telus.net
Thu Jan 20 02:30:57 UTC 2011
Package: llvm-2.7
Version: 2.7-6
Severity: normal
The llvm-2.7 installer sets up the binfmt_misc module with the wrong magic
number.
~/Projects/llvm$ cat /proc/sys/fs/binfmt_misc/llvm-2.7.binfmt
enabled
interpreter /usr/bin/lli-2.7
flags:
offset 0
magic 6c6c7663
~/Projects/llvm$ llvm-as-2.7 hello.ll
~/Projects/llvm$ chmod u+x hello.bc
~/Projects/llvm$ ls -l hello.bc
-rwxr--r-- 1 lenard lenard 348 Jan 19 18:15 hello.bc
~/Projects/llvm$ ./hello.bc
bash: ./hello.bc: cannot execute binary file
The correct magic number is 'BC'.
~/Projects/llvm$ hexdump -Cn 4 hello.bc
00000000 42 43 c0 de |BC..|
00000004
~# update-binfmts --install llvm /usr/bin/lli-2.7 --magic 'BC'
~/Projects/llvm$ cat /proc/sys/fs/binfmt_misc/llvm
enabled
interpreter /usr/bin/lli-2.7
flags:
offset 0
magic 4243
~/Projects/llvm$ ./hello.bc
hello world
-- System Information:
Debian Release: 6.0
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=en_CA.utf8, LC_CTYPE=en_CA.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages llvm-2.7 depends on:
ii libc6 2.11.2-7 Embedded GNU C Library: Shared lib
ii libffi5 3.0.9-3 Foreign Function Interface library
ii libgcc1 1:4.4.5-8 GCC support library
ii libllvm2.7 2.7-6 Low-Level Virtual Machine (LLVM),
ii libstdc++6 4.4.5-8 The GNU Standard C++ Library v3
ii llvm-2.7-runtime 2.7-6 Low-Level Virtual Machine (LLVM),
Versions of packages llvm-2.7 recommends:
ii llvm-2.7-dev 2.7-6 Low-Level Virtual Machine (LLVM),
Versions of packages llvm-2.7 suggests:
ii llvm-2.7-doc 2.7-6 Low-Level Virtual Machine (LLVM),
-- no debconf information
More information about the Pkg-llvm-team
mailing list