Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jun 2009 14:38:01 +0200
From:      Roman Divacky <rdivacky@FreeBSD.org>
To:        Erik Cederstrand <erik@cederstrand.dk>
Cc:        Ed Schouten <ed@80386.nl>, hackers@FreeBSD.org, current@FreeBSD.org
Subject:   Re: Clang: now available from a SVN server near you!
Message-ID:  <20090604123801.GA34971@freebsd.org>
In-Reply-To: <31BD4D08-6558-46FF-9B93-CF8249AAC461@cederstrand.dk>
References:  <20090604093831.GE48776@hoeg.nl> <31BD4D08-6558-46FF-9B93-CF8249AAC461@cederstrand.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jun 04, 2009 at 02:35:56PM +0200, Erik Cederstrand wrote:
> Den 04/06/2009 kl. 11.38 skrev Ed Schouten:
> 
> >You can now build your very own version of FreeBSD with Clang  
> >installed
> >as /usr/bin/cc as follows:
> 
> Thanks for your hard work, Ed. This is great news!
> 
> You might want to mention that a few parts are still GCC-compiled due  
> to bugs in Clang ( see http://wiki.freebsd.org/ 
> BuildingFreeBSDWithClang). Also, it's very encouraging that the ports  
> run you did with Erwin 
> (http://lists.cs.uiuc.edu/pipermail/cfe-dev/2009-June/005274.html ) 
> compiles over 7000 ports with Clang.
> 
> I've asked in the Clang list, but I'd like an opinion from FreeBSD  
> folks, too: Clang supports LTO 
> (http://llvm.org/docs/LinkTimeOptimization.html ), which has a potential 
> for performance improvements. It doesn't work  on FreeBSD because the 
> linker we have (in binutils) doesn't know about  the libLTO that LLVM 
> provides. There's a new linker from GNU called  Gold, but as far as I know 
> it's GPLv3 licensed and therefore  undesirable at least to have in base. 
> LLVM provides a linker (http://llvm.org/cmds/llvm-ld.html ) but "it doesn't 
> interact correctly with conventional nm/ar/etc" 
> (http://lists.cs.uiuc.edu/pipermail/cfe-dev/2009-June/005296.html ). 
> There's the ELF toolchain project (elftoolchain.sourceforge.net/)  but a 
> BSD-licensed ld hasn't been developed yet.
> 
> What would be the best way to get LTO to work on FreeBSD?

you could use llvm-ld (see the wiki for instructions how to do it). there's also some 
effort to make gnu ld usable with llvm LTO and I guess the patch could be backported 
to our ld. I guess



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090604123801.GA34971>