交叉编译gdisk for arm

时间:2016-05-01 01:02:29

标签: android arm cross-compiling

我的构建机器是 android@builduntu-VM:~/gdisk-0.8.10$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 15.04 Release: 15.04 Codename: vivid

我正在尝试为armeabi-v7a(Android)编译,所以我已经下载了位于/ usr / arm的arm-linux-androideabi工具链......

android@builduntu-VM:~/gdisk-0.8.10$ cd /usr android@builduntu-VM:/usr$ ls arm-linux-androideabi arm-linux-gnueabi arm-linux-gnueabihf bin games include lib lib32 libx32 local sbin share src x86_64-linux-gnu

我的makefile看起来像这样

CC=gcc

CXX=g++

CFLAGS+=-D_FILE_OFFSET_BITS=64

#CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16

CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64

LDFLAGS+=

LIB_NAMES=crc32 support guid gptpart mbrpart basicmbr mbr gpt bsd parttypes attributes diskio diskio-unix

MBR_LIBS=support diskio diskio-unix basicmbr mbrpart

LIB_OBJS=$(LIB_NAMES:=.o)

MBR_LIB_OBJS=$(MBR_LIBS:=.o)

LIB_HEADERS=$(LIB_NAMES:=.h)

DEPEND= makedepend $(CXXFLAGS)

我用export来设置我的CC变量

`android@builduntu-VM:/usr/arm-linux-androideabi/bin$ export CC="/usr/arm-linux-androideabi/"`

android@builduntu-VM:/usr/arm-linux-androideabi/bin$ echo $CC

/usr/arm-linux-androideabi/

当我运行make并检查文件时,文件是针对错误的体系结构编译的。我做错了什么?

`android@builduntu-VM:~/gdisk-0.8.10$ file gdisk`

gdisk: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=3d45ba9c70e1f17380da4669047ef67ace3a083a, not stripped

0 个答案:

没有答案