Richard M. Stallman
last updated 22 May 1992
for version 2.2
(preliminary draft, which will change)
Copyright © 1988, 1989, 1992 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the sections entitled “GNU General Public License” and “Boycott” are included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that the sections entitled “GNU General Public License” and “Boycott”, and this permission notice, may be included in translations approved by the Free Software Foundation instead of in the original English.
GNU GENERAL PUBLIC LICENSE | GNU General Public License says how you can copy and share GNU CC. | |
Contributors to GNU CC | People who have contributed to GNU CC. | |
1 Protect Your Freedom—Fight “Look And Feel” | Protect your freedom—fight “look and feel”. | |
• Invoking GCC | Command options supported by ‘gcc’. | |
• Installation | How to configure, compile and install GNU CC. | |
• Extensions | GNU extensions to the C language. | |
2 Known Causes of Trouble with GNU CC | If you have trouble installing GNU CC. | |
• Bugs | How, why and where to report bugs. | |
• Service | How to find suppliers of support for GNU CC. | |
• VMS | Using GNU CC on VMS. | |
• Portability | Goals of GNU CC’s portability features. | |
• Interface | Function-call interface of GNU CC output. | |
• Passes | Order of passes, what they do, and what each file is for. | |
• RTL | The intermediate representation that most passes work on. | |
• Machine Desc | How to write machine description instruction patterns. | |
• Target Macros | How to write the machine description C macros. | |
• Config | Writing the ‘xm-machine.h’ file. | |
• Index | Index of concepts and symbol names. |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Version 2, June 1991
Copyright © 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software—to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation’s software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author’s protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors’ reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone’s free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and “any later version”, you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
one line to give the program's name and a brief idea of what it does. Copyright (C) 19yy name of author This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands ‘show w’ and ‘show c’ should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than ‘show w’ and ‘show c’; they could even be mouse-clicks or menu items—whatever suits your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a “copyright disclaimer” for the program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice
This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
In addition to Richard Stallman, several people have written parts of GNU CC.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section is a political message from the League for Programming Freedom to the users of GNU CC. It is included here as an expression of support for the League on the part of the Free Software Foundation.
Apple and Lotus are trying to create a new form of legal monopoly: a copyright on a class of user interfaces. These monopolies would cause serious problems for users and developers of computer software and systems. Xerox, too, has tried to make a monopoly for itself on window systems; their suit against Apple was thrown out on a technicality, but Xerox has not said anything to indicate it wouldn’t try again.
Until a few years ago, the law seemed clear: no one could restrict others from using a user interface; programmers were free to implement any interface they chose. Imitating interfaces, sometimes with changes, was standard practice in the computer field. The interfaces we know evolved gradually in this way; for example, the Macintosh user interface drew ideas from the Xerox interface, which in turn drew on work done at Stanford and SRI. 1-2-3 imitated VisiCalc, and dBase imitated a database program from JPL.
Most computer companies, and nearly all computer users, were happy with this state of affairs. The companies that are suing say it does not offer “enough incentive” to develop their products, but they must have considered it “enough” when they made their decision to do so. It seems they are not satisfied with the opportunity to continue to compete in the marketplace—not even with a head start.
If companies like Xerox, Lotus, and Apple are permitted to make law through the courts, the precedent will hobble the software industry:
To protect our freedom from lawsuits like these, a group of programmers and users have formed a new grass-roots political organization, the League for Programming Freedom.
The purpose of the League is to oppose new monopolistic practices such as user-interface copyright and software patents; it calls for a return to the legal policies of the recent past, in which these practices were not allowed. The League is not concerned with free software as an issue, and not affiliated with the Free Software Foundation.
The League’s membership rolls include John McCarthy, inventor of Lisp, Marvin Minsky, founder of the Artificial Intelligence lab, Guy L. Steele, Jr., author of well-known books on Lisp and C, as well as Richard Stallman, the developer of GNU CC. Please join and add your name to the list. Membership dues in the League are $42 per year for programmers, managers and professionals; $10.50 for students; $21 for others.
The League needs both activist members and members who only pay their dues.
To join, or for more information, phone (617) 492-0023 or write to:
League for Programming Freedom 1 Kendall Square #143 P.O. Box 9171 Cambridge, MA 02139
You can also send electronic mail to league@prep.ai.mit.edu
.
Here are some suggestions from the League for things you can do to protect your freedom to write programs:
House Subcommittee on Intellectual Property 2137 Rayburn Bldg Washington, DC 20515 Senate Subcommittee on Patents, Trademarks and Copyrights United States Senate Washington, DC 20510
(These committees have received lots of mail already; let’s give them even more.)
Express your opinion! You can make a difference.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section describes known problems that affect users of GNU CC. Most of these are not GNU CC bugs per se—if they were, we would fix them. But the result for a user may be like the result of a bug.
Some of these problems are due to bugs in other software, some are missing features that are too much work to add, and some are places where people’s opinions differ as to what is best.
2.1 Actual Bugs We Haven’t Fixed Yet | Bugs we will fix later. | |
2.2 Installation Problems | Problems that manifest when you install GNU CC. | |
2.3 Cross-Compiler Problems | Common problems of cross compiling with GNU CC. | |
2.4 Interoperation | Problems using GNU CC with other compilers, and with certain linkers, assemblers and debuggers. | |
• Incompatibilities | GNU CC is incompatible with traditional C. | |
• Disappointments | Regrettable things we can’t change, but not quite bugs. | |
• Non-bugs | Things we think are right, but some others disagree. |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This is a list of problems (and some apparent problems which don’t really mean anything is wrong) that show up during installation of GNU CC.
CC
can interfere with the functioning of make
.
gcc
driver program looked for
as
and ld
in various places such as files beginning with
‘/usr/local/lib/gcc-’. GNU CC version 2 looks for them in the
directory ‘/usr/local/lib/gcc-lib/target/version’.
Thus, to use a version of as
or ld
that is not the system
default, for example gas
or GNU ld
, you must put them in
that directory (or make links to them from that directory).
make
. These failures, which
are often due to files that were not found, are expected, and can safely
be ignored.
make
recompiles parts of the compiler when installing
the compiler. In one case, this was traced down to a bug in
make
. Either ignore the problem or switch to GNU Make.
genflags
or genoutput
while building GCC. This is said to
be due to a bug in sh
. You can probably get around it by running
genflags
or genoutput
manually and then retrying the
make
.
switch
statement. You can avoid this problem by specifying
‘LANGUAGES=c’ when you compile GNU CC with the Ultrix compiler.
Then you can compile the entire GNU compiler with GNU CC.
_floatdisf cc1: warning: `-g' option not supported on this version of GCC cc1: warning: `-g1' option not supported on this version of GCC ./gcc: Internal compiler error: program as got fatal signal 11
A patched version of the assembler is available by anonymous ftp from
altdorf.ai.mit.edu
as the file
‘archive/cph/hpux-8.0-assembler’. If you have HP software support,
the patch can also be obtained directly from HP, as described in the
following note:
This is the patched assembler, to patch SR#1653-010439, where the assembler aborts on floating point constants.
The bug is not really in the assembler, but in the shared library version of the function “cvtnum(3c)”. The bug on “cvtnum(3c)” is SR#4701-078451. Anyway, the attached assembler uses the archive library version of “cvtnum(3c)” and thus does not exhibit the bug.
This patch is also known as PHCO_0800.
as: /usr/tmp/cca08196.s @line#30 [err#1060] Argument 1 or 3 in FARG upper - lookahead = RTNVAL=GR
This happens because HP changed the assembler syntax after system release 8.02. GNU CC assumes the newer syntax; if your assembler wants the older syntax, comment out this line in the file ‘pa1-hpux.h’:
#define HP_FP_ARG_DESCRIPTOR_REVERSED
muldi3
in file ‘libgcc2.c’.
You may be able to succeed by getting GNU CC version 1, installing it, and using it to compile GNU CC version 2. The bug in the Pyramid C compiler does not seem to affect GNU CC version 1.
To solve this problem, reconfigure the kernel adding the following line to the configuration file:
MAXUMEM = 4096
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The compiler writes these integer constants by examining the floating point value as an integer and printing that integer, because this is simple to write and independent of the details of the floating point representation. But this does not work if the compiler is running on a different machine with an incompatible floating point format, or even a different byte-ordering.
In addition, correct constant folding of floating point values requires representing them in the target machine’s format. (The C standard does not quite require this, but in practice it is the only way to win.)
It is now possible to overcome these problems by defining macros such
as REAL_VALUE_TYPE
. But doing so is a substantial amount of
work for each target machine. @xref{Cross-compilation}.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section lists various difficulties encountered in using GNU C or GNU C++ together with other compilers or with the assemblers, linkers and debuggers on certain systems.
GNU C++ also uses different techniques for arranging virtual function tables and the layout of class instances. In general, therefore, linking code compiled with different C++ compilers does not work.
This happens if you are using the GNU linker, because it does only static linking and looks only for unshared libraries. If you have a shared library with no unshared counterpart, the GNU linker won’t find anything.
We hope to make a linker which supports Sun shared libraries, but please don’t ask when it will be finished—we don’t know.
_dlclose
, _dlsym
or _dlopen
when linking, compile and link against the file
‘mit/util/misc/dlsym.c’ from the MIT version of X windows.
alloca
or variable-size arrays. This is because GNU CC doesn’t
generate HPUX unwind descriptors for such functions. It may even be
impossible to generate them.
va_list
as parameters, such as
vprintf
. This may be fixed eventually.
IBM has produced a fixed version of the assembler. The replacement assembler is not a standard component of either AIX 3.1.5 or AIX 3.2, but is expected to become standard in a future distribution. This assembler is available from IBM as APAR IX22829. Yet more bugs have been fixed in a newer assembler, which will shortly be available as APAR IX26107. See the file ‘README.RS6000’ for more details on these assemblers.
extern int foo; … foo … static int foo;
will cause the linker to report an undefined symbol foo
.
Although this behavior differs from most other systems, it is not a
bug because redefining an extern
variable as static
is undefined in ANSI C.
[Top] | [Contents] | [Index] | [ ? ] |
This document was generated on February 23, 2025 using texi2html 5.0.
The buttons in the navigation panels have the following meaning:
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ << ] | FastBack | Beginning of this chapter or previous chapter | 1 |
[ < ] | Back | Previous section in reading order | 1.2.2 |
[ Up ] | Up | Up section | 1.2 |
[ > ] | Forward | Next section in reading order | 1.2.4 |
[ >> ] | FastForward | Next chapter | 2 |
[Top] | Top | Cover (top) of document | |
[Contents] | Contents | Table of contents | |
[Index] | Index | Index | |
[ ? ] | About | About (help) |
where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:
This document was generated on February 23, 2025 using texi2html 5.0.