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