Reputation: 2744
I am experiencing a problem with ICU4C version 52.
I cross compiled it for TI AM335x board using the toolchain provided by TI (SDK 6.00.00); my development machine is Ubuntu 12.04 LTS 32-bit.
The problem is that when I deploy the library to my target platform and launch any tool (like icuinfo
or even any application which rely on ICU, e.g. a QT application) then it exits with code 1 (and no output is produced). If I strace
the command, I obtain the output you can find here.
In other words, it seems that somebody is calling exit_group(1)
after having loaded libicudata.so.52
.
But why? How can I fix the problem?
Just for reference, here is how I cross-compiled ICU (maybe I've made some mistakes?):
1) first of all I compiled ICU for my development machine:
./configure --host=arm-linux-gnueabihf --prefix=/opt/icu
--disable-samples --disable-tests --with-cross-build=/opt/icupc
followed by:
make && make install
2) then I cross-compiled ICU: I've set my environment variables AR
, CC
, CFLAGS
, LDFLAGS
, LIBS
, CPPFLAGS
, CXX
, CXXFLAGS
, CPP
for pointing to my cross-compiling toolchain and then:
./configure --host=arm-linux-gnueabihf --prefix=/opt/icu
--with-cross-build=/home/morix/devel/icupc/source
followed by:
make && make install
3) at the end I copied the content of /opt/icu
to my target platform and I've tried to run icuinfo
, with no luck (as previously described).
Upvotes: 1
Views: 3432
Reputation: 2744
I found the solution or at least a workaround.
For a reason that I could not determine, ICU fails to load its data (embedded in libicudata.so.52
) at startup (when cross-compiled for ARM using Linaro GCC toolchain).
Digging into ICU documentation I discovered that I could compile ICU to package data in different ways, and I decided to package them in standard files. The configuration of ICU cross-compilation is done this way:
./configure --host=arm-linux-gnueabihf --prefix=/opt/icu
--disable-samples --disable-tests
--with-cross-build=/home/morix/devel/icupc/source
--with-data-packaging=files
At run-time I have then to set my environment variable ICU_DATA
to point to the data folders (which in my case is /opt/icu/share/icu/52.1
) and the magic is done: ICU runs fine (icuinfo
tool terminates with ICU Initialization returned: U_ZERO_ERROR
which indicates success).
Upvotes: 1