首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用cygwin交叉编译到arm-linux

使用cygwin交叉编译到arm-linux
EN

Stack Overflow用户
提问于 2011-04-10 23:00:24
回答 1查看 1.7K关注 0票数 2

我正在尝试使用cygwin to Android模拟器交叉编译strace。我使用这个article作为我的起点。我按照这些instructions安装了交叉编译器。然后,我使用以下命令准备makefile

代码语言:javascript
复制
./configure -host=arm-linux

现在,当我执行make时,我得到以下错误:

代码语言:javascript
复制
$ make
make  all-recursive
make[1]: Entering directory `/home/bruce/strace-4.6'
Making all in tests
make[2]: Entering directory `/home/bruce/strace-4.6/tests'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/bruce/strace-4.6/tests'
make[2]: Entering directory `/home/bruce/strace-4.6'
arm-linux-gcc -DHAVE_CONFIG_H -I.  -I./linux/arm -I./linux -I./linux  -Wall -Wwr
ite-strings -g -O2 -MT block.o -MD -MP -MF .deps/block.Tpo -c -o block.o block.c

block.c: In function `block_ioctl':
block.c:198: error: `u64' undeclared (first use in this function)
block.c:198: error: (Each undeclared identifier is reported only once
block.c:198: error: for each function it appears in.)
block.c:271: error: `BLKTRACESTOP' undeclared (first use in this function)
make[2]: *** [block.o] Error 1
make[2]: Leaving directory `/home/bruce/strace-4.6'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/bruce/strace-4.6'
make: *** [all] Error 2

即使我在Makefile中的CFLAGS变量后面附加了-static,也会发生这种情况(为什么我需要这样做?)请帮帮忙。

下面是198-206行:

代码语言:javascript
复制
case BLKGETSIZE64:
        if (exiting(tcp)) {
            uint64_t val;
            if (syserror(tcp) || umove(tcp, arg, &val) < 0)
                tprintf(", %#lx", arg);
            else
                tprintf(", %" PRIu64, val);
        }
        break;
EN

回答 1

Stack Overflow用户

发布于 2011-06-01 13:11:33

首先,BLKGETSIZE64 #的定义是什么?定义中可能隐藏了"u64“标记。

对于arm-linux-gcc而言,64位int真的是一个定义良好的对象吗?它一定是一个thought...but,对吧?

将-static添加到CFLAGS会导致二进制程序静态链接,而不是动态链接。这意味着它需要运行的所有代码都将被构建到可执行文件中。通常,它会动态链接到共享的对象库(.so文件,Windows下的DLL),但是你不能指望你的程序所需要的特定库包含在嵌入式设备中。而不是在手持设备上安装所有的库,你可以(可能)通过在你的可执行文件中构建相关的部分来节省空间。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5612595

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档