LinuxSir.cn,穿越时空的Linuxsir!

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

请问各位高人一个sed命令!

[复制链接]
发表于 2008-4-17 16:56:52 | 显示全部楼层 |阅读模式
sed -i \
's|libs -o|libs -L/usr/lib-Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \
        scripts/test-installation.pl
如题,谢谢!
 楼主| 发表于 2008-4-17 17:10:12 | 显示全部楼层
在lfs6.2的6.9小节:
root:/sources/glibc-2.3.6# sed -i \
> 's|libs -o|libs -L/usr/lib-W1,-dynamic-linker=/lib/ld-linux.so.2 \
> -o| '   scripts/test-installation.pl
root:/sources/glibc-2.3.6#
  执行之后,在test-installation.pl之中只有以下最有可能是:
open GCC, "$CC /tmp/test-prg$$.c $link_libs -L/usr/lib -W1,-dynamic-linker=/lib/ld-linux.so.2
-o /tmp/test-prg$$ 2>&1 |"
  or die ("Couldn't execute $CC!");
  哪位大侠能解释一下是怎么回事阿?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-17 18:01:10 | 显示全部楼层
果然出错了,make install 后:
CC="gcc" /usr/bin/perl scripts/test-installation.pl /sources/glibc-build/
cc1: error: unrecognized command line option "-W1,-dynamic-linker=/lib/ld-linux.so.2"
sh: line 1: -o: command not found
Execution of gcc failed!
The script has found some problems with your installation!
Please read the FAQ and the README file and check the following:
- Did you change the gcc specs file (necessary after upgrading from
  Linux libc5)?
- Are there any symbolic links of the form libXXX.so to old libraries?  Links like libm.so -> libm.so.5 (where libm.so.5 is an old library) are wrong,
  libm.so should point to the newly installed glibc file - and there should be
  only one such link (check e.g. /lib and /usr/lib)
You should restart this script from your build directory after you've
fixed all problems!
Btw. the script doesn't work if you're installing GNU libc not as yourprimary library!
make[1]: *** [install] Error 1
make[1]: Leaving directory `/sources/glibc-2.3.6'
make: *** [install] Error 2
root:/sources/glibc-build#
怎么论坛人这么少阿??
回复 支持 反对

使用道具 举报

发表于 2008-4-17 18:07:47 | 显示全部楼层
是-Wl(小写的L,不是1),开始我想当然的把它当作了gcc的警告等级,也在这里搞了半天
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-17 18:51:40 | 显示全部楼层
那现在怎么办那 ?
回复 支持 反对

使用道具 举报

发表于 2008-4-17 20:07:17 | 显示全部楼层
再用sed修改一下

sed -i 's|-W1,|-Wl,|' scripts/test-installation.pl

第一个是数字1,第二个是小写的L,它的作用就是把你写错了的-W1,改成正确的-Wl.
然后直接make install就可以了,这个文件只影响安装,不需要重编译了.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-4-17 23:19:15 | 显示全部楼层
多谢,可惜我不会sed,我是用vi改的!
回复 支持 反对

使用道具 举报

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

本版积分规则

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