source: chapter06/glibc-32.xml@ c3fd1c2

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

Remove a note no longer needed and adjust wording

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

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