作者feelthat (云端传送)
看板Programming
标题[讨论] configure build host target 什麽意思
时间Sat May 20 04:29:18 2023
ubuntu x86_64 or linux
若要编译一包 open source 通常会使用到
./configure --build=xxx-linux-gnu --host=xxx-linux-gnu --target=xxx-linux-gnu
这里给出几个解释 让大家真正了解定义
https://sensperiodit.files.wordpress.com/2011/04/hagen-the-definitive-guide-to-gcc-2e-apress-2006.pdf
CHAPTER 11 COMPILING GCC P.233
The build system is the machine on which you build GCC;
the host system is the machine on which the completed compiler will run;
and the target system is the machine for which the compiler will generate code.
refer to:
GCC source
https://ftp.gnu.org/gnu/gcc
AR AS LD binutils source
https://ftp.gnu.org/gnu/binutils
//
https://stackoverflow.com/questions/47010422/cross-compilation-terminologies-build-host-and-target
I have a PowerPC machine making a compiler that you will run on an x86
machine that will make binaries that run on an ARM.
That makes the PPC the build,
the x86 the host,
and the target is the ARM
//
https://blog.csdn.net/liufuchun111/article/details/81509651
./configure --build=i386-linux --host=powerpc-linux --target=powerpc-linux
利用i386-linux(--build)的编译器对gcc进行编译
编译出来的gcc运行在powerpc-linux(--host)
这个gcc用来编译能够在powerpc-linux(--target)运行的代码。
//
https://linux.die.net/man/1/config.guess
config.guess
This script will guess the type of the 'build' machine.
//
https://github.com/gcc-mirror/gcc/blob/master/config.guess
Note: NetBSD doesn't particularly care about the vendor
portion of the name. We always set it to "unknown".
//
EX: ./configure --build=x86_64-unknown-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
build:
编译 GCC source 与 编译 AR AS LD source
是在 x86_64 未知制造商的 linux 系统
host:
GCC & AR AS LD 在 86_64-linux 执行 hello_world.c 的编译
target:
hello_world 在 CPU 为 arm64 的系统下执行
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 218.187.81.159 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Programming/M.1684528169.A.FBE.html
※ 编辑: feelthat (218.187.81.159 台湾), 05/20/2023 22:40:13