GSoC: Making ports work with clang

Andrius Morkūnas hinokind at
Sun May 30 12:51:22 UTC 2010

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

> 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

> 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.


More information about the freebsd-ports mailing list