- Timestamp:
- 10/31/2022 07:01:11 AM (2 years ago)
- Branches:
- xry111/clfs-ng
- Children:
- 2828b85
- Parents:
- 6219892 (diff), 61f8251 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- chapter05
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter05/binutils-pass1.xml
r6219892 r98755ac 85 85 <listitem> 86 86 <para>This tells the configure script to prepare to install the 87 binutils programs in the <filename87 Binutils programs in the <filename 88 88 class="directory">$LFS/tools</filename> directory.</para> 89 89 </listitem> -
chapter05/gcc-pass1.xml
r6219892 r98755ac 51 51 52 52 <note><para>There are frequent misunderstandings about this chapter. The 53 procedures are the same as every other chapter as explained earlier (<xref54 linkend='buildinstr'/>). First extract the gcctarball from the sources55 directory and then change to the directory created. Only then should you53 procedures are the same as every other chapter, as explained earlier (<xref 54 linkend='buildinstr'/>). First, extract the gcc-&gcc-version; tarball from the sources 55 directory, and then change to the directory created. Only then should you 56 56 proceed with the instructions below.</para></note> 57 57 … … 106 106 <term><parameter>--with-glibc-version=&glibc-version;</parameter></term> 107 107 <listitem> 108 <para>This option specifies the version of glibc which will be108 <para>This option specifies the version of Glibc which will be 109 109 used on the target. It is not relevant to the libc of the host 110 distro because everything compiled by pass1 gccwill run in the110 distro because everything compiled by pass1 GCC will run in the 111 111 chroot environment, which is isolated from libc of the host 112 112 distro.</para> … … 151 151 <listitem> 152 152 <para>This switch forces GCC to link its internal libraries 153 statically. We need this because the shared libraries require glibc,153 statically. We need this because the shared libraries require Glibc, 154 154 which is not yet installed on the target system.</para> 155 155 </listitem> … … 203 203 does not exist, so the internal header that has just been installed is a 204 204 partial, self-contained file and does not include the extended features of 205 the system header. This is adequate for building glibc, but the full205 the system header. This is adequate for building Glibc, but the full 206 206 internal header will be needed later. Create a full version of the internal 207 207 header using a command that is identical to what the GCC build system does -
chapter05/glibc.xml
r6219892 r98755ac 61 61 <para> 62 62 The above command is correct. The <command>ln</command> command has 63 a fewsyntactic versions, so be sure to check63 several syntactic versions, so be sure to check 64 64 <command>info coreutils ln</command> and <filename>ln(1)</filename> 65 before reporting what you may think isan error.65 before reporting what may appear to be an error. 66 66 </para> 67 67 </note> 68 68 69 <para>Some of the Glibc programs use the non-FHS 69 <para>Some of the Glibc programs use the non-FHS-compliant 70 70 <filename class="directory">/var/db</filename> directory to store their 71 71 runtime data. Apply the following patch to make such programs store their … … 133 133 <listitem> 134 134 <para>This ensures that the library is installed in /usr/lib instead 135 of the default /lib64 on 64 135 of the default /lib64 on 64-bit machines.</para> 136 136 </listitem> 137 137 </varlistentry> … … 151 151 <para>The missing or incompatible <command>msgfmt</command> program is 152 152 generally harmless. This <command>msgfmt</command> program is part of the 153 Gettext package which the host distribution should provide.</para>153 Gettext package, which the host distribution should provide.</para> 154 154 155 155 <note><para>There have been reports that this package may fail when 156 building as a "parallel make". If th isoccurs, rerun the make command157 with a"-j1" option.</para></note>156 building as a "parallel make". If that occurs, rerun the make command 157 with the "-j1" option.</para></note> 158 158 159 159 <para>Compile the package:</para> … … 166 166 recommendations, you are building as 167 167 <systemitem class="username">root</systemitem>, the next command will 168 install the newly built glibc to your host system, which most likely169 will render it unusable. So doublecheck that the environment is170 correctly set, before running the following command.</para></warning>168 install the newly built Glibc to your host system, which will almost 169 certainly render it unusable. So double-check that the environment is 170 correctly set, and that you are not &root;, before running the following command.</para></warning> 171 171 172 172 <screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen> … … 182 182 installed. If it is not set, it defaults to the root (<filename 183 183 class="directory">/</filename>) directory. Here we specify that 184 the package beinstalled in <filename class="directory">$LFS185 </filename>, which will become the root after<xref linkend=184 the package is installed in <filename class="directory">$LFS 185 </filename>, which will become the root directory in <xref linkend= 186 186 "ch-tools-chroot"/>.</para> 187 187 </listitem> … … 190 190 </variablelist> 191 191 192 <para>Fix hardcoded path to the executable loader in192 <para>Fix a hard coded path to the executable loader in the 193 193 <command>ldd</command> script:</para> 194 194 … … 211 211 <filename>/lib/ld-linux.so.2</filename>.</para> 212 212 213 <para>If the output is not shown as above or there was no output at all,213 <para>If the output is not as shown above, or there is no output at all, 214 214 then something is wrong. Investigate and retrace the steps to find out 215 215 where the problem is and correct it. This issue must be resolved before 216 continuing on.</para>216 continuing.</para> 217 217 218 218 <para>Once all is well, clean up the test file:</para> … … 222 222 </caution> 223 223 224 <note><para>Building packages in the next chapter will serve as an224 <note><para>Building the packages in the next chapter will serve as an 225 225 additional check that the toolchain has been built properly. If some 226 package, especially binutils-pass2 or gcc-pass2, fails to build, it is226 package, especially Binutils-pass2 or GCC-pass2, fails to build, it is 227 227 an indication that something has gone wrong with the 228 pre viousBinutils, GCC, or Glibc installations.</para></note>228 preceding Binutils, GCC, or Glibc installations.</para></note> 229 229 230 230 <para>Now that our cross-toolchain is complete, finalize the installation 231 of the limits.h header. For doing so, run a utility provided by the GCC231 of the limits.h header. To do this, run a utility provided by the GCC 232 232 developers:</para> 233 233 -
chapter05/libstdc++.xml
r6219892 r98755ac 29 29 (part of GCC is written in C++), but we had to defer its installation 30 30 when we built <xref linkend="ch-tools-gcc-pass1"/> 31 because it depends on glibc, which was not yet available in the target31 because Libstdc++ depends on Glibc, which was not yet available in the target 32 32 directory. 33 33 </para> … … 54 54 </note> 55 55 56 <para>Create a separate build directory for libstdc++ and enter it:</para>56 <para>Create a separate build directory for Libstdc++ and enter it:</para> 57 57 58 58 <screen><userinput remap="pre">mkdir -v build 59 59 cd build</userinput></screen> 60 60 61 <para>Prepare libstdc++ for compilation:</para>61 <para>Prepare Libstdc++ for compilation:</para> 62 62 63 63 <screen><userinput remap="configure">../libstdc++-v3/configure \ … … 76 76 <term><parameter>--host=...</parameter></term> 77 77 <listitem> 78 <para>Specifies that the cross 78 <para>Specifies that the cross-compiler we have just built 79 79 should be used instead of the one in 80 80 <filename>/usr/bin</filename>.</para> … … 94 94 <listitem> 95 95 <para>This specifies the installation directory for include files. 96 Because libstdc++ is the standard C++ library for LFS, this96 Because Libstdc++ is the standard C++ library for LFS, this 97 97 directory should match the location where the C++ compiler 98 98 (<command>$LFS_TGT-g++</command>) would search for the 99 99 standard C++ include files. In a normal build, this information 100 is automatically passed to the libstdc++ <command>configure</command>100 is automatically passed to the Libstdc++ <command>configure</command> 101 101 options from the top level directory. In our case, this information 102 102 must be explicitly given. 103 103 The C++ compiler will prepend the sysroot path 104 <filename class="directory">$LFS</filename> (specified building105 GCC pass1) to the include file search path, so it will actually104 <filename class="directory">$LFS</filename> (specified when building 105 GCC-pass1) to the include file search path, so it will actually 106 106 search in 107 107 <filename class="directory">$LFS/tools/$LFS_TGT/include/c++/&gcc-version;</filename>. 108 108 The combination of the <parameter>DESTDIR</parameter> 109 109 variable (in the <command>make install</command> command below) 110 and this switch ensures to install the headersthere.</para>110 and this switch causes the headers to be installed there.</para> 111 111 </listitem> 112 112 </varlistentry> … … 114 114 </variablelist> 115 115 116 <para>Compile libstdc++ by running:</para>116 <para>Compile Libstdc++ by running:</para> 117 117 118 118 <screen><userinput remap="make">make</userinput></screen> … … 123 123 124 124 <para>Remove the libtool archive files because they are harmful for 125 cross 125 cross-compilation:</para> 126 126 127 127 <screen><userinput remap="install">rm -v $LFS/usr/lib/lib{stdc++,stdc++fs,supc++}.la</userinput></screen>
Note:
See TracChangeset
for help on using the changeset viewer.