zcleo 发表于 2005-2-23 08:55:17

安装lfs5.0第五章锁定glibc遇到问题!!斑竹大虾救命

按照手册安装LFS5.0,在第五章"锁定(Locking in)" Glibc一节,
检查一下新工具链的基本功能(编译和连接)是否正常时,没看到结果:


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

我改如何检查错误呢,小弟新手,无从下手啊,拜托斑竹及各位大虾指导一下!!
文档说多数是因为specs文件没改对,,“只要把 "/lib/ld-linux.so.2" 替换成 "/tools/lib/ld-linux.so.2" 就行了”,我打开我的文件看了,好像是正确的啊,蓝色标出的部分好像也改过来了,可为什么不对呢?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*} }}}}}}

小弟新手,望版主、大虾帮忙啊!

linky_fan 发表于 2005-2-23 19:42:05

首先说明一下, 我没有做过5.0版本的lfs(俺用的是5.1), 刚刚看了一下文档, 注意到了在文档中有下面这句话:

If you are working on a platform where the name of the dynamic linker is something other than ld-linux.so.2, you must substitute ld-linux.so.2 with the name of your platform's dynamic linker in the above commands. Refer back to the Section called Toolchain technical notes if necessary.

大意是当你你用来做宿主的发行版中的dynamic linker不是ld-linux.so.2(名字不一样)时候,需要把下面这个sed语句更改一下

sed -e 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' \

sed -e 's@ /lib/your-ld-name@ /tools/lib/ld-linux.so.2@g'

good luck
页: [1]
查看完整版本: 安装lfs5.0第五章锁定glibc遇到问题!!斑竹大虾救命