[8eb3fe4] | 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 |
|
---|
[ee1a413] | 8 | <sect1 arch="ml_32,ml_x32,ml_all" id="ch-system-glibc-32" role="wrap">
|
---|
[8eb3fe4] | 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 |
|
---|
[d8fba27] | 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>
|
---|
[8eb3fe4] | 27 |
|
---|
[c3fd1c2] | 28 | <!-- No longer needed
|
---|
[607ea0f] | 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 <linux/sockios.h>' \
|
---|
| 32 | sysdeps/unix/sysv/linux/bits/socket.h</userinput></screen>
|
---|
[c3fd1c2] | 33 | -->
|
---|
| 34 | <para>Temporarily move a file that would get overwritten by the 32-bit builds:</para>
|
---|
[8eb3fe4] | 35 |
|
---|
[d8fba27] | 36 | <screen><userinput remap="pre">mv /usr/include/limits.h{,.backup} </userinput></screen>
|
---|
[8eb3fe4] | 37 |
|
---|
| 38 | </sect2>
|
---|
[ee1a413] | 39 |
|
---|
| 40 | <!-- ~~~~~~~~~~~~~~~~~~~~ ABI 32 ~~~~~~~~~~~~~~~~~~~~ -->
|
---|
| 41 |
|
---|
| 42 | <sect2 arch="ml_32,ml_all" role="installation">
|
---|
[8eb3fe4] | 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
|
---|
| 49 | cd build</userinput></screen>
|
---|
| 50 |
|
---|
| 51 | <para>Prepare Glibc for compilation:</para>
|
---|
| 52 |
|
---|
[d8fba27] | 53 | <screen><userinput remap="configure">CC="gcc -m32 -ffile-prefix-map=/tools=/usr" \
|
---|
| 54 | CXX="g++ -m32 -ffile-prefix-map=/tools=/usr" \
|
---|
[8eb3fe4] | 55 | ../configure --prefix=/usr \
|
---|
| 56 | --disable-werror \
|
---|
| 57 | --enable-kernel=&min-kernel; \
|
---|
| 58 | --enable-stack-protector=strong \
|
---|
[7693759] | 59 | --with-headers=/usr/include \
|
---|
[8eb3fe4] | 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
|
---|
| 73 | make install_root=$PWD/DESTDIR install
|
---|
| 74 | mv -v DESTDIR/usr/lib32/* /usr/lib32/
|
---|
| 75 | install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
|
---|
| 76 | /usr/include/gnu/
|
---|
| 77 | ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-linux.so.2
|
---|
| 78 | ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-lsb.so.3
|
---|
| 79 | ln -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
|
---|
| 84 | ldconfig</userinput></screen>
|
---|
| 85 |
|
---|
| 86 | <para>Do cleanup:</para>
|
---|
| 87 |
|
---|
| 88 | <screen><userinput>cd ..
|
---|
| 89 | rm -rf build</userinput></screen>
|
---|
| 90 |
|
---|
| 91 | </sect2>
|
---|
| 92 |
|
---|
[ee1a413] | 93 | <!-- ~~~~~~~~~~~~~~~~~~~~ ABI x32 ~~~~~~~~~~~~~~~~~~~~ -->
|
---|
[d8fba27] | 94 |
|
---|
| 95 | <!--
|
---|
| 96 | In case the compilation ends with
|
---|
| 97 |
|
---|
| 98 | ...
|
---|
| 99 | 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; \
|
---|
| 100 | then echo 'stubs.h unchanged'; \
|
---|
| 101 | 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
|
---|
| 102 | rm -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
|
---|
| 105 | make[1]: *** [Makefile:106: install-symbolic-link] Error 126
|
---|
| 106 | make[1]: Leaving directory '/autolfs/sources/glibc-2.29'
|
---|
| 107 | make: *** [Makefile:12: install] Error 2
|
---|
| 108 |
|
---|
| 109 | it is a good sign that the actually running kernel isn't ML-enabled.
|
---|
| 110 | ArchLinux's kernels are configured like
|
---|
| 111 |
|
---|
| 112 | CONFIG_IA32_EMULATION=y
|
---|
| 113 | # CONFIG_IA32_AOUT is not set
|
---|
[7693759] | 114 | # CONFIG_X86_X32 is not set <<<<<
|
---|
[d8fba27] | 115 |
|
---|
| 116 | It isn't x32-enabled ==> Error when building x32 stuff
|
---|
| 117 | -->
|
---|
[ee1a413] | 118 |
|
---|
| 119 | <sect2 arch="ml_x32,ml_all" role="installation">
|
---|
[8eb3fe4] | 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
|
---|
| 126 | cd build</userinput></screen>
|
---|
| 127 |
|
---|
| 128 | <para>Prepare Glibc for compilation:</para>
|
---|
| 129 |
|
---|
[d8fba27] | 130 | <screen><userinput remap="configure">CC="gcc -mx32 -ffile-prefix-map=/tools=/usr" \
|
---|
| 131 | CXX="g++ -mx32 -ffile-prefix-map=/tools=/usr" \
|
---|
[8eb3fe4] | 132 | ../configure --prefix=/usr \
|
---|
| 133 | --disable-werror \
|
---|
| 134 | --enable-kernel=&min-kernel; \
|
---|
| 135 | --enable-stack-protector=strong \
|
---|
[7693759] | 136 | --with-headers=/usr/include \
|
---|
[8eb3fe4] | 137 | --enable-multi-arch \
|
---|
| 138 | --libdir=/usr/libx32 \
|
---|
[7693759] | 139 | --libexecdir=/usr/libx32 \
|
---|
[8eb3fe4] | 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
|
---|
| 150 | make install_root=$PWD/DESTDIR install
|
---|
| 151 | mv -v DESTDIR/usr/libx32/* /usr/libx32/
|
---|
| 152 | install -vm644 DESTDIR/usr/include/gnu/lib-names-x32.h /usr/include/gnu/
|
---|
| 153 | [ -e DESTDIR/usr/include/gnu/stubs-x32.h ] \
|
---|
| 154 | && 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
|
---|
| 156 | ln -svf ../usr/libx32/ld-linux-x32.so.2 /lib/ld-linux-x32.so.2
|
---|
| 157 | ln -svf ../lib/locale /usr/libx32/locale</userinput></screen>
|
---|
| 158 | <!-- For whatever reason the stubs-x32.h doesn't get created. The 'ln' above is
|
---|
| 159 | just 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
|
---|
| 164 | ldconfig</userinput></screen>
|
---|
| 165 |
|
---|
| 166 | <para>Do cleanup:</para>
|
---|
| 167 |
|
---|
| 168 | <screen><userinput>cd ..
|
---|
| 169 | rm -rf build</userinput></screen>
|
---|
| 170 |
|
---|
[d8fba27] | 171 | </sect2>
|
---|
| 172 |
|
---|
| 173 | <!-- ~~~~~~~~~~~~~~~~~~~~ Cleanup ~~~~~~~~~~~~~~~~~~~~ -->
|
---|
| 174 |
|
---|
| 175 | <sect2 role="installation">
|
---|
| 176 | <title>Cleanup</title>
|
---|
| 177 |
|
---|
[8eb3fe4] | 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>
|
---|
[d8fba27] | 183 |
|
---|
[8eb3fe4] | 184 | </sect1>
|
---|