Changeset f6820bb6
- Timestamp:
- 10/30/2022 02:23:55 PM (18 months ago)
- Branches:
- 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, bdubbs/gcc13, multilib, renodr/libudev-from-systemd, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/update-glibc
- Children:
- 6b052ef
- Parents:
- 019499e
- Location:
- chapter05
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter05/binutils-pass1.xml
r019499e rf6820bb6 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
r019499e rf6820bb6 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 … … 108 108 <term><parameter>--with-glibc-version=&glibc-version;</parameter></term> 109 109 <listitem> 110 <para>This option specifies the version of glibc which will be110 <para>This option specifies the version of Glibc which will be 111 111 used on the target. It is not relevant to the libc of the host 112 distro because everything compiled by pass1 gccwill run in the112 distro because everything compiled by pass1 GCC will run in the 113 113 chroot environment, which is isolated from libc of the host 114 114 distro.</para> … … 153 153 <listitem> 154 154 <para>This switch forces GCC to link its internal libraries 155 statically. We need this because the shared libraries require glibc,155 statically. We need this because the shared libraries require Glibc, 156 156 which is not yet installed on the target system.</para> 157 157 </listitem> … … 205 205 does not exist, so the internal header that has just been installed is a 206 206 partial, self-contained file and does not include the extended features of 207 the system header. This is adequate for building glibc, but the full207 the system header. This is adequate for building Glibc, but the full 208 208 internal header will be needed later. Create a full version of the internal 209 209 header using a command that is identical to what the GCC build system does -
chapter05/glibc.xml
r019499e rf6820bb6 59 59 <para> 60 60 The above command is correct. The <command>ln</command> command has 61 a fewsyntactic versions, so be sure to check61 several syntactic versions, so be sure to check 62 62 <command>info coreutils ln</command> and <filename>ln(1)</filename> 63 before reporting what you may think isan error.63 before reporting what may appear to be an error. 64 64 </para> 65 65 </note> 66 66 67 <para>Some of the Glibc programs use the non-FHS 67 <para>Some of the Glibc programs use the non-FHS-compliant 68 68 <filename class="directory">/var/db</filename> directory to store their 69 69 runtime data. Apply the following patch to make such programs store their … … 129 129 <listitem> 130 130 <para>This ensures that the library is installed in /usr/lib instead 131 of the default /lib64 on 64 131 of the default /lib64 on 64-bit machines.</para> 132 132 </listitem> 133 133 </varlistentry> … … 147 147 <para>The missing or incompatible <command>msgfmt</command> program is 148 148 generally harmless. This <command>msgfmt</command> program is part of the 149 Gettext package which the host distribution should provide.</para>149 Gettext package, which the host distribution should provide.</para> 150 150 151 151 <note><para>There have been reports that this package may fail when 152 building as a "parallel make". If th isoccurs, rerun the make command153 with a"-j1" option.</para></note>152 building as a "parallel make". If that occurs, rerun the make command 153 with the "-j1" option.</para></note> 154 154 155 155 <para>Compile the package:</para> … … 162 162 recommendations, you are building as 163 163 <systemitem class="username">root</systemitem>, the next command will 164 install the newly built glibc to your host system, which most likely165 will render it unusable. So doublecheck that the environment is166 correctly set, before running the following command.</para></warning>164 install the newly built Glibc to your host system, which will almost 165 certainly render it unusable. So double-check that the environment is 166 correctly set, and that you are not &root;, before running the following command.</para></warning> 167 167 168 168 <screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen> … … 178 178 installed. If it is not set, it defaults to the root (<filename 179 179 class="directory">/</filename>) directory. Here we specify that 180 the package beinstalled in <filename class="directory">$LFS181 </filename>, which will become the root after<xref linkend=180 the package is installed in <filename class="directory">$LFS 181 </filename>, which will become the root directory in <xref linkend= 182 182 "ch-tools-chroot"/>.</para> 183 183 </listitem> … … 186 186 </variablelist> 187 187 188 <para>Fix hardcoded path to the executable loader in188 <para>Fix a hard coded path to the executable loader in the 189 189 <command>ldd</command> script:</para> 190 190 … … 207 207 <filename>/lib/ld-linux.so.2</filename>.</para> 208 208 209 <para>If the output is not shown as above or there was no output at all,209 <para>If the output is not as shown above, or there is no output at all, 210 210 then something is wrong. Investigate and retrace the steps to find out 211 211 where the problem is and correct it. This issue must be resolved before 212 continuing on.</para>212 continuing.</para> 213 213 214 214 <para>Once all is well, clean up the test file:</para> … … 218 218 </caution> 219 219 220 <note><para>Building packages in the next chapter will serve as an220 <note><para>Building the packages in the next chapter will serve as an 221 221 additional check that the toolchain has been built properly. If some 222 package, especially binutils-pass2 or gcc-pass2, fails to build, it is222 package, especially Binutils-pass2 or GCC-pass2, fails to build, it is 223 223 an indication that something has gone wrong with the 224 pre viousBinutils, GCC, or Glibc installations.</para></note>224 preceding Binutils, GCC, or Glibc installations.</para></note> 225 225 226 226 <para>Now that our cross-toolchain is complete, finalize the installation 227 of the limits.h header. For doing so, run a utility provided by the GCC227 of the limits.h header. To do this, run a utility provided by the GCC 228 228 developers:</para> 229 229 -
chapter05/libstdc++.xml
r019499e rf6820bb6 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.