+ -
当前位置:首页 → 问答吧 → LFS6.5中采用变量LFS_TGT有何积极意义?

LFS6.5中采用变量LFS_TGT有何积极意义?

时间:2009-10-05

来源:互联网

在.bashrc设置LFS_TGT=$(uname -m)-lfs-linux-gnu
意义何在?

作者: zswlb9999   发布时间: 2009-10-05

引自 http://www.linuxfromscratch.org/lfs/...vironment.html
引用:
The LFS_TGT variable sets a non-default, but compatible machine description for use when building our cross compiler and linker and when cross compiling our temporary toolchain. More information is contained in Section 5.2, “Toolchain Technical Notes”.
貌似是迎合交叉编译所需而新加入的

作者: d00m3d   发布时间: 2009-10-05

应当主要是方便针对 subarch 优化。
LFS 主要用于 x86 机器,i486 i586 i686 ...
之前,老手册,构建系统的类型取决于宿主内核类型。
比如用针对 i486 优化的内核,构建出的系统类型为 i486-pc-linux-gnu.

有时,宿主内核 和 宿主工具链 并不严格匹配,比如,用 x86_64 内核 配合 i686-pc-linux-gnu 的工具链,此时手册就不适用了;
但可以用 youbest 的新方法 http://www.linuxsir.org/bbs/thread357642.html

作者: 聚焦深空   发布时间: 2009-10-06

引用:
作者: zswlb9999
在.bashrc设置LFS_TGT=$(uname -m)-lfs-linux-gnu
意义何在?
我也正在用LFS65更新系统,这个新的用法会导致 ada 不能正常再生,所以我编译时还是改为
引用:
LFS_TGT=i686-pc-linux-gnu

作者: linux001   发布时间: 2009-10-06

clfs2.0
5.3. Build Variables

To account for the possibility that the host and target are the same arch, as cross-compiling won't work when host and target are the same, part of the triplet needs to be changed slightly to add "cross". Set CLFS_HOST using the following command:

export CLFS_HOST="$(echo $MACHTYPE | \
sed "s/$(echo $MACHTYPE | cut -d- -f2)/cross/")"

作者: zswlb9999   发布时间: 2009-10-08