[tlbuild] build failure on x86_64-linux (gcc4.4) since ICU 4.4

Karl Berry karl at freefriends.org
Wed Apr 7 17:34:47 CEST 2010


It's an issue that arises only with GCC 4.4+, as best I can tell.  I
sent a note to Peter a couple days ago, which I'll append.  I think he
is away, haven't heard from him in a while.  And, as it turns out, I am
also going to be away until next Tuesday.  Doubt I will have a chance to
commit a workaround today :(.  If you or anyone else can get it going
(my suggested approach is below), so much the better.

k


>From karl Mon Apr  5 20:29:23 +0200 2010
To: peb
Subject: gcc 4.4.3 and xetex/icu lossage

Do you have gcc 4.4.3 (probably any 4.4.x)?  ICU does not compile for me
with that.  (It does with the system gcc on tug.org, labeled 4.1.2,
although since it is Red Hat, who knows what the version really is.  But
I expect any version <= 4.3.x works.)

With the current sources, xetex does not compile, as I wrote yesterday.
                 [...]
                 from ../../../texk/web2c/xetexdir/FontTableCache.cpp:42:
/home/texlive/karl/Build/source/Work/libs/icu/include/unicode/umachine.h:314:
  error: 'char16_t' does not name a type

This refers to these lines in
Build/source/libs/icu/icu-4.4/common/unicode/umachine.h:

311 #if defined _GCC_
312     typedef __CHAR16_TYPE__ char16_t;
313 #endif
314     typedef char16_t UChar;

_GCC_ is not defined when compiling xetex, and hence the first typedef
on line 312 is not executed, hence the second typedef of UChar refers to
something nonexistent.

I tried changing the #if to refer to __GNUC__ to make it effective, but
then there were new problems compiling icu itself.

What happens is that icu-4.4/configure.in adds -std=gnu99 -D_GCC_ to
(yuck) CFLAGS for GCC >= 4.4.  So, _GCC_ is defined when compiling icu,
and it works out ok.  But without those same options for xetex (likewise
bibtexu), they can't work.  But they should only be added when they were
added for icu, and that does not look so easy to do.

Maybe a simpler approach would be to add an option to icu-4.4 so that it
does not even make this check.  After all, it's not like we actually
need UTF16 string literals.  Unfortunately, right now it is only
conditioned on --enable-strict, and we certainly want to keep
--disable-strict, so we'd have to add our own test.  For your
convenience, I'll append the stuff from icu-4.4/configure.in that I'm
talking about.

Wdyt?

Thanks,
Karl

# GCC >= 4.4 supports UTF16 string literals. The CFLAGS and CXXFLAGS may change in the future.
# Since we have to use a different standard, if strict is enable, don't enable UTF16 string literals.
U_CHECK_GNUC_UTF16_STRING=0
if test "$ac_use_strict_options" = no && test "$CHECK_UTF16_STRING_RESULT" = "unknown"; then
    if test "$ac_cv_c_compiler_gnu" = yes; then
        OLD_CFLAGS="${CFLAGS}"
        OLD_CXXFLAGS="${CXXFLAGS}"
        CFLAGS="${CFLAGS} -std=gnu99 -D_GCC_"
        CXXFLAGS="${CXXFLAGS} -std=c++0x"
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
#ifdef _GCC_
typedef __CHAR16_TYPE__ char16_t;
#endif
char16_t test[] = u"This is a UTF16 literal string.";
#else
GCC IS TOO OLD!
#endif
        ]], [[]])],[U_CHECK_UTF16_STRING=1],[U_CHECK_UTF16_STRING=0])


More information about the tlbuild mailing list