本文介绍了交叉编译的ICU4C不起作用(所有应用程序均以代码“ 1”退出)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了ICU4C 52版的问题。

I am experiencing a problem with ICU4C version 52.

我使用TI提供的工具链(SDK 6.00.00)为TI AM335x板交叉编译了该代码;我的开发机器是32位Ubuntu 12.04 LTS。

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.

问题是,当我将库部署到目标平台并启动任何工具(例如 icuinfo 或什至是任何依赖ICU的应用程序,例如QT应用程序,然后它就会以代码1退出(并且不会产生任何输出)。如果我执行 strace 命令,则获得的输出可以找到。

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.

换句话说,似乎有人加载 libicudata.so.52 后调用 exit_group(1)

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?

仅供参考,这是我交叉编译ICU的方式(也许我已经犯了一些错误?):

Just for reference, here is how I cross-compiled ICU (maybe I've made some mistakes?):

1)首先,我为开发机器编译了ICU:

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

接着是:

make && make install

2)然后交叉编译ICU:我已将环境变量设置为 AR CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CPP 指向我的交叉编译工具链,然后:

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

其后为:

make && make install

3)复制 / opt /的内容icu 到我的目标平台,并且我尝试运行 icuinfo ,但是没有运气(如前所述)。

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).

推荐答案

我找到了解决方案,或者至少是一种解决方法。

I found the solution or at least a workaround.

由于我无法确定的原因,ICU在启动时(使用为ARM交叉编译时)无法加载其数据(嵌入在 libicudata.so.52 中)。 Linaro GCC工具链)。

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).

深入ICU文档,我发现我可以编译ICU以不同的方式打包数据,因此我决定将它们打包到标准文件中。 ICU交叉编译的配置是通过以下方式完成的:

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

在运行时,我必须设置环境变量 ICU_DATA 指向数据文件夹(在我的情况下为 /opt/icu/share/icu/52.1 ),魔术是完成:ICU运行正常( icuinfo 工具终止,返回 ICU初始化返回:U_ZERO_ERROR 表示成功)。

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).

这篇关于交叉编译的ICU4C不起作用(所有应用程序均以代码“ 1”退出)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 22:31