source: chapter02/hostreqs.xml@ ac1639c

multilib
Last change on this file since ac1639c was ac1639c, checked in by Thomas Trepl <thomas@…>, 5 months ago

Automatic merge of trunk into multilib

  • Property mode set to 100644
File size: 10.1 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-partitioning-hostreqs" xreflabel="Host System Requirements">
9 <?dbhtml filename="hostreqs.html"?>
10
11 <title>Host System Requirements</title>
12
13 <sect2>
14 <title>Hardware</title>
15
16 <para>The LFS editors recommend that the system CPU have at least
17 four cores and that the system have at least 8 GB of memory.
18 Older systems that do not meet these requirements will still work,
19 but the time to build packages will be significantly longer
20 than documented.
21 </para>
22
23 </sect2>
24
25 <sect2>
26 <title>Software</title>
27
28 <para>Your host system should have the following software with the
29 minimum versions indicated. This should not be an issue for most
30 modern Linux distributions. Also note that many distributions will
31 place software headers into separate packages, often in the form of
32 <literal><replaceable>&lt;package-name&gt;</replaceable>-devel</literal>
33 or
34 <literal><replaceable>&lt;package-name&gt;</replaceable>-dev</literal>.
35 Be sure to install those if your distribution provides them.</para>
36
37 <para>Earlier versions of the listed software packages may work, but have
38 not been tested.</para>
39
40 <itemizedlist spacing="compact">
41
42 <listitem>
43 <para><emphasis role="strong">Bash-3.2</emphasis> (/bin/sh
44 should be a symbolic or hard link to bash)</para>
45 </listitem>
46
47 <listitem>
48 <para><emphasis role="strong">Binutils-2.13.1</emphasis> (Versions
49 greater than &binutils-version; are not recommended as they have
50 not been tested)</para>
51 </listitem>
52
53 <listitem>
54 <para><emphasis role="strong">Bison-2.7</emphasis> (/usr/bin/yacc
55 should be a link to bison or a small script that executes bison)</para>
56 </listitem>
57
58 <!-- In Coreutils-8.1 the nproc program is added. -->
59 <listitem>
60 <para><emphasis role="strong">Coreutils-8.1</emphasis></para>
61 </listitem>
62
63 <listitem>
64 <para><emphasis role="strong">Diffutils-2.8.1</emphasis></para>
65 </listitem>
66
67 <listitem>
68 <para><emphasis role="strong">Findutils-4.2.31</emphasis></para>
69 </listitem>
70
71 <listitem>
72 <para><emphasis role="strong">Gawk-4.0.1</emphasis> (/usr/bin/awk
73 should be a link to gawk)</para>
74 </listitem>
75
76 <listitem>
77 <!-- Pass 1 GCC FTBFS with GCC-5.1 because of
78 https://gcc.gnu.org/PR65801. -->
79 <para><emphasis role="strong">GCC-5.2</emphasis> including the C++
80 compiler, <command>g++</command> (Versions greater than &gcc-version; are
81 not recommended as they have not been tested). C and C++ standard
82 libraries (with headers) must also be present so the C++ compiler can
83 build hosted programs</para>
84 </listitem>
85
86 <listitem>
87 <para><emphasis role="strong">Grep-2.5.1a</emphasis></para>
88 </listitem>
89
90 <listitem>
91 <para><emphasis role="strong">Gzip-1.3.12</emphasis></para>
92 </listitem>
93
94 <listitem>
95 <para><emphasis role="strong">Linux Kernel-&min-kernel;</emphasis></para>
96
97 <para>The reason for the kernel version requirement is that we specify
98 that version when building <application>glibc</application> in
99 <xref linkend="chapter-cross-tools"/> and
100 <xref linkend="chapter-building-system"/>, so the workarounds for
101 older kernels are not enabled and the compiled
102 <application>glibc</application> is slightly faster and smaller.
103 As at June 2023, &min-kernel; is the oldest kernel release still
104 supported by the kernel developers.</para>
105
106 <para>If the host kernel is earlier than &min-kernel; you will need to replace
107 the kernel with a more up-to-date version. There are two ways
108 you can go about this. First, see if your Linux vendor provides a &min-kernel;
109 or later kernel package. If so, you may wish to install it. If your
110 vendor doesn't offer an acceptable kernel package, or you would prefer not to
111 install it, you can compile a kernel yourself. Instructions for
112 compiling the kernel and configuring the boot loader (assuming the host
113 uses GRUB) are located in <xref linkend="chapter-bootable"/>.</para>
114
115 <para>We require the host kernel to support UNIX 98 pseudo terminal
116 (PTY). It should be enabled on all desktop or server distros shipping
117 Linux &min-kernel; or a newer kernel. If you are building a custom
118 host kernel, ensure <option>CONFIG_UNIX98_PTYS</option> is set to
119 <literal>y</literal> in the kernel configuration.</para>
120
121 </listitem>
122
123 <listitem>
124 <para><emphasis role="strong">M4-1.4.10</emphasis></para>
125 </listitem>
126
127 <listitem>
128 <para><emphasis role="strong">Make-4.0</emphasis></para>
129 </listitem>
130
131 <listitem>
132 <para><emphasis role="strong">Patch-2.5.4</emphasis></para>
133 </listitem>
134
135 <listitem>
136 <para><emphasis role="strong">Perl-5.8.8</emphasis></para>
137 </listitem>
138
139 <listitem>
140 <para><emphasis role="strong">Python-3.4</emphasis></para>
141 </listitem>
142
143 <listitem>
144 <para><emphasis role="strong">Sed-4.1.5</emphasis></para>
145 </listitem>
146
147 <listitem>
148 <para><emphasis role="strong">Tar-1.22</emphasis></para>
149 </listitem>
150
151 <listitem>
152 <para><emphasis role="strong">Texinfo-5.0</emphasis></para>
153 </listitem>
154
155 <listitem>
156 <para><emphasis role="strong">Xz-5.0.0</emphasis></para>
157 </listitem>
158
159 </itemizedlist>
160
161 <important>
162 <para>Note that the symlinks mentioned above are required to build an LFS
163 system using the instructions contained within this book. Symlinks that
164 point to other software (such as dash, mawk, etc.) may work, but are not
165 tested or supported by the LFS development team, and may require either
166 deviation from the instructions or additional patches to some
167 packages.</para>
168 </important>
169
170 <!-- Use an empty sect2 element to prevent a pdf warning. -->
171 <bridgehead renderas="sect2"
172 id="version-check"
173 xreflabel="Host System Requirements">
174 </bridgehead>
175 <!--<title> </title>-->
176
177 <para >To see whether your host system has all the appropriate versions, and
178 the ability to compile programs, run the following commands:</para>
179
180<screen role="nodump"><?dbfo keep-together="auto"?><userinput>cat &gt; version-check.sh &lt;&lt; "EOF"
181<literal>#!/bin/bash
182# A script to list version numbers of critical development tools
183
184# If you have tools installed in other directories, adjust PATH here AND
185# in ~lfs/.bashrc (section 4.4) as well.
186
187LC_ALL=C
188PATH=/usr/bin:/bin
189
190bail() { echo "FATAL: $1"; exit 1; }
191grep --version > /dev/null 2> /dev/null || bail "grep does not work"
192sed '' /dev/null || bail "sed does not work"
193sort /dev/null || bail "sort does not work"
194
195ver_check()
196{
197 if ! type -p $2 &amp;>/dev/null
198 then
199 echo "ERROR: Cannot find $2 ($1)"; return 1;
200 fi
201 v=$($2 --version 2>&amp;1 | grep -E -o '[0-9]+\.[0-9\.]+[a-z]*' | head -n1)
202 if printf '%s\n' $3 $v | sort --version-sort --check &amp;>/dev/null
203 then
204 printf "OK: %-9s %-6s >= $3\n" "$1" "$v"; return 0;
205 else
206 printf "ERROR: %-9s is TOO OLD ($3 or later required)\n" "$1";
207 return 1;
208 fi
209}
210
211ver_kernel()
212{
213 kver=$(uname -r | grep -E -o '^[0-9\.]+')
214 if printf '%s\n' $1 $kver | sort --version-sort --check &amp;>/dev/null
215 then
216 printf "OK: Linux Kernel $kver >= $1\n"; return 0;
217 else
218 printf "ERROR: Linux Kernel ($kver) is TOO OLD ($1 or later required)\n" "$kver";
219 return 1;
220 fi
221}
222
223# Coreutils first because --version-sort needs Coreutils >= 7.0
224ver_check Coreutils sort 8.1 || bail "Coreutils too old, stop"
225ver_check Bash bash 3.2
226ver_check Binutils ld 2.13.1
227ver_check Bison bison 2.7
228ver_check Diffutils diff 2.8.1
229ver_check Findutils find 4.2.31
230ver_check Gawk gawk 4.0.1
231ver_check GCC gcc 5.2
232ver_check "GCC (C++)" g++ 5.2
233ver_check Grep grep 2.5.1a
234ver_check Gzip gzip 1.3.12
235ver_check M4 m4 1.4.10
236ver_check Make make 4.0
237ver_check Patch patch 2.5.4
238ver_check Perl perl 5.8.8
239ver_check Python python3 3.4
240ver_check Sed sed 4.1.5
241ver_check Tar tar 1.22
242ver_check Texinfo texi2any 5.0
243ver_check Xz xz 5.0.0
244ver_kernel &min-kernel;
245
246if mount | grep -q 'devpts on /dev/pts' &amp;&amp; [ -e /dev/ptmx ]
247then echo "OK: Linux Kernel supports UNIX 98 PTY";
248else echo "ERROR: Linux Kernel does NOT support UNIX 98 PTY"; fi
249
250alias_check() {
251 if $1 --version 2>&amp;1 | grep -qi $2
252 then printf "OK: %-4s is $2\n" "$1";
253 else printf "ERROR: %-4s is NOT $2\n" "$1"; fi
254}
255echo "Aliases:"
256alias_check awk GNU
257alias_check yacc Bison
258alias_check sh Bash
259
260echo "Compiler check:"
261if printf "int main(){}" | g++ -x c++ -
262then echo "OK: g++ works";
263else echo "ERROR: g++ does NOT work"; fi
264rm -f a.out
265
266if [ "$(nproc)" = "" ]; then
267 echo "ERROR: nproc is not available or it produces empty output"
268else
269 echo "OK: nproc reports $(nproc) logical cores are available"
270fi</literal>
271EOF
272
273bash version-check.sh</userinput></screen>
274
275 <para arch="ml_32,ml_x32,ml_all">
276 Building multilib support requires the kernel of the host system
277 to have 32-bit emulation support included.
278 </para>
279<screen arch="ml_32,ml_x32,ml_all">Binary Emulations ---&gt;
280 [*] IA32 Emulation
281 &lt;M&gt; IA32 a.out support
282 [*] x32 ABI for 64-bit mode
283</screen>
284
285 <para arch="ml_32,ml_x32,ml_all">The option 'IA32 a.out support' is
286 optional. In case your kernel does not have 'x32 ABI for 64-bit mode'
287 enabled but only 'IA32 Emulation', you can continue to build your
288 system but you have to leave out any sections showing instructions
289 for building x32 objects. If neither 'IA32 Emulation' nor
290 'x32 ABI for 64-bit mode' is enabled, you will run in errors
291 latest when building <application>glibc</application> in Chapter 6,
292 so an upgrade of your host system kernel is required.
293 </para>
294
295 </sect2>
296
297</sect1>
Note: See TracBrowser for help on using the repository browser.