[86bea76] | 1 | <sect2><title> </title><para> </para></sect2>
|
---|
| 2 |
|
---|
[ebd94a2] | 3 | <sect2>
|
---|
| 4 | <title>Installation of Glibc</title>
|
---|
| 5 |
|
---|
| 6 | <para>At the beginning of this chapter you installed Glibc and applied a
|
---|
| 7 | patch to it. Part of this patch was undoing some changes to make static
|
---|
| 8 | binaries compiled against Glibc-2.2 work. However, this is not what the
|
---|
| 9 | Glibc developers intended and we don't need to keep this modified Glibc
|
---|
| 10 | around. So we reinstall Glibc here to remove this patch.</para>
|
---|
| 11 |
|
---|
| 12 | <para>A second reason to install Glibc again is because it's considered
|
---|
| 13 | cleaner. The first Glibc was installed using programs compiled on your host
|
---|
| 14 | distribution which sometimes has the effect of tainting Glibc. While this
|
---|
| 15 | isn't a problem with the other packages compiled early in this chapter, for
|
---|
| 16 | Glibc we want to be sure it's 100% OK (although feel free to reinstall
|
---|
| 17 | other packages at this point so you can say you compiled an LFS system with
|
---|
| 18 | LFS. Much like GCC's bootstrap installation method).</para>
|
---|
| 19 |
|
---|
| 20 | <para>We'll also install the linuxthreads man pages here. As you may
|
---|
| 21 | recall, during the first installation of Glibc this wasn't possible because
|
---|
[2b114b25] | 22 | Perl wasn't installed yet. Now that everything needed to install the Glibc
|
---|
| 23 | linuxthreads man pages is present as well, we will install those too.</para>
|
---|
[ebd94a2] | 24 |
|
---|
[2b114b25] | 25 | <para>Before starting to install Glibc, you must cd into the
|
---|
[ebd94a2] | 26 | glibc-&glibc-version; directory and unpack glibc-linuxthreads inside
|
---|
| 27 | the glibc-&glibc-version; directory, not in /usr/src as you normally
|
---|
| 28 | would do.</para>
|
---|
| 29 |
|
---|
| 30 | <para>This package is known to behave badly when you have changed its
|
---|
[2b114b25] | 31 | default optimization flags (including the -march and -mcpu options).
|
---|
| 32 | Therefore, if you have defined any environment variables that override
|
---|
| 33 | default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
|
---|
| 34 | or modifying them when building Glibc. You have been warned.</para>
|
---|
[ebd94a2] | 35 |
|
---|
| 36 | <para>Basically, compiling Glibc in any other way than the book suggests
|
---|
| 37 | is putting your system at very high risk.</para>
|
---|
| 38 |
|
---|
[86bea76] | 39 | <para>It is recommended by the Glibc installation documentation to build
|
---|
| 40 | Glibc outside of the source tree. Create the build directory:</para>
|
---|
[ebd94a2] | 41 |
|
---|
| 42 | <para><screen><userinput>mkdir ../glibc-build &&
|
---|
[86bea76] | 43 | cd ../glibc-build</userinput></screen></para>
|
---|
| 44 |
|
---|
| 45 | <para>Next, prepare Glibc to be compiled:</para>
|
---|
| 46 |
|
---|
| 47 | <para><screen><userinput>../glibc-&glibc-version;/configure --prefix=/usr --disable-profile \
|
---|
| 48 | --enable-add-ons --libexecdir=/usr/bin</userinput></screen></para>
|
---|
| 49 |
|
---|
| 50 | <para>Continue with compiling the package:</para>
|
---|
| 51 |
|
---|
| 52 | <para><screen><userinput>make</userinput></screen></para>
|
---|
| 53 |
|
---|
| 54 | <para>Begin package installation:</para>
|
---|
| 55 |
|
---|
| 56 | <para><screen><userinput>make install</userinput></screen></para>
|
---|
| 57 |
|
---|
| 58 | <para>Build the linuxthreads man pages:</para>
|
---|
| 59 |
|
---|
| 60 | <para><screen><userinput>make -C ../glibc-&glibc-version;/linuxthreads/man</userinput></screen></para>
|
---|
| 61 |
|
---|
| 62 | <para>Install the man pages:</para>
|
---|
| 63 |
|
---|
| 64 | <para><screen><userinput>make -C ../glibc-&glibc-version;/linuxthreads/man install</userinput></screen></para>
|
---|
| 65 |
|
---|
| 66 | <para>Complete package installation by relaunching bash:</para>
|
---|
| 67 |
|
---|
| 68 | <para><screen><userinput>exec /bin/bash --login</userinput></screen></para>
|
---|
[ebd94a2] | 69 |
|
---|
| 70 | </sect2>
|
---|
| 71 |
|
---|