Changeset 5aa74f2 for chapter05/adjusting.xml
- Timestamp:
- 01/17/2006 07:39:16 PM (18 years ago)
- Children:
- 23102484
- Parents:
- 8fee5c5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter05/adjusting.xml
r8fee5c5 r5aa74f2 1 1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ 2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" 3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ 3 4 <!ENTITY % general-entities SYSTEM "../general.ent"> 4 5 %general-entities; 5 6 ]> 7 6 8 <sect1 id="ch-tools-adjusting"> 7 <title>Adjusting the Toolchain</title> 8 <?dbhtml filename="adjusting.html"?> 9 <?dbhtml filename="adjusting.html"?> 9 10 10 <para>Now that the temporary C libraries have been installed, all 11 tools compiled in the rest of this chapter should be linked against 12 these libraries. In order to accomplish this, the linker and the 13 compiler's specs file need to be adjusted.</para> 11 <title>Ajustar las herramientas</title> 14 12 15 <para>The linker, adjusted at the end of the first pass of Binutils, 16 is installed by running the following command from within the 17 <filename class="directory">binutils-build</filename> directory:</para> 13 <para>Ahora que se han instalado las librerías de C temporales, todas las 14 herramientas que compilemos en el resto de este capítulo deberían enlazarse 15 contra ellas. Para conseguirlo, deben ajustarse el enlazador y el fichero 16 specs del compilador.</para> 17 18 <para>El enlazador, que se ajustó al final del primer paso de Binutils, 19 se instala ejecutando el siguiente comando desde el directorio 20 <filename class="directory">binutils-build</filename>:</para> 18 21 19 22 <screen><userinput>make -C ld install</userinput></screen> 20 23 21 <para>From this point onwards, everything will link only 22 against the libraries in<filename class="directory">/tools/lib</filename>.</para>24 <para>Desde ahora todo se enlazará solamente contra las librerías que hay en 25 <filename class="directory">/tools/lib</filename>.</para> 23 26 24 <note><para>If the earlier warning to retain the Binutils source and 25 build directories from the first pass was missed, ignore the above 26 command. This results in a small chance that the subsequent testing 27 programs will link against libraries on the host. This is not ideal, 28 but it is not a major problem. The situation is corrected when the 29 second pass of Binutils is installed later.</para></note> 27 <note> 28 <para>Si por alguna razón olvidaste el aviso sobre conservar los directorios 29 de las fuentes y de construcción del primer paso de Binutils, ignora el 30 comando anterior. El resultado es la pequeña pega de que los siguientes 31 programas de pruebas se enlazarán contra las librerías del anfitrión. Esto 32 no es lo ideal, pero no es un gran problema. La situación se corregirá 33 cuando instalemos un poco más adelante la segunda fase de Binutils.</para> 34 </note> 30 35 31 <para>Now that the adjusted linker is installed, the Binutils build and source 32 directories should be removed.</para>36 <para>Ahora que se ha instalado el enlazador ajustado, debes eliminar los 37 directorios de las fuentes y de construcción de Binutils.</para> 33 38 34 <para>The next task is to point GCC to the new dynamic linker. This is done by 35 dumping GCC's <quote>specs</quote> file to a location where GCC will look for it 36 by default. A simple <command>sed</command> substitution then alters the 37 dynamic linker that GCC will use:</para>39 <para>Lo siguiente esapuntar GCC al nuevo enlazador dinámico. Esto se hace 40 volcando el fichero <quote>specs</quote>de GCC a un lugar en el que GCC lo 41 busque por defecto. Entonces una simple sustitución <command>sed</command> 42 altera el enlazdor inámic que GCC usará:</para> 38 43 39 <!-- Ampersands are needed to allow copy and paste --> 40 44 <!-- Ampersands are needed to allow cut and paste --> 41 45 <screen><userinput>SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs && 42 46 gcc -dumpspecs > $SPECFILE && … … 45 49 unset SPECFILE</userinput></screen> 46 50 47 <para>It is recommended that the above 48 command be copy-and-pasted in order to ensure accuracy. 49 Alternatively, the specs file can be edited by hand. This is done by 50 replacing every occurrence of <quote>/lib/ld-linux.so.2</quote> with 51 <quote>/tools/lib/ld-linux.so.2</quote></para> 51 <para><phrase condition="html">Recomendamos que copies y pegues lo anterior 52 para asegurar que no hay errores.</phrase> Alternativamente, puedes editar el 53 fichero specs a mano si quieres. Esto se hace reemplazando cada aparición de 54 <quote>/lib/ld-linux.so.2</quote> con <quote>/tools/lib/ld-linux.so.2</quote>.</para> 52 55 53 <para>Be sure to visually inspect the specs file in order to verify the 54 intended changes have been made.</para>56 <para>Asegúrate de revisar visualmente el fichero specs para 57 verificar que se han hecho los cambios deseados.</para> 55 58 56 <important><para>If working on a platform where the name of the 57 dynamic linker is something other than 58 <filename class="libraryfile">ld-linux.so.2</filename>, replace 59 <quote>ld-linux.so.2</quote> with the name of the platform's 60 dynamic linker in the above commands. Refer back to <xref 61 linkend="ch-tools-toolchaintechnotes" role=","/> if 62 necessary.</para></important>59 <important> 60 <para>Si estás trabajando sobre una plataforma en la que el nombre del 61 enlazador dinámico no es <filename class="libraryfile">ld-linux.so.2</filename>, 62 en el anterior comando debes sustituir <filename>ld-linux.so.2</filename> con 63 el nombre del enlazador dinámico de tu plataforma. En caso necesario consulta 64 la <xref linkend="ch-tools-toolchaintechnotes"/>.</para> 65 </important> 63 66 64 <para>During the build process, GCC runs a script 65 (<command>fixincludes</command>) that scans the system for header files that may 66 need to be fixed (they might contain syntax errors, for example), and installs 67 the fixed versions in a private include directory. There is a possibility that, 68 as a result of this process, some header files from the host system have found 69 their way into GCC's private include directory. As the rest of this chapter only 70 requires the headers from GCC and Glibc, which have both been installed at this 71 point, any "fixed" headers can safely be removed. This helps to avoid 72 any host headers polluting the build environment. Run the following commands to 73 remove the header files in GCC's private include directory (you may find it 74 easier to copy and paste these commands, rather than typing them by hand, due to 75 their length):</para> 67 <para>Durante el proceso de construcción, GCC ejecuta un guión 68 (<command>fixincludes</command>) que explora el sistema buscando ficheros de 69 cabecera que puedan necesitar ser corregidos (que pueden contener errores de 70 sintaxis, por ejemplo), e instala las versiones corregidas en un directorio 71 privado. Existe la posibilidad de que, como resultado de este proceso, algunos 72 ficheros de cabecera del sistema anfitrión se hayan colado dentro de dicho 73 directorio privado de cabeceras de GCC. Como el resto de este capítulo sólo 74 necesita las cabeceras de GCC y Glibc, que ya han sido instaladas, cualquier 75 cabecera <quote>fijada</quote> puede borrarse sin problemas. Esto ayuda a 76 evitar que cualquier cabecera del anfitrión contamine el entorno de 77 construcción. Ejecuta los siguientes comandos para eliminr dichos ficheros de 78 cabecera (puede que encuentres más facil copiar y pegar estos comandos en vez 79 de teclearlos, debido a su longitud):</para> 76 80 77 81 <!-- && used to ease copy and pasting --> … … 81 85 unset GCC_INCLUDEDIR</userinput></screen> 82 86 83 <caution><para>At this point, it is imperative to stop and ensure that 84 the basic functions (compiling and linking) of the new toolchain are 85 working as expected. To perform a sanity check, run the following 86 commands:</para>87 <caution> 88 <para>En este punto es obligatorio parar y asegurarse de que las operaciones 89 básicas (compilación y enlazado) de las nuevas herramientas funcionan como 90 se espera. Para esto vamos a hacer una simple comprobación:</para> 87 91 88 92 <screen><userinput>echo 'main(){}' > dummy.c … … 90 94 readelf -l a.out | grep ': /tools'</userinput></screen> 91 95 92 <para>If everything is working correctly, there should be no errors, 93 and the output of the last command will be of the form:</para>96 <para>Si todo funciona correctamente, no debe haber errores y la salida del 97 último comando debe ser:</para> 94 98 95 <screen><computeroutput>[Requesting program interpreter: 99 <screen><computeroutput>[Requesting program interpreter: 100 /tools/lib/ld-linux.so.2] 101 102 [Intérprete de programa solicitado: 96 103 /tools/lib/ld-linux.so.2]</computeroutput></screen> 97 104 98 <para>Note that<filename class="directory">/tools/lib</filename>99 appears as the prefix of the dynamic linker.</para>105 <para>Confirma que <filename class="directory">/tools/lib</filename> 106 aparezca como el prefijo de tu enlazador dinámico.</para> 100 107 101 <para>If the output is not shown as above or there was no output at 102 all, then something is wrong. Investigate and retrace the steps to 103 find out where the problem is and correct it. This issue must be 104 resolved before continuing on. First, perform the sanity check again, 105 using <command>gcc</command> instead of <command>cc</command>. If this 106 works, then the <filename class="symlink">/tools/bin/cc</filename> symlink is missing. 107 Revisit <xref linkend="ch-tools-gcc-pass1" role=","/> and install the symlink. 108 Next, ensure that the <envar>PATH</envar> is correct. This can be checked by running 109 <command>echo $PATH</command> and verifying that <filename 110 class="directory">/tools/bin</filename> is at the head of the list. If 111 the <envar>PATH</envar> is wrong it could mean that you are not logged in as user 112 <emphasis>lfs</emphasis> or that something went wrong back in <xref 113 linkend="ch-tools-settingenviron" role="."/> Another option is that something 114 may have gone wrong with the specs file amendment above. In this case, 115 redo the specs file amendment, being careful to copy-and-paste the 116 commands.</para> 108 <para>Si no recibes una salida como la mostrada arriba, o no hay salida 109 alguna, algo está seriamente mal. Investiga y revisa tus pasos para 110 encontrar el problema y corregirlo. El problema debe resolverse antes de 111 continuar. Primero, repite la comprobación de sanidad usando 112 <command>gcc</command> en vez de <command>cc</command>. Si esto funciona 113 significa que falta el enlace simbólico <filename 114 class="symlink">/tools/bin/cc</filename>. Vuelve a la <xref 115 linkend="ch-tools-gcc-pass1"/> e instala el enlace simbólico. Seguidamente, 116 asegúrate de que tu <envar>PATH</envar> es correcto. Puedes comprobarlo 117 ejecutando <command>echo $PATH</command> y verificando que <filename 118 class="directory">/tools/bin</filename> está en cabeza de la lista. Si 119 el <envar>PATH</envar> está mal puede significar que no has ingresado 120 como usuario <systemitem class="username">lfs</systemitem> o que algo 121 salió mal en la <xref linkend="ch-tools-settingenviron"/>. Otra opción es 122 que algo pudo ir mal en el anterior arreglo del fichero specs. En este caso, 123 repite el arreglo del fichero<phrase condition="html"> asegurándote de 124 copiar y pegar los comandos como se recomendó</phrase>.</para> 117 125 118 <para>Once all is well, clean up the test files:</para>126 <para>Cuando todo esté bien, borra los ficheros de prueba:</para> 119 127 120 128 <screen><userinput>rm -v dummy.c a.out</userinput></screen> 121 129 122 <para>Building TCL in the next section will serve as an additional check that 123 the toolchain has been built properly. If TCL fails to build, it is an 124 indication that something has gone wrong with the Binutils, GCC, or Glibc 125 installation, but not with TCL itself.</para> 126 127 </caution> 130 <para>La construcción de TCL en la siguiente sección servirá como comprobación 131 adicional de que las herramientas se han construido correctamente. Si la 132 construcción de TCL falla, esto es una indicación de que algo fué mal durante 133 la instalación de Binutils, GCC o Glibc, pero no con el propio TCL.</para> 134 </caution> 128 135 129 136 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.