2019-04-01 18:00:45 +01:00
<?xml version="1.0" encoding="ISO-8859-1"?>
< !DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
2019-04-07 10:47:30 +01:00
<sect1 arch= "ml_32,ml_x32,ml_all" id= "ch-system-glibc-32" role= "wrap" >
2019-04-01 18:00:45 +01:00
<?dbhtml filename="glibc-32.html"?>
<sect1info condition= "script" >
<productname > glibc-32</productname>
<productnumber > &glibc-version; </productnumber>
<address > &glibc-url; </address>
</sect1info>
<title > Glibc-&glibc-version; - 32-bit</title>
<indexterm zone= "ch-system-glibc-32" >
<primary sortas= "a-Glibc-32" > Glibc-32</primary>
</indexterm>
2019-04-22 07:40:16 +01:00
<sect2 role= "installation" >
<title > Preparation to install of ML-Glibc</title>
<screen > <userinput remap= "pre" > patch -Np1 -i ../&glibc-fhs-patch; </userinput> </screen>
2019-04-01 18:00:45 +01:00
2019-08-05 17:51:20 +01:00
<para > Fix a problem introduced with the linux-5.2 kernel:</para>
<screen > <userinput remap= "pre" > sed -i '/asm.socket.h/a# include < linux/sockios.h> ' \
sysdeps/unix/sysv/linux/bits/socket.h</userinput> </screen>
2019-04-22 07:40:16 +01:00
<para > Remove a file that may be left over from a previous build attempt:</para>
2019-04-01 18:00:45 +01:00
2019-04-22 07:40:16 +01:00
<screen > <userinput remap= "pre" > mv /usr/include/limits.h{,.backup} </userinput> </screen>
2019-04-01 18:00:45 +01:00
</sect2>
2019-04-07 10:47:30 +01:00
<!-- ~~~~~~~~~~~~~~~~~~~~ ABI 32 ~~~~~~~~~~~~~~~~~~~~ -->
<sect2 arch= "ml_32,ml_all" role= "installation" >
2019-04-01 18:00:45 +01:00
<title > Installation of Glibc - 32-bit</title>
<para > The Glibc documentation recommends building Glibc
in a dedicated build directory:</para>
<screen > <userinput remap= "pre" > mkdir -v build
cd build</userinput> </screen>
<para > Prepare Glibc for compilation:</para>
2019-04-22 07:40:16 +01:00
<screen > <userinput remap= "configure" > CC="gcc -m32 -ffile-prefix-map=/tools=/usr" \
CXX="g++ -m32 -ffile-prefix-map=/tools=/usr" \
2019-04-01 18:00:45 +01:00
../configure --prefix=/usr \
--disable-werror \
--enable-kernel=&min-kernel; \
--enable-stack-protector=strong \
2019-10-29 09:04:54 +00:00
--with-headers=/usr/include \
2019-04-01 18:00:45 +01:00
--enable-multi-arch \
--libdir=/usr/lib32 \
--libexecdir=/usr/lib32 \
libc_cv_slibdir=/usr/lib32 \
i686-pc-linux-gnu</userinput> </screen>
<para > Compile the package:</para>
<screen > <userinput remap= "make" > make</userinput> </screen>
<para > Install the package:</para>
<screen > <userinput remap= "install" > sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
make install_root=$PWD/DESTDIR install
mv -v DESTDIR/usr/lib32/* /usr/lib32/
install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
/usr/include/gnu/
ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-linux.so.2
ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-lsb.so.3
ln -svf ../lib/locale /usr/lib32/locale</userinput> </screen>
<para > Configure the linker cache configuration:</para>
<screen > <userinput > echo "/usr/lib32" > /etc/ld.so.conf.d/lib32.conf
ldconfig</userinput> </screen>
<para > Do cleanup:</para>
<screen > <userinput > cd ..
rm -rf build</userinput> </screen>
</sect2>
2019-04-07 10:47:30 +01:00
<!-- ~~~~~~~~~~~~~~~~~~~~ ABI x32 ~~~~~~~~~~~~~~~~~~~~ -->
2019-04-22 07:40:16 +01:00
<!--
In case the compilation ends with
...
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; \
then echo 'stubs.h unchanged'; \
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
rm -f /autolfs/sources/glibc-2.29/build/stubs.h
/autolfs/sources/glibc-2.29/build/elf/sln /autolfs/sources/glibc-2.29/build/elf/symlink.list
/autolfs/sources/glibc-2.29/build/elf/sln: /autolfs/sources/glibc-2.29/build/elf/sln: cannot execute binary file
make[1]: *** [Makefile:106: install-symbolic-link] Error 126
make[1]: Leaving directory '/autolfs/sources/glibc-2.29'
make: *** [Makefile:12: install] Error 2
it is a good sign that the actually running kernel isn't ML-enabled.
ArchLinux's kernels are configured like
CONFIG_IA32_EMULATION=y
# CONFIG_IA32_AOUT is not set
2019-10-29 09:04:54 +00:00
# CONFIG_X86_X32 is not set < < < < <
2019-04-22 07:40:16 +01:00
It isn't x32-enabled ==> Error when building x32 stuff
-->
2019-04-07 10:47:30 +01:00
<sect2 arch= "ml_x32,ml_all" role= "installation" >
2019-04-01 18:00:45 +01:00
<title > Glibc - x32-bit</title>
<para > The Glibc documentation recommends building Glibc
in a dedicated build directory:</para>
<screen > <userinput remap= "pre" > mkdir -v build
cd build</userinput> </screen>
<para > Prepare Glibc for compilation:</para>
2019-04-22 07:40:16 +01:00
<screen > <userinput remap= "configure" > CC="gcc -mx32 -ffile-prefix-map=/tools=/usr" \
CXX="g++ -mx32 -ffile-prefix-map=/tools=/usr" \
2019-04-01 18:00:45 +01:00
../configure --prefix=/usr \
--disable-werror \
--enable-kernel=&min-kernel; \
--enable-stack-protector=strong \
2019-10-29 09:04:54 +00:00
--with-headers=/usr/include \
2019-04-01 18:00:45 +01:00
--enable-multi-arch \
--libdir=/usr/libx32 \
2019-10-29 09:04:54 +00:00
--libexecdir=/usr/libx32 \
2019-04-01 18:00:45 +01:00
libc_cv_slibdir=/usr/libx32 \
x86_64-pc-linux-gnux32</userinput> </screen>
<para > Compile the package:</para>
<screen > <userinput remap= "make" > make</userinput> </screen>
<para > Install the package:</para>
<screen > <userinput remap= "install" > sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
make install_root=$PWD/DESTDIR install
mv -v DESTDIR/usr/libx32/* /usr/libx32/
install -vm644 DESTDIR/usr/include/gnu/lib-names-x32.h /usr/include/gnu/
[ -e DESTDIR/usr/include/gnu/stubs-x32.h ] \
& & install -vm644 DESTDIR/usr/include/gnu/stubs-x32.h /usr/include/gnu/ \
|| ln -v /usr/include/gnu/stubs-64.h /usr/include/gnu/stubs-x32.h
ln -svf ../usr/libx32/ld-linux-x32.so.2 /lib/ld-linux-x32.so.2
ln -svf ../lib/locale /usr/libx32/locale</userinput> </screen>
<!-- For whatever reason the stubs - x32.h doesn't get created. The 'ln' above is
just a "brute force" workaraound by copying the stubs-64.h file. -->
<para > Configure the linker cache configuration:</para>
<screen > <userinput > echo "/usr/libx32" > /etc/ld.so.conf.d/libx32.conf
ldconfig</userinput> </screen>
<para > Do cleanup:</para>
<screen > <userinput > cd ..
rm -rf build</userinput> </screen>
2019-04-22 07:40:16 +01:00
</sect2>
<!-- ~~~~~~~~~~~~~~~~~~~~ Cleanup ~~~~~~~~~~~~~~~~~~~~ -->
<sect2 role= "installation" >
<title > Cleanup</title>
2019-04-01 18:00:45 +01:00
<para > Restore the file we moved temporarily away:</para>
<screen > <userinput remap= "pre" > mv /usr/include/limits.h{.backup,} </userinput> </screen>
</sect2>
2019-04-22 07:40:16 +01:00
2019-04-01 18:00:45 +01:00
</sect1>