Changeset e9a652b for chapter06/readjusting.xml
- Timestamp:
- 03/23/2007 09:05:26 PM (17 years ago)
- Branches:
- 10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- a4cb337
- Parents:
- 8bfbf40
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter06/readjusting.xml
r8bfbf40 re9a652b 45 45 </important> 46 46 47 <screen><userinput>gcc -dumpspecs | \ 48 perl -p -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g;' \ 49 -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' > \ 47 <screen><userinput>gcc -dumpspecs | sed \ 48 -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' \ 49 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \ 50 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \ 50 51 `dirname $(gcc --print-libgcc-file-name)`/specs</userinput></screen> 51 52 … … 58 59 59 60 <screen role="nodump" os="a"><userinput>echo 'main(){}' > dummy.c 60 cc dummy.c - Wl,--verbose &> dummy.log61 cc dummy.c -v -Wl,--verbose &> dummy.log 61 62 readelf -l a.out | grep ': /lib'</userinput></screen> 62 63 … … 81 82 /usr/lib/crtn.o succeeded</computeroutput></screen> 82 83 83 <para os="g">Next, verify that the new linker is being used with the correct search paths:</para> 84 <para os="g">Verify that the compiler is searching for the correct header 85 files:</para> 84 86 85 <screen role="nodump" os="h"><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen>87 <screen role="nodump"><userinput>grep -B1 '^ /usr/include' dummy.log</userinput></screen> 86 88 87 <para os="i">If everything is working correctly, there should be no errors, 89 <para os="h">This command should return successfully with the following output:</para> 90 91 <screen><computeroutput>#include <...> search starts here: 92 /usr/include</computeroutput></screen> 93 94 <para os="i">Next, verify that the new linker is being used with the correct search paths:</para> 95 96 <screen role="nodump" os="j"><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen> 97 98 <para os="k">If everything is working correctly, there should be no errors, 88 99 and the output of the last command will be:</para> 89 100 … … 92 103 SEARCH_DIR("/lib");</computeroutput></screen> 93 104 94 <para os=" j">Next make sure that we're using the correct libc:</para>105 <para os="l">Next make sure that we're using the correct libc:</para> 95 106 96 <screen role="nodump" os=" k"><userinput>grep "/lib/libc.so.6 " dummy.log</userinput></screen>107 <screen role="nodump" os="m"><userinput>grep "/lib/libc.so.6 " dummy.log</userinput></screen> 97 108 98 <para os=" l">If everything is working correctly, there should be no errors,109 <para os="n">If everything is working correctly, there should be no errors, 99 110 and the output of the last command will be:</para> 100 111 101 <screen os=" m"><computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput></screen>112 <screen os="o"><computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput></screen> 102 113 103 <para os=" n">Lastly, make sure GCC is using the correct dynamic linker:</para>114 <para os="p">Lastly, make sure GCC is using the correct dynamic linker:</para> 104 115 105 <screen role="nodump" os=" o"><userinput>grep found dummy.log</userinput></screen>116 <screen role="nodump" os="q"><userinput>grep found dummy.log</userinput></screen> 106 117 107 <para os=" p">If everything is working correctly, there should be no errors,118 <para os="r">If everything is working correctly, there should be no errors, 108 119 and the output of the last command will be (allowing for 109 120 platform-specific differences in dynamic linker name):</para> 110 121 111 <screen os=" q"><computeroutput>found ld-linux.so.2 at /lib/ld-linux.so.2</computeroutput></screen>122 <screen os="s"><computeroutput>found ld-linux.so.2 at /lib/ld-linux.so.2</computeroutput></screen> 112 123 113 <para os=" r">If the output does not appear as shown above or is not received124 <para os="t">If the output does not appear as shown above or is not received 114 125 at all, then something is seriously wrong. Investigate and retrace the 115 126 steps to find out where the problem is and correct it. The most likely … … 117 128 issues will need to be resolved before continuing on with the process.</para> 118 129 119 <para os=" s">Once everything is working correctly, clean up the test files:</para>130 <para os="u">Once everything is working correctly, clean up the test files:</para> 120 131 121 <screen role="nodump" os=" t"><userinput>rm -v dummy.c a.out dummy.log</userinput></screen>132 <screen role="nodump" os="v"><userinput>rm -v dummy.c a.out dummy.log</userinput></screen> 122 133 123 134 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.