2011-04-10 243 views
2

我想用cygwin交叉编译strace到Android模拟器。我用这个article 作为我的出发点。我按照这些instructions安装了交叉编译器。然后,我准备用使用cygwin交叉编译到arm-linux

./configure -host=arm-linux 

现在的Makefile,当我做make我得到以下错误:

$ 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 

这就算我追加-static Makefile中的CFLAGS变量之后(我为什么要发生做这个?)。请帮忙。

这里是线198-206:

case BLKGETSIZE64: 
     if (exiting(tcp)) { 
      uint64_t val; 
      if (syserror(tcp) || umove(tcp, arg, &val) < 0) 
       tprintf(", %#lx", arg); 
      else 
       tprintf(", %" PRIu64, val); 
     } 
     break; 

回答

2

首先,什么是BLKGETSIZE64 #define的作为? 定义中可能会隐藏一个“u64”令牌。

就arm-linux-gcc而言,64位int实际上是一个明确定义的对象吗?只是一个想法...但它一定是,对吧?

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