LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1444|回复: 4

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

[复制链接]
发表于 2009-10-5 12:46:10 | 显示全部楼层 |阅读模式
在.bashrc设置LFS_TGT=$(uname -m)-lfs-linux-gnu
意义何在?
发表于 2009-10-5 19:36:20 | 显示全部楼层
引自 http://www.linuxfromscratch.org/ ... ingenvironment.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”.
貌似是迎合交叉编译所需而新加入的
回复 支持 反对

使用道具 举报

发表于 2009-10-5 20:00:54 | 显示全部楼层
应当主要是方便针对 subarch 优化。
LFS 主要用于 x86 机器,i486 i586 i686 ...
之前,老手册,构建系统的类型取决于宿主内核类型。
比如用针对 i486 优化的内核,构建出的系统类型为 i486-pc-linux-gnu.

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

使用道具 举报

发表于 2009-10-6 11:16:36 | 显示全部楼层
Post by zswlb9999;2033215
在.bashrc设置LFS_TGT=$(uname -m)-lfs-linux-gnu
意义何在?


我也正在用LFS65更新系统,这个新的用法会导致 ada 不能正常再生,所以我编译时还是改为
LFS_TGT=i686-pc-linux-gnu
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-10-8 18:40:51 | 显示全部楼层
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/")"
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表