Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 269651

Summary: [ebuild] clang C compiler
Product: Gentoo Linux Reporter: Ravi Pinjala <ravi>
Component: New packagesAssignee: Bernard Cafarelli <voyageur>
Status: RESOLVED FIXED    
Severity: enhancement CC: corecrystal, hans, hauschild.markus, nbkolchin, voyageur
Priority: High Keywords: EBUILD
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: clang SVN ebuild
dev-lang/clang-2.6_pre1.ebuild
dev-lang/clang-2.6_pre1.ebuild, with static analyzer
dev-lang/clang-2.6_pre2.ebuild
WIP version of clang-2.6_pre2

Description Ravi Pinjala 2009-05-13 05:38:01 UTC
Clang (http://clang.llvm.org) is a C compiler being developed by the LLVM project. It's supposed to be smaller, faster, and cleaner than GCC. 

Reproducible: Always
Comment 1 Ravi Pinjala 2009-05-13 05:40:24 UTC
Created attachment 191108 [details]
clang SVN ebuild

My initial attempt at an ebuild. Unfortunately, it pulls down all of LLVM as well - clang seems to be completely dependent on the LLVM build system, and won't build outside of its source tree. This ebuild only installs clang, though.
Comment 2 Ravi Pinjala 2009-09-04 19:11:50 UTC
Created attachment 203137 [details]
dev-lang/clang-2.6_pre1.ebuild

Ebuild for the prerelease of Clang 2.6 (or is that 1.0?). The paths are hardcoded, mainly because I don't know how upstream is going to version this in the future - right now it's tied to the LLVM version. 

Clang still doesn't have its own build system; see http://llvm.org/bugs/show_bug.cgi?id=4840 for details on that.
Comment 3 Ravi Pinjala 2009-09-14 18:49:19 UTC
Created attachment 204112 [details]
dev-lang/clang-2.6_pre1.ebuild, with static analyzer

Added a USE flag for installing the Clang static analyzer too
Comment 4 Ravi Pinjala 2009-09-26 07:54:31 UTC
Created attachment 205269 [details]
dev-lang/clang-2.6_pre2.ebuild

Ebuild for clang-2.6 prerelease 2. Biggest change in this ebuild is switching to EAPI 2 for SRC_URI arrows, since upstream uses the same filenames for the different prereleases, and just puts them in different directories. >_>
Comment 5 Bernard Cafarelli gentoo-dev 2009-09-28 13:54:58 UTC
Created attachment 205474 [details]
WIP version of clang-2.6_pre2

Thanks for the work so far on this!
I hope to add clang in tree at the same time as llvm 2.6 release, here is my current version of the ebuild (lots of parts taken from llvm ebuild, like src_configure)
Comment 6 Ravi Pinjala 2009-09-28 16:53:26 UTC
Oh, awesome! Looking forward to seeing this in the tree. :D

One question: Clang uses LLVM's build system, but is it actually modified by any of LLVM's configure options? My understanding was that it's mostly independent of LLVM, unless you enable LTO.
Comment 7 Bernard Cafarelli gentoo-dev 2009-09-28 23:11:09 UTC
It does still use a few parameters generated by llvm's configure (release/debug output directory, cflags, ...), but this is more of a leftover from initial build system (when it was a simple subtool of llvm).

Hopefully by next version it will build independently so we don't have to recompile parts of llvm twice :)
Comment 8 Bernard Cafarelli gentoo-dev 2009-10-25 20:25:07 UTC
I've just added final 2.6 clang in tree, enjoy!