LFS-SVN-no-lib64-20161202.diff 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. Index: chapter05/gcc-pass1.xml
  2. ===================================================================
  3. --- chapter05/gcc-pass1.xml (revision 11147)
  4. +++ chapter05/gcc-pass1.xml (working copy)
  5. @@ -68,8 +68,7 @@
  6. class="directory">/usr/include</filename> from GCC's include search path.
  7. Issue:</para>
  8. -<screen><userinput remap="pre">for file in \
  9. - $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
  10. +<screen><userinput remap="pre">for file in gcc/config/{linux,i386/linux{,64}}.h
  11. do
  12. cp -uv $file{,.orig}
  13. sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&amp;@g' \
  14. @@ -97,7 +96,18 @@
  15. Finally, we use <command>touch</command> to update the timestamp on the
  16. copied files. When used in conjunction with <command>cp -u</command>, this
  17. prevents unexpected changes to the original files in case the commands are
  18. - inadvertently run twice. </para>
  19. + inadvertently run twice.</para>
  20. +
  21. + <para>Finally, on x86_64 hosts, set the default directory name for
  22. + 64-bit libraries to <quote>lib</quote>:</para>
  23. +
  24. +<screen><userinput remap="pre">case $(uname -m) in
  25. + x86_64)
  26. + sed -e '/m64=/s/lib64/lib/' \
  27. + -i.orig gcc/config/i386/t-linux64
  28. + ;;
  29. +esac</userinput></screen>
  30. +
  31. <!--
  32. <para>GCC doesn't detect stack protection correctly, which causes problems
  33. for the build of Glibc-&glibc-version;, so fix that by issuing the following
  34. @@ -123,6 +133,7 @@
  35. --target=$LFS_TGT \
  36. --prefix=/tools \
  37. --with-glibc-version=2.11 \
  38. + --with-slibdir=/tools/lib \
  39. --with-sysroot=$LFS \
  40. --with-newlib \
  41. --without-headers \
  42. Index: chapter05/gcc-pass2.xml
  43. ===================================================================
  44. --- chapter05/gcc-pass2.xml (revision 11147)
  45. +++ chapter05/gcc-pass2.xml (working copy)
  46. @@ -70,8 +70,7 @@
  47. use the one installed in <filename
  48. class="directory">/tools</filename>.</para>
  49. -<screen><userinput remap="pre">for file in \
  50. - $(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
  51. +<screen><userinput remap="pre">for file in gcc/config/{linux,i386/linux{,64}}.h
  52. do
  53. cp -uv $file{,.orig}
  54. sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&amp;@g' \
  55. @@ -84,6 +83,16 @@
  56. touch $file.orig
  57. done</userinput></screen>
  58. + <para>If building on x86_64, change the default directory name for 64-bit
  59. + libraries to <quote>lib</quote>:</para>
  60. +
  61. +<screen><userinput remap="pre">case $(uname -m) in
  62. + x86_64)
  63. + sed -e '/m64=/s/lib64/lib/' \
  64. + -i.orig gcc/config/i386/t-linux64
  65. + ;;
  66. +esac</userinput></screen>
  67. +
  68. <para>As in the first build of GCC it requires the GMP, MPFR and MPC
  69. packages. Unpack the tarballs and move them into the required directory
  70. names:</para>
  71. @@ -117,6 +126,7 @@
  72. --prefix=/tools \
  73. --with-local-prefix=/tools \
  74. --with-native-system-header-dir=/tools/include \
  75. + --with-slibdir=/tools/lib \
  76. --enable-languages=c,c++ \
  77. --disable-libstdcxx-pch \
  78. --disable-multilib \
  79. Index: chapter06/creatingdirs.xml
  80. ===================================================================
  81. --- chapter06/creatingdirs.xml (revision 11147)
  82. +++ chapter06/creatingdirs.xml (working copy)
  83. @@ -24,9 +24,7 @@
  84. mkdir -pv /usr/{,local/}share/man/man{1..8}
  85. case $(uname -m) in
  86. - x86_64) ln -sv lib /lib64
  87. - ln -sv lib /usr/lib64
  88. - ln -sv lib /usr/local/lib64 ;;
  89. + x86_64) mkdir -v /lib64 ;;
  90. esac
  91. mkdir -v /var/{log,mail,spool}
  92. Index: chapter06/gcc.xml
  93. ===================================================================
  94. --- chapter06/gcc.xml (revision 11147)
  95. +++ chapter06/gcc.xml (working copy)
  96. @@ -45,6 +45,16 @@
  97. <screen><userinput remap="pre">patch -Np1 -i ../gcc-6.1.0-asan-1.patch</userinput></screen>
  98. -->
  99. + <para>If building on x86_64, change the default direcotory name for 64-bit
  100. + libraries to <quote>lib</quote>:</para>
  101. +
  102. +<screen><userinput remap="pre">case $(uname -m) in
  103. + x86_64)
  104. + sed -e '/m64=/s/lib64/lib/' \
  105. + -i.orig gcc/config/i386/t-linux64
  106. + ;;
  107. +esac</userinput></screen>
  108. +
  109. <para>The GCC documentation recommends building GCC in a dedicated build directory:</para>
  110. <screen><userinput remap="pre">mkdir -v build
  111. @@ -175,10 +185,8 @@
  112. <para>Depending on your machine architecture, the above may differ slightly,
  113. the difference usually being the name of the directory
  114. - after <filename class="directory">/usr/lib/gcc</filename>. If your machine is
  115. - a 64-bit system, you may also see a directory named <filename class="directory">lib64</filename>
  116. - towards the end of the string. The important thing to
  117. - look for here is that <command>gcc</command> has found all three
  118. + after <filename class="directory">/usr/lib/gcc</filename>. The important
  119. + thing to look for here is that <command>gcc</command> has found all three
  120. <filename>crt*.o</filename> files under the
  121. <filename class="directory">/usr/lib</filename> directory.</para>
  122. Index: chapter06/glibc.xml
  123. ===================================================================
  124. --- chapter06/glibc.xml (revision 11147)
  125. +++ chapter06/glibc.xml (working copy)
  126. @@ -57,6 +57,18 @@
  127. <screen><userinput remap="pre">patch -Np1 -i ../&glibc-fhs-patch;</userinput></screen>
  128. + <para>Create a symlink for LSB compliance and, for x86_64, a
  129. + compatibility symlink required for the dynamic loader to function
  130. + correctly:</para>
  131. +
  132. +<screen><userinput remap="pre">case $(uname -m) in
  133. + x86) ln -s ld-linux.so.2 /lib/ld-lsb.so.3
  134. + ;;
  135. + x86_64) ln -s ../lib/ld-linux-x86-64.so.2 /lib64
  136. + ln -s ../lib/ld-linux-x86-64.so.2 /lib64/ld-lsb-x86-64.so.3
  137. + ;;
  138. +esac</userinput></screen>
  139. +
  140. <para>The Glibc documentation recommends building Glibc
  141. in a dedicated build directory:</para>
  142. @@ -67,7 +79,8 @@
  143. <screen><userinput remap="configure">../configure --prefix=/usr \
  144. --enable-kernel=&min-kernel; \
  145. - --enable-obsolete-rpc</userinput></screen>
  146. + --enable-obsolete-rpc \
  147. + libc_cv_slibdir=/lib</userinput></screen>
  148. <para>Compile the package:</para>
  149. Index: chapter06/libcap.xml
  150. ===================================================================
  151. --- chapter06/libcap.xml (revision 11147)
  152. +++ chapter06/libcap.xml (working copy)
  153. @@ -55,7 +55,7 @@
  154. <para>Install the package:</para>
  155. -<screen><userinput remap="install">make RAISE_SETFCAP=no prefix=/usr install
  156. +<screen><userinput remap="install">make RAISE_SETFCAP=no lib=lib prefix=/usr install
  157. chmod -v 755 /usr/lib/libcap.so</userinput></screen>
  158. <variablelist>