You are not logged in.

#1 2010-06-14 16:02:52

Falcata
Member
From: Michiana
Registered: 2008-01-23
Posts: 501
Website

Using llvm and c++

Okay, I know that in order to compile software written in C with llvm instead of gcc, I use this command before compiling:

alias llvmc=gcc

What do I do if I want to compile software written in C++ using llvm instead of g++ ?

Offline

#2 2010-06-14 16:38:42

gamewolf
Member
Registered: 2009-12-02
Posts: 60

Re: Using llvm and c++

Do you mean using C++ instead of C? If so, replace gcc with g++

Offline

#3 2010-06-14 18:12:48

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: Using llvm and c++

Falcata wrote:

Okay, I know that in order to compile software written in C with llvm instead of gcc, I use this command before compiling:

alias llvmc=gcc

What do I do if I want to compile software written in C++ using llvm instead of g++ ?

Forgive me, but I don't think that line does what you say it does.  How are you compiling software?

Offline

#4 2010-06-14 18:13:55

Falcata
Member
From: Michiana
Registered: 2008-01-23
Posts: 501
Website

Re: Using llvm and c++

either with makepkg or with yaourt -Sb

Offline

#5 2010-06-14 20:38:47

jac
Member
From: /home/jac
Registered: 2009-05-19
Posts: 431
Website

Re: Using llvm and c++

I think Trent means that the alias you have makes gcc run when llvm is executed, not the other way around. With

alias gcc=llvm

llvm is run where gcc would normally have been.
If you want llvm to run instead of g++, you can alias g++ just as easily

alias g++=llvm

(I asssume you're using bash?)

Last edited by jac (2010-06-14 20:40:17)

Offline

#6 2010-06-14 20:39:42

Falcata
Member
From: Michiana
Registered: 2008-01-23
Posts: 501
Website

Re: Using llvm and c++

Yeah, I'm using bash.  I'll try this instead.

Offline

#7 2010-06-14 21:08:48

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Using llvm and c++

Instead of aliasing gcc and c++, I'd use the CC and CXX environmental variables for C and C++ respectively in makepkg.conf. I can't remember off of the top of my head if they need to exported or not.

Offline

#8 2010-06-14 21:10:52

Falcata
Member
From: Michiana
Registered: 2008-01-23
Posts: 501
Website

Re: Using llvm and c++

Well, aliasing is preferred because some software, such as wine and chromium, will not compile under llvm, so I'd prefer to use it explicitly rather than by default.

Offline

#9 2011-01-06 16:07:35

W.F.Cody
Member
From: Ghent
Registered: 2010-11-18
Posts: 155

Re: Using llvm and c++

Anyone tried the LLL tool chain to compile the Linux kernel with LLVM/Clang?

I was planning to try to make a self-hosting (Clang-compiled) AURs for it, but I have not come around to it yet...


https://github.com/brycelelbach/lll
https://github.com/brycelelbach/lll-llvm
https://github.com/brycelelbach/lll-linux
https://github.com/brycelelbach/lll-clang


It made quite a splash when this guy announced that Linux could be compiled with Clang....


My AUR packages
Any package of mine is up for grabs. If you think you could mantain it better - just contact me!

Offline

Board footer

Powered by FluxBB