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 <linux/sockios.h>' \
|
---|
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
|
---|
48 | cd 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" \
|
---|
53 | CXX="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 | --with-headers=/usr/include \
|
---|
59 | --enable-multi-arch \
|
---|
60 | --libdir=/usr/lib32 \
|
---|
61 | --libexecdir=/usr/lib32 \
|
---|
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
|
---|
72 | make install_root=$PWD/DESTDIR install
|
---|
73 | mv -v DESTDIR/usr/lib32/* /usr/lib32/
|
---|
74 | install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
|
---|
75 | /usr/include/gnu/
|
---|
76 | ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-linux.so.2
|
---|
77 | ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-lsb.so.3
|
---|
78 | ln -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
|
---|
83 | ldconfig</userinput></screen>
|
---|
84 |
|
---|
85 | <para>Do cleanup:</para>
|
---|
86 |
|
---|
87 | <screen><userinput>cd ..
|
---|
88 | rm -rf build</userinput></screen>
|
---|
89 |
|
---|
90 | </sect2>
|
---|
91 |
|
---|
92 | <!-- ~~~~~~~~~~~~~~~~~~~~ ABI x32 ~~~~~~~~~~~~~~~~~~~~ -->
|
---|
93 |
|
---|
94 | <!--
|
---|
95 | In case the compilation ends with
|
---|
96 |
|
---|
97 | ...
|
---|
98 | if 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; \
|
---|
99 | then echo 'stubs.h unchanged'; \
|
---|
100 | else /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
|
---|
101 | rm -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
|
---|
104 | make[1]: *** [Makefile:106: install-symbolic-link] Error 126
|
---|
105 | make[1]: Leaving directory '/autolfs/sources/glibc-2.29'
|
---|
106 | make: *** [Makefile:12: install] Error 2
|
---|
107 |
|
---|
108 | it is a good sign that the actually running kernel isn't ML-enabled.
|
---|
109 | ArchLinux's kernels are configured like
|
---|
110 |
|
---|
111 | CONFIG_IA32_EMULATION=y
|
---|
112 | # CONFIG_IA32_AOUT is not set
|
---|
113 | # CONFIG_X86_X32 is not set <<<<<
|
---|
114 |
|
---|
115 | It 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
|
---|
125 | cd 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" \
|
---|
130 | CXX="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 | --with-headers=/usr/include \
|
---|
136 | --enable-multi-arch \
|
---|
137 | --libdir=/usr/libx32 \
|
---|
138 | --libexecdir=/usr/libx32 \
|
---|
139 | libc_cv_slibdir=/usr/libx32 \
|
---|
140 | x86_64-pc-linux-gnux32</userinput></screen>
|
---|
141 |
|
---|
142 | <para>Compile the package:</para>
|
---|
143 |
|
---|
144 | <screen><userinput remap="make">make</userinput></screen>
|
---|
145 |
|
---|
146 | <para>Install the package:</para>
|
---|
147 |
|
---|
148 | <screen><userinput remap="install">sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
|
---|
149 | make install_root=$PWD/DESTDIR install
|
---|
150 | mv -v DESTDIR/usr/libx32/* /usr/libx32/
|
---|
151 | install -vm644 DESTDIR/usr/include/gnu/lib-names-x32.h /usr/include/gnu/
|
---|
152 | [ -e DESTDIR/usr/include/gnu/stubs-x32.h ] \
|
---|
153 | && install -vm644 DESTDIR/usr/include/gnu/stubs-x32.h /usr/include/gnu/ \
|
---|
154 | || ln -v /usr/include/gnu/stubs-64.h /usr/include/gnu/stubs-x32.h
|
---|
155 | ln -svf ../usr/libx32/ld-linux-x32.so.2 /lib/ld-linux-x32.so.2
|
---|
156 | ln -svf ../lib/locale /usr/libx32/locale</userinput></screen>
|
---|
157 | <!-- For whatever reason the stubs-x32.h doesn't get created. The 'ln' above is
|
---|
158 | just a "brute force" workaraound by copying the stubs-64.h file. -->
|
---|
159 |
|
---|
160 | <para>Configure the linker cache configuration:</para>
|
---|
161 |
|
---|
162 | <screen><userinput>echo "/usr/libx32" > /etc/ld.so.conf.d/libx32.conf
|
---|
163 | ldconfig</userinput></screen>
|
---|
164 |
|
---|
165 | <para>Do cleanup:</para>
|
---|
166 |
|
---|
167 | <screen><userinput>cd ..
|
---|
168 | rm -rf build</userinput></screen>
|
---|
169 |
|
---|
170 | </sect2>
|
---|
171 |
|
---|
172 | <!-- ~~~~~~~~~~~~~~~~~~~~ Cleanup ~~~~~~~~~~~~~~~~~~~~ -->
|
---|
173 |
|
---|
174 | <sect2 role="installation">
|
---|
175 | <title>Cleanup</title>
|
---|
176 |
|
---|
177 | <para>Restore the file we moved temporarily away:</para>
|
---|
178 |
|
---|
179 | <screen><userinput remap="pre">mv /usr/include/limits.h{.backup,} </userinput></screen>
|
---|
180 |
|
---|
181 | </sect2>
|
---|
182 |
|
---|
183 | </sect1>
|
---|