gpt4 book ai didi

compilation - 使用automake进行交叉编译时,重要的是什么?

转载 作者:行者123 更新时间:2023-12-02 10:54:55 25 4
gpt4 key购买 nike

简单地回答这个问题可能并不容易,但是我不认为它是开放式的:使用automakeconfigure交叉编译库时,为避免“工具链泄漏”,我需要做的最重要的事情是什么?

这是一些背景...

首先,这里定义了一个工具链泄漏:http://landley.net/writing/docs/cross-compiling.html

我正在使用工具链从源代码编译libuuid,该工具链是为将在基于定制debian的系统上运行的交叉编译代码而设计的。该项目的目标是使用工具链编译代码(包括我的应用程序依赖的第3方库),以便编译独立于主机。

到目前为止,我已经尝试提供工具链的gcc编译器,该编译器看起来还可以,但是当我运行./configure时,它会检查很多东西,而且我不确定如何分辨哪一个真正重要,我不确定如何只在我的工具链中 checkin 并忽略主机系统上的任何内容。这里有一些例子:

在这里,您可以看到./configure对我的工具链编译器感到满意:

checking whether we are using the GNU C compiler... yes
checking whether <toolchain>/bin/i686-linux-gcc accepts -g... yes

然后不久,您可以看到它在我的主机系统上找到了 grep,这似乎是“工具链泄漏”
checking for grep that handles long lines and -e... /bin/grep

然后,稍后在主机系统中搜索一些 header 。我想我可以指定它的外观,但我仍然不知道需要哪些 header :
checking for linux/compiler.h... no
checking for linux/blkpg.h... yes
checking for linux/major.h... yes
checking asm/io.h usability... no
<...>

最佳答案

Then shortly after you can see it finds grep on my host system which seems like a 'toolchain leak'



我不会将其称为“工具链泄漏”,并且引用的文章也没有。它确实将这些事情称为“泄漏”:
  • autoconf --build 系统的头文件不正确(在本文和您的文章中称为“主机”)。
  • --build系统
  • 中的库不正确

    我认为我使用过的任何工具链都不具有自己的 grep可执行文件。它会有什么不同?

    话虽如此,它不应该使用 --buildlinux header 。通常,工具链具有它们自己的副本。那将是一个“泄漏”。

    I'm compiling libuuid from source using a toolchain that is made for cross compiling code that will run on a custom debian based system. The goal of the project is to compile the code (including this 3rd party library that my app depends on) using the toolchain so that the compilation is independent of the host machine.



    它将是这样的:使用工具链编译依赖项,并将其安装在工具链 /usr/lib中(或者,如果您不想使工具链困惑,则计划在其中保留交叉编译的库)。使用工具链编译 libuuid(当然是引用依赖项)。

    关于compilation - 使用automake进行交叉编译时,重要的是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20966394/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com