Преглед изворни кода

Opted for case syntax for testing the architecture in Glibc

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/jh/BOOK@8402 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Jeremy Huntwork пре 18 година
родитељ
комит
ecdeed26b6
3 измењених фајлова са 14 додато и 18 уклоњено
  1. 9 13
      chapter05/adjusting.xml
  2. 3 3
      chapter05/glibc.xml
  3. 2 2
      chapter06/glibc.xml

+ 9 - 13
chapter05/adjusting.xml

@@ -32,22 +32,18 @@ ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld</userinput></screen>
   <para>The next task is to point GCC to the new dynamic linker. This is done by
   dumping GCC's <quote>specs</quote> file to a location where GCC will look for it
   by default. A simple <command>sed</command> substitution then alters the
-  dynamic linker that GCC will use.</para>
+  dynamic linker that GCC will use. The principle here is to find all references
+  to the dynamic linker file in <filename class="directory">/lib</filename>
+  or possibly <filename class="directory">/lib64</filename> if the host system
+  is 64-bit capable, and adjust them to point to the new location in
+  <filename class="directory">/tools</filename>.</para>
 
   <para>For the sake of accuracy, it is recommended to use a copy-and-paste
   method when issuing the following command. Be sure to visually inspect the
-  specs file and verify that all occurrences of <quote>/lib/ld-linux.so.2</quote>
-  have been replaced with <quote>/tools/lib/ld-linux.so.2</quote>:</para>
-
-  <important>
-    <para>If working on a platform where the name of the dynamic linker is
-    something other than <filename class="libraryfile">ld-linux.so.2</filename>,
-    replace <quote>ld-linux.so.2</quote> with the name of the platform's
-    dynamic linker in the following commands. Refer to <xref
-    linkend="ch-tools-toolchaintechnotes" role=","/> if necessary. Additionally,
-    note that on 64-bit machines the linker may actually be expected in the
-    <filename class="directory">/lib64</filename> directory.</para>
-  </important>
+  specs file to verify that it has properly adjusted all references to the
+  dynamic linker location. Refer to <xref
+    linkend="ch-tools-toolchaintechnotes" role=","/> for the default name
+  of the dynamic linker, if necessary.</para>
 
 <!-- Ampersands are needed to allow copy and paste -->
 <screen><userinput>gcc -dumpspecs | sed 's@/lib\(64\)\?/ld@/tools&amp;@g' \

+ 3 - 3
chapter05/glibc.xml

@@ -59,9 +59,9 @@ cd ../glibc-build</userinput></screen>
     -mtune=native flag is also necessary to reset a reasonable value for -mtune
     that is changed when setting -march.</para>
 
-<screen><userinput remap="configure">if [ uname -m | grep -q i[4-7]86 ]; do
-  echo "CFLAGS += -march=i486" &gt; configparms
-done</userinput></screen>
+<screen><userinput remap="configure">case `uname -m` in
+  i?86) echo "CFLAGS += -march=i486 -mtune=native" &gt; configparms ;;
+esac</userinput></screen>
 
     <para>Next, prepare Glibc for compilation:</para>
 

+ 2 - 2
chapter06/glibc.xml

@@ -106,8 +106,8 @@ cd ../glibc-build</userinput></screen>
 
     <para>Again, add the needed compiler flags to CFLAGS for x86 machines:</para>
 
-<screen><userinput remap="configure">if [ uname -m | grep -q i[4-7]86 ]; do
-  echo "CFLAGS += -march=i486" &gt; configparms
+<screen><userinput remap="configure">case `uname -m` in
+  i?86) echo "CFLAGS += -march=i486 -mtune=native" &gt; configparms ;;
 done</userinput></screen>
 
     <para>Prepare Glibc for compilation:</para>