Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 440156 - dev-libs/icu-50_rc-r1 built with gcc-4.6 breaks building app-office/libreoffice-3.6.2.2 with >=gcc-4.7
Summary: dev-libs/icu-50_rc-r1 built with gcc-4.6 breaks building app-office/libreoffi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Office Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: icu-50_c++11
  Show dependency tree
 
Reported: 2012-10-29 19:30 UTC by Alexandre Rostovtsev (RETIRED)
Modified: 2013-02-06 14:54 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
icu.patch (icu.patch,1.65 KB, patch)
2012-10-29 22:37 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff
icu.patch (icu.patch,1.66 KB, patch)
2012-10-30 01:51 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-10-29 19:30:40 UTC
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.
Comment 1 Arfrever Frehtes Taifersar Arahesis 2012-10-29 22:37:55 UTC
Created attachment 327720 [details, diff]
icu.patch

Please test this patch.
Comment 2 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-10-30 00:09:40 UTC
(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
Comment 3 Arfrever Frehtes Taifersar Arahesis 2012-10-30 01:51:50 UTC
Created attachment 327726 [details, diff]
icu.patch

Please test this patch.
Comment 4 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-10-30 04:14:04 UTC
(In reply to comment #3)

This one seems to work.
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2012-11-01 03:01:20 UTC
Comment on attachment 327726 [details, diff]
icu.patch

Please provide a patch that also addresses the ridiculous line lengths.
Comment 6 Kenton Groombridge 2012-11-03 23:01:48 UTC
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
Comment 7 Tomáš Chvátal (RETIRED) gentoo-dev 2013-02-06 14:54:02 UTC
Ok this should be sorted out for 50.1 and newer so please reopen if it is not still fixed.