glibc-32.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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. <sect1 arch="ml_32,ml_x32,ml_all" id="ch-system-glibc-32" role="wrap">
  8. <?dbhtml filename="glibc-32.html"?>
  9. <sect1info condition="script">
  10. <productname>glibc-32</productname>
  11. <productnumber>&glibc-version;</productnumber>
  12. <address>&glibc-url;</address>
  13. </sect1info>
  14. <title>Glibc-&glibc-version; - 32-bit</title>
  15. <indexterm zone="ch-system-glibc-32">
  16. <primary sortas="a-Glibc-32">Glibc-32</primary>
  17. </indexterm>
  18. <sect2 role="installation">
  19. <title>Preparation to install of ML-Glibc</title>
  20. <screen><userinput remap="pre">patch -Np1 -i ../&glibc-fhs-patch;</userinput></screen>
  21. <!-- No longer needed
  22. <para>Fix a problem introduced with the linux-5.2 kernel:</para>
  23. <screen><userinput remap="pre">sed -i '/asm.socket.h/a# include &lt;linux/sockios.h&gt;' \
  24. sysdeps/unix/sysv/linux/bits/socket.h</userinput></screen>
  25. -->
  26. <para>Temporarily move a file that would get overwritten by the 32-bit builds:</para>
  27. <screen><userinput remap="pre">mv /usr/include/limits.h{,.backup} </userinput></screen>
  28. </sect2>
  29. <!-- ~~~~~~~~~~~~~~~~~~~~ ABI 32 ~~~~~~~~~~~~~~~~~~~~ -->
  30. <sect2 arch="ml_32,ml_all" role="installation">
  31. <title>Installation of Glibc - 32-bit</title>
  32. <para>The Glibc documentation recommends building Glibc
  33. in a dedicated build directory:</para>
  34. <screen><userinput remap="pre">mkdir -v build
  35. cd build</userinput></screen>
  36. <para>Prepare Glibc for compilation:</para>
  37. <screen><userinput remap="configure">CC="gcc -m32 -ffile-prefix-map=/tools=/usr" \
  38. CXX="g++ -m32 -ffile-prefix-map=/tools=/usr" \
  39. ../configure --prefix=/usr \
  40. --disable-werror \
  41. --enable-kernel=&min-kernel; \
  42. --enable-stack-protector=strong \
  43. --with-headers=/usr/include \
  44. --enable-multi-arch \
  45. --libdir=/usr/lib32 \
  46. --libexecdir=/usr/lib32 \
  47. libc_cv_slibdir=/usr/lib32 \
  48. i686-pc-linux-gnu</userinput></screen>
  49. <para>Compile the package:</para>
  50. <screen><userinput remap="make">make</userinput></screen>
  51. <para>Install the package:</para>
  52. <screen><userinput remap="install">sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
  53. make install_root=$PWD/DESTDIR install
  54. mv -v DESTDIR/usr/lib32/* /usr/lib32/
  55. install -vm644 DESTDIR/usr/include/gnu/{lib-names,stubs}-32.h \
  56. /usr/include/gnu/
  57. ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-linux.so.2
  58. ln -svf ../usr/lib32/ld-linux.so.2 /lib/ld-lsb.so.3
  59. ln -svf ../lib/locale /usr/lib32/locale</userinput></screen>
  60. <para>Configure the linker cache configuration:</para>
  61. <screen><userinput>echo "/usr/lib32" > /etc/ld.so.conf.d/lib32.conf
  62. ldconfig</userinput></screen>
  63. <para>Do cleanup:</para>
  64. <screen><userinput>cd ..
  65. rm -rf build</userinput></screen>
  66. </sect2>
  67. <!-- ~~~~~~~~~~~~~~~~~~~~ ABI x32 ~~~~~~~~~~~~~~~~~~~~ -->
  68. <!--
  69. In case the compilation ends with
  70. ...
  71. 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; \
  72. then echo 'stubs.h unchanged'; \
  73. 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
  74. rm -f /autolfs/sources/glibc-2.29/build/stubs.h
  75. /autolfs/sources/glibc-2.29/build/elf/sln /autolfs/sources/glibc-2.29/build/elf/symlink.list
  76. /autolfs/sources/glibc-2.29/build/elf/sln: /autolfs/sources/glibc-2.29/build/elf/sln: cannot execute binary file
  77. make[1]: *** [Makefile:106: install-symbolic-link] Error 126
  78. make[1]: Leaving directory '/autolfs/sources/glibc-2.29'
  79. make: *** [Makefile:12: install] Error 2
  80. it is a good sign that the actually running kernel isn't ML-enabled.
  81. ArchLinux's kernels are configured like
  82. CONFIG_IA32_EMULATION=y
  83. # CONFIG_IA32_AOUT is not set
  84. # CONFIG_X86_X32 is not set <<<<<
  85. It isn't x32-enabled ==> Error when building x32 stuff
  86. -->
  87. <sect2 arch="ml_x32,ml_all" role="installation">
  88. <title>Glibc - x32-bit</title>
  89. <para>The Glibc documentation recommends building Glibc
  90. in a dedicated build directory:</para>
  91. <screen><userinput remap="pre">mkdir -v build
  92. cd build</userinput></screen>
  93. <para>Prepare Glibc for compilation:</para>
  94. <screen><userinput remap="configure">CC="gcc -mx32 -ffile-prefix-map=/tools=/usr" \
  95. CXX="g++ -mx32 -ffile-prefix-map=/tools=/usr" \
  96. ../configure --prefix=/usr \
  97. --disable-werror \
  98. --enable-kernel=&min-kernel; \
  99. --enable-stack-protector=strong \
  100. --with-headers=/usr/include \
  101. --enable-multi-arch \
  102. --libdir=/usr/libx32 \
  103. --libexecdir=/usr/libx32 \
  104. libc_cv_slibdir=/usr/libx32 \
  105. x86_64-pc-linux-gnux32</userinput></screen>
  106. <para>Compile the package:</para>
  107. <screen><userinput remap="make">make</userinput></screen>
  108. <para>Install the package:</para>
  109. <screen><userinput remap="install">sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile
  110. make install_root=$PWD/DESTDIR install
  111. mv -v DESTDIR/usr/libx32/* /usr/libx32/
  112. install -vm644 DESTDIR/usr/include/gnu/lib-names-x32.h /usr/include/gnu/
  113. [ -e DESTDIR/usr/include/gnu/stubs-x32.h ] \
  114. &amp;&amp; install -vm644 DESTDIR/usr/include/gnu/stubs-x32.h /usr/include/gnu/ \
  115. || ln -v /usr/include/gnu/stubs-64.h /usr/include/gnu/stubs-x32.h
  116. ln -svf ../usr/libx32/ld-linux-x32.so.2 /lib/ld-linux-x32.so.2
  117. ln -svf ../lib/locale /usr/libx32/locale</userinput></screen>
  118. <!-- For whatever reason the stubs-x32.h doesn't get created. The 'ln' above is
  119. just a "brute force" workaraound by copying the stubs-64.h file. -->
  120. <para>Configure the linker cache configuration:</para>
  121. <screen><userinput>echo "/usr/libx32" > /etc/ld.so.conf.d/libx32.conf
  122. ldconfig</userinput></screen>
  123. <para>Do cleanup:</para>
  124. <screen><userinput>cd ..
  125. rm -rf build</userinput></screen>
  126. </sect2>
  127. <!-- ~~~~~~~~~~~~~~~~~~~~ Cleanup ~~~~~~~~~~~~~~~~~~~~ -->
  128. <sect2 role="installation">
  129. <title>Cleanup</title>
  130. <para>Restore the file we moved temporarily away:</para>
  131. <screen><userinput remap="pre">mv /usr/include/limits.h{.backup,} </userinput></screen>
  132. </sect2>
  133. </sect1>