顯示具有 GCC 標籤的文章。 顯示所有文章
顯示具有 GCC 標籤的文章。 顯示所有文章

2013年2月7日 星期四

GCC configure : --build --host --target

從知道 Cross Compile 這個名詞以來,就看過這三個參數不知道幾次了,但除了剛開始時有想過這個問題之外,後來就沒仔細了解。這個問題是,這三個參數到底是有什麼差別?以自己的經驗,使用最多也只會的是 --host 這個參數(當要對某個程式做 cross compile 時用的),其他我還真的不了解怎麼用!今天總算對它們比較了解!

首先,根據不同的組合,它們有不同的名稱:

Native compiler: --build, --host, --target 都一樣
例:--build=x86 --host=x86 --target=x86

Cross compiler: --build 和 --host 一樣但 --target 不同
例:--build=SH --host=SH --target=ARM

Crossback compiler: --build 和 --target 一樣但 --host 不同
例:--build=x86 --host=MIPS --target=x86

Crossed native compiler: --host 和 --target 一樣但 --build 不同
例:--build=PPC --host=SPARC --target=SPARC

Canadian compiler: --build, --host, --target 都不一樣
例:--build=ARM --host=SH --target=MIPS