Changeset 2914987b
- Timestamp:
- 01/26/2006 02:45:36 PM (18 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:
- 942465e
- Parents:
- 40abfd5
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter01/changelog.xml
r40abfd5 r2914987b 44 44 allow test-installation.pl to run.</para> 45 45 </listitem> 46 <listitem> 47 <para>[jhuntwork] - Adjust chapter 5 binutils to build a static ld-new 48 for use in the chapter 6 readjusting section. Also add some extended 49 sanity checks. These fixes are adapted from DIY-Linux and Greg Schafer. 50 Thanks to Dan Nicholson for the report, as well. 51 </listitem> 46 52 </itemizedlist> 47 53 </listitem> -
chapter05/binutils-pass2.xml
r40abfd5 r2914987b 50 50 51 51 <screen><userinput>../binutils-&binutils-version;/configure --prefix=/tools \ 52 --disable-nls -- enable-shared --with-lib-path=/tools/lib</userinput></screen>52 --disable-nls --with-lib-path=/tools/lib</userinput></screen> 53 53 54 54 <variablelist> … … 81 81 <para>Install the package:</para> 82 82 83 <para>Now prepare the linker for the <quote>Re-adjusting</quote> phase in 84 the next chapter:</para> 85 86 <screen><userinput>make -C ld clean 87 make -C ld LDFLAGS="-s" LIB_PATH=/usr/lib:/lib 88 cp -v ld/ld-new /tools/bin</userinput></screen> 89 83 90 <screen><userinput>make install</userinput></screen> 84 91 -
chapter06/readjusting.xml
r40abfd5 r2914987b 20 20 directories.</para> 21 21 22 <para>First, amend the GCC specs file so that it points to the new 22 <para>First, create a symlink to the adjusted linker we created in chapter 5.</para> 23 24 <screen><userinput>ln -sv /tools/bin/ld-new /usr/bin/ld</userinput></screen> 25 26 <para>Next, amend the GCC specs file so that it points to the new 23 27 dynamic linker. A <command>sed</command> command accomplishes this:</para> 24 28 25 29 <screen><userinput>SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs && 26 30 gcc -dumpspecs > $SPECFILE && 27 sed -i 's@^/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' $SPECFILE && 31 sed -i -e '/^\*link:$/{n;s,$, -L/usr/lib,}' \ 32 -e 's@^/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' $SPECFILE && 28 33 unset SPECFILE</userinput></screen> 29 34 … … 39 44 necessary.</para></important> 40 45 41 <para>Now create temporary wrapper scripts for <filename>gcc</filename> and42 <filename>ld</filename>. These scripts will point to their real counterparts 46 <para>Now create a temporary wrapper script for <filename>gcc</filename>. 47 This script will point to the real <filename>gcc</filename> 43 48 in <filename class="directory">/tools</filename> but with adjusted parameters 44 49 to ensure that GCC in the next section links to our newly installed Glibc.</para> … … 46 51 <screen><userinput>cat > /usr/bin/gcc << "EOF" 47 52 #!/bin/bash 48 /tools/bin/gcc -B/usr/lib $@53 /tools/bin/gcc -B/usr/lib/ -B/usr/bin/ $@ 49 54 EOF 50 cat > /usr/bin/ld << "EOF" 51 #!/bin/bash 52 /tools/bin/ld -nostdlib -L/usr/lib -L/lib $@ 53 EOF 54 chmod 755 /usr/bin/{ld,gcc} 55 chmod 755 /usr/bin/gcc 55 56 ln -s gcc /usr/bin/cc</userinput></screen> 56 57 … … 61 62 62 63 <screen><userinput>echo 'main(){}' > dummy.c 63 cc dummy.c 64 cc dummy.c -Wl,--verbose &> dummy.log 64 65 readelf -l a.out | grep ': /lib'</userinput></screen> 65 66 … … 73 74 the prefix of our dynamic linker.</para> 74 75 76 <para>Now make sure that we're setup to use the correct start files:</para> 77 78 <screen><userinput>grep "/usr/lib/crt.* " dummy.log</userinput></screen> 79 80 <para>If everything is working correctly, there should be no errors, 81 and the output of the last command will be:</para> 82 83 <screen><computeroutput>attempt to open /usr/lib/crt1.o succeeded 84 attempt to open /usr/lib/crti.o succeeded 85 attempt to open /usr/lib/crtn.o succeeded</computeroutput></screen> 86 87 <para>Next make sure that we're using the correct libc:</para> 88 89 <screen><userinput>grep "/lib/libc.so.6 " dummy.log</userinput></screen> 90 91 <para>If everything is working correctly, there should be no errors, 92 and the output of the last command will be:</para> 93 94 <screen><computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput></screen> 95 96 <para>Lastly, make sure GCC is using the correct dynamic linker:</para> 97 98 <screen><userinput>grep found dummy.log</userinput></screen> 99 100 <para>If everything is working correctly, there should be no errors, 101 and the output of the last command will be (allowing for 102 platform-specific differences in dynamic linker name):</para> 103 104 <screen><computeroutput>found ld-linux.so.2 at /lib/ld-linux.so.2</computeroutput></screen> 105 75 106 <para>If the output does not appear as shown above or is not received 76 107 at all, then something is seriously wrong. Investigate and retrace the … … 83 114 files:</para> 84 115 85 <screen><userinput>rm -v dummy.c a.out </userinput></screen></caution>116 <screen><userinput>rm -v dummy.c a.out dummy.log</userinput></screen></caution> 86 117 87 118 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.