binutils-pass1-inst.xml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  2. <sect2>
  3. <title>Installation of Binutils</title>
  4. <para>It is important that Binutils be the first package to get compiled,
  5. because both Glibc and GCC perform various tests on the available linker and
  6. assembler to determine which of their own features to enable.</para>
  7. <para>This package is known to behave badly when you have changed its default
  8. optimization flags (including the -march and -mcpu options). Therefore, if
  9. you have defined any environment variables that override default
  10. optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting or
  11. modifying them when building Binutils.</para>
  12. <para>It is recommended by the Binutils installation documentation to build
  13. Binutils outside of the source directory in a dedicated directory:</para>
  14. <para><screen><userinput>mkdir ../binutils-build
  15. cd ../binutils-build</userinput></screen></para>
  16. <para>Next, prepare Binutils to be compiled:</para>
  17. <para><screen><userinput>../binutils-&binutils-version;/configure \
  18. &nbsp;&nbsp;&nbsp;&nbsp;--prefix=/stage1 --disable-nls</userinput></screen></para>
  19. <para>The meaning of the configure switches is:</para>
  20. <itemizedlist>
  21. <listitem><para><userinput>--prefix=/stage1</userinput>: This tells the
  22. configure script to prepare to install the Binutils programs in the
  23. <filename>/stage1</filename> directory.</para></listitem>
  24. <listitem><para><userinput>--disable-nls</userinput>: This disables
  25. internationalization (a word often shortened to i18n). We don't need this
  26. for our static programs and <emphasis>nls</emphasis> often causes problems
  27. when linking statically.</para></listitem>
  28. </itemizedlist>
  29. <para>Continue with compiling the package:</para>
  30. <para><screen><userinput>make configure-host
  31. make LDFLAGS="-all-static"</userinput></screen></para>
  32. <para>The meaning of the make option is:</para>
  33. <itemizedlist>
  34. <listitem><para><userinput>LDFLAGS="-all-static"</userinput>: This tells
  35. the linker that all the Binutils programs should be linked
  36. statically.</para></listitem>
  37. </itemizedlist>
  38. <para>And install the package:</para>
  39. <para><screen><userinput>make install</userinput></screen></para>
  40. <para>Now already prepare the linker for the "locking in" of
  41. <emphasis>glibc</emphasis> later on:</para>
  42. <para><screen><userinput>make -C ld clean
  43. make -C ld LIB_PATH=/stage1/lib</userinput></screen></para>
  44. <para><emphasis>Do not yet remove</emphasis> the binutils-* directories.
  45. We will need them again a bit further on in this chapter.</para>
  46. </sect2>