LinuxSir.cn,穿越时空的Linuxsir!

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

安装lfs5.0第五章锁定glibc遇到问题!!

[复制链接]
发表于 2005-2-22 16:05:40 | 显示全部楼层 |阅读模式
按照手册安装LFS5.0,在第五章"锁定(Locking in)" Glibc一节,
检查一下新工具链的基本功能(编译和连接)是否正常时,没看到结果:
[Requesting program interpreter: /tools/lib/ld-linux.so.2]

现象是什么结果也没有:
[lfs@localhost lfs]$ SPECFILE=/tools/lib/gcc-lib/*/*/specs &&
> sed -e 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' \
>     $SPECFILE > tempspecfile
[lfs@localhost lfs]$ mv tempspecfile $SPECFILE &&
> unset SPECFILE
[lfs@localhost lfs]$ rm -f /tools/lib/gcc-lib/*/*/include/{pthread.h,bits/sigthread.h}
[lfs@localhost lfs]$ echo 'main(){}' > dummy.c
[lfs@localhost lfs]$ gcc dummy.c
[lfs@localhost lfs]$ readelf -l a.out | grep ': /tools'
[lfs@localhost lfs]$

我改如何检查错误呢,小弟新手,无从下手啊,拜托斑竹及各位大虾指导一下!!

文档说多数是因为specs文件没改对,我手工编辑不知行不,手动编辑specs文件,“只要把 "/lib/ld-linux.so.2" 替换成 "/tools/lib/ld-linux.so.2" 就行了”,可我不知怎么手工编辑,怎么编,在哪编,specs文件是什么文件,请大虾帮忙指导!!
 楼主| 发表于 2005-2-22 16:13:35 | 显示全部楼层
另外,第一遍安装Glibc-2.3.2运行测试套件make check时有如下错误:

Timed out: the child process got signal Bad system call
make[2]: *** [/mnt/lfs/glibc-build/resolv/tst-leaks.out] Error 1
make[2]: Leaving directory `/mnt/lfs/glibc-2.3.2/resolv'
make[1]: *** [resolv/tests] Error 2
make[1]: Leaving directory `/mnt/lfs/glibc-2.3.2'
make: *** [check] Error 2

是不是属于文档提及的“在老点或慢些的机器上运行时,有些测试会因为超时(timeout)而失败。”的现象,会不回对安装有影响!!
回复 支持 反对

使用道具 举报

发表于 2005-2-22 16:52:23 | 显示全部楼层
使用文本编辑器编辑/tools/lib/gcc-lib/*/*/specs这个文件。

*asm:
%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}

*asm_debug:
%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}

*asm_final:


*asm_options:
%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}

*invoke_as:
%{!S:-o %|.s |
as %(asm_options) %|.s %A }

*cpp:
%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}

*cpp_options:
%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{g*:%{!g0:%{!fno-working-directory:-fworking-directory}}} %{O*} %{undef}

*cpp_debug_options:
%{d*}

*cpp_unique_options:
%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}

*trad_capable_cpp:
cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}

*cc1:
%(cc1_cpu) %{profile:-p}

*cc1_options:
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} %{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*}

*cc1plus:


*link_gcc_c_sequence:
%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}

*endfile:
%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s

*link:
%{!static:--eh-frame-hdr} -m elf_i386 %{shared:-shared}   %{!shared:     %{!ibcs:      %{!static:        %{rdynamic:-export-dynamic}     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}}    %{static:-static}}}

*lib:
%{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}

*libgcc:
%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared-libgcc:-lgcc --as-needed -lgcc_s%M --no-as-needed}%{shared-libgcc:-lgcc_s%M%{!shared: -lgcc}}}}

*startfile:
%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}}    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}

*switches_need_spaces:


*cross_compile:
0

*version:
3.4.1

*multilib:
. ;

*multilib_defaults:


*multilib_extra:


*multilib_matches:


*multilib_exclusions:


*multilib_options:


*linker:
collect2

*link_libgcc:
%D

*md_exec_prefix:


*md_startfile_prefix:


*md_startfile_prefix_1:


*startfile_prefix_spec:


*sysroot_suffix_spec:


*sysroot_hdrs_suffix_spec:


*cc1_cpu:
%{!mtune*: %{m386:mtune=i386 %n`-m386' is deprecated. Use `-march=i386' or `-mtune=i386' instead.
} %{m486:-mtune=i486 %n`-m486' is deprecated. Use `-march=i486' or `-mtune=i486' instead.
} %{mpentium:-mtune=pentium %n`-mpentium' is deprecated. Use `-march=pentium' or `-mtune=pentium' instead.
} %{mpentiumpro:-mtune=pentiumpro %n`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mtune=pentiumpro' instead.
} %{mcpu=*:-mtune=%* %n`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
}} %<mcpu=* %{mpni:-msse3 %n`-mpni' is deprecated. Use `-msse3' instead.
} %{mno-pni:-mno-sse3 %n`-mno-pni' is deprecated. Use `-mno-sse3' instead.
} %{mintel-syntax:-masm=intel %n`-mintel-syntax' is deprecated. Use `-masm=intel'instead.
} %{mno-intel-syntax:-masm=att %n`-mno-intel-syntax' is deprecated. Use `-masm=att' instead.
}

*link_command:
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %{pie:-pie} %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}    %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov}    %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}} %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-22 16:57:59 | 显示全部楼层
谢谢!你现在就去!我上哪能找到看懂这些东东的资料呢?:)
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-22 23:46:39 | 显示全部楼层
楼上的大虾,我打开我的文件看了,好像是正确的啊,蓝色标出的部分好像也改过来了,
可为什么不对呢?specs文件好像没问题!

*asm:
%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}

*asm_debug:
%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}

*asm_final:
%|

*asm_options:
%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}

*invoke_as:
%{!S:-o %{|!pipe:%g.s} |
as %(asm_options) %{!pipe:%g.s} %A }

*cpp:
%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}

*cpp_options:
%(cpp_unique_options) %1 %{m*} %{std*} %{ansi} %{W*&pedantic*} %{w} %{f*} %{O*} %{undef}

*cpp_debug_options:
%{d*}

*cpp_unique_options:
%{C:%{!E:%eGNU C does not support -C without using -E}} %{CC:%{!E:%eGNU C does not support -CC without using -E}} %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I %{MD:-MD %{!o:%b.d}%{o*:%.d%*}} %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}} %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*} %{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}} %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3} %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i %{E|M|MM:%W{o*}}

*trad_capable_cpp:
cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}

*cc1:
%(cc1_cpu) %{profile:-p}

*cc1_options:
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}} %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*} -auxbase%{c|S:%{o*:-strip %*}%{!o*: %b}}%{!c:%{!S: %b}} %{g*} %{O*} %{W*&pedantic*} %{w} %{std*} %{ansi} %{v:-version} %{pg:-p} %{p} %{f*} %{undef} %{Qn:-fno-ident} %{--help:--help} %{--target-help:--target-help} %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}} %{fsyntax-only:-o %j} %{-param*}

*cc1plus:


*link_gcc_c_sequence:
%G %L %G

*endfile:
%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s

*link:
%{!static:--eh-frame-hdr} -m elf_i386 %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static:         %{rdynamic:-export-dynamic}         %{!dynamic-linker:-dynamic-linker /tools/lib/ld-linux.so.2}}         %{static:-static}}}

*lib:
%{pthread:-lpthread}    %{shared:-lc}    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}

*libgcc:
%{static|static-libgcc:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!shared:%{!shared-libgcc:-lgcc -lgcc_eh}%{shared-libgcc:-lgcc_s%M -lgcc}}%{shared:%{shared-libgcc:-lgcc_s%M}%{!shared-libgcc:-lgcc}}}}

*startfile:
%{!shared:      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s}                        %{!p:%{profile:gcrt1.o%s}                          %{!profile:crt1.o%s}}}}    crti.o%s %{static:crtbeginT.o%s}   %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}

*switches_need_spaces:


*predefines:


*cross_compile:
0

*version:
3.3.1

*multilib:
. ;

*multilib_defaults:


*multilib_extra:


*multilib_matches:


*multilib_exclusions:


*multilib_options:


*linker:
collect2

*link_libgcc:
%D

*md_exec_prefix:


*md_startfile_prefix:


*md_startfile_prefix_1:


*startfile_prefix_spec:


*cc1_cpu:
%{!mcpu*: %{m386:-mcpu=i386 %n`-m386' is deprecated. Use `-march=i386' or `-mcpu=i386' instead.
} %{m486:-mcpu=i486 %n`-m486' is deprecated. Use `-march=i486' or `-mcpu=i486' instead.
} %{mpentium:-mcpu=pentium %n`-mpentium' is deprecated. Use `-march=pentium' or `-mcpu=pentium' instead.
} %{mpentiumpro:-mcpu=pentiumpro %n`-mpentiumpro' is deprecated. Use `-march=pentiumpro' or `-mcpu=pentiumpro' instead.
}} %{mintel-syntax:-masm=intel %n`-mintel-syntax' is deprecated. Use `-masm=intel' instead.
} %{mno-intel-syntax:-masm=att %n`-mno-intel-syntax' is deprecated. Use `-masm=att' instead.
}

*link_command:
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:    %(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}    %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}    %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}    %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-23 10:54:31 | 显示全部楼层
等待,期盼中!!!!!!!!!!!!!!!!
回复 支持 反对

使用道具 举报

发表于 2005-2-23 11:38:21 | 显示全部楼层
[lfs@localhost lfs]$ echo 'main(){}' > dummy.c
[lfs@localhost lfs]$ gcc dummy.c
[lfs@localhost lfs]$ readelf -l a.out
这样运行一下。然后把返回信息贴上来看看。
[lfs@localhost lfs]$echo $PATH
把返回信息发上来。
[lfs@localhost lfs]$which gcc
这个结果也贴上来。

在之前编译的binutils,gcc,glibc都正常结束的吗?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-23 14:41:12 | 显示全部楼层
[root@localhost lfs]# echo 'main(){}' > dummy.c
[root@localhost lfs]# gcc dummy.c
[root@localhost lfs]# readelf -l a.out

Elf file type is EXEC (Executable file)
Entry point 0x8048250
There are 6 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  PHDR           0x000034 0x08048034 0x08048034 0x000c0 0x000c0 R E 0x4
  INTERP         0x0000f4 0x080480f4 0x080480f4 0x00019 0x00019 R   0x1
      [Requesting program interpreter: /tools/lib/ld-linux.so.2]
  LOAD           0x000000 0x08048000 0x08048000 0x003e4 0x003e4 R E 0x1000
  LOAD           0x0003e4 0x080493e4 0x080493e4 0x00100 0x00104 RW  0x1000
  DYNAMIC        0x0003f4 0x080493f4 0x080493f4 0x000c8 0x000c8 RW  0x4
  NOTE           0x000110 0x08048110 0x08048110 0x00020 0x00020 R   0x4

Section to Segment mapping:
  Segment Sections...
   00
   01     .interp
   02     .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata
   03     .data .eh_frame .dynamic .ctors .dtors .jcr .got .bss
   04     .dynamic
   05     .note.ABI-tag
[root@localhost lfs]# echo $PATH
/tools/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
[root@localhost lfs]# which gcc
/tools/bin/gcc
[root@localhost lfs]#
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-2-23 15:01:36 | 显示全部楼层
谢谢你,6692975,真的,这里就你给我回复,斑竹都怎么了,上午碰见一个求他半天也不理我!!哭!!!!!!!

之前编译的binutils,gcc,glibc除了glibc,第一遍安装Glibc-2.3.2运行测试套件make check时有如下错误:

Timed out: the child process got signal Bad system call
make[2]: *** [/mnt/lfs/glibc-build/resolv/tst-leaks.out] Error 1
make[2]: Leaving directory `/mnt/lfs/glibc-2.3.2/resolv'
make[1]: *** [resolv/tests] Error 2
make[1]: Leaving directory `/mnt/lfs/glibc-2.3.2'
make: *** [check] Error 2
然后我继续make check到make install
其它应该是正常结束的

现在我的新建的lfs用户不知怎么了,全变成英文了,输入法也没了,主目录等桌面图标页面目全菲,现在我在root下,一切倒正常,不知道怎么了,实在不行我就删掉lfs用户,再建一个,郁闷啊!
不管怎样,谢谢你的支持!!

                                                                            zcleo敬谢!
回复 支持 反对

使用道具 举报

发表于 2005-2-23 15:36:31 | 显示全部楼层
最近斑竹忙一些,过一阵就好了。

你的系统环境,gcc,编译出来的a.out都没问题。
[Requesting program interpreter: /tools/lib/ld-linux.so.2]

[lfs@localhost lfs]$ echo 'main(){}' > dummy.c
[lfs@localhost lfs]$ gcc dummy.c
[lfs@localhost lfs]$ readelf -l a.out
如果这里你看到输出中有这行:
[Requesting program interpreter: /tools/lib/ld-linux.so.2]
就象你帖出来的,但是运行下面这行却没有输出
[lfs@localhost lfs]$ readelf -l a.out | grep ': /tools'
我觉得你可以继续下去,这里使用grep目的就是为了在那一堆输出中提取出
上面那行,便于查看。
为什么grep不能正常显示,真是奇怪 :ask
做lfs的lfs帐户,并不需要使用这个用户的图形界面的。
只要在shell登陆用户为lfs就可以。

如果使用KDE环境,将~/.kde ~/.kderc删除掉,就能恢复原貌了。

Good Luck !
回复 支持 反对

使用道具 举报

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

本版积分规则

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