LLVM Setup for Eclipse CDT (replacement for llvm-ld) [message #1271854] |
Sun, 16 March 2014 11:27 |
Dimitri Joukoff Messages: 19 Registered: September 2012 |
Junior Member |
|
|
I'm doing a C course at University, and I need to use Clang. I'm using Ubuntu 13.10.
Thus far I've been using gedit to write my code and the command line, with my own Makefile, to build it.
I've used Eclipse for other languages and want to use it for this course, so I installed Eclipse (Kepler) + CDT, and also installed the LLVM plugin. On my machine, I already have LLVM 3.2 and 3.4 installed.
My program compiles ok, but I can't link it. Since llvm-ld is not available in my version of LLVM, what linker do I use in its place (that supports LLVM)?
I've tried llvm-link, but it gives me errors complaining about the -L option and -lstdc++:
make all
Building target: a1
Invoking: LLVM C linker
llvm-link -v -L/usr/lib/gcc/x86_64-linux-gnu/4.8/ -o "a1" ./hello.bc ./mycat.bc -lstdc++
llvm-link: Unknown command line argument '-L/usr/lib/gcc/x86_64-linux-gnu/4.8/'. Try: 'llvm-link -help'
llvm-link: Did you mean '-nvptx-emit-line-numbers'?
llvm-link: Unknown command line argument '-lstdc++'. Try: 'llvm-link -help'
llvm-link: Did you mean '-stats'?
make: *** [a1] Error 1
I've tried removing the library references in the 'LLVM Preference' sheet but they keep coming back.
I would really appreciate if someone could actually list all the settings that need to be made so as to get this working smoothly. My projects are small and will at most involve a small number of files but I will have multiple targets within the same project. (Where I think I will use my own Makefile.)
I've been trying to figure this out this LLVM setup all weekend. So much so that I think the command line option is the way to go.
Cheers,
Dimitri.
|
|
|
|
Re: LLVM Setup for Eclipse CDT (replacement for llvm-ld) [message #1272038 is a reply to message #1271867] |
Sun, 16 March 2014 23:32 |
Dimitri Joukoff Messages: 19 Registered: September 2012 |
Junior Member |
|
|
I didn't think that a missing linker would prevent everyone from using LLVM, and I figured there would be a workaround.
In fact there is (not necessarily the best example but it does work):
clang -emit-llvm -c hello.c
llvm-link -o hello.bc1 hello.o
opt hello.bc1 -o hello.bc2 -std-compile-opts
llc -filetype=obj hello.bc2 -o hello2.o
clang hello2.o
So my question really is, how can you make llvm-link, opt, llc, and clang the second time, work with Eclipse.
Or if there is an easier/better alternative way, what is it?
[Updated on: Sun, 16 March 2014 23:38] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01793 seconds