Changeset 1ba726f for chapter06/readjusting.xml
- Timestamp:
- 01/30/2006 01:45:25 AM (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:
- b87ea87
- Parents:
- bedc966
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter06/readjusting.xml
rbedc966 r1ba726f 20 20 directories.</para> 21 21 22 <para>First, create a symlink to the adjusted linker we created in chapter 5.</para> 22 <para>First, backup the <filename class="directory">/tools</filename> linker, and 23 replace it with the adjusted linker we made in chapter 5. We'll also create a 24 link to its counterpart in <filename class="directory">/tools/$MACHTYPE/bin</filename></para> 23 25 24 <screen><userinput>ln -sv /tools/bin/ld-new /usr/bin/ld</userinput></screen> 26 <screen><userinput>mv -v /tools/bin/{ld,ld-old} 27 mv -v /tools/$MACHTYPE/bin/{ld,ld-old} 28 mv -v /tools/bin/{ld-new,ld} 29 ln -sv /tools/bin/ld /tools/$MACHTYPE/bin/ld</userinput></screen> 25 30 26 31 <para>Next, amend the GCC specs file so that it points to the new 27 dynamic linker. A <command>sed</command> command accomplishes this:</para> 32 dynamic linker, and so that GCC knows where to find its start files. 33 A <command>perl</command> command accomplishes this:</para> 28 34 29 <screen><userinput> SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs &&30 gcc -dumpspecs > $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 &&33 unset SPECFILE</userinput></screen>35 <screen><userinput>gcc -dumpspecs | \ 36 perl -pi -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g;' \ 37 -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' > \ 38 `dirname $(gcc --print-libgcc-file-name)`/specs 39 </userinput></screen> 34 40 35 41 <para>It is a good idea to visually inspect the specs file to verify the intended … … 43 49 linkend="ch-tools-toolchaintechnotes" role=","/> if 44 50 necessary.</para></important> 45 46 <para>Now create a temporary wrapper script for <filename>gcc</filename>.47 This script will point to the real <filename>gcc</filename>48 in <filename class="directory">/tools</filename> but with adjusted parameters49 to ensure that GCC in the next section links to our newly installed Glibc.</para>50 51 <screen><userinput>cat > /usr/bin/gcc << "EOF"52 #!/bin/bash53 /tools/bin/gcc -B/usr/lib/ -B/usr/bin/ $@54 EOF55 chmod 755 /usr/bin/gcc56 ln -s gcc /usr/bin/cc</userinput></screen>57 51 58 52 <caution><para>It is imperative at this point to stop and ensure that
Note:
See TracChangeset
for help on using the changeset viewer.