Help with new llvm-gcc4 port

Emil Mikulic emil at cs.rmit.edu.au
Wed Nov 15 00:14:05 PST 2006


Hi there,

The LLVM project (http://llvm.org/) is currently in 1.9 prerelease.

FreeBSD currently has a devel/llvm port, maintained by Hye-Shik Chang
(perky@) (CC'd), but this port installs a "tools-only" LLVM.

LLVM is much more useful in conjunction with llvm-gcc4 (GCC 4.0.1 acting
as a front-end to LLVM), but the process of building llvm-gcc4 from
source is a little bit hairy.

I've given it my best:
http://goanna.cs.rmit.edu.au/~emil/llvm-gcc4-1.9-r4.tar.bz2 (4KB)

Unfortunately, my ports-fu is weak and I'm sure I've done some really
horrible things in that Makefile (I have tried to clearly mark them with
FIXMEs).  It'd be really nice if someone with more ports experience
could help me polish this port and get it into the ports tree sometime
after 1.9 release comes out.

-=-

More details (duplicated in a big comment in the Makefile):

The process for building LLVM with the gcc4 frontend is roughly:

	1. Build a tools-only LLVM and don't install it, just leave the
	object dirs there.

	2. Configure llvm-gcc4 against the results of the previous step
	and build.

	3. Install llvm-gcc4.

	4. Re-configure LLVM so that it finds the now-installed llvm-gcc
	binary, build and install LLVM.

Hye-Shik and I think a good way to handle this would be to have two
ports:

	* devel/llvm-gcc4 port does #1 through #3
	(maybe it should be *lang*/llvm-gcc4?)

	* devel/llvm port depends on llvm-gcc4 and does #4

We could add a CONFIG knob to the devel/llvm port to let the user choose
whether to build a tools-only LLVM or one with a full-blown cfrontend.
I don't think this would entail anything more than a dependency in the
port Makefile for llvm: building llvm after llvm-gcc4 is installed 

--Emil


More information about the freebsd-ports mailing list