[b3f1ebb3] | 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 |
|
---|
[fd48baa] | 8 | <sect1 arch="ml_32,ml_x32,ml_all" id="ch-system-glibc-32" role="wrap">
|
---|
[b3f1ebb3] | 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 |
|
---|
[d82ab5d] | 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>
|
---|
[b3f1ebb3] | 27 |
|
---|
[bc375da6] | 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 |
|
---|
[d82ab5d] | 33 | <para>Remove a file that may be left over from a previous build attempt:</para>
|
---|
[b3f1ebb3] | 34 |
|
---|
[d82ab5d] | 35 | <screen><userinput remap="pre">mv /usr/include/limits.h{,.backup} </userinput></screen>
|
---|
[b3f1ebb3] | 36 |
|
---|
| 37 | </sect2>
|
---|
[fd48baa] | 38 |
|
---|
| 39 | <!-- ~~~~~~~~~~~~~~~~~~~~ ABI 32 ~~~~~~~~~~~~~~~~~~~~ -->
|
---|
| 40 |
|
---|
| 41 | <sect2 arch="ml_32,ml_all" role="installation">
|
---|
[b3f1ebb3] | 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 |
|
---|
[d82ab5d] | 52 | <screen><userinput remap="configure">CC="gcc -m32 -ffile-prefix-map=/tools=/usr" \
|
---|
| 53 | CXX="g++ -m32 -ffile-prefix-map=/tools=/usr" \
|
---|
[b3f1ebb3] | 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
|
---|
| 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 |
|
---|
[fd48baa] | 92 | <!-- ~~~~~~~~~~~~~~~~~~~~ ABI x32 ~~~~~~~~~~~~~~~~~~~~ -->
|
---|
[d82ab5d] | 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 | -->
|
---|
[fd48baa] | 117 |
|
---|
| 118 | <sect2 arch="ml_x32,ml_all" role="installation">
|
---|
[b3f1ebb3] | 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 |
|
---|
[d82ab5d] | 129 | <screen><userinput remap="configure">CC="gcc -mx32 -ffile-prefix-map=/tools=/usr" \
|
---|
| 130 | CXX="g++ -mx32 -ffile-prefix-map=/tools=/usr" \
|
---|
[b3f1ebb3] | 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
|
---|
| 148 | make install_root=$PWD/DESTDIR install
|
---|
| 149 | mv -v DESTDIR/usr/libx32/* /usr/libx32/
|
---|
| 150 | install -vm644 DESTDIR/usr/include/gnu/lib-names-x32.h /usr/include/gnu/
|
---|
| 151 | [ -e DESTDIR/usr/include/gnu/stubs-x32.h ] \
|
---|
| 152 | && 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
|
---|
| 154 | ln -svf ../usr/libx32/ld-linux-x32.so.2 /lib/ld-linux-x32.so.2
|
---|
| 155 | ln -svf ../lib/locale /usr/libx32/locale</userinput></screen>
|
---|
| 156 | <!-- For whatever reason the stubs-x32.h doesn't get created. The 'ln' above is
|
---|
| 157 | just 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
|
---|
| 162 | ldconfig</userinput></screen>
|
---|
| 163 |
|
---|
| 164 | <para>Do cleanup:</para>
|
---|
| 165 |
|
---|
| 166 | <screen><userinput>cd ..
|
---|
| 167 | rm -rf build</userinput></screen>
|
---|
| 168 |
|
---|
[d82ab5d] | 169 | </sect2>
|
---|
| 170 |
|
---|
| 171 | <!-- ~~~~~~~~~~~~~~~~~~~~ Cleanup ~~~~~~~~~~~~~~~~~~~~ -->
|
---|
| 172 |
|
---|
| 173 | <sect2 role="installation">
|
---|
| 174 | <title>Cleanup</title>
|
---|
| 175 |
|
---|
[b3f1ebb3] | 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>
|
---|
[d82ab5d] | 181 |
|
---|
[b3f1ebb3] | 182 | </sect1>
|
---|