If icu-50_rc-r1 is built with gcc-4.6, or any other gcc version that does not support the "-std=c++11" flag, it will be configured to not use utf16 strings: # emerge -1 icu [...] checking for UTF-16 string literal support... unknown checking for a library suffix to use... none CPPFLAGS= $(THREADSCPPFLAGS) -DU_DISABLE_RENAMING=1 CFLAGS=-march=native -O2 -pipe -Wall -std=c99 -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $(THREADSCFLAGS) CXXFLAGS=-march=native -O2 -pipe -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long $(THREADSCXXFLAGS) However, icu-50_rc-r1's /usr/include/unicode/platform.h enables utf16 strings *even if the installed icu binary does not support them*, so long as the code that uses the icu header is being built using >=gcc-4.7 with C++11 or C++0x: # if (defined(__cplusplus) && __cplusplus >= 201103L) # define U_HAVE_CHAR16_T 1 # else # define U_HAVE_CHAR16_T 0 # endif This naturally causes a build failure in app-office/libreoffice-3.6.2.2 if it is built using gcc-4.7, because libreoffice uses "-std=gnu++0x" in its compiler flags: /var/tmp/portage/app-office/libreoffice-3.6.2.2/work/libreoffice-core-3.6.2.2/workdir/unxlngx6.pro/CxxObject/i18npool/source/collator/gencoll_rule.o: In function `sal_main_with_args(int, char**)': gencoll_rule.cxx:(.text+0x3de): undefined reference to `icu::UnicodeString::UnicodeString(char16_t const*)' collect2: error: ld returned 1 exit status make[2]: *** [/var/tmp/portage/app-office/libreoffice-3.6.2.2/work/libreoffice-core-3.6.2.2/workdir/unxlngx6.pro/LinkTarget/Executable/gencoll_rule] Error 1 icu needs to modify the installed headers so that they match the installed icu binary. The choice of whether to use utf16 strings in icu's public API must be made at icu's build time, not at the build time of every package that links to icu.
Created attachment 327720 [details, diff] icu.patch Please test this patch.
(In reply to comment #1) This fails to build with gcc-4.7: >>> Compiling source in /var/tmp/portage/dev-libs/icu-50_rc-r1/work/icu/source ... make -j1 VERBOSE=1 rebuilding config/icucross.mk cd ./config; \ make -f pkgdataMakefile make[1]: Entering directory `/var/tmp/portage/dev-libs/icu-50_rc-r1/work/icu/source/config' rm -rf pkgdata.inc make[1]: Leaving directory `/var/tmp/portage/dev-libs/icu-50_rc-r1/work/icu/source/config' rm -rf config/icu-config /usr/bin/install -c ./config/icu-config-top config/icu-config chmod u+w config/icu-config LC_ALL=C sed -f ./config/make2sh.sed < ./config/Makefile.inc | grep -v '#M#' | uniq >> config/icu-config LC_ALL=C sed -f ./config/make2sh.sed < ./config/mh-linux | grep -v '#M#' | uniq >> config/icu-config cat ./config/icu-config-bottom >> config/icu-config echo "# Rebuilt on "`date` >> config/icu-config chmod u-w config/icu-config config/icu-uc.pc updated. config/icu-i18n.pc updated. config/icu-le.pc updated. config/icu-lx.pc updated. config/icu-io.pc updated. /bin/sh ./mkinstalldirs lib mkdir lib /bin/sh ./mkinstalldirs bin mkdir bin make[0]: Making `all' in `stubdata' make[1]: Entering directory `/var/tmp/portage/dev-libs/icu-50_rc-r1/work/icu/source/stubdata' (deps) stubdata.c In file included from ../common/unicode/ptypes.h:50:0, from ../common/unicode/umachine.h:44, from ../common/unicode/utypes.h:36, from stubdata.c:20: ../common/unicode/platform.h:669:8: error: missing ')' in expression x86_64-pc-linux-gnu-gcc -D_REENTRANT -DU_DISABLE_RENAMING=1 -I../common -DU_ATTRIBUTE_DEPRECATED= -march=native -O2 -pipe -Wall -std=c99 -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -c -DPIC -fPIC -o stubdata.o stubdata.c In file included from ../common/unicode/ptypes.h:50:0, from ../common/unicode/umachine.h:44, from ../common/unicode/utypes.h:36, from stubdata.c:20: ../common/unicode/platform.h:669:8: error: missing ')' in expression make[1]: *** [stubdata.o] Error 1
Created attachment 327726 [details, diff] icu.patch Please test this patch.
(In reply to comment #3) This one seems to work.
Comment on attachment 327726 [details, diff] icu.patch Please provide a patch that also addresses the ridiculous line lengths.
Last patch posted on 30 Oct worked fine with previous libreoffice, but even with patch applied, libreoffice-3.6.3.2 build breaks with: /var/tmp/portage/app-office/libreoffice-3.6.3.2/work/libreoffice-core-3.6.3.2/workdir/unxlngx6.pro/CxxObject/vcl/generic/glyphs/gcach_layout.o:(.data.rel.ro._ZTV21IcuFontFromServerFont[_ZTV21IcuFontFromServerFont]+0x48): undefined reference to `icu::LEFontInstance::mapCharsToGlyphs(char16_t const*, int, int, signed char, icu::LECharMapper const*, signed char, icu::LEGlyphStorage&) const' collect2: error: ld returned 1 exit status
Ok this should be sorted out for 50.1 and newer so please reopen if it is not still fixed.