如何交叉构建GZIP?

ysa*_*sap 2 embedded gzip cross-compiling

我正在尝试gzip在 Linux 机器上构建嵌入式平台。我从这里下载了最新的 gzip 发行版。然后,make需要首先运行该configure程序,以便为Makefile特定目标量身定制一个程序。

所以我运行configure并收到一些错误消息。这个问题似乎是几件事的结合。我们的编译器版本称为e-gcc,所以我使用了以下行,并收到此错误:

~/Projects/gzip-1.4$ ./configure CC=e-gcc
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... e-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/home/xyz/Projects/gzip-1.4':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
Run Code Online (Sandbox Code Playgroud)

显然,C编译的程序无法运行,b/c是交叉编译器。该消息说我必须使用该--host选项,但问题是我们在 gcc 中并没有真正定义的名称。但是,我尝试过:

./configure CC=e-gcc --host=epiphany
Run Code Online (Sandbox Code Playgroud)

收到的错误是:

configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c

blah blah blah

checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `epiphany': machine `epiphany' not recognized
configure: error: /bin/bash build-aux/config.sub epiphany failed
Run Code Online (Sandbox Code Playgroud)

最后一件事,我尝试作弊并将主机设置arm为在精神上最接近我们的架构。配置更进一步,但最终也失败并显示以下消息:

checking for GNU libc compatible realloc... no
checking for rmdir... no
configure: error: in `/home/xyz/Projects/gzip-1.4':
configure: error: Your system lacks the rmdir function.
              Please report this, along with the output of "uname -a", to the
              bug-coreutils@gnu.org mailing list.  To continue past this point,
              rerun configure with SKIP_RMDIR_CHECK=yes.
              E.g., ./configure SKIP_RMDIR_CHECK=yes
See `config.log' for more details.
Run Code Online (Sandbox Code Playgroud)

我现在对如何继续一无所知。有什么建议么?

Mar*_*ler 5

嵌入式平台是否具有命令行 gzip 程序有意义的环境?如果您想对为嵌入式平台编写的软件进行 gzip 压缩和解压缩,那么您应该考虑使用zlib

  • zlib 与 gzip 非常相关,由同一作者编写。是的,您可以使用它来压缩和解压缩与 gzip 实用程序兼容的 gzip 流。 (2认同)