source: trunk/src/gcc/FAQ@ 1282

Last change on this file since 1282 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 28.2 KB
Line 
1
2 GCC Frequently Asked Questions
3
4 The latest version of this document is always available at
5 [1]http://www.gnu.org/software/gcc/faq.html.
6
7 This FAQ tries to answer specific questions concerning GCC. For
8 general information regarding C, C++, resp. Fortran please check the
9 [2]comp.lang.c FAQ, [3]comp.std.c++ FAQ, and the [4]Fortran
10 Information page.
11
12 Other GCC-related FAQs: [5]libstdc++-v3, and [6]GCJ.
13 _________________________________________________________________
14
15 Questions
16
17 1. [7]General information
18 1. [8]What is the relationship between GCC and EGCS?
19 2. [9]What is the relationship between GCC and Cygnus / Red Hat?
20 3. [10]What is an open development model?
21 4. [11]How do I report a bug?
22 5. [12]How do I get a bug fixed or a feature added?
23 6. [13]Does GCC work on my platform?
24 2. [14]Installation
25 1. [15]How to install multiple versions of GCC
26 2. [16]Dynamic linker is unable to find GCC libraries
27 3. [17]libstdc++/libio tests fail badly with --enable-shared
28 4. [18]GCC can not find GNU as/GNU ld
29 5. [19]cpp: Usage:... Error
30 6. [20]Optimizing the compiler itself
31 3. [21]Testsuite problems
32 1. [22]Unable to run the testsuite
33 2. [23]How do I pass flags like -fnew-abi to the testsuite?
34 3. [24]How can I run the test suite with multiple options?
35 4. [25]Older versions of GCC
36 1. [26]Is there a stringstream / sstream for GCC 2.95.2?
37 5. [27]Miscellaneous
38 1. [28]Friend Templates
39 2. [29]dynamic_cast, throw, typeid don't work with shared
40 libraries
41 3. [30]Why do I need autoconf, bison, xgettext, automake, etc?
42 4. [31]Why can't I build a shared library?
43 5. [32]When building C++, the linker says my constructors,
44 destructors or virtual tables are undefined, but I defined
45 them
46 6. [33]Will GCC someday include an incremental linker?
47 _________________________________________________________________
48
49 General information
50
51What is the relationship between GCC and EGCS?
52
53 In 1990/1991 gcc version 1 had reached a point of stability. For the
54 targets it could support, it worked well. It had limitations inherent
55 in its design that would be difficult to resolve, so a major effort
56 was made to resolve those limitiations and gcc version 2 was the
57 result.
58
59 When we had gcc2 in a useful state, development efforts on gcc1
60 stopped and we all concentrated on making gcc2 better than gcc1 could
61 ever be. This is the kind of step forward we wanted to make with the
62 EGCS project when it was formed in 1997.
63
64 In April 1999 the Free Software Foundation officially halted
65 development on the gcc2 compiler and appointed the EGCS project as the
66 official GCC maintainers. The net result was a single project which
67 carries forward GCC development under the ultimate control of the
68 [34]GCC Steering Committee.
69 _________________________________________________________________
70
71What is the relationship between GCC and Cygnus / Red Hat?
72
73 It is a common mis-conception that Red Hat controls GCC either
74 directly or indirectly.
75
76 While Red Hat does donate hardware, network connections, code and
77 developer time to GCC development, Red Hat does not control GCC.
78
79 Overall control of GCC is in the hands of the [35]GCC Steering
80 Committee which includes people from a variety of different
81 organizations and backgrounds. The purpose of the steering committee
82 is to make decisions in the best interest of GCC and to help ensure
83 that no individual or company has control over the project.
84
85 To summarize, Red Hat contributes to the GCC project, but does not
86 exert a controlling influence over GCC.
87 _________________________________________________________________
88
89What is an open development model?
90
91 We are using a bazaar style [36][1] approach to GCC development: we
92 make snapshots publicly available to anyone who wants to try them; we
93 welcome anyone to join the development mailing list. All of the
94 discussions on the development mailing list are available via the web.
95 We're going to be making releases with a much higher frequency than
96 they have been made in the past.
97
98 In addition to weekly snapshots of the GCC development sources, we
99 have the sources readable from a CVS server by anyone. Furthermore we
100 are using remote CVS to allow remote maintainers write access to the
101 sources.
102
103 There have been many potential GCC developers who were not able to
104 participate in GCC development in the past. We want these people to
105 help in any way they can; we ultimately want GCC to be the best
106 compiler in the world.
107
108 A compiler is a complicated piece of software, there will still be
109 strong central maintainers who will reject patches, who will demand
110 documentation of implementations, and who will keep the level of
111 quality as high as it is today. Code that could use wider testing may
112 be integrated--code that is simply ill-conceived won't be.
113
114 GCC is not the first piece of software to use this open development
115 process; FreeBSD, the Emacs lisp repository, and the Linux kernel are
116 a few examples of the bazaar style of development.
117
118 With GCC, we are adding new features and optimizations at a rate that
119 has not been done since the creation of gcc2; these additions
120 inevitably have a temporarily destabilizing effect. With the help of
121 developers working together with this bazaar style development, the
122 resulting stability and quality levels will be better than we've had
123 before.
124
125 [1] We've been discussing different development models a lot over
126 the past few months. The paper which started all of this introduced
127 two terms: A cathedral development model versus a bazaar
128 development model. The paper is written by Eric S. Raymond, it is
129 called ``[37]The Cathedral and the Bazaar''. The paper is a useful
130 starting point for discussions.
131 _________________________________________________________________
132
133How do I report a bug?
134
135 There are complete instructions [38]here.
136 _________________________________________________________________
137
138How do I get a bug fixed or a feature added?
139
140 There are lots of ways to get something fixed. The list below may be
141 incomplete, but it covers many of the common cases. These are listed
142 roughly in order of increasing difficulty for the average GCC user,
143 meaning someone who is not skilled in the internals of GCC, and where
144 difficulty is measured in terms of the time required to fix the bug.
145 No alternative is better than any other; each has its benefits and
146 disadvantages.
147 * Hire someone to fix it for you. There are various companies and
148 individuals providing support for GCC. This alternative costs
149 money, but is relatively likely to get results.
150 * [39]Report the problem to the GCC GNATS bug tracking system and
151 hope that someone will be kind enough to fix it for you. While
152 this is certainly possible, and often happens, there is no
153 guarantee that it will. You should not expect the same response
154 from this method that you would see from a commercial support
155 organization since the people who read GCC bug reports, if they
156 choose to help you, will be volunteering their time. This
157 alternative will work best if you follow the directions on
158 [40]submitting bugreports.
159 * Fix it yourself. This alternative will probably bring results, if
160 you work hard enough, but will probably take a lot of time, and,
161 depending on the quality of your work and the perceived benefits
162 of your changes, your code may or may not ever make it into an
163 official release of GCC.
164 _________________________________________________________________
165
166Does GCC work on my platform?
167
168 The host/target specific installation notes for GCC include
169 information about known problems with installing or using GCC on
170 particular platforms. These are included in the sources for a release
171 in INSTALL/specific.html, and the [41]latest version is always
172 available at the GCC web site. Reports of [42]successful builds for
173 several versions of GCC are also available at the web site.
174 _________________________________________________________________
175
176 Installation
177
178How to install multiple versions of GCC
179
180 It may be desirable to install multiple versions of the compiler on
181 the same system. This can be done by using different prefix paths at
182 configure time and a few symlinks.
183
184 Basically, configure the two compilers with different --prefix
185 options, then build and install each compiler. Assume you want "gcc"
186 to be the latest compiler and available in /usr/local/bin; also assume
187 that you want "gcc2" to be the older gcc2 compiler and also available
188 in /usr/local/bin.
189
190 The easiest way to do this is to configure the new GCC with
191 --prefix=/usr/local/gcc and the older gcc2 with
192 --prefix=/usr/local/gcc2. Build and install both compilers. Then make
193 a symlink from /usr/local/bin/gcc to /usr/local/gcc/bin/gcc and from
194 /usr/local/bin/gcc2 to /usr/local/gcc2/bin/gcc. Create similar links
195 for the "g++", "c++" and "g77" compiler drivers.
196
197 An alternative to using symlinks is to configure with a
198 --program-transform-name option. This option specifies a sed command
199 to process installed program names with. Using it you can, for
200 instance, have all the new GCC programs installed as "new-gcc" and the
201 like. You will still have to specify different --prefix options for
202 new GCC and old GCC, because it is only the executable program names
203 that are transformed. The difference is that you (as administrator) do
204 not have to set up symlinks, but must specify additional directories
205 in your (as a user) PATH. A complication with --program-transform-name
206 is that the sed command invariably contains characters significant to
207 the shell, and these have to be escaped correctly, also it is not
208 possible to use "^" or "$" in the command. Here is the option to