]>
Commit | Line | Data |
---|---|---|
f2d76545 JL |
1 | egcs Frequently Asked Questions |
2 | ||
3 | ||
4 | How is egcs be different from gcc2? | |
5 | ||
6 | Six years ago, gcc version 1 had reached a point of stability. For the | |
7 | targets it could support, it worked well. It had limitations inherent in | |
8 | its design that would be difficult to resolve, so a major effort was made | |
9 | and gcc version 2 was the result. When we had gcc2 in a useful state, | |
10 | development efforts on gcc1 stopped and we all concentrated on making | |
11 | gcc2 better than gcc1 could ever be. This is the kind of step forward | |
12 | we want to make with egcs. | |
13 | ||
14 | In brief, the three biggest differences between egcs and gcc2 are | |
15 | these: | |
16 | ||
17 | ||
18 | More rexamination of basic architectual decisions of | |
19 | gcc and an interest in adding new optimizations; | |
20 | ||
21 | working with the groups who have fractured out from gcc2 (like | |
22 | the Linux folks, the Intel optimizations folks, Fortran folks) | |
23 | including more front-ends; and finally | |
24 | ||
25 | An open development model (see below) for the development process. | |
26 | ||
27 | ||
28 | These three differences will work together to result in a more | |
29 | useful compiler, a more stable compiler, a central compiler that works | |
30 | for more people, a compiler that generates better code. | |
31 | ||
32 | ||
33 | There are a lot of exciting compiler optimizations that have come | |
34 | out. We want them in gcc. There are a lot of front ends out there for | |
35 | gcc for languages like Fortran or Pascal. We want them easily | |
36 | installable by users. After six years of working on gcc2, we've come | |
37 | to see problems and limitations in the way gcc is architected; it is | |
38 | time to address these again. | |
39 | ||
40 | ||
41 | What is an open development model? | |
42 | ||
43 | With egcs, we are going to try a bazaar style[1] approach to its | |
44 | development: We're going to be making snapshots publically available | |
45 | to anyone who wants to try them; we're going to welcome anyone to join | |
46 | the development mailing list. All of the discussions on the | |
47 | development mailing list are available via the web. We're going to be | |
48 | making releases with a much higher frequency than they have been made | |
49 | in the past: We're shooting for three by the end of 1997. | |
50 | ||
51 | In addition to weekly snapshots of the egcs development sources, we | |
52 | are going to look at making the sources readable from a CVS server by | |
53 | anyone. We want to make it so external maintainers of parts of egcs | |
54 | are able to commit changes to their part of egcs directly into the | |
55 | sources without going through an intermediary. | |
56 | ||
57 | There have been many potential gcc developers who were not able to | |
58 | participate in gcc development in the past. We these people to help in | |
59 | any way they can; we ultimately want gcc to be the best compiler in the | |
60 | world. | |
61 | ||
62 | A compiler is a complicated piece of software, there will still be | |
63 | strong central maintainers who will reject patches, who will demand | |
64 | documentation of implementations, and who will keep the level of | |
65 | quality as high as it is today. Code that could use wider testing may | |
66 | be intergrated--code that is simply ill-conceived won't be. | |
67 | ||
68 | egcs is not the first piece of software to use this open development | |
69 | process; FreeBSD, the Emacs lisp repository, and Linux are a few | |
70 | examples of the bazaar style of development. | |
71 | ||
72 | With egcs, we will be adding new features and optimizations at a | |
73 | rate that has not been done since the creation of gcc2; these additions | |
74 | will inevitably have a temporarily destabilizing effect. With the help | |
75 | of developers working together with this bazaar style development, the | |
76 | resulting stability and quality levels will be better than we've had | |
77 | before. | |
78 | ||
79 | cathedral-vs-bazaar[1] | |
80 | We've been discussing different development models a lot over the | |
81 | past few months. The paper which started all of this introduced two | |
82 | terms: A cathedral development model versus a bazaar | |
83 | development model. The paper is written by Eric S. Raymond, it is | |
84 | called `` http://locke.ccil.org/~esr/writings/cathedral.html" The | |
85 | Cathedral and the Bazaar''. The paper is a useful starting point | |
86 | for discussions. | |
87 | ||
88 | ||
89 | ||
90 | bits/libc-lock.h: No such file or directory | |
91 | egcs includes a tightly integrated libio and libstdc++ implementation which | |
92 | can cause problems on hosts which have libio integrated into their C library | |
93 | (most notably Linux). | |
94 | ||
95 | We believe that we've solved the major technical problems for the most | |
96 | common versions of libc found on Linux systems. However, some versions | |
97 | of Linux use pre-release versions of glibc2, which egcs has trouble detecting | |
98 | and correctly handling. | |
99 | ||
100 | If you're using one of these pre-release versions of glibc2, you may get | |
101 | a message "bits/libc-lock.h: No such file or directory" when building egcs. | |
102 | Unfortunately, to fix this problem you will need to update your C library to | |
103 | glibc2.0.5c. | |
104 | ||
105 | Late breaking news: we may have at least a partial solution for these | |
106 | problems. So this FAQ entry may no longer be needed. | |
107 | ||
108 | ||
109 | `_IO_stdfile_0_lock' was not declared in this scope | |
110 | If you get this error, it means either egcs incorrectly guessed what version | |
111 | of libc is installed on your linux system, or you incorrectly specified a | |
112 | version of glibc when configuring egcs. | |
113 | ||
114 | If you did not provide a target name when configuring egcs, then you've | |
115 | found a bug which needs to be reported. If you did provide a target name at | |
116 | configure time, then you should reconfigure without specifying a target name. | |
117 | ||
118 | ||
119 | Problems building the Fortran compiler | |
120 | The Fortran front end can not be built with most vendor compilers; it must | |
121 | be built with gcc. As a result, you may get an error if you do not follow | |
122 | the install instructions carefully. | |
123 | ||
124 | In particular, instead of using "make" to build egcs, you should use | |
125 | "make bootstrap" if you are building a native compiler or "make cross" | |
126 | if you are building a cross compiler. | |
127 | ||
128 | It has also been reported that the Fortran compiler can not be built | |
129 | on Red Hat 4.X linux for the Alpha. Fixing this may require upgrading | |
130 | binutils or to Red Hat 5.0; we'll provide more information as it becomes | |
131 | available. | |
132 | ||
133 | ||
134 | Problems building on MIPS platforms | |
135 | egcs requires the use of GAS on all versions of Irix, except Irix 6 due | |
136 | to limitations in older Irix assemblers. | |
137 | ||
138 | Either of these messages indicates that you are using the MIPS assembler | |
139 | when instead you should be using GAS. | |
140 | ||
141 | as0: Error: ./libgcc2.c, line 1:Badly delimited numeric literal | |
142 | .4byte $LECIE1-$LSCIE1 | |
143 | as0: Error: ./libgcc2.c, line 1:malformed statement | |
144 | ||
145 | ||
146 | ||
147 | as0: Error: /home/law/egcs_release/gcc/libgcc2.c, line 1:undefined symbol in expression | |
148 | .word $LECIE1-$LSCIE1 | |
149 | ||
150 | ||
151 | For Irix 6, you should use the native assembler as GAS is not supported | |
152 | on Irix 6. | |
153 | ||
154 | ||
155 | Problems with exception handling on x86 platforms | |
156 | If you are using the GNU assembler (aka gas) on an x86 platform and | |
157 | exception handling is not working correctly, then odds are you're using a | |
158 | buggy assembler. | |
159 | ||
160 | We recommend binutils-2.8.0.1.15 or newer. | |
161 | "ftp://tsx-11.mit.edu/pub/linux/packages/GCC/binutils-2.8.1.0.15.tar.gz binutils-2.8.0.1.15 source | |
162 | ftp://tsx-11.mit.edu/pub/linux/packages/GCC/binutils-2.8.1.0.15.bin.tar.gz binutils-2.8.0.1.15 x86 binary for libc5 | |
163 | ftp://tsx-11.mit.edu/pub/linux/packages/GCC/binutils-2.8.1.0.15.glibc.bin.tar.gz binutils-2.8.0.1.15 x86 binary for glibc2 | |
164 | Or, you can try a | |
165 | ftp://ftp.cygnus.com/pub/egcs/infrastructure/gas-970915.tar.gz binutils snapshot; however, be aware that the binutils snapshot is untested | |
166 | and may not work (or even build). Use it at your own risk. | |
167 | ||
168 | ||
169 | Bootstrap comparison failures on HPs | |
170 | If you bootstrap the compiler on hpux10 using the HP assembler instead of | |
171 | gas, every file will fail the comparison test. | |
172 | ||
173 | The HP asembler inserts timestamps into object files it creates, causing | |
174 | every file to be different. The location of the timestamp varies for each | |
175 | object file, so there's no real way to work around this mis-feature. | |
176 | ||
177 | Odds are your compiler is fine, but there's no way to be certain. | |
178 | ||
179 | If you use GAS on HPs, then you will not run into this problem because | |
180 | GAS never inserts timestamps into object files. For this and various other | |
181 | reasons we highly recommend using GAS on HPs. | |
182 | ||
183 | ||
184 | Bootstrap loops rebuilding cc1 over and over | |
185 | When building egcs, the build process loops rebuilding cc1 over and | |
186 | over again. This happens on mips-sgi-irix5.2, and possibly other platforms. | |
187 | ||
188 | This is probably a bug somewhere in the egcs Makefile. Until we find and | |
189 | fix this bug we recommend you use GNU make instead of vendor supplied make | |
190 | programs. | |
191 | ||
192 | ||
193 | Dynamic linker is unable to find GCC libraries | |
194 | This problem manifests itself by programs not finding shared libraries | |
195 | they depend on when the programs are started. Note this problem often manifests | |
196 | itself with failures in the libio/libstdc++ tests after configuring with | |
197 | --enable-shared and building egcs. | |
198 | ||
199 | GCC does not specify a runpath so that the dynamic linker can find dynamic | |
200 | libraries at runtime. | |
201 | ||
202 | The short explaination is that if you always pass a -R option to the | |
203 | linker, then your programs become dependent on directories which | |
204 | may be NFS mounted, and programs may hang unnecessarily when an | |
205 | NFS server goes down. | |
206 | ||
207 | The problem is not programs that do require the directories; those | |
208 | programs are going to hang no matter what you do. The problem is | |
209 | programs that do not require the directories. | |
210 | ||
211 | SunOS effectively always passed a -R option for every -L option; | |
212 | this was a bad idea, and so it was removed for Solaris. We should | |
213 | not recreate it. | |
214 | ||
215 | ||
216 | Unable to run the testsuite | |
217 | If you get a message about unable to find "standard.exp" when trying to | |
218 | run the egcs testsuites, then your dejagnu is too old to run the egcs tests. | |
219 | You will need to get a newer version of dejagnu; we've made a | |
220 | <a href="ftp://ftp.cygnus.com/pub/egcs/infrastructure/dejagnu-971028.tar.gz"> | |
221 | dejagnu snapshot available until a new version of dejagnu can be released. | |
222 | ||
223 | ||
224 | How to build a cross compiler | |
225 | Building cross compilers is a rather complex undertaking because they | |
226 | usually need additional software (cross assembler, cross linker, target | |
227 | libraries, target include files, etc). | |
228 | ||
229 | We recommend reading the <a href="ftp://ftp.cygnus.com/pub/embedded/crossgcc/FAQ-0.8.1"> | |
230 | crossgcc FAQ for information about building cross compilers. | |
231 | ||
232 | If you have all the pieces available, then `make cross' should build a | |
233 | cross compiler. `make LANGUAGES="c c++" install'will install the cross | |
234 | compiler. | |
235 | ||
236 | Note that if you're trying to build a cross compiler in a tree which | |
237 | includes binutils-2.8 in addition to egcs, then you're going to need to | |
238 | make a couple minor tweaks so that the cross assembler, linker and | |
239 | nm utilities will be found. | |
240 | ||
241 | binutils-2.8 builds those files as gas.new, ld.new and nm.new; egcs gcc | |
242 | looks for them using gas-new, ld-new and nm-new, so you may have to arrange | |
243 | for any symlinks which point to <file>.new to be changed to <file>-new. | |
244 | ||
245 | ||
246 | Snapshots, how, when, why | |
247 | We make snapshots of the egcs sources about once a week; there is no | |
248 | predetermined schedule. These snapshots are intended to give everyone | |
249 | access to work in progress. Any given snapshot may generate incorrect code | |
250 | or even fail to build. | |
251 | ||
252 | If you plan on downloading and using snapshots, we highly recommend you | |
253 | subscribe to the egcs mailing lists. See <a href="index.html#mailinglists"> | |
254 | mailing lists on the main egcs page for instructions on how to subscribe. | |
255 | ||
256 | When using the diff files to update from older snapshots to newer snapshots, | |
257 | make sure to use "-E" and "-p" arguments to patch so that empty files are | |
258 | deleted and full pathnames are provided to patch. If your version of | |
259 | patch does not support "-E", you'll need to get a newer version. Also note | |
260 | that you may need autoconf, autoheader and various other programs if you use | |
261 | diff files to update from one snapshot to the next. | |
262 | ||
263 | ||
264 | How to install both egcs and gcc2 | |
265 | It may be desirable to install both egcs and gcc2 on the same system. This | |
266 | can be done by using different prefix paths at configure time and a few | |
267 | symlinks. | |
268 | ||
269 | Basically, configure the two compilers with different --prefix options, | |
270 | then build and install each compiler. Assume you want "gcc" to be the egcs | |
271 | compiler and available in /usr/local/bin; also assume that you want "gcc2" | |
272 | to be the gcc2 compiler and also available in /usr/local/bin. | |
273 | ||
274 | The easiest way to do this is to configure egcs with --prefix=/usr/local/egcs | |
275 | and gcc2 with --prefix=/usr/local/gcc2. Build and install both compilers. | |
276 | Then make a symlink from /usr/local/bin/gcc to /usr/local/egcs/bin/gcc and | |
277 | from /usr/local/bin/gcc2 to /usr/local/gcc2/bin/gcc. Create similar links | |
278 | for the "g++", "c++" and "g77" compiler drivers. | |
279 | ||
280 | ||
281 | Problems building Linux kernels | |
282 | If you installed a recent binutils/gas snapshot on your Linux system, | |
283 | you may not be able to build the kernel because objdump does not understand | |
284 | the "-k" switch. The solution for this problem is to remove /usr/bin/encaps. | |
285 | ||
286 | You may get an internal compiler error compiling process.c in newer | |
287 | versions of the Linux kernel on x86 machines. This is a bug in an asm | |
288 | statement in process.c, not a bug in egcs. XXX How to fix?!? | |
289 | ||
290 | You may get errors with the X driver of the form | |
291 | _X11TransSocketUNIXConnect: Can't connect: errno = 111 | |
292 | ||
293 | It's a kernel bug. The function sys_iopl in arch/i386/kernel/process.c | |
294 | does an illegal hack which used to work but is now broken since GCC optimizes | |
295 | more aggressively . The newer 2.1.x kernels already have a fix which should | |
296 | also work in 2.0.32. | |
297 | ||
298 | ||
299 | Virtual memory exhausted error | |
300 | This error means your system ran out of memory; this can happen for large | |
301 | files, particularly when optimizing. If you're getting this error you should | |
302 | consider trying to simplify your files or reducing the optimization level. | |
303 | ||
304 | Note that using -pedantic or -Wreturn-type can cause an explosion in the | |
305 | amount of memory needed for template-heavy C++ code, such as code that uses | |
306 | STL. Also note that -Wall includes -Wreturn-type, so if you use -Wall you | |
307 | will need to specify -Wno-return-type to turn it off. | |
308 | ||
309 | ||
310 | GCC can not find GAS | |
311 | Some configurations like irix4, irix5, hpux* require the use of the GNU | |
312 | assembler intead of the system assembler. To ensure that egcs finds the GNU | |
313 | assembler, you should configure the GNU assembler with the same --prefix | |
314 | option as you used for egcs. Then build & install the GNU assembler. | |
315 | ||
316 | ||
317 | egcs does not work on Red Hat 5.0 | |
318 | egcs does not currently work with Red Hat 5.0; we'll update this | |
319 | entry with more information as it becomes available. | |
320 | ||
321 | ||
322 | Last modified: December 2, 1997 |