You are not logged in.
Pages: 1
Hey guys,
For those of you that don't know, clang and llvm were built to eventually replace gcc.
I'm trying to run it now from the Archlinux packages.
For some reason clang and llvm are separate packages. Additionally, clang does not depend on llvm - it depends on gcc-libs.
Can anyone explain this to me?
If you install llvm by itself, you can run llvmc with some sample c program - it complains that llvm-gcc isn't present. You can get that from the AUR, but from what I understand, llvm-gcc is not clang.
If you install clang by itself, it generates c files almost the same way gcc does, without llvm.
Can someone tell me what's wrong? How do you like clang and llvm together?
Thank you,
LiteHacker
Offline
clang actually includes llvm, at least the binary package I downloaded from the llvm web site does. I checked the pkgbuild and it uses the llvm sources from svn, so I guess it does, too.
If you check "llvmc --help", llvmc includes the option "-clang" to make it use clang instead of llvm-gcc as frontend. But this should automatically be done if you build clang.
Offline
$ llvmc -clang hello.c -o hello3
/usr/bin/ld: warning: cannot find entry symbol mit-llvm-bc; defaulting to 080482f0
llc: bitcode didn't read correctly.
Reason: Invalid bitcode signature
Offline
$ clang hello.c -o hello
$ ./hello
Hello World
$ llvmc -clang hello.c -o hello
/usr/bin/ld: warning: cannot find entry symbol mit-llvm-bc; defaulting to 0000000008048330
llc: bitcode didn't read correctly.
Reason: Bitcode stream should be a multiple of 4 bytes in length
I can confirm this behaviour with 2.6, but just invoking clang directly works fine.
Offline
Sorry for the necropost, but is it safe to assume that llvm can be used as a drop-in replacement for GCC?
Offline
Well, clang can be used as a drop-in replacement for GCC.
Offline
Pages: 1