Changeset 5560d46 for chapter05/gcc-pass2.xml
- Timestamp:
- 08/08/2007 04:07:12 AM (17 years ago)
- Children:
- 4f56afa3
- Parents:
- bdd659b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter05/gcc-pass2.xml
rbdd659b r5560d46 85 85 > gcc/Makefile.in</userinput></screen> 86 86 87 <para>Apply the following patch to change the location of GCC's default 88 dynamic linker (typically <filename 89 class="libraryfile">ld-linux-x86-64.so.2</filename>):</para> 90 91 <screen><userinput>patch -Np1 -i ../&gcc-specs-patch;</userinput></screen> 92 93 <para>The above patch also removes <filename 87 <para>The following command will change the location of GCC's default 88 dynamic linker to use the one we installed in 89 <filename class="directory">/tools</filename>. It also removes <filename 94 90 class="directory">/usr/include</filename> from GCC's include search path. 95 Patchingnow rather than adjusting the specs file after installation91 Doing this now rather than adjusting the specs file after installation 96 92 ensures that the new dynamic linker is used during the actual build of 97 93 GCC. That is, all of the binaries created during the build will link 98 against the new Glibc.</para> 99 100 <important> 101 <para>The above patch is critical in ensuring a successful overall 102 build. Do not forget to apply it.</para> 103 </important> 94 against the new Glibc. Issue:</para> 95 96 <screen><userinput>for file in $(find gcc/config -name linux64.h -o -name linux.h) 97 do 98 cp -uv $file{,.orig} 99 sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \ 100 -e 's@/usr@/tools@g' $file.orig > $file 101 echo " 102 #undef STANDARD_INCLUDE_DIR 103 #define STANDARD_INCLUDE_DIR 0" >> $file 104 touch $file.orig 105 done</userinput></screen> 106 107 <para>In case the above seems hard to follow, let's break it down a bit. 108 First we find all the files under the gcc/config directory that are named 109 either <filename>linux.h</filename> or <filename>linux64.h</filename>. 110 For each file found, we copy it to a file of the same name but with an added 111 suffix of <quote>.orig</quote>. Then the first sed expression prepends 112 <quote>/tools</quote> to every instance of <quote>/lib/ld</quote>, 113 <quote>/lib64/ld</quote> or <quote>/lib32/ld</quote>, while the second one 114 replaces hard-coded instances of <quote>/usr</quote>. Then we add our define 115 statments altering the include search path to the end of the file. Finally, 116 we use <command>touch</command> to update the timestamp on the copied files. 117 When used in conjunction with <command>cp -u</command>, this prevents unexpected 118 changes to the original files in case the command is inadvertently run twice. 119 </para> 104 120 105 121 <para>Unsetting the multlib spec for GCC ensures that it 106 122 won't attempt to link against libraries on the host:</para> 107 123 108 <screen><userinput>cp gcc/config/i386/t-linux64{,.tmp} 109 sed '/MULTILIB_OSDIRNAMES/d' gcc/config/i386/t-linux64.tmp \ 110 > gcc/config/i386/t-linux64</userinput></screen> 124 <screen><userinput>for file in $(find gcc/config -name t-linux64) ; do \ 125 cp -v $file{,.orig} 126 sed '/MULTILIB_OSDIRNAMES/d' $file.orig > $file 127 done</userinput></screen> 111 128 112 129 <para>Create a separate build directory again:</para>
Note:
See TracChangeset
for help on using the changeset viewer.