1 This is the file README. It documents release 1.39.0 of the GNU C++
2 compiler system, still in test release status. Many bugs reported in
3 the previous test releases have been fixed. Some bugs surely remain.
4 To see the list of current issues/bugs in GNU C++, look at the file
5 dist-g++/ideas, or see the BugList section of the GNU C++ Users Guide.
7 See the file HINTS for special clues relating to GNU C++ configuration
12 GNU C++ is GNU CC, with a C++ front end. GNU CC is the Free Software
13 Foundation's optimizing, retargetable, ANSI C compiler. GNU CC has
14 source level debugging support from the GDB debugger (also available
15 from the Free Software Foundation). For more information about GNU
16 CC, write to the Free Software Foundation at the address given below.
17 GNU C++ is an extension of GNU CC. It keeps the powerful optimizer,
18 and maintains a high degree of source-level debugging support, while
19 providing the object-oriented features of C++. Numerous files have
20 been added, changed, and hacked without mercy from their original GNU
21 CC incarnation to make this compiler accept a reasonable super/subset
24 *Disclaimer*: GNU C++ is not perfectly compatible with AT&T
25 C++. It is, however, a reasonably faithful implementation of C++ as
26 described in the C++ reference manual. To make GNU C++ more mobile,
27 only the files that are not shared with GNU CC are currently being
28 distributed. If you do not have GNU CC yet, or your version is older
29 than 1.39, you should take care of getting that first. GNU CC is
30 available to sites which have anonymous ftp capability to
31 prep.ai.mit.edu. Contact the Free Software Foundation for more
34 GNU C++ is still under development, but has stabilized (hopefully) to
35 the point where bug fixes will not require major implementation or
36 reimplementation. The purpose of this distribution is to give
37 interested parties a chance to start working with a free C++ compiler.
38 It is expected (and hoped) that this compiler will continue to evolve
39 at a fairly rapid pace. I am hoping to receive not just bug reports,
40 but also code contributions, new features, and anything else that
41 makes GNU C++ a better compiler.
43 Documentation for GNU C++ does not really exist. If you would like to
44 write some, more power to you. What does exist is in the file
45 dist-g++/g++.texinfo .
47 GNU C++ is no longer distributed with a special debugger. The current
48 version of GDB needed to debug GNU C++ program is version 3.5, which
49 can be gotten from prep.ai.mit.edu in the usual way.
51 Currently, the debugger supports all of the features of the compiler,
52 except for: new and delete, operator forms of new and delete, user
53 defined type conversion, and multiple inheritance when multiple
54 inheritance must actually be used. The reason for these exceptions is
55 the degree of difficulty of their implementation. I am waiting until
56 I see a clean, general way of doing it. Until then, I would
57 appreciate any input (thoughts, caveats, source code) you would like
60 A name demangler has been provided by James Clark. Here is the text
63 This package contains a demangler for GNU C++ version 1.39
64 (November 6 version); it will probably require work for other
67 It has *not* been extensively tested, so use with caution.
69 Demangling converts an encoded g++ symbol name approximately into
70 the form of a C++ declaration.
72 cplus-dem.c provides a self-contained implementation of the
73 demangling function cplus_demangle.
75 g++filt.c is a simple filter that illustrates the use of
76 cplus_demangle. It has a similar function to the c++filt program
77 provided for cfront 2.0. It filters its input replacing encoded
78 g++ symbol names by their demangled equivalents. Anything not part
79 of a g++ symbol name is passed through unchanged. It can be used
80 to filter the output of, for example, gprof or nm.
82 ld.c.patch contains a rather ugly patch to ld.c (the version which
83 comes with g++) to make it use cplus_demangle for printing the
84 names of undefined symbols when a -lg++ option is given.
89 GNU C++ was originally developed on a Sun-3 workstation, running Sun's
90 OS 3.5, and was migrated to a Sun-4 workstation, running Sun's OS 4.0
91 (Berkeley 4.2 compatible with some System V enhancements). The GNU
92 C++ library was developed on a VAX 11/750 running BSD 4.3, and is now
93 being developed on a Sun-4 workstation as well. If you have machines
94 other than these, or any kind of machine running System V, you may
95 experience installation difficulties due to conditions which I cannot
96 anticipate. I will try to help you with problems on these machines,
97 but my primary goal is supporting GNU C++, and not System V (or VMS).
99 Installation of GNU C++. (From distribution tape)
101 Select the directory in your file system where GNU code usually goes.
102 If this is your first GNU code, then you have probably not installed
103 GNU CC. Please install it, and then continue with these instructions.
104 You also need to have bison installed. In this directory, you should
105 have the subdirectories
108 gcc/ linked to -> gcc-1.39
111 and possibly others. Unload the tape by using the tar command.
113 install% tar xvf TARFILE
115 where TARFILE is either the name of a tar file if you got the
116 distribution via ftp, or is the name of the tape device on which the
117 release tape is held.
119 Your directory tree should now contain the additional file
123 If you have specifically requested that the GNU C++ library be
124 included on the tape that we make for you, you will also have the
129 If you got this tar file electronically instead of by tape, these
130 directories will come from separate tar files.
132 The GNU C++ library contains header files such as `stdio.h',
133 `stream.h', etc., which are useful when trying examples from the book.
134 It also contains a number of useful classes which serve both as
135 function program units, as well as example C++ code.
137 The code for GNU C++ is in the directory g++-1.39.0/. Here is how to
140 (0) Installation of GNU C++ assumes that you will share binaries
141 with GNU CC. If this is not the case, then run "make cleanconfig"
142 after running "make maketest".
144 (1) Make a directory, e.g. g++/ and `cd' into it
149 (2) Make symbolic links from all files in the g++-1.39.0 directory
150 to the current g++ directory, i.e., ln -s ../g++-1.39.0/* .
152 (3) Read carefully the comments at the top of the Makefile, to see
153 what flags, you will need to modify, if any. For example, if you
154 have a System V machine, you may have to uncomment the line which
157 (4) Do a `make' of the "maketest" target in the Makefile. If your
158 directory structure is as described here, you need not give any
159 additional arguments. Otherwise, you must set DIR to the
160 directory which contains GNU CC sources, and TDIR to the directory
161 which contains GNU CC object files. The variable CDIR is the
162 directory for GNU CC's machine-specific files. You do not need to
163 explicitly give this a value unless you have moved GNU CC's
164 "config" directory relative to the DIR director.
166 The error messages about links that could not be made should be
169 (5) Configure the compiler for the machine target you want. This is
170 accomplished by running the program "config.g++". For example, on
171 a Sun4 running SunOS 4.0, you would type:
173 install% config.g++ sun4-os4
175 Now, You should still be in the directory g++/:
181 If GAS and GNU LD work for your machine, *use them*. That will permit
182 you to use the system's crt0.o, including mcrt0.o and gcrt0.o which
183 support profiling and other features. Said another way, if you use
184 GNU ld and GNU as, don't use special crt0.o!
186 To install GAS, you should have release 1.34 or greater. Since GAS
187 and GNU C/C++ do not share source code, there is no need to try to
188 match GAS and GNU C/C++ version numbers. To install GAS in such a way
189 that GNU C/C++ can find it, install it as `gcc-as' wherever `gcc-cc1'
190 and `gcc-cc1plus' are installed. Usually this is
191 `/usr/local/lib/gcc-as'. Similarly install GNU LD as `gcc-ld' where
192 `gcc-cc1' and friends are installed, usually `/usr/local/lib/gcc-ld'.
194 GNU LD will not work if your system uses COFF object files. In
195 this case, use the `collect' program.
197 If neither GNU LD or `collect' works, use collect2.c. (In
198 particular, use it on Convex machines.) To use collect2.c, your
199 system must support the -r flag of ld. Edit collect2.c if
200 necessary to tell it about your assembler syntax, then compile it
201 with gcc and install it as /usr/local/lib/gcc-ld.
203 *Very Important* [For non-GAS users]: If you do not use GAS, GNU C++
204 may need to use its own crt0.c, borrowed and modified from GNU Emacs.
205 You should verify that the crt0.c provided is fed suitable definitions
206 for correct compilation. If you have GNU Emacs, and you are not
207 compiling to a SUN, consult your local GNU Emacs guru, to see what
208 sort of #defines are required for proper operation.
210 In any event, at this point, just type `make':
214 If you are not using a SUN, you will need to use the appropriate
215 machine dependent files, as per GNU CC. If you do not provide a
216 proper crt0.c, any executable produced by GNU C++ may fail to run at
217 all. Conversely, if you have a program which does not make it as far
218 as the first line in main (), you have probably failed to provide the
219 correct flags to the compiler when building crt0.c.
221 You have now just made GNU C++. Having done that, you should now
222 proceed to use GNU C++ to build the GNU C++ run-time libraries, which
223 are in the directory dist-libg++/ . This code was contributed
224 by Doug Lea, and implements streams, obstacks, structured files, and
225 other C++ public service objects. The README in that directory
226 explains the installation procedure for that code. Also, by making
227 the library and running the test programs (the Makefile in
228 dist-libg++/ will tell you what to do), you can verify that GNU
229 C++ has been properly installed.
231 GNU ld is normally distributed with the GNU binary utilities. It is
232 preferable to use that for linking GNU C++ programs. However, it is
233 possible to link GNU C++ programs using the version of GNU ld
234 distributed with GNU C++ (this has been tested under SunOS 4.0 and
235 under SunOS 4.1.1). To install GNU ld from these sources, execute the
238 install% make install-ld
242 GNU C++ and GDB 3.4 are intended to be compatible. GDB+ no longer
243 exists. Read installation instructions provided in dist-gdb.
247 I suggest making all of the files in ../gcc/ read-only, so that when
248 you are making modifications to files of GNU C++, you will notice when
249 new ground is being broken. It also helps to know what files can be
250 updated from the standard GNU software without impacting GNU C++. For
251 example, if there is a bug fix for the file `cse.c', that same fix
252 applies to GNU CC and GNU C++. With both compilers pointing to the
253 same directory via symbolic links, one need not concern oneself
262 For more information.
264 For questions concerning GNU CC and GDB, the Free Software Foundation
265 maintains the following address:
267 The Free Software Foundation
268 675 Massachusetts Avenue
272 Phone: (617) 876 - 3296
274 Cygnus Support provides commercial support for GNU C++ on a fixed-fee
275 basis. If you want support, or have support-related questions, please
279 814 University Avenue
283 Phone: (415) 322-3811
285 Software from the Free Software Foundation is provided with absolutely
286 no warranty, to the extent permitted by applicable state law.
287 Redistribution of its code (source and/or executable) by MCC does not
288 imply that MCC offers a warranty for such code.