binutils-inst.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  2. <sect2>
  3. <title>Installation of Binutils</title>
  4. <para>This package is known to behave badly when you have changed its default
  5. optimization flags (including the -march and -mcpu options). Binutils is
  6. best left alone. Therefore, if you have defined any environment variables
  7. that override default optimizations, such as CFLAGS and CXXFLAGS, we
  8. recommend unsetting or modifying them when building binutils. You have been
  9. warned.</para>
  10. <para>It is recommended by the Binutils installation documentation to build
  11. Binutils outside of the source directory in a dedicated directory:</para>
  12. <para><screen><userinput>mkdir ../binutils-build
  13. cd ../binutils-build</userinput></screen></para>
  14. <para>Next, prepare Binutils to be compiled:</para>
  15. <para><screen><userinput>../binutils-&binutils-version;/configure --prefix=$LFS/static --disable-nls</userinput></screen></para>
  16. <para>The meaning of the (new) configure switches are:</para>
  17. <itemizedlist>
  18. <listitem><para><userinput>--disable-nls:</userinput> This option disables
  19. internationalization (also known as i18n). We don't need this for our
  20. static programs and nls often causes problems when you're linking
  21. statically.</para></listitem>
  22. </itemizedlist>
  23. <para>Continue with compiling the package:</para>
  24. <para><screen><userinput>make LDFLAGS="-all-static"</userinput></screen></para>
  25. <para>The meaning of the make option is:</para>
  26. <itemizedlist>
  27. <listitem><para><userinput>make LDFLAGS="-all-static":</userinput> This is
  28. how we tell Binutils that all programs should be statically linked. Setting
  29. the <emphasis>LDFLAGS</emphasis> variable is the common way of specifying we
  30. want a static link to take place, however, its value and the way it is set
  31. is not always the same. You'll see with the remaining packages that there
  32. are different ways of setting up the <emphasis>LDFLAGS</emphasis>
  33. variable.</para></listitem>
  34. </itemizedlist>
  35. <para>And finish off installing the package:</para>
  36. <para><screen><userinput>make install</userinput></screen></para>
  37. </sect2>