aboutsummaryrefslogtreecommitdiff
path: root/ru_RU.KOI8-R/articles/custom-gcc/article.xml
blob: ee6969823d5058b5fb425aa18242c1bf35aed410 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<?xml version="1.0" encoding="koi8-r" standalone="no"?>
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN"
        "../../../share/xml/freebsd42.dtd" [
<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//RU" "../../share/xml/entities.ent">
%entities;
]>

<!--
    The FreeBSD Russian Documentation Project
    $FreeBSD$
    Original revision: r34679
-->

<!-- :   -->

<article lang="ru">
  <articleinfo>
    <title>    <application>GCC</application>
       <application>binutils</application> c  
      &os;</title>

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

    <legalnotice 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>
  </articleinfo>

  <sect1 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 id="prerequisites">
    <title></title>

    <sect2 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 && make install</userinput></screen>
    </sect2>

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

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

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

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

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

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

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

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

      <programlisting>.if !empty(.CURDIR:M/usr/ports/*) && 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 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 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/*) && 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 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/*) && 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  
	<filename role="package">net/openldap</filename>*.  
	      :</para>

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

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

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

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

  </sect1>
</article>