gcc:编译:目标主机、编译主机、编译环境、运行环境

这里主要说一下目标主机的概念;

下面这个连接里,嵌套说了一下主机环境与目标主机的概念。这里为什么要说这个概念,原因systemtap也牵扯到编译主机与目标主机。
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/5/html/systemtap_beginners_guide/cross-compiling

作为C、C++的程序员,我们需要这个概念要放到潜意识里,作为一个常识。
当前编译主机:就是编译的一个环境;
目标主机,就是生成的二进制程序文件,需要安放的一个生成环境,测试环境。

当然,编译环境和目标环境可以是一台机器,但是多数情况下是不同的主机。

主要是需要确保编译环境与目标环境:各种基础软件的版本一致性,以及采用的架构一致(这里的架构,主要是指硬件:CPU,内存,主板);如果不一致,就会出现各种奇奇怪怪的问题。

host system — the system on which you compile the instrumentation modules (from SystemTap scripts), to be loaded on target systems.
target system — the system for which you are building the instrumentation module (from SystemTap scripts).
target kernel — the kernel of the target system. This is the kernel on which you wish to load/run the instrumentation module.

猜你喜欢

转载自blog.csdn.net/qq_36428903/article/details/125815115