关于ARM-EABI-gcc和交叉编译 [英] About arm-eabi-gcc and cross-compiling

查看:360
本文介绍了关于ARM-EABI-gcc和交叉编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要被移植到一个复杂的开源库 的Andr​​oid NDK。首先,我需要配置(。/配置)。我明白: 我要做的交叉编译/家庭/用户/ Android的NDK /编译/ prebuilt / Linux的86 / ARM-EABI-4.4.0 /斌/ ARM-EABI-gcc的 我想,对不对?该实用程序将正确配置的库?如果 是的,那么问题2:

I have a complicated open source library that needs to be ported to Android NDK. First, I need to configure (. / Configure). I understand: I have to do cross-compile with / home/user/android-ndk/build/prebuilt/ linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc I think right? This utility will correctly configures a library? If yes, then question 2:

1.I'm试图编译这样的库:礼包。使用以下命令:

1.I'm trying to compile such a library: libao. use these commands:


PREBUILT = / home/user/android-ndk/build/prebuilt/linux-x86/arm- 
eabi-4.4.0 
PLATFORM = / home/user/android-ndk/build/platforms/android-3/arch-arm 
INSTALL = / home/user/sox-14.3.2/com 

export CC = "/ home/user/android-ndk/build/prebuilt/linux-x86/arm- 
eabi-4.4.0/bin/arm-eabi-gcc" 
export CFLAGS = "-fPIC-DANDROID" 
export LDFLAGS = "-Wl,-T, $ PREBUILT / arm-eabi / lib / ldscripts / 
armelf.x-Wl,-rpath-link = $ PLATFORM / usr / lib-L $ PLATFORM / usr / 
lib-nostdlib $ PREBUILT / lib/gcc/arm-eabi/4.4.0/crtbegin.o $ PREBUILT/ 
lib/gcc/arm-eabi/4.4.0/crtend.o-lc-lm-ldl " 

. / Configure - host = arm - with-gnu-ld - enable-shared \ 

在大会结束时收到以下: 配置:错误:没有在这个平台上找到16位的类型!

At the end of the assembly receive the following: configure: error: No 16 bit type found on this platform!

这到底意味着什么?如何修复和正确配置库? 也许我能以某种方式更方便,你可以配置磁带库?

What could this mean? How to fix and properly configure the library? Maybe I can somehow easier you can configure the library?

推荐答案

我觉得这是很难(甚至不可能)使用./configure脚本建立库为Android。 Android有它自己的建筑体系 Android.mk 原生code,我觉得这将是最容易的方式。你必须prepare这样的makefile文件手动,然后使用NDK-build脚本来与NDK。加上NDK样本安装,您可以检查那里的文件怎么这么会是什么样子。

I think it is hard (or even impossible) to use ./configure script to build library for Android. Android has its own building system Android.mk for native code and I think this will be the easiest way to go. You have to prepare such makefile manually and then use ndk-build script that come with NDK. Together with NDK samples are installed and you can check there how such file may look like.

如果您只想运行配置生成的config.h请点击此链接<一个href="http://warpedtimes.word$p$pss.com/2010/02/03/building-open-source-libraries-with-android-ndk/">http://warpedtimes.word$p$pss.com/2010/02/03/building-open-source-libraries-with-android-ndk/. 它包含的信息如下一套的./configure参数可能会奏效

If you want to just run configure to generate config.h please follow this link http://warpedtimes.wordpress.com/2010/02/03/building-open-source-libraries-with-android-ndk/. It contains information that following set of parameters for ./configure might work

./configure –host=arm-eabi CC=arm-eabi-gcc CPPFLAGS="-I$ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/include/" CFLAGS="-nostdlib" LDFLAGS="-Wl,-rpath-link=$ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/lib/ -L$ANDROID_ROOT/build/platforms/android-3/arch-arm/usr/lib/" LIBS="-lc "

这篇关于关于ARM-EABI-gcc和交叉编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆