使用 Android 独立工具链构建 libiconv 失败
当我尝试使用 Android NDK 独立工具链 (android-ndk-r5-crystax-2) 构建 libiconv 时,我得到 this错误输出。有人可以告诉我可能出了什么问题吗?
我的环境是这样的:
export NDK=$HOME/android/android-ndk-r5-crystax-2
export TOOLCHAIN=$HOME/android/toolchain
export ARCH=armv7-a
export SYSROOT=$TOOLCHAIN/sysroot
export PATH=$PATH:$TOOLCHAIN/bin:$SYSROOT/usr/local/bin
export CROSS_COMPILE=arm-linux-androideabi
export CC=${CROSS_COMPILE}-gcc
export CXX=${CROSS_COMPILE}-g++
export AR=${CROSS_COMPILE}-ar
export AS=${CROSS_COMPILE}-as
export LD=${CROSS_COMPILE}-ld
export RANLIB=${CROSS_COMPILE}-ranlib
export NM=${CROSS_COMPILE}-nm
export STRIP=${CROSS_COMPILE}-strip
export CFLAGS="-DANDROID -mandroid -fomit-frame-pointer --sysroot $SYSROOT -march=$ARCH -mfloat-abi=softfp -mfpu=vfp -mthumb"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-L${NDK}/sources/crystax/libs/armeabi-v7a -lcrystax"
When I try to build libiconv using the Android NDK standalone toolchain (android-ndk-r5-crystax-2), I get this error output. Can someone please tell me what might be wrong?
My environment looks like this:
export NDK=$HOME/android/android-ndk-r5-crystax-2
export TOOLCHAIN=$HOME/android/toolchain
export ARCH=armv7-a
export SYSROOT=$TOOLCHAIN/sysroot
export PATH=$PATH:$TOOLCHAIN/bin:$SYSROOT/usr/local/bin
export CROSS_COMPILE=arm-linux-androideabi
export CC=${CROSS_COMPILE}-gcc
export CXX=${CROSS_COMPILE}-g++
export AR=${CROSS_COMPILE}-ar
export AS=${CROSS_COMPILE}-as
export LD=${CROSS_COMPILE}-ld
export RANLIB=${CROSS_COMPILE}-ranlib
export NM=${CROSS_COMPILE}-nm
export STRIP=${CROSS_COMPILE}-strip
export CFLAGS="-DANDROID -mandroid -fomit-frame-pointer --sysroot $SYSROOT -march=$ARCH -mfloat-abi=softfp -mfpu=vfp -mthumb"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="-L${NDK}/sources/crystax/libs/armeabi-v7a -lcrystax"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
运行配置脚本时,您应该指定:
gl_cv_header_working_stdint_h=yes。
示例:
祝你好运。
when run configure script, you shoud specify:
gl_cv_header_working_stdint_h=yes.
Example:
Good luck.
我也有同样的问题。事实证明,该库仍将被构建,这是构建过程中失败的其他部分。 make install,你应该会看到 libiconv 已安装,尽管它返回失败。
另外,当您使用闪亮的新 libiconv 时,共享版本将无法工作,因为它需要使用版本化的 soname (libiconv.so..),但 android-ndk 则不然对此感到高兴。确保将其构建为静态的,这样就可以了。
I had the same problem. Turns out, the library will still be built, this is some other part of the build process that is failing. make install and you should see libiconv installed, despite it returning failue.
Also, when you go to use your shiny new libiconv, the shared version won't work because it will want to use the versioned soname (libiconv.so..) but android-ndk isn't too happy about that. Make sure you build it static, and you'll be good.