[tlbuild] gcc vs. clang in icu

Karl Berry karl at freefriends.org
Tue Mar 26 22:52:17 CET 2013


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.

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.

One viable option is to leave bad enough alone until a user-level
problem is seen.  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 :).

karl


More information about the tlbuild mailing list