binutils-inst.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  2. <sect2><title>Installation of Binutils</title>
  3. <note><para>The testsuite for Binutils in this chapter is considered
  4. <emphasis>critical</emphasis>. Do not skip it under any circumstances.</para>
  5. </note>
  6. <para>This package is known to behave badly when you have changed its
  7. default optimization flags (including the -march and -mcpu options).
  8. Therefore, if you have defined any environment variables that override
  9. default optimizations, such as CFLAGS and CXXFLAGS, we recommend unsetting
  10. or modifying them when building Binutils.</para>
  11. <para>It is recommended by the Binutils installation documentation to build
  12. Binutils outside of the source directory:</para>
  13. <para><screen><userinput>mkdir ../binutils-build
  14. cd ../binutils-build</userinput></screen></para>
  15. <para>Now prepare Binutils for compilation:</para>
  16. <para><screen><userinput>../binutils-&binutils-version;/configure \
  17. &nbsp;&nbsp;&nbsp;&nbsp;--prefix=/usr --enable-shared</userinput></screen></para>
  18. <para>Compile the package:</para>
  19. <para><screen><userinput>make tooldir=/usr</userinput></screen></para>
  20. <para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
  21. executables end up) is set to $(exec_prefix)/$(target_alias), which expands
  22. into, for example, <filename>/usr/i686-pc-linux-gnu</filename>. Since we only
  23. build for our own system, we don't need this target specific directory in
  24. <filename>/usr</filename>. That setup would be used if the system was used to
  25. cross-compile (for example compiling a package on an Intel machine that
  26. generates code that can be executed on PowerPC machines).</para>
  27. <para>Test the results:</para>
  28. <para><screen><userinput>make check</userinput></screen></para>
  29. <para>Install the package:</para>
  30. <para><screen><userinput>make tooldir=/usr install</userinput></screen></para>
  31. <para>Install the <emphasis>libiberty</emphasis> header file that is needed by
  32. some packages:</para>
  33. <para><screen><userinput>cp ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen></para>
  34. </sect2>