You are not logged in.

#1 2009-06-04 21:02:08

falotromplastero
Member
From: Santiago, Chile.
Registered: 2008-10-27
Posts: 15

using llvm

Hello
somedays ago i read don't know where that FreeBSD will eventually replace gcc for llvm.
I didnt know what was it so i made a lil research and now i think i know what is it.
My question is if i'm patient enough to compile it and install it, how do i use it to compile software with makepkg?
Hoping you not gonna laught at my face and saying thank you for your help.
Falotromplastero.

Offline

#2 2009-06-05 00:53:48

tom5760
Member
From: Philadelphia, PA, USA
Registered: 2006-02-05
Posts: 283
Website

Re: using llvm

Well, it depends on the software you are trying to build.  Most C and C++ projects that have ./configure scripts or Makefiles will let you define a CC and CXX variable to switch the compiler from GCC.  You could set these to llvm in /etc/makepkg.conf to give it a shot.

Also, llvm is in community, and clang (C frontend for llvm) is in the AUR.

Good luck!

Offline

#3 2009-06-05 03:36:08

falotromplastero
Member
From: Santiago, Chile.
Registered: 2008-10-27
Posts: 15

Re: using llvm

I have installed the llvm-gcc package from AUR, is it the same as clang?? And can you tell me how can i specify in makepkg.conf to use llvm instead of gcc.
Thanks.
Falotromplastero

Offline

#4 2009-06-05 03:58:45

tom5760
Member
From: Philadelphia, PA, USA
Registered: 2006-02-05
Posts: 283
Website

Re: using llvm

LLVM is a compiler framework, it is not a compiler for any specific language.  That is the job of an LLVM frontend.  Clang is an LLVM frontend for C and C++.  There is also a GCC frontend to LLVM.  You'd need one of those in order to build C and C++ code.  Once you have that, you could probably put the path to the compiler in the CC and CXX variables in /etc/makepkg.conf.

You might have issues using LLVM if the build system of whatever package you are trying to build uses some GCC specific flags.  If that is the case you'd need to edit the specific package's configure scripts or makefiles or whatever they use.

I'd say it would be worth just getting Clang or GCC-LVM working on some small bit of C or C++ code first, then try to build packages with it later.

EDIT: Check out http://llvm.org to get a better idea of what LLVM is and what it does.

Last edited by tom5760 (2009-06-05 03:59:46)

Offline

#5 2009-06-05 04:26:08

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,384
Website

Re: using llvm

And note that C++ is very incomplete with Clang/LLVM

Offline

#6 2009-06-23 23:36:56

ammon
Member
Registered: 2008-12-11
Posts: 413

Re: using llvm

@ Allan

http://clang.llvm.org/cxx_status.html

Here they mention that they are close to what G++ can do.
Do you think it is usable to compile some programs which dont use too complex c++ code? (I dont know nothing about c++, ok?) smile

I would like to try it.

Offline

#7 2009-06-23 23:39:49

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: using llvm

Try and see smile That page has a whole lotta red blocks though.

While LLVM does seem as though it will be faster/better than GCC, and least right now, the main reason the BSDs want to switch is because LLVM and Clang are under permissive licenses (BSD, X11, MIT, etc.) as opposed to copyleft (GPL, LGPL, etc.), which *BSD prefers.

Last edited by Ranguvar (2009-06-23 23:40:18)

Offline

#8 2009-06-23 23:46:15

ammon
Member
Registered: 2008-12-11
Posts: 413

Re: using llvm

First I need to install it.
Thats where it failed.
Clang-svn from AUR failed to compile. Same error as last comment on AUR page.

Offline

#9 2009-06-23 23:59:03

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: using llvm

Looks like a fairly simple error, but then, I don't yet know C. I'd report it to upstream. At a guess, it's some GCC 4.4 problem.

Offline

#10 2009-06-25 02:46:23

Nezmer
Member
Registered: 2008-10-24
Posts: 559
Website

Re: using llvm

The FreeBSD guys are trying to offer an alternative to GCC to build their base system . They can't achieve that goal with ports because a lot of written software code is GCC-dependent .


English is not my native language .

Offline

Board footer

Powered by FluxBB