|
|
第一个问题
按照LFS 6.2的文档来看, youbest 大作
http://www.linuxsir.cn/bbs/showthread.php?t=244052提到的
- [color="Red"]cd binutils-build
- make -C ld install
- cd ..
- rm -rf binutils-build
- rm -rf binutils-2.15.94.0.2.2[/color]
- SPECFILE=$(gcc --print-file specs) &&
- sed 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' $SPECFILE > tempspecfile &&
- mv -f tempspecfile $SPECFILE &&
- unset SPECFILE
- rm -vf /tools/lib/gcc/*/*/include/{pthread.h,bits/sigthread.h}
复制代码
红色标记出的并没有在 5.7节中提到.
5.7里是这样的:
- 5.7. Adjusting the Toolchain
- Now that the temporary C libraries have been installed, all tools compiled in the rest of this chapter should be
- linked against these libraries. In order to accomplish this, the linker and the compiler's specs file need to be
- adjusted.
- The linker, adjusted at the end of the first pass of Binutils, needs to be renamed so that it can be properly found
- and used. First, backup the original linker, then replace it with the adjusted linker. We'll also create a link to its
- counterpart in /tools/$(gcc -dumpmachine)/bin
- mv -v /tools/bin/{ld,ld-old}
- mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old}
- mv -v /tools/bin/{ld-new,ld}
- ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
- From this point onwards, everything will link only against the libraries in /tools/lib.
- The next task is to point GCC to the new dynamic linker. This is done by dumping GCC's “specs” file to a
- location where GCC will look for it by default. A simple sed substitution then alters the dynamic linker that
- GCC will use:
- SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs &&
- gcc -dumpspecs > $SPECFILE &&
- sed 's@^/lib/ld-linux.so.2@/tools&@g' $SPECFILE > tempspecfile &&
- mv -vf tempspecfile $SPECFILE &&
- unset SPECFILE
复制代码
不知红色部分的命令是否要执行?
第二个问题
LFS 6.2 Chapter 5.7中提到
- mv -v /tools/bin/{ld,ld-old}
- mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old}
- mv -v /tools/bin/{ld-new,ld}
- ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
复制代码
第三条命令我很疑惑, 即
- mv -v /tools/bin/{ld-new,ld}
复制代码
/tools/bin/ld-new 是如何得到的?
因为我执行后出现了错误.如下:
- lfs:/mnt/lfs/sources$ mv -v /tools/bin/{ld,ld-old}
- `/tools/bin/ld' -> `/tools/bin/ld-old'
- lfs:/mnt/lfs/sources$ mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old}
- `/tools/i686-pc-linux-gnu/bin/ld' -> `/tools/i686-pc-linux-gnu/bin/ld-old'
- lfs:/mnt/lfs/sources$ mv -v /tools/bin/{ld-new,ld}
- [color="Red"]mv: cannot stat `/tools/bin/ld-new': No such file or directory[/color]
- lfs:/mnt/lfs/sources$ ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
- create symbolic link `/tools/i686-pc-linux-gnu/bin/ld' to `/tools/bin/ld'
- lfs:/mnt/lfs/sources$ echo $?
- 0
复制代码
请问这是为什么?
万分感谢!! |
|