GSoC: Making ports work with clang

Erik Cederstrand erik at
Sun May 30 13:53:58 UTC 2010

Den 30/05/2010 kl. 14.51 skrev Andrius Morkūnas:

> On Sun, 30 May 2010 14:58:05 +0300, Volodymyr Kostyrko <c.kworr at> wrote:
>> 1. __dso not found after link. Some symbols seems to be omitted from
>> libraries and linking of plugins fails badly.
> Known problem with known fix.
>> 2. Assembler errors. Xorg has some in x11-servers/xorg-server
>> x11-drivers/xf86-video-vesa x11-drivers/xf86-video-ati, everything else
>> compiles and works.
> Assembler errors often aren't similar to each other, so fixing them may
> be very easy or difficult. Hopefully we will fix them for big stuff like
> xorg (not really as part of this GSoC project).
>> 3. Big bunch of compile errors or config errors. This means incorrectly
>> written code, like not correctly declaring variables. This also means
>> some automake stupidities like testing c++ compiler with c style code -
>> for example clang++ refuses to compile "int main(void) {}".
> $ cat
> int main(void) {}
> $ clang -o test && ./test && echo "No, it works."
> No, it works.
> Other than that, yes, many problems are related to insane configure
> scripts.
>> 4. Some ports specify that thay need at least gcc 3.3.
> This is another of those insane configure scripts, testing for specific
> version of specific compiler, rather than testing if it can compile
> anything.
>> 5. Some ports needs --dumpspecs.
> It's a bit uglier than "some ports":
> $ grep dumpspecs /usr/ports/Mk/
> GECKO_PTHREAD_LIBS!=${CC} -dumpspecs | ${GREP} -m 1 pthread: | ${SED} -e 's|^.*%{\!pg: %{pthread:|| ; s|}.*$$||' || ${TRUE}
>> audio/libmad - distorted sound
>> lang/python26 - compiling any gir dumps core
>> textproc/expat2 - dbus dumps core at launch
> Python and expat shout i386 in my face, clang/llvm tends to not like
> i386 too much. But I think few miscompilations were fixed recently,
> so some of these may already be working fine.
>> And this all data is not current. It's one month old. Since then
>> dumpspecs was implemented. And maybe some other problems begone - I just
>> have not enough time to look at this thoroughly.
> Some problems from a month ago are definitely gone, but I don't think
> dumpspecs is one of them.

Andrius, would it make sense to create e.g. a wiki page tracking the status and current known problems with compiling ports with clang? Just like there's a wiki page ClangBSD status.

I think it would make it easier for lurkers to jump in and test things, and help whittle away at the problems.


More information about the freebsd-ports mailing list