aboutsummaryrefslogblamecommitdiff
path: root/ru_RU.KOI8-R/articles/custom-gcc/article.xml
blob: 04fbd962b1b40e22c277ea009b198b24281451a3 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                       
                                                                               
                                                             


                                             
                             
   
                               

                                                                                                                      

                                                               
    
 
                                                                                                         
                                                        
                             
 
                                                       








                                                     



                                        






                                                                      
         
 
                        














                                                                             
                                

                             
                                        












                                                                             
                                                                                                                

            
                                   






                                                                         

                                              



                                                                          
                                                                                                                                       


            
                                        



                                                                            
                                                                      

                                  
                                        




                                                                           
                                                                                               

















                                                                        
                                          
































                                                                            
                                  






                                                                               
                                                                                               











                                                                             
                                                







                                                                     
                                                                                               








                                                                           
                                                

                                                             
                                                                                                                                                


            
                                      








                                                                            
                                                                                                                                                                    







                                                                           
<?xml version="1.0" encoding="koi8-r"?>
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN"
	"http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd">
<!--
    The FreeBSD Russian Documentation Project
    $FreeBSD$
    Original revision: r43184
-->
<!-- :   -->
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:lang="ru">
  <info><title>    <application>GCC</application>
       <application>binutils</application> c  
      &os;</title>
    

    <author><personname><firstname>Martin</firstname><surname>Matuska</surname></personname><affiliation>
	<address><email>mm@FreeBSD.org</email></address>
      </affiliation></author>

    <legalnotice xml:id="trademarks" role="trademarks">
      &tm-attrib.freebsd;
      &tm-attrib.general;
    </legalnotice>

    <copyright>
      <year>2009</year>
      <holder>The &os; Documentation Project</holder>
    </copyright>

    <pubdate>$FreeBSD$</pubdate>

    <releaseinfo>$FreeBSD$</releaseinfo>

    <abstract>
      <para>   ,     
	 <application>GCC</application>   
	<application>binutils</application>    &os;.
	    
	<application>GCC</application>.</para>
    </abstract>
  </info>

  <sect1 xml:id="intro">
    <title></title>

    <para>,   &os; 8.0, &mdash; 
      <application>GCC</application>  4.2.1.    
      &os;  <application>binutils</application> 
      2.15.   -  ,   ,  ,
          <acronym>CPU</acronym>, 
       <acronym>SSSE3</acronym>, <acronym>SSE4.1</acronym>,
      <acronym>SSE4.2</acronym>  ..    ,
               .
       ,       
      <application>GCC</application> (,  4.4)
           &os;.</para>
  </sect1>

  <sect1 xml:id="prerequisites">
    <title></title>

    <sect2 xml:id="installing-binutils">
      <title> binutils  </title>

      <para>     
	  <application>GCC</application>,  
	   <application>binutils</application>.  
	  ,   
	<application>binutils</application>    
	  <acronym>CPU</acronym>.</para>

      <para> ,     
	<application>binutils</application>   
	&os;,   :</para>

      <screen>&prompt.root; <userinput>cd /usr/ports/devel/binutils &amp;&amp; make install</userinput></screen>
    </sect2>

    <sect2 xml:id="installing-gcc">
      <title> GCC  </title>

      <para>
	   &os;     
	<application>GCC</application>.      
	  4.4.  ,   
	   ()  (:
	<package>lang/gcc43</package> 
	<package>lang/gcc45</package>).</para>

      <para>     
	<application>GCC</application>,   :</para>

      <screen>&prompt.root; <userinput>cd /usr/ports/lang/<replaceable>gcc44</replaceable> &amp;&amp; make install</userinput></screen>
    </sect2>
  </sect1>

  <sect1 xml:id="configuring-ports-gcc">
    <title>    
       <application>GCC</application></title>

    <para>    <application>GCC</application>,
          &os;,  
       .</para>

    <sect2 xml:id="adjusting-make.conf">
      <title>  <filename>make.conf</filename></title>

      <para>    <filename>/etc/make.conf</filename>
	(  ):</para>

      <programlisting>.if !empty(.CURDIR:M/usr/ports/*) &amp;&amp; exists(/usr/local/bin/gcc44)
CC=gcc44
CXX=g++44
CPP=cpp44
.endif</programlisting>

      <para>  ,    
	 <envar>${CC}</envar>  <envar>${CPP}</envar>.</para>

      <note>
	<para>, ģ ,  
	  <application>GCC</application>  4.4.   , 
	   <command>gcc43</command>, 
	  <literal>"gcc44"</literal>  <literal>"gcc43"</literal> 
	  <literal>"4.4"</literal>  <literal>"4.3"</literal>
	   ..</para>
      </note>
    </sect2>

    <sect2 xml:id="adjusting-libmap.conf">
      <title>  <filename>libmap.conf</filename></title>

      <para>      
	  libgcc_s  libstdc++.     
	  ,     
	<application>GCC</application> ( 4.2.1).   
	rltd ( ldd)  ,    
	<filename>/etc/libmap.conf</filename> ( 
	):</para>

      <programlisting>libgcc_s.so.1   gcc44/libgcc_s.so.1
libgomp.so.1    gcc44/libgomp.so.1
libobjc.so.3    gcc44/libobjc.so.2
libssp.so.0     gcc44/libssp.so.0
libstdc++.so.6  gcc44/libstdc++.so.6</programlisting>

      <note>
	<para>    <application>GCC</application>
	   4.4.     <command>gcc43</command>,
	   <literal>"gcc44"</literal>  <literal>"gcc43"</literal>
	   ..   ,    
	     ,   
	  .</para>
      </note>

      <warning>
	<para> C++    , 
	      .   
	    ,      
	   libstdc++.so.</para>
      </warning>
    </sect2>

    <sect2 xml:id="custom-cflags">
      <title>  <literal>CFLAGS</literal>  
	</title>

      <para> ,    
	<literal>CFLAGS</literal>, 
	<filename>/etc/make.conf</filename>   :</para>

      <programlisting>.if !empty(.CURDIR:M/usr/ports/*) &amp;&amp; exists(/usr/local/bin/gcc44)
CC=gcc44
CXX=g++44
CPP=cpp44
CFLAGS+=-mssse3
.endif</programlisting>

      <para>   <literal>CFLAGS</literal> /
	 <literal>CPUTYPE</literal>.    
	<literal>CPUTYPE</literal>       
	,     .</para>
    </sect2>

    <sect2 xml:id="excluding-unbuildable-ports">
      <title> ,      
	<application>GCC</application></title>

      <para> ,   ,    
	  <application>GCC</application>, 
	<filename>/etc/make.conf</filename>  
	:</para>

      <programlisting>.if !empty(.CURDIR:M/usr/ports/*) &amp;&amp; exists(/usr/local/bin/gcc44)
.if empty(.CURDIR:M/usr/ports/net/openldap*)
CC=gcc44
CXX=g++44
CPP=cpp44
.endif
.endif</programlisting>

      <para>, ģ ,   
	<command>gcc</command> 4.4  
	<package>net/openldap</package>*.  
	      :</para>

      <programlisting>.if empty(.CURDIR:M/usr/ports/net/openldap*) &amp;&amp; empty(.CURDIR:M/usr/ports/xxx/yyy) &amp;&amp; ...</programlisting>
    </sect2>
  </sect1>

  <sect1 xml:id="performance-imparct">
    <title>    </title>

    <para> <application>GCC</application>  4.4 
         <acronym>SSSE3</acronym>
      (   <acronym>CPU</acronym>)    10%
          .   
          20% (,  
       ).</para>

    <para> ,   <uri xlink:href="http://people.freebsd.org/~mm/benchmarks/perlbench/">http://people.freebsd.org/~mm/benchmarks/perlbench/</uri>,
        <application>GCC</application>   
          &os;, <application>GCC</application>  4.3 
      <application>GCC</application>  4.4   
      <literal>CFLAGS</literal>.    
         perlbench.</para>

  </sect1>
</article>