使用arm-linux-androideabi-4.4.3编译ICU

2024-01-03

我想使用 Cygwin 交叉编译 Android 的 ICU 静态库。到目前为止,我已经能够配置和制作 Cygwin/MSVC 和 Cygwin 版本。我已经安装了android-ndk-r7,并且可以在toolchains目录中看到gcc的版本。有几个例子建议使用 host:arm-eabi - 但这在我的机器上不存在。

我已经复制了mh-linux to mh-未知 in /icu/源/配置并运行以下命令:

export HOST_ICU=/cygdrive/d/__/External/SQLite/icu
export ICU_CROSS_BUILD=/cygdrive/d/__/External/SQLite/icu-cygwin
export NDK_ROOT=/cygdrive/d/__/android-ndk-r7
export CPPFLAGS="-I$NDK_ROOT/platforms/android-8/arch-arm/usr/include/ -O3 -fno-short-wchar -DU_USING_ICU_NAMESPACE=0 -DU_GNUC_UTF16_STRING=0 -fno-short-enums -nostdlib"
export CXXFLAGS="-I$NDK_ROOT/platforms/android-8/arch-arm/usr/include/ -O3 -fno-short-wchar -DU_USING_ICU_NAMESPACE=0 -DU_GNUC_UTF16_STRING=0 -fno-short-enums -nostdlib"
export CFLAGS="-I$NDK_ROOT/platforms/android-8/arch-arm/usr/include/ -O3 -fno-short-wchar -DU_USING_ICU_NAMESPACE=0 -DU_GNUC_UTF16_STRING=0 -fno-short-enums -nostdlib"
export LDFLAGS="-lc -Wl,-rpath-link=$NDK_ROOT/platforms/android-8/arch-arm/usr/lib/ -L $NDK_ROOT/platforms/android-8/arch-arm/usr/lib/"

$HOST_ICU/source/configure --with-cross-build=$ICU_CROSS_BUILD --enable-extras=no --enable-strict=no --enable-static --enable-shared=no --enable-tests=no --enable-samples=no --enable-dyload=no --enable-tools=no --host=arm-eabi --with-data-packaging=archive

我收到以下错误:

checking for ICU version numbers... release 4.8.1.1, library 48.1.1, unicode version 6.0
checking build system type... i686-pc-cygwin
checking host system type... arm-unknown-eabi
checking target system type... arm-unknown-eabi
checking whether to build debug libraries... no
checking whether to build release libraries... yes
checking for arm-eabi-gcc... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/cygdrive/d/Projects/__/External/SQLite/icu-android':
configure: error: C compiler cannot create executables
See `config.log' for more details

我确信这是一个“愚蠢”的问题,但是如何让 ICU 配置脚本指向 $NDK_ROOT\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\arm-linux- 下的 gcc androideabi\bin?我是否缺少一些设置或安装?我应该设置我的路径以便第一个gcc找到的是其中的一个ARM-Linux-Androideabi?

更新1。我刚刚注意到windows\arm-linux=androideabi\bin包含gcc, 窗口\bin包含ARM-Linux-androideabi-gcc。我怎样才能让 ICU 调用这个?

更新2。根据 Steven R. Loomis 的建议,我从 config.sub 和 config.guess 获取了更新

http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD

placed android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin进入我的路径,并使用 --host=arm-linux-androideabi 重新运行配置...这次:

checking for arm-linux-androideabi-gcc... arm-linux-androideabi-gcc
checking whether the C compiler works... no

绝对更接近。 config.log 中的详细错误

gcc version 4.4.3 (GCC)
configure:3125: $? = 0
configure:3114: arm-linux-androideabi-gcc -V >&5
arm-linux-androideabi-gcc.exe: '-V' option must have argument
configure:3125: $? = 1
configure:3114: arm-linux-androideabi-gcc -qversion >&5
arm-linux-androideabi-gcc.exe: unrecognized option '-qversion'
arm-linux-androideabi-gcc.exe: no input files
configure:3125: $? = 1
configure:3145: checking whether the C compiler works
configure:3167: arm-linux-androideabi-gcc -I/cygdrive/d/Projects/android-ndk-r7/platforms/android-8/arch-arm/usr/include
/ -O3 -fno-short-wchar -DU_USING_ICU_NAMESPACE=0 -DU_GNUC_UTF16_STRING=0 -fno-short-enums -nostdlib -I/cygdrive/d/Projec
ts/android-ndk-r7/platforms/android-8/arch-arm/usr/include/ -O3 -fno-short-wchar -DU_USING_ICU_NAMESPACE=0 -DU_GNUC_UTF1
6_STRING=0 -fno-short-enums -nostdlib -lc -Wl,-rpath-link=/cygdrive/d/Projects/android-ndk-r7/platforms/android-8/arch-a
rm/usr/lib/ -L /cygdrive/d/Projects/android-ndk-r7/platforms/android-8/arch-arm/usr/lib/ conftest.c  >&5
D:/Projects/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/
4.4.3/../../../../arm-linux-androideabi/bin/ld.exe: cannot find -lc
collect2: ld returned 1 exit status
configure:3171: $? = 1
configure:3209: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3214: error: in `/cygdrive/d/Projects/__/External/SQLITE/icu-android':
configure:3216: error: C compiler cannot create executables
See `config.log' for more details

更新3。对 config.sub 和 config.guess 的更改起作用,因为我们现在使用正确的 gcc 编译器。 -lc 失败来自于无法找到 libc.so (位于 android-ndk-r7/platforms/android-8/arch-arm/usr/lib 中,即使它位于 LDFLAGS 中。我确实有一个原始 LDFLAGS 中 -L 之后的额外空格,但删除它并没有帮助。

更新4。根据较旧的帖子http://groups.google.com/group/android-ndk/browse_thread/thread/46295616a889bc12 http://groups.google.com/group/android-ndk/browse_thread/thread/46295616a889bc12

“Windows NDK 工具链(幸运的是)是 Windows 原生的,所以它 不通过 cygwin 翻译层进行翻译 /cygdrive 路径。”

更新5。将 /cygdrive/d/ 的所有实例交换为 D:/。现在C编译器可以工作了,但仍然不能编译。怀疑 ICU_CROSS_BUILD 必须位于 icu/source 目录中。

checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-androideabi-gcc accepts -g... yes
checking for arm-linux-androideabi-gcc option to accept ISO C89... none needed
checking for arm-linux-androideabi-g++... arm-linux-androideabi-g++
checking whether we are using the GNU C++ compiler... yes
checking whether arm-linux-androideabi-g++ accepts -g... yes
checking how to run the C preprocessor... arm-linux-androideabi-gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for gmake... /usr/bin/gmake
configure: error: D:/Projects/__/External/SQLite/icu-cygwin/config/icucross.mk not found. Please build ICU in
 D:/Projects/__/External/SQLite/icu-cygwin first.

更新6。我在 icu-cygwin 中重新配置并重新构建了我的 Cygwin 文件夹。想想吧,这次 icucross.mk 就在那里。配置成功!但...

Update 7 Make结局并没有那么好。

$ make
D:/Projects/__/External/SQLite/icu/source/config/mh-linux:41: *** target pattern contains no `%'.  Stop.

什么?!?!看来现在我们又想要 Cygwin 路径了..:(

更新8.更改了我的路径,以便 HOST_ICU 和 ICU_CROSS_BUILD 使用 Cygwin 路径,但 NDK_ROOT 是 Windows 路径(因为 Android NDK ld 无法处理 cygwin 路径)。

这次更进一步,但是

arm-linux-androideabi-gcc.exe: /cygdrive/d/Projects/__/External/SQLit                                                                 e/icu/source/stubdata/stubdata.c: No such file or directory
arm-linux-androideabi-gcc.exe: no input files

看来必须要发生的是arm-linux-androideabi-gcc需要为cygwin制作,否则交叉构建将无法工作。

更新9.看来arm-linux-androideabi-gcc不支持cygwin路径 - 尽管ndk_build支持。但是,ICU 设置为调用 arm-linux-androideabi-gcc,而“make”需要 cygwin 路径。也许是时候切换到 OSX 或 Linux 来执行此操作了。

更新 10 - 仍然没有成功。 Cygwin- 显然,arm-linux-androideabi Crystax 构建也不支持 -L 中的 cygwin 路径。尝试在 Cygwin 下交叉编译将给出 -lc 错误,因为它无法解析库的 -L/cygdrive/d/... 路径。更改为 D:/ 有帮助,但稍后会导致 make 失败,因为它是 Cygwin make。

Linux- 使用正常的 NDK r7 构建,配置将失败并出现 wchar_t = 0 错误。 Crystax NDK 构建将修复此问题,并且 make 将失败并抱怨 Android 的 sys/type.h 中的 uint64_t。看Android NDK 中的 ICU 库 https://stackoverflow.com/questions/4168962/icu-library-in-android-ndk/9224077#9224077。您可以强制定义它,这将导致另一个有关大小不匹配的错误。

OSX- 可能是最成功的,使用官方构建或 Crystax 构建进行编译,它直接导致 uint64_t 错误。如果你绕过它,它会引导你

icu/source/common/ustrenum.cpp:118: error: must #include <typeinfo> before using typeid

Help!


00.下载安卓ndkhttp://developer.android.com/tools/sdk/ndk/index.html http://developer.android.com/tools/sdk/ndk/index.html

example install d:\android-r9b

01.下载安装示例d:\msys MSys http://www.mingw.org/wiki/MSYS http://www.mingw.org/wiki/MSYS 1.01

02.下载 gcc 3.8.1 w64http://mingw-w64.sourceforge.net/ http://mingw-w64.sourceforge.net/示例安装d:\mingw32_64

03.下载icue版本52.1http://site.icu-project.org/download/52#TOC-ICU4C-Download http://site.icu-project.org/download/52#TOC-ICU4C-Download

04.提取icu源代码到d:\icu

05. Enter msys use export PATH=/d/msys/1.0/bin:/d/ming32_64/mingw32/bin:$PATH

06. cd /d/icu;mkdir mingw;mkdir android;cd mingw

这是遵循 icu readme.html 交叉编译步骤

07. cd /d/icu/ming ;../source/runConfigureICU MinGW ;make

没问题,一切正常并且正在运行/d/icu/mingw/bin生成稍后交叉编译的工具。

08. cd /d/icu/android

09. /d/android-ndk-r9b/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=/d/androidgcc/ -- toolchain=arm-linux-androideabi-4.8

如果使用 Windows 7/8 64 位添加附加选项:--system=windowx86_64

10. export PATH再次;export PATH=/d/msys/1.0/bin/:/d/androidgcc/bin/:/d/androidgcc/arm-linux-androideabi/bin/

该路径必须包含ar.exe执行创建库。

11.创建共享库。

sh ../source/configure --host=armv6-google-linux --enable-shared=yes --disable-static -with-cross-build=/d/icu/mingw CC=arm-linux-androideabi-gcc CXX=arm-linux-androideabi-g++ AR=arm-linux-androideabi-ar --with-data-packaging=archive

12. make

一切顺利

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用arm-linux-androideabi-4.4.3编译ICU 的相关文章

  • Realm 中的更新语句

    I have VisitingCardPOJO表格 我想更新单个条目说在哪里no 3 VisitingCardPOJO java public class VisitingCardPOJO extends RealmObject Prima
  • 模仿 youtube/gmail 应用程序的导航抽屉

    背景 近几个月来 谷歌发布了Youtube 应用程序 http www androidpolice com 2013 08 19 breaking massive youtube for android v5 0 update brings
  • GCM 无法唤醒设备

    我正在开发 GCM 应用程序 当设备不空闲时 即按电源按钮休眠 一切正常 但是 当我在设备空闲时发送消息时 设备不会唤醒 我做了以下事情 已验证服务器应用程序中的delay while idle未设置为true 每条消息使用不同的折叠键 多
  • Android版本App更新代码

    我读到如果我们想更新Google Play中的应用程序 版本代码应该高于以前的apk文件 我有一个版本代码为 20 且版本名称为 1 0 的应用程序 那么要更新app 应该如何增加版本号呢 应该增加10吗 或者仅仅 1 就足够了 即版本代码
  • 在android中从JSON生成listview

    我对 Android 完全陌生 目前正在尝试从从我的服务器中提取的 JSON 数组生成列表视图 我已经阅读了很多教程 但没有运气 有一种独特的方法可以做到这一点 请您指出一些适合开始的资源 我读过了this http www josecgo
  • 更新到 Kotlin 1.3.30 后出现“未解析的引用:Parcelize”

    我使用 Kotlin 1 3 21 很长时间了kotlin android extensions插件长期处于实验模式 今天我通过升级版本切换到 Kotlin 1 3 30 现在无论我使用什么 Parcelize注释我看到错误 Unresol
  • 是否可以将自定义属性添加到 Android 资源的样式中?

    我在我的项目中使用视图流组件 它允许开发人员覆盖一些属性 例如
  • Monodroid 示例/带有源代码的小部件

    我是一名 NET 开发人员 我对用 C 开发 Android 应用程序感兴趣 并且我得到了 monodroid 是否有任何来源可以让我获得 monodroid 示例应用程序 带有源代码 这将帮助我在 monodroid 中开发应用程序 或者
  • 如何向 Android Studio 中的现有项目添加新活动?

    在 Eclipse 中 您只需单击 新建 按钮并选择 Android 活动即可添加新活动 但 Android Studio 有点不同 我无法找到如何向项目添加新活动 要添加一个Activity使用 Android Studio 此步骤与添加
  • 如何在单个查询中搜索 RealmObject 的 RealmList 字段

    假设我有一堂课 public class Company extends RealmObject private String companyId private RealmList
  • Android 无法解析日期异常

    当尝试解析发送到我的 Android 客户端的日期字符串时 我得到一个无法解析的日期 这是例外 java text ParseException 无法解析的日期 2018 09 18T00 00 00Z 位于 偏移量 19 在 java t
  • 将人类日期(当地时间 GMT)转​​换为日期

    我正在服务器上工作 服务器正在向我发送 GMT 本地日期的日期 例如Fri Jun 22 09 29 29 NPT 2018在字符串格式上 我将其转换为日期 如下所示 SimpleDateFormat simpleDateFormat ne
  • PhoneGap 1.4 封装 Sencha Touch 2.X - 性能怎么样?

    我正在构建一个多平台平板电脑应用程序 仅使用其 Webview 使用 Phonegap 1 4 对其进行包装 然后使用 Sencha Touch 2 框架发挥我的魔力 我所说的多平台是指 iOS 5 X 和 Android 3 0 目前 到
  • react-native android fontFamily 不生效

    问题一 我在index android js的欢迎样式中添加了fontFamily 但没有效果 fontFamily 真的可以在 Android 上使用吗 欢迎 字体大小 20 fontFamily roboto thin 文本对齐 居中
  • 蓝牙发送和接收文本数据

    我是 Android 开发新手 我想制作一个使用蓝牙发送和接收文本的应用程序 我得到了有关发送文本的所有内容逻辑工作 但是当我尝试在手机中测试它时 我看不到界面 这是Main Activity Code import android sup
  • Android TextureView 和硬件加速

    我正在尝试实现上所示的示例这一页 http developer android com reference android view TextureView html 我已经在运行 android 4 及以上版本的三种不同设备上进行了尝试
  • android系统用户和linux root用户有什么区别

    当我将手机连接到电脑并使用adb shell与我的手机通信并输入的命令ps命令输出当前在我的手机上运行的进程信息 我发现有两个特殊用户 一个是root 另一个是system 据我所知 Android是基于linux的 所以root用户是最大
  • 如何解决 greenDAO 在执行 InsertOrReplace 时“不存在这样的表错误”?

    我正在使用 greenDAO 并且已成功生成所有必需的类和实体 并且我可以看到我的表已创建 但是在要替换的行上放置断点后 我收到一条错误消息 告诉我 不存在这样的表错误 try appTimeUsageDao insertOrReplace
  • Activity 暂停时调用 FragmentManager.popBackStack 是否安全

    的文档FragmentManager popBackStack https developer android com reference android app FragmentManager html popBackStack java
  • Android Espresso 单击按钮时出现错误

    我正在尝试使用 espresso 框架为 Android 应用程序编写一些 UI 测试 现在我只是检查启动屏幕上是否存在所有元素 然后尝试单击登录按钮 单击按钮时 测试由于错误而失败 我似乎无法理解为什么会发生这种情况 我的测试代码是 Ru

随机推荐

  • 为什么 Android aapt 会删除 asset 的 .gz 文件扩展名?

    当我将 GZIP 压缩文件添加到 Android 项目的资源中时 打包项目时 gz 扩展名将被删除 因此 例如 我的资产文件夹中的 foo gz 需要在代码中使用getAssets open foo 我使用的其他扩展名 例如 html 似乎
  • Xamarin 绑定类别返回错误:无法在静态类中声明实例成员

    我正在尝试绑定ReFrostedViewController https github com romaonthego REFrostedViewController到 c 我使用 Objective Sharpie 来生成界面 但是当我使
  • 调试 JBoss 100% CPU 使用率

    最初发布关于服务器故障 https serverfault com questions 122065 debugging jboss 100 cpu usage 有人建议这个问题最好在这里问 我们正在使用 JBoss 运行两个 WAR 一个
  • 关于 LoadFunc 的示例和更多说明

    在哪里可以找到有关 LoadFunc 的更多信息 示例 除了http web archive org web 20130701024312 http ofps oreilly com titles 9781449302641 load an
  • OpenCV 设置键盘事件回调

    我在 OSX 和 Ubuntu 系统上使用 C 中的 openCV 我想要一个等效的函数setMouseCallback但对于键盘事件 按下按键 据我所知 在 openCV 中执行此操作的方法是使用waitKey 但实际上它不能用作回调 因
  • 如何动态添加 ng-click 处理程序

    我尝试在之前生成的按钮 动态 上添加 ng click 但效果不佳 我也尝试过在这个论坛上找到的所有解决方案 但没有一个能很好地工作 我的html代码 div class container max height div content d
  • 等待'background-image' css样式完全加载

    我的应用程序正在 Angular 5 中开发 我想先加载背景图片 div class sign in 然后才加载页面的其余部分 已经尝试过 窗口加载 窗口 文档 onload document getElementById mainDiv
  • 如何在iPhone中实现VoIP+SIP? [关闭]

    Closed 这个问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 我想为 iPhone 开发 VoIP 应用程序 但我不知道 VoIP 概念的基础知识 也不知道是否有任
  • msbuild PackageReference.PrivateAssets = 全部似乎不起作用

    我有一个引用 NUnit3TestAdapter 的测试项目 我不会将此引用复制到依赖于此的项目 我认为设置 PrivateAssets All 就可以了 但显然我误解了它的工作原理 因为它没有达到预期的效果 这是代码 汇总 Rollup
  • Java中字符与int的转换

    您无法从 int 转换为 char 因此这是非法的int i 88 char c i 然而这是允许的char c 88 不是一个普通的数字并且int文字 这怎么被允许呢 char实际上是 Java 中的无符号 16 位整数类型 与其他整数类
  • 无法通过反射休眠获取字段值

    我在 jpa 中更新对象时遇到问题 我有 Bean 用户 public class User Id GeneratedValue strategy GenerationType IDENTITY Column name id unique
  • 访问Android的OBEX服务器并读取数据

    我想知道是否可以使用 Bluecove 从 Windows 的 Android OBEX 服务器读取数据 联系人 未接来电等 我在 Windows 中尝试了以下代码 但它返回OBEX HTTP NOT ACCEPTABLE连接时 据我所知
  • Marklogic 8 Windows 7 安装后登录

    我已在具有 8Gb 内存的 64 位 Windows 7 计算机上安装了 MarkLogic 8 服务器似乎运行良好 除了我无法登录之外 一切似乎都很好 使用 使用 Marklogic Server 或 管理 Marklogic Serve
  • UIAlertController:addSubview

    我想向我的警报控制器添加一个子视图 但为什么按钮要放在顶部呢 我该如何解决这个问题 let alert UIAlertController title nil message nil preferredStyle UIAlertContro
  • HTTP 错误 404.3 - 未找到 - 由于扩展配置,无法提供您请求的页面

    HTTP 错误 404 3 未找到 由于扩展配置的原因 无法提供您请求的页面 如果页面是脚本 请添加处理程序 如果应下载该文件 请添加 MIME 映射 IIS 7 上托管的 WCF 服务出现此错误的原因可能是什么 已回答here https
  • Groovy 文件无法在 Intellij IDEA 中编译

    我有 Maven 项目 包含 java 和 groovy 测试 在命令行maven编译中 所有测试都在运行 但在我的IDEA项目 由 AutoImport maven项目 自动创建 中 IDEA将groovy文件复制到 target tes
  • IE7 与 Firefox/Opera/Chrome 之间的间距差异

    我对 IE7 与 Firefox Chrome Opera 中无序列表的垂直空间量一直存在问题 而且我似乎找不到解决方案 在IE7中 空间变小了 这也是我希望看到的 在 Firefox Chrome 和 Opera 中 之间的间距大约是原来
  • java.lang.RuntimeException:在android中createWindowSurface失败EGL_BAD_ALLOC

    我为我的应用程序创建了 1080x1920 的自定义 Galaxy S4 AVD 我可以在该 AVD 中运行我的应用程序 几秒钟后它会闪烁并抛出一些像这样的错误 02 05 12 06 39 809 E EGL emulation 829
  • 将泛型参数转换为整数或从整数转换

    我想编写通用类 旨在与内置类型一起使用 例如byte and ushort 在内部计算中 我需要将泛型类型转换为整数 然后再转换回泛型类型 我找到了编译此类代码的方法 例如 class Test
  • 使用arm-linux-androideabi-4.4.3编译ICU

    我想使用 Cygwin 交叉编译 Android 的 ICU 静态库 到目前为止 我已经能够配置和制作 Cygwin MSVC 和 Cygwin 版本 我已经安装了android ndk r7 并且可以在toolchains目录中看到gcc