[tlbuild] gcc vs. clang in icu

Khaled Hosny khaledhosny at eglug.org
Wed Mar 27 04:33:24 CET 2013


On Tue, Mar 26, 2013 at 09:52:17PM +0000, Karl Berry wrote:
> Dick reported the following.  I wanted to reply on the list so it would
> end up in the archives.
>     
>     The whole compile uses [gcc], EXCEPT the icu compile. It's configure
>     utility checks for clang and clang++, finds them, and uses
>     them. Recall that llvm-clang is another open source compiler system,
>     which Apple supports. In Lion Apple switched completely to this
>     system and removed gcc. I believe gcc and clang are compatible, so
>     the fact that clang is used for icu causes no harm. But I wouldn't
>     bet my house on it.)
> 
> I wouldn't bet a nickel on it.  Indeed, I find it amazing that this
> works at all -- clang++ and g++ do precisely the same name-mangling of
> symbols?  Seems sooo unlikely, but I guess that is the inescapable
> conclusion, otherwise your xetex wouldn't link.

This gives me chills.

> Anyway, it's certainly true
> (Build/source/libs/icu/icu-51.1/source/configure.in, line 119) that icu
> goes to a lot of trouble to disable the user's chosen compiler and
> preferentially use clang[++] from PATH.  I can't express how bad of an
> idea I think this is.  It seems they do not even provide a way to
> override it.

ICU developers have that interesting idea of reinventing the whole
autotools magic like 5 times in different places of their build system.

If patching ICU's configure.in is a possibility, I suggest we do so.
Clang is not Mac only, I just installed it on my Linux box and ICU build
started using it! (not to mention the nonsense C++11 comment they have
there, because GCC actually have a slightly more C++11 support than
Clang).

> Otherwise, I would suggest temporarily making clang and clang++ be
> symlinks to /bin/false for your build (in $HOME/bin or some such early
> directory in your path), so configure will presumably not consider
> them working compilers and use gcc/g++ instead.  Of course, I won't be
> surprised if ICU then starts to misbehave :).

And it does, it will insist on using clang regardless which will of
course fail.

Regards,
Khaled


More information about the tlbuild mailing list