soc2010andriusmorkunas

(MarkLinimon note 20110610: apparently this project was never completed. However, much of the patches generated should still be usable.)

Making ports work with clang

This project will bring clang to FreeBSD ports system as an alternative to GCC. When the project is completed, user will be able to freely set ports compiler to either GCC or clang, without having to worry whether things will break or not. While the project is mostly about clang, many changes to ports system will be generic. They will make it easier to compile ports with any GCC-compatible compiler (including latest versions of GCC).

Email: hinokind@gmail.com

IRC: Andrius @ freenode, OFTC, EFNet

See the clangports repository in Perforce.

$ cat /etc/make.conf
CC=clang
$ cat /usr/ports/multimedia/ffmpeg-devel/Makefile | grep USE_GCC
USE_GCC=    4.4+

At the moment, this would add dependency to gcc44, then try to compile with clang anyway. USE_GCC shouldn't be ignored.

$ cat /etc/make.conf
CC=clang

This also changes compiler for the base system. It shouldn't be like this. And no, ugly hack to only apply CC=clang for stuff in /usr/ports/* is not a good solution, user shouldn't need to do things like that.

Since some people get wrong ideas about what I'm trying to do, here's a list of things that are not my goals:

  • Replace gcc with clang
  • Make all ports work with clang over summer
  • Make some specific port work with clang (it would be nice to get some of them working, but that's not a terribly high priority)
  • Early tasks (during community bonding period or right after it)
    • Review existing patches by me, KoopMast and ReneLadan.
    • Make individual ports (mostly big ones like Gnome, KDE and their depends) build with clang. Submit patches upstream when appropriate.
  • Before mid-term evaluation
    • Implement a way to set ports compiler without manually overriding CC or CXX.
    • Continue fixing individual ports if there is time for that.
  • After mid-term evaluation
    • Write a tool that would report problems when port doesn't build with alternative compiler or when it doesn't respect environment.
    • Finish tasks planned for earlier time, but not yet finished, if they exist.
    • Write documentation for things changed or introduced to ports system.
    • Fix more ports.

Mentor: KoopMast

Co-mentor: RomanDivacky

  • soc2010andriusmorkunas.txt
  • Last modified: 2026/10/12 10:55
  • (external edit)