Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » LLVM Setup for Eclipse CDT (replacement for llvm-ld)
LLVM Setup for Eclipse CDT (replacement for llvm-ld) [message #1271854] Sun, 16 March 2014 11:27 Go to next message
Dimitri Joukoff is currently offline Dimitri JoukoffFriend
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 #1271867 is a reply to message #1271854] Sun, 16 March 2014 12:27 Go to previous messageGo to next message
Klaus km is currently offline Klaus kmFriend
Messages: 142
Registered: November 2011
Senior Member
Hello Dimitri,

Quote:
and also installed the LLVM plugin


which Plugin? There is no LLVM-Plugin from eclipse.org.

Or did you use the plugin from Petri Tuononen?

The author explicit mentions, that this plugin does not work with LLVM 3.2 and newer!

See here
http://code.google.com/p/llvm4eclipsecdt/
or here
https://marketplace.eclipse.org/content/llvm-toolchain-eclipse-cdt

quote from the page:
Quote:
Does not yet work with LLVM 3.2. Works with older versions. This is, because llvm-ld (linker) tool was removed from 3.2.



regards,
Klaus



Re: LLVM Setup for Eclipse CDT (replacement for llvm-ld) [message #1272038 is a reply to message #1271867] Sun, 16 March 2014 23:32 Go to previous message
Dimitri Joukoff is currently offline Dimitri JoukoffFriend
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

Previous Topic:namespace problem : could not been resolved
Next Topic:Undefined reference to (itpp library)
Goto Forum:
  


Current Time: Fri Apr 19 14:52:05 GMT 2024

Powered by FUDForum. Page generated in 0.01793 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top