source: chapter06/glibc-32.xml@ 607ea0f

multilib-10.1 multilib-before-cross
Last change on this file since 607ea0f was 607ea0f, checked in by Thomas Trepl <thomas@…>, 2 years ago

MultiLib: Merge changes from trunk
Upgrade isl-0.12
Upgrade linux-firmware-20190519

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

  • Property mode set to 100644
File size: 6.6 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="ml_32,ml_x32,ml_all" 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="installation">
24 <title>Preparation to install of ML-Glibc</title>
25
26<screen><userinput remap="pre">patch -Np1 -i ../&glibc-fhs-patch;</userinput></screen>
27
28 <para>Fix a problem introduced with the linux-5.2 kernel:</para>
29
30<screen><userinput remap="pre">sed -i '/asm.socket.h/a# include &lt;linux/sockios.h&gt;' \
31 sysdeps/unix/sysv/linux/bits/socket.h</userinput></screen>
32
33 <para>Remove a file that may be left over from a previous build attempt:</para>
34
35<screen><userinput remap="pre">mv /usr/include/limits.h{,.backup} </userinput></screen>
36
37 </sect2>
38
39 <!-- ~~~~~~~~~~~~~~~~~~~~ ABI 32 ~~~~~~~~~~~~~~~~~~~~ -->
40
41 <sect2 arch="ml_32,ml_all" role="installation">
42 <title>Installation of Glibc - 32-bit</title>
43
44 <para>The Glibc documentation recommends building Glibc
45 in a dedicated build directory:</para>
46
47<screen><userinput remap="pre">mkdir -v build
48cd build</userinput></screen>
49
50 <para>Prepare Glibc for compilation:</para>
51
52<screen><userinput remap="configure">CC="gcc -m32 -ffile-prefix-map=/tools=/usr" \
53CXX="g++ -m32 -ffile-prefix-map=/tools=/usr" \
54../configure --prefix=/usr \
55 --disable-werror \
56 --enable-kernel=&min-kernel; \
57 --enable-stack-protector=strong \
58 --enable-multi-arch \
59 --libdir=/usr/lib32 \
60 --libexecdir=/usr/lib32 \
61 --with-headers=/usr/include \
62 libc_cv_slibdir=/usr/lib32 \
63 i686-pc-linux-gnu</userinput></screen>
64
65 <para>Compile the package:</para>
66
67<screen><userinput remap="make">make</userinput></screen>
68
69 <para>Install the package:</para>
70
71<screen><userinput remap="install">sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
72make install_root=$PWD/DESTDIR install
73mv -v DESTDIR/usr/lib32/* /usr/lib32/
74install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
75 /usr/include/gnu/
76ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-linux.so.2
77ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-lsb.so.3
78ln -svf ../lib/locale /usr/lib32/locale</userinput></screen>
79
80 <para>Configure the linker cache configuration:</para>
81
82<screen><userinput>echo "/usr/lib32" > /etc/ld.so.conf.d/lib32.conf
83ldconfig</userinput></screen>
84
85 <para>Do cleanup:</para>
86
87<screen><userinput>cd ..
88rm -rf build</userinput></screen>
89
90 </sect2>
91
92 <!-- ~~~~~~~~~~~~~~~~~~~~ ABI x32 ~~~~~~~~~~~~~~~~~~~~ -->
93
94<!--
95In case the compilation ends with
96
97...
98if test -r /autolfs/sources/glibc-2.29/build/DESTDIR/usr/include/gnu/stubs-x32.h && cmp -s /autolfs/sources/glibc-2.29/build/stubs.h /autolfs/sources/glibc-2.29/build/DESTDIR/usr/include/gnu/stubs-x32.h; \
99then echo 'stubs.h unchanged'; \
100else /usr/bin/install -c -m 644 /autolfs/sources/glibc-2.29/build/stubs.h /autolfs/sources/glibc-2.29/build/DESTDIR/usr/include/gnu/stubs-x32.h; fi
101rm -f /autolfs/sources/glibc-2.29/build/stubs.h
102/autolfs/sources/glibc-2.29/build/elf/sln /autolfs/sources/glibc-2.29/build/elf/symlink.list
103/autolfs/sources/glibc-2.29/build/elf/sln: /autolfs/sources/glibc-2.29/build/elf/sln: cannot execute binary file
104make[1]: *** [Makefile:106: install-symbolic-link] Error 126
105make[1]: Leaving directory '/autolfs/sources/glibc-2.29'
106make: *** [Makefile:12: install] Error 2
107
108it is a good sign that the actually running kernel isn't ML-enabled.
109ArchLinux's kernels are configured like
110
111CONFIG_IA32_EMULATION=y
112# CONFIG_IA32_AOUT is not set
113# CONFIG_X86_X32 is not set
114
115It isn't x32-enabled ==> Error when building x32 stuff
116-->
117
118 <sect2 arch="ml_x32,ml_all" role="installation">
119 <title>Glibc - x32-bit</title>
120
121 <para>The Glibc documentation recommends building Glibc
122 in a dedicated build directory:</para>
123
124<screen><userinput remap="pre">mkdir -v build
125cd build</userinput></screen>
126
127 <para>Prepare Glibc for compilation:</para>
128
129<screen><userinput remap="configure">CC="gcc -mx32 -ffile-prefix-map=/tools=/usr" \
130CXX="g++ -mx32 -ffile-prefix-map=/tools=/usr" \
131../configure --prefix=/usr \
132 --disable-werror \
133 --enable-kernel=&min-kernel; \
134 --enable-stack-protector=strong \
135 --enable-multi-arch \
136 --libdir=/usr/libx32 \
137 --with-headers=/usr/include \
138 libc_cv_slibdir=/usr/libx32 \
139 x86_64-pc-linux-gnux32</userinput></screen>
140
141 <para>Compile the package:</para>
142
143<screen><userinput remap="make">make</userinput></screen>
144
145 <para>Install the package:</para>
146
147<screen><userinput remap="install">sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
148make install_root=$PWD/DESTDIR install
149mv -v DESTDIR/usr/libx32/* /usr/libx32/
150install -vm644 DESTDIR/usr/include/gnu/lib-names-x32.h /usr/include/gnu/
151[ -e DESTDIR/usr/include/gnu/stubs-x32.h ] \
152 &amp;&amp; install -vm644 DESTDIR/usr/include/gnu/stubs-x32.h /usr/include/gnu/ \
153 || ln -v /usr/include/gnu/stubs-64.h /usr/include/gnu/stubs-x32.h
154ln -svf ../usr/libx32/ld-linux-x32.so.2 /lib/ld-linux-x32.so.2
155ln -svf ../lib/locale /usr/libx32/locale</userinput></screen>
156<!-- For whatever reason the stubs-x32.h doesn't get created. The 'ln' above is
157just a "brute force" workaraound by copying the stubs-64.h file. -->
158
159 <para>Configure the linker cache configuration:</para>
160
161<screen><userinput>echo "/usr/libx32" > /etc/ld.so.conf.d/libx32.conf
162ldconfig</userinput></screen>
163
164 <para>Do cleanup:</para>
165
166<screen><userinput>cd ..
167rm -rf build</userinput></screen>
168
169 </sect2>
170
171 <!-- ~~~~~~~~~~~~~~~~~~~~ Cleanup ~~~~~~~~~~~~~~~~~~~~ -->
172
173 <sect2 role="installation">
174 <title>Cleanup</title>
175
176 <para>Restore the file we moved temporarily away:</para>
177
178<screen><userinput remap="pre">mv /usr/include/limits.h{.backup,} </userinput></screen>
179
180 </sect2>
181
182</sect1>
Note: See TracBrowser for help on using the repository browser.