Changeset 1a76da0
- Timestamp:
- 10/30/2022 11:30:10 PM (18 months ago)
- Branches:
- multilib
- Children:
- f8e4cf6
- Parents:
- 07fd8bf8 (diff), decf315 (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. - Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter05/binutils-pass1.xml
r07fd8bf8 r1a76da0 92 92 <listitem> 93 93 <para>This tells the configure script to prepare to install the 94 binutils programs in the <filename94 Binutils programs in the <filename 95 95 class="directory">$LFS/tools</filename> directory.</para> 96 96 </listitem> -
chapter05/gcc-pass1.xml
r07fd8bf8 r1a76da0 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 … … 143 143 <term><parameter>--with-glibc-version=&glibc-version;</parameter></term> 144 144 <listitem> 145 <para>This option specifies the version of glibc which will be145 <para>This option specifies the version of Glibc which will be 146 146 used on the target. It is not relevant to the libc of the host 147 distro because everything compiled by pass1 gccwill run in the147 distro because everything compiled by pass1 GCC will run in the 148 148 chroot environment, which is isolated from libc of the host 149 149 distro.</para> … … 188 188 <listitem> 189 189 <para>This switch forces GCC to link its internal libraries 190 statically. We need this because the shared libraries require glibc,190 statically. We need this because the shared libraries require Glibc, 191 191 which is not yet installed on the target system.</para> 192 192 </listitem> … … 247 247 does not exist, so the internal header that has just been installed is a 248 248 partial, self-contained file and does not include the extended features of 249 the system header. This is adequate for building glibc, but the full249 the system header. This is adequate for building Glibc, but the full 250 250 internal header will be needed later. Create a full version of the internal 251 251 header using a command that is identical to what the GCC build system does -
chapter05/glibc.xml
r07fd8bf8 r1a76da0 62 62 <para> 63 63 The above command is correct. The <command>ln</command> command has 64 a fewsyntactic versions, so be sure to check64 several syntactic versions, so be sure to check 65 65 <command>info coreutils ln</command> and <filename>ln(1)</filename> 66 before reporting what you may think isan error.66 before reporting what may appear to be an error. 67 67 </para> 68 68 </note> 69 69 70 <para>Some of the Glibc programs use the non-FHS 70 <para>Some of the Glibc programs use the non-FHS-compliant 71 71 <filename class="directory">/var/db</filename> directory to store their 72 72 runtime data. Apply the following patch to make such programs store their … … 140 140 <listitem> 141 141 <para>This ensures that the library is installed in /usr/lib instead 142 of the default /lib64 on 64 142 of the default /lib64 on 64-bit machines.</para> 143 143 </listitem> 144 144 </varlistentry> … … 158 158 <para>The missing or incompatible <command>msgfmt</command> program is 159 159 generally harmless. This <command>msgfmt</command> program is part of the 160 Gettext package which the host distribution should provide.</para>160 Gettext package, which the host distribution should provide.</para> 161 161 162 162 <note><para>There have been reports that this package may fail when 163 building as a "parallel make". If th isoccurs, rerun the make command164 with a"-j1" option.</para></note>163 building as a "parallel make". If that occurs, rerun the make command 164 with the "-j1" option.</para></note> 165 165 166 166 <para>Compile the package:</para> … … 173 173 recommendations, you are building as 174 174 <systemitem class="username">root</systemitem>, the next command will 175 install the newly built glibc to your host system, which most likely176 will render it unusable. So doublecheck that the environment is177 correctly set, before running the following command.</para></warning>175 install the newly built Glibc to your host system, which will almost 176 certainly render it unusable. So double-check that the environment is 177 correctly set, and that you are not &root;, before running the following command.</para></warning> 178 178 179 179 <screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen> … … 189 189 installed. If it is not set, it defaults to the root (<filename 190 190 class="directory">/</filename>) directory. Here we specify that 191 the package beinstalled in <filename class="directory">$LFS192 </filename>, which will become the root after<xref linkend=191 the package is installed in <filename class="directory">$LFS 192 </filename>, which will become the root directory in <xref linkend= 193 193 "ch-tools-chroot"/>.</para> 194 194 </listitem> … … 197 197 </variablelist> 198 198 199 <para>Fix hardcoded path to the executable loader in199 <para>Fix a hard coded path to the executable loader in the 200 200 <command>ldd</command> script:</para> 201 201 … … 218 218 <filename>/lib/ld-linux.so.2</filename>.</para> 219 219 220 <para>If the output is not shown as above or there was no output at all,220 <para>If the output is not as shown above, or there is no output at all, 221 221 then something is wrong. Investigate and retrace the steps to find out 222 222 where the problem is and correct it. This issue must be resolved before 223 continuing on.</para>223 continuing.</para> 224 224 225 225 <para>Once all is well, clean up the test file:</para> … … 229 229 </caution> 230 230 231 <note><para>Building packages in the next chapter will serve as an231 <note><para>Building the packages in the next chapter will serve as an 232 232 additional check that the toolchain has been built properly. If some 233 package, especially binutils-pass2 or gcc-pass2, fails to build, it is233 package, especially Binutils-pass2 or GCC-pass2, fails to build, it is 234 234 an indication that something has gone wrong with the 235 pre viousBinutils, GCC, or Glibc installations.</para></note>235 preceding Binutils, GCC, or Glibc installations.</para></note> 236 236 237 237 <para>Now that our cross-toolchain is complete, finalize the installation 238 of the limits.h header. For doing so, run a utility provided by the GCC238 of the limits.h header. To do this, run a utility provided by the GCC 239 239 developers:</para> 240 240 -
chapter05/libstdc++.xml
r07fd8bf8 r1a76da0 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 arch="ml_32,ml_x32,ml_all"><userinput remap="configure">../libstdc++-v3/configure \ … … 84 84 <term><parameter>--host=...</parameter></term> 85 85 <listitem> 86 <para>Specifies that the cross 86 <para>Specifies that the cross-compiler we have just built 87 87 should be used instead of the one in 88 88 <filename>/usr/bin</filename>.</para> … … 109 109 <listitem> 110 110 <para>This specifies the installation directory for include files. 111 Because libstdc++ is the standard C++ library for LFS, this111 Because Libstdc++ is the standard C++ library for LFS, this 112 112 directory should match the location where the C++ compiler 113 113 (<command>$LFS_TGT-g++</command>) would search for the 114 114 standard C++ include files. In a normal build, this information 115 is automatically passed to the libstdc++ <command>configure</command>115 is automatically passed to the Libstdc++ <command>configure</command> 116 116 options from the top level directory. In our case, this information 117 117 must be explicitly given. 118 118 The C++ compiler will prepend the sysroot path 119 <filename class="directory">$LFS</filename> (specified building120 GCC pass1) to the include file search path, so it will actually119 <filename class="directory">$LFS</filename> (specified when building 120 GCC-pass1) to the include file search path, so it will actually 121 121 search in 122 122 <filename class="directory">$LFS/tools/$LFS_TGT/include/c++/&gcc-version;</filename>. 123 123 The combination of the <parameter>DESTDIR</parameter> 124 124 variable (in the <command>make install</command> command below) 125 and this switch ensures to install the headersthere.</para>125 and this switch causes the headers to be installed there.</para> 126 126 </listitem> 127 127 </varlistentry> … … 129 129 </variablelist> 130 130 131 <para>Compile libstdc++ by running:</para>131 <para>Compile Libstdc++ by running:</para> 132 132 133 133 <screen><userinput remap="make">make</userinput></screen> … … 138 138 139 139 <para>Remove the libtool archive files because they are harmful for 140 cross 140 cross-compilation:</para> 141 141 142 142 <screen><userinput remap="install">rm -v $LFS/usr/lib/lib{stdc++,stdc++fs,supc++}.la</userinput></screen> -
part3intro/toolchaintechnotes.xml
r07fd8bf8 r1a76da0 146 146 147 147 <note> 148 <para>All the packages involved with cross-compilationuse an148 <para>All the cross-compiled packages in this book use an 149 149 autoconf-based building system. The autoconf-based building system 150 150 accepts system types in the form cpu-vendor-kernel-os, … … 258 258 this is the only compiler available for building the C/C++ libraries 259 259 during stage 2. Of course, the compiler built by stage 2, cc-lfs, 260 would be able to build those libraries, but (1) the build system of 261 gcc does not know cc-lfs can run on pc, and (2) using cc-lfs on pc 262 would create a risk of linking to the pc libraries, since cc-lfs is a native 263 compiler. So we have to re-build libstdc++ later as a part of 264 gcc stage 2.</para> 260 would be able to build those libraries, but:</para> 261 262 <itemizedlist> 263 <listitem> 264 <para> 265 Generally cc-lfs cannot run on pc (the host distro). Despite the 266 triplets of pc and lfs are compatible to each other, an executable 267 for lfs will depend on glibc-&glibc-version; while the host distro 268 may utilize a different libc implementation (for example, musl) or 269 a previous release of glibc (for example, glibc-2.13). 270 </para> 271 </listitem> 272 <listitem> 273 <para> 274 Even if cc-lfs happens to run on pc, using it on pc would create 275 a risk of linking to the pc libraries, since cc-lfs is a native 276 compiler. 277 </para> 278 </listitem> 279 </itemizedlist> 280 281 <para>So we have to re-build libstdc++ later as a part of gcc stage 2.</para> 265 282 266 283 <para>In &ch-final; (or <quote>stage 3</quote>), all the packages needed for
Note:
See TracChangeset
for help on using the changeset viewer.