llvm compilation of libc?

Hello,

I’m wondering if anyone had any success (even a small amount) compiling any variant of libc to llvm bitcode?

uclibc can be compiled into .bc. Check out http://klee.llvm.org/

I would recommend Newlib. It's easy to configure and compile using Clang.

http://sourceware.org/newlib/

- xi

Hi Xi,

How did you compile it with clang? I ran into problems:

clang -emit-llvm -DPACKAGE_NAME=“newlib” -DPACKAGE_TARNAME=“newlib” -DPACKAGE_VERSION=“1.19.0” -DPACKAGE_STRING=“newlib\ 1.19.0” -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -I. -DMISSING_SYSCALL_NAMES -fno-builtin -DMISSING_SYSCALL_NAMES -fno-builtin -O2 -c -o lib_a-memcpy.o test -f 'memcpy.S' || echo './'memcpy.S
/tmp/cc-qoxxpO.s:51:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % rax, (% rdi)
^
/tmp/cc-qoxxpO.s:52:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r8 , 8 (% rdi)
^
/tmp/cc-qoxxpO.s:53:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r9 , 16 (% rdi)
^
/tmp/cc-qoxxpO.s:54:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r10, 24 (% rdi)
^
/tmp/cc-qoxxpO.s:55:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r11, 32 (% rdi)
^
/tmp/cc-qoxxpO.s:56:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r12, 40 (% rdi)
^
/tmp/cc-qoxxpO.s:57:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r13, 48 (% rdi)
^
/tmp/cc-qoxxpO.s:58:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r14, 56 (% rdi)
^
/tmp/cc-qoxxpO.s:69:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % rax, 64 (% rdi)
^
/tmp/cc-qoxxpO.s:70:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r8 , 72 (% rdi)
^
/tmp/cc-qoxxpO.s:71:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r9 , 80 (% rdi)
^
/tmp/cc-qoxxpO.s:72:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r10, 88 (% rdi)
^
/tmp/cc-qoxxpO.s:73:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r11, 96 (% rdi)
^
/tmp/cc-qoxxpO.s:74:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r12, 104 (% rdi)
^
/tmp/cc-qoxxpO.s:75:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r13, 112 (% rdi)
^
/tmp/cc-qoxxpO.s:76:3: error: invalid instruction mnemonic ‘movntiq’
movntiq % r14, 120 (% rdi)
^
make[2]: *** [lib_a-memcpy.o] Error 1

Thanks.

Fixed in r133759.

-Eli