source: chapter06/glibc-32.xml@ 8eb3fe4

multilib-10.1
Last change on this file since 8eb3fe4 was 8eb3fe4, checked in by Thomas Trepl <thomas@…>, 5 years ago

First apply of multilib-patch of April 1st, 2019

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/multilib@11566 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 5.5 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
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 arch="multilib" id="ch-system-glibc-32" role="wrap">
9 <?dbhtml filename="glibc-32.html"?>
10
11 <sect1info condition="script">
12 <productname>glibc-32</productname>
13 <productnumber>&glibc-version;</productnumber>
14 <address>&glibc-url;</address>
15 </sect1info>
16
17 <title>Glibc-&glibc-version; - 32-bit</title>
18
19 <indexterm zone="ch-system-glibc-32">
20 <primary sortas="a-Glibc-32">Glibc-32</primary>
21 </indexterm>
22<!--
23 <sect2 role="package">
24 <title/>
25
26 <para>The Glibc package contains the main C library. This library provides
27 the basic routines for allocating memory, searching directories, opening and
28 closing files, reading and writing files, string handling, pattern matching,
29 arithmetic, and so on.</para>
30
31 <segmentedlist>
32 <segtitle>&buildtime;</segtitle>
33 <segtitle>&diskspace;</segtitle>
34
35 <seglistitem>
36 <seg>&glibc-ch6-sbu;</seg>
37 <seg>&glibc-ch6-du;</seg>
38 </seglistitem>
39 </segmentedlist>
40
41 </sect2>
42-->
43 <sect2 role="installation">
44 <title>Installation of Glibc - 32-bit</title>
45
46<screen><userinput remap="pre">patch -Np1 -i ../&glibc-fhs-patch;</userinput></screen>
47
48 <para>Remove a file that may be left over from a previous build attempt:</para>
49
50<screen><userinput remap="pre">mv /usr/include/limits.h{,.backup} </userinput></screen>
51
52 <para>The Glibc documentation recommends building Glibc
53 in a dedicated build directory:</para>
54
55<screen><userinput remap="pre">mkdir -v build
56cd build</userinput></screen>
57
58 <para>Prepare Glibc for compilation:</para>
59
60<screen><userinput remap="configure">CC="gcc -m32 -ffile-prefix-map=/tools=/usr -isystem /usr/include" \
61CXX="g++ -m32 -ffile-prefix-map=/tools=/usr -isystem /usr/include" \
62../configure --prefix=/usr \
63 --disable-werror \
64 --enable-kernel=&min-kernel; \
65 --enable-stack-protector=strong \
66 --enable-multi-arch \
67 --libdir=/usr/lib32 \
68 --libexecdir=/usr/lib32 \
69 --with-headers=/usr/include \
70 libc_cv_slibdir=/usr/lib32 \
71 i686-pc-linux-gnu</userinput></screen>
72
73 <para>Compile the package:</para>
74
75<screen><userinput remap="make">make</userinput></screen>
76
77 <para>Install the package:</para>
78
79<screen><userinput remap="install">sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
80make install_root=$PWD/DESTDIR install
81mv -v DESTDIR/usr/lib32/* /usr/lib32/
82install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
83 /usr/include/gnu/
84ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-linux.so.2
85ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-lsb.so.3
86ln -svf ../lib/locale /usr/lib32/locale</userinput></screen>
87
88 <para>Configure the linker cache configuration:</para>
89
90<screen><userinput>echo "/usr/lib32" > /etc/ld.so.conf.d/lib32.conf
91ldconfig</userinput></screen>
92
93 <para>Do cleanup:</para>
94
95<screen><userinput>cd ..
96rm -rf build</userinput></screen>
97
98 </sect2>
99
100 <sect2>
101 <title>Glibc - x32-bit</title>
102
103 <para>The Glibc documentation recommends building Glibc
104 in a dedicated build directory:</para>
105
106<screen><userinput remap="pre">mkdir -v build
107cd build</userinput></screen>
108
109 <para>Prepare Glibc for compilation:</para>
110
111<screen><userinput remap="configure">CC="gcc -mx32 -ffile-prefix-map=/tools=/usr -isystem /usr/include" \
112CXX="g++ -mx32 -ffile-prefix-map=/tools=/usr -isystem /usr/include" \
113../configure --prefix=/usr \
114 --disable-werror \
115 --enable-kernel=&min-kernel; \
116 --enable-stack-protector=strong \
117 --enable-multi-arch \
118 --libdir=/usr/libx32 \
119 --with-headers=/usr/include \
120 libc_cv_slibdir=/usr/libx32 \
121 x86_64-pc-linux-gnux32</userinput></screen>
122
123 <para>Compile the package:</para>
124
125<screen><userinput remap="make">make</userinput></screen>
126
127 <para>Install the package:</para>
128
129<screen><userinput remap="install">sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
130make install_root=$PWD/DESTDIR install
131mv -v DESTDIR/usr/libx32/* /usr/libx32/
132install -vm644 DESTDIR/usr/include/gnu/lib-names-x32.h /usr/include/gnu/
133[ -e DESTDIR/usr/include/gnu/stubs-x32.h ] \
134 &amp;&amp; install -vm644 DESTDIR/usr/include/gnu/stubs-x32.h /usr/include/gnu/ \
135 || ln -v /usr/include/gnu/stubs-64.h /usr/include/gnu/stubs-x32.h
136ln -svf ../usr/libx32/ld-linux-x32.so.2 /lib/ld-linux-x32.so.2
137ln -svf ../lib/locale /usr/libx32/locale</userinput></screen>
138<!-- For whatever reason the stubs-x32.h doesn't get created. The 'ln' above is
139just a "brute force" workaraound by copying the stubs-64.h file. -->
140
141 <para>Configure the linker cache configuration:</para>
142
143<screen><userinput>echo "/usr/libx32" > /etc/ld.so.conf.d/libx32.conf
144ldconfig</userinput></screen>
145
146 <para>Do cleanup:</para>
147
148<screen><userinput>cd ..
149rm -rf build</userinput></screen>
150
151 <para>Restore the file we moved temporarily away:</para>
152
153<screen><userinput remap="pre">mv /usr/include/limits.h{.backup,} </userinput></screen>
154
155 </sect2>
156
157</sect1>
158
Note: See TracBrowser for help on using the repository browser.