mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 12:00:03 -05:00
Compare commits
5 Commits
misc/cutov
...
misc/first
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3520370f09 | ||
|
|
861bb6c1b0 | ||
|
|
737cee66f2 | ||
|
|
89045fd128 | ||
|
|
d7194dd690 |
542
gcc/ABOUT-GCC-NLS
Normal file
542
gcc/ABOUT-GCC-NLS
Normal file
@@ -0,0 +1,542 @@
|
||||
Notes on GCC's Native Language Support
|
||||
|
||||
GCC's Native Language Support (NLS) is relatively new and
|
||||
experimental, so NLS is currently disabled by default. Use
|
||||
configure's --enable-nls option to enable it. Eventually, NLS will be
|
||||
enabled by default, and you'll need --disable-nls to disable it. You
|
||||
must enable NLS in order to make a GCC distribution.
|
||||
|
||||
By and large, only diagnostic messages have been internationalized.
|
||||
Some work remains in other areas; for example, GCC does not yet allow
|
||||
non-ASCII letters in identifiers.
|
||||
|
||||
Not all of GCC's diagnostic messages have been internationalized.
|
||||
Programs like `enquire' and `genattr' are not internationalized, as
|
||||
their users are GCC maintainers who typically need to be able to read
|
||||
English anyway; internationalizing them would thus entail needless
|
||||
work for the human translators. And no one has yet gotten around to
|
||||
internationalizing the messages in the C++ compiler, or in the
|
||||
specialized MIPS-specific programs mips-tdump and mips-tfile.
|
||||
|
||||
The GCC library should not contain any messages that need
|
||||
internationalization, because it operates below the
|
||||
internationalization library.
|
||||
|
||||
Currently, the only language translation supplied is en_UK (British English).
|
||||
|
||||
Unlike some other GNU programs, the GCC sources contain few instances
|
||||
of explicit translation calls like _("string"). Instead, the
|
||||
diagnostic printing routines automatically translate their arguments.
|
||||
For example, GCC source code should not contain calls like `error
|
||||
(_("unterminated comment"))'; it should contain calls like `error
|
||||
("unterminated comment")' instead, as it is the `error' function's
|
||||
responsibility to translate the message before the user sees it.
|
||||
|
||||
By convention, any function parameter in the GCC sources whose name
|
||||
ends in `msgid' is expected to be a message requiring translation.
|
||||
For example, the `error' function's first parameter is named `msgid'.
|
||||
GCC's exgettext script uses this convention to determine which
|
||||
function parameter strings need to be translated. The exgettext
|
||||
script also assumes that any occurrence of `%eMSGID}' on a source
|
||||
line, where MSGID does not contain `%' or `}', corresponds to a
|
||||
message MSGID that requires translation; this is needed to identify
|
||||
diagnostics in GCC spec strings.
|
||||
|
||||
If you enable NLS and modify source files, you'll need to use a
|
||||
special version of the GNU gettext package to propagate the
|
||||
modifications to the translation tables. Apply the following patch
|
||||
(use `patch -p0') to GNU gettext 0.10.35, which you can retrieve from:
|
||||
|
||||
ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz
|
||||
|
||||
This patch has been submitted to the GNU gettext maintainer, so
|
||||
eventually we shouldn't need this special gettext version.
|
||||
|
||||
This patch 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
This patch 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 patch; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
|
||||
1998-07-26 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* po/Makefile.in.in (maintainer-clean): Remove cat-id-tbl.c and
|
||||
stamp-cat-id.
|
||||
|
||||
1998-07-24 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* po/Makefile.in.in (cat-id-tbl.o): Depend on
|
||||
$(top_srcdir)/intl/libgettext.h, not ../intl/libgettext.h.
|
||||
|
||||
1998-07-20 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* po/Makefile.in.in (.po.pox, all-yes, $(srcdir)/cat-id-tbl.c,
|
||||
$(srcdir)/stamp-cat-id, update-po): Prepend `$(srcdir)/' to
|
||||
files built in the source directory; this is needed for
|
||||
VPATH-based make in Solaris 2.6.
|
||||
|
||||
1998-07-17 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
Add support for user-specified argument numbers for keywords.
|
||||
Extract all strings from a keyword arg, not just the first one.
|
||||
Handle parenthesized commas inside keyword args correctly.
|
||||
Warn about nested keywords.
|
||||
|
||||
* doc/gettext.texi: Document --keyword=id:argnum.
|
||||
|
||||
* src/xgettext.c (scan_c_file):
|
||||
Warn about nested keywords, e.g. _(_("xxx")).
|
||||
Warn also about not-yet-implemented but allowed nesting, e.g.
|
||||
dcgettext(..._("xxx")..., "yyy").
|
||||
Get all strings in a keyword arg, not just the first one.
|
||||
Handle parenthesized commas inside keyword args correctly.
|
||||
|
||||
* src/xget-lex.h (enum xgettext_token_type_ty):
|
||||
Replace xgettext_token_type_keyword1 and
|
||||
xgettext_token_type_keyword2 with just plain
|
||||
xgettext_token_type_keyword; it now has argnum value.
|
||||
Add xgettext_token_type_rp.
|
||||
(struct xgettext_token_ty): Add argnum member.
|
||||
line_number and file_name are now also set for
|
||||
xgettext_token_type_keyword.
|
||||
(xgettext_lex_keyword): Arg is const char *.
|
||||
|
||||
* src/xget-lex.c: Include "hash.h".
|
||||
(enum token_type_ty): Add token_type_rp.
|
||||
(keywords): Now a hash table.
|
||||
(phase5_get): Return token_type_rp for ')'.
|
||||
(xgettext_lex, xgettext_lex_keyword): Add support for keyword argnums.
|
||||
(xgettext_lex): Return xgettext_token_type_rp for ')'.
|
||||
Report keyword argnum, line number, and file name back to caller.
|
||||
|
||||
1998-07-09 Paul Eggert <eggert@twinsun.com>
|
||||
|
||||
* intl/Makefile.in (uninstall):
|
||||
Do nothing unless $(PACKAGE) is gettext.
|
||||
|
||||
===================================================================
|
||||
RCS file: doc/gettext.texi,v
|
||||
retrieving revision 0.10.35.0
|
||||
retrieving revision 0.10.35.1
|
||||
diff -pu -r0.10.35.0 -r0.10.35.1
|
||||
--- doc/gettext.texi 1998/05/01 05:53:32 0.10.35.0
|
||||
+++ doc/gettext.texi 1998/07/18 00:25:15 0.10.35.1
|
||||
@@ -1854,13 +1854,19 @@ List of directories searched for input f
|
||||
Join messages with existing file.
|
||||
|
||||
@item -k @var{word}
|
||||
-@itemx --keyword[=@var{word}]
|
||||
-Additonal keyword to be looked for (without @var{word} means not to
|
||||
+@itemx --keyword[=@var{keywordspec}]
|
||||
+Additonal keyword to be looked for (without @var{keywordspec} means not to
|
||||
use default keywords).
|
||||
|
||||
-The default keywords, which are always looked for if not explicitly
|
||||
-disabled, are @code{gettext}, @code{dgettext}, @code{dcgettext} and
|
||||
-@code{gettext_noop}.
|
||||
+If @var{keywordspec} is a C identifer @var{id}, @code{xgettext} looks
|
||||
+for strings in the first argument of each call to the function or macro
|
||||
+@var{id}. If @var{keywordspec} is of the form
|
||||
+@samp{@var{id}:@var{argnum}}, @code{xgettext} looks for strings in the
|
||||
+@var{argnum}th argument of the call.
|
||||
+
|
||||
+The default keyword specifications, which are always looked for if not
|
||||
+explicitly disabled, are @code{gettext}, @code{dgettext:2},
|
||||
+@code{dcgettext:2} and @code{gettext_noop}.
|
||||
|
||||
@item -m [@var{string}]
|
||||
@itemx --msgstr-prefix[=@var{string}]
|
||||
===================================================================
|
||||
RCS file: intl/Makefile.in,v
|
||||
retrieving revision 0.10.35.0
|
||||
retrieving revision 0.10.35.1
|
||||
diff -pu -r0.10.35.0 -r0.10.35.1
|
||||
--- intl/Makefile.in 1998/04/27 21:53:18 0.10.35.0
|
||||
+++ intl/Makefile.in 1998/07/09 21:39:18 0.10.35.1
|
||||
@@ -143,10 +143,14 @@ install-data: all
|
||||
installcheck:
|
||||
|
||||
uninstall:
|
||||
- dists="$(DISTFILES.common)"; \
|
||||
- for file in $$dists; do \
|
||||
- rm -f $(gettextsrcdir)/$$file; \
|
||||
- done
|
||||
+ if test "$(PACKAGE)" = "gettext"; then \
|
||||
+ dists="$(DISTFILES.common)"; \
|
||||
+ for file in $$dists; do \
|
||||
+ rm -f $(gettextsrcdir)/$$file; \
|
||||
+ done
|
||||
+ else \
|
||||
+ : ; \
|
||||
+ fi
|
||||
|
||||
info dvi:
|
||||
|
||||
===================================================================
|
||||
RCS file: src/xget-lex.c,v
|
||||
retrieving revision 0.10.35.0
|
||||
retrieving revision 0.10.35.1
|
||||
diff -pu -r0.10.35.0 -r0.10.35.1
|
||||
--- src/xget-lex.c 1998/07/09 22:49:48 0.10.35.0
|
||||
+++ src/xget-lex.c 1998/07/18 00:25:15 0.10.35.1
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "error.h"
|
||||
#include "system.h"
|
||||
#include "libgettext.h"
|
||||
+#include "hash.h"
|
||||
#include "str-list.h"
|
||||
#include "xget-lex.h"
|
||||
|
||||
@@ -83,6 +84,7 @@ enum token_type_ty
|
||||
token_type_eoln,
|
||||
token_type_hash,
|
||||
token_type_lp,
|
||||
+ token_type_rp,
|
||||
token_type_comma,
|
||||
token_type_name,
|
||||
token_type_number,
|
||||
@@ -109,7 +111,7 @@ static FILE *fp;
|
||||
static int trigraphs;
|
||||
static int cplusplus_comments;
|
||||
static string_list_ty *comment;
|
||||
-static string_list_ty *keywords;
|
||||
+static hash_table keywords;
|
||||
static int default_keywords = 1;
|
||||
|
||||
/* These are for tracking whether comments count as immediately before
|
||||
@@ -941,6 +943,10 @@ phase5_get (tp)
|
||||
tp->type = token_type_lp;
|
||||
return;
|
||||
|
||||
+ case ')':
|
||||
+ tp->type = token_type_rp;
|
||||
+ return;
|
||||
+
|
||||
case ',':
|
||||
tp->type = token_type_comma;
|
||||
return;
|
||||
@@ -1179,6 +1185,7 @@ xgettext_lex (tp)
|
||||
while (1)
|
||||
{
|
||||
token_ty token;
|
||||
+ void *keyword_value;
|
||||
|
||||
phase8_get (&token);
|
||||
switch (token.type)
|
||||
@@ -1213,17 +1220,20 @@ xgettext_lex (tp)
|
||||
if (default_keywords)
|
||||
{
|
||||
xgettext_lex_keyword ("gettext");
|
||||
- xgettext_lex_keyword ("dgettext");
|
||||
- xgettext_lex_keyword ("dcgettext");
|
||||
+ xgettext_lex_keyword ("dgettext:2");
|
||||
+ xgettext_lex_keyword ("dcgettext:2");
|
||||
xgettext_lex_keyword ("gettext_noop");
|
||||
default_keywords = 0;
|
||||
}
|
||||
|
||||
- if (string_list_member (keywords, token.string))
|
||||
- {
|
||||
- tp->type = (strcmp (token.string, "dgettext") == 0
|
||||
- || strcmp (token.string, "dcgettext") == 0)
|
||||
- ? xgettext_token_type_keyword2 : xgettext_token_type_keyword1;
|
||||
+ if (find_entry (&keywords, token.string, strlen (token.string),
|
||||
+ &keyword_value)
|
||||
+ == 0)
|
||||
+ {
|
||||
+ tp->type = xgettext_token_type_keyword;
|
||||
+ tp->argnum = (int) keyword_value;
|
||||
+ tp->line_number = token.line_number;
|
||||
+ tp->file_name = logical_file_name;
|
||||
}
|
||||
else
|
||||
tp->type = xgettext_token_type_symbol;
|
||||
@@ -1236,6 +1246,12 @@ xgettext_lex (tp)
|
||||
tp->type = xgettext_token_type_lp;
|
||||
return;
|
||||
|
||||
+ case token_type_rp:
|
||||
+ last_non_comment_line = newline_count;
|
||||
+
|
||||
+ tp->type = xgettext_token_type_rp;
|
||||
+ return;
|
||||
+
|
||||
case token_type_comma:
|
||||
last_non_comment_line = newline_count;
|
||||
|
||||
@@ -1263,16 +1279,32 @@ xgettext_lex (tp)
|
||||
|
||||
void
|
||||
xgettext_lex_keyword (name)
|
||||
- char *name;
|
||||
+ const char *name;
|
||||
{
|
||||
if (name == NULL)
|
||||
default_keywords = 0;
|
||||
else
|
||||
{
|
||||
- if (keywords == NULL)
|
||||
- keywords = string_list_alloc ();
|
||||
+ int argnum;
|
||||
+ size_t len;
|
||||
+ const char *sp;
|
||||
+
|
||||
+ if (keywords.table == NULL)
|
||||
+ init_hash (&keywords, 100);
|
||||
+
|
||||
+ sp = strchr (name, ':');
|
||||
+ if (sp)
|
||||
+ {
|
||||
+ len = sp - name;
|
||||
+ argnum = atoi (sp + 1);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ len = strlen (name);
|
||||
+ argnum = 1;
|
||||
+ }
|
||||
|
||||
- string_list_append_unique (keywords, name);
|
||||
+ insert_entry (&keywords, name, len, (void *) argnum);
|
||||
}
|
||||
}
|
||||
|
||||
===================================================================
|
||||
RCS file: src/xget-lex.h,v
|
||||
retrieving revision 0.10.35.0
|
||||
retrieving revision 0.10.35.1
|
||||
diff -pu -r0.10.35.0 -r0.10.35.1
|
||||
--- src/xget-lex.h 1998/07/09 22:49:48 0.10.35.0
|
||||
+++ src/xget-lex.h 1998/07/18 00:25:15 0.10.35.1
|
||||
@@ -23,9 +23,9 @@ Foundation, Inc., 59 Temple Place - Suit
|
||||
enum xgettext_token_type_ty
|
||||
{
|
||||
xgettext_token_type_eof,
|
||||
- xgettext_token_type_keyword1,
|
||||
- xgettext_token_type_keyword2,
|
||||
+ xgettext_token_type_keyword,
|
||||
xgettext_token_type_lp,
|
||||
+ xgettext_token_type_rp,
|
||||
xgettext_token_type_comma,
|
||||
xgettext_token_type_string_literal,
|
||||
xgettext_token_type_symbol
|
||||
@@ -37,8 +37,14 @@ struct xgettext_token_ty
|
||||
{
|
||||
xgettext_token_type_ty type;
|
||||
|
||||
- /* These 3 are only set for xgettext_token_type_string_literal. */
|
||||
+ /* This 1 is set only for xgettext_token_type_keyword. */
|
||||
+ int argnum;
|
||||
+
|
||||
+ /* This 1 is set only for xgettext_token_type_string_literal. */
|
||||
char *string;
|
||||
+
|
||||
+ /* These 2 are set only for xgettext_token_type_keyword and
|
||||
+ xgettext_token_type_string_literal. */
|
||||
int line_number;
|
||||
char *file_name;
|
||||
};
|
||||
@@ -50,7 +56,7 @@ void xgettext_lex PARAMS ((xgettext_toke
|
||||
const char *xgettext_lex_comment PARAMS ((size_t __n));
|
||||
void xgettext_lex_comment_reset PARAMS ((void));
|
||||
/* void xgettext_lex_filepos PARAMS ((char **, int *)); FIXME needed? */
|
||||
-void xgettext_lex_keyword PARAMS ((char *__name));
|
||||
+void xgettext_lex_keyword PARAMS ((const char *__name));
|
||||
void xgettext_lex_cplusplus PARAMS ((void));
|
||||
void xgettext_lex_trigraphs PARAMS ((void));
|
||||
|
||||
===================================================================
|
||||
RCS file: src/xgettext.c,v
|
||||
retrieving revision 0.10.35.0
|
||||
retrieving revision 0.10.35.1
|
||||
diff -pu -r0.10.35.0 -r0.10.35.1
|
||||
--- src/xgettext.c 1998/07/09 22:49:48 0.10.35.0
|
||||
+++ src/xgettext.c 1998/07/18 00:25:15 0.10.35.1
|
||||
@@ -835,6 +835,8 @@ scan_c_file(filename, mlp, is_cpp_file)
|
||||
int is_cpp_file;
|
||||
{
|
||||
int state;
|
||||
+ int commas_to_skip; /* defined only when in states 1 and 2 */
|
||||
+ int paren_nesting; /* defined only when in state 2 */
|
||||
|
||||
/* Inform scanner whether we have C++ files or not. */
|
||||
if (is_cpp_file)
|
||||
@@ -854,63 +856,79 @@ scan_c_file(filename, mlp, is_cpp_file)
|
||||
{
|
||||
xgettext_token_ty token;
|
||||
|
||||
- /* A simple state machine is used to do the recognising:
|
||||
+ /* A state machine is used to do the recognising:
|
||||
State 0 = waiting for something to happen
|
||||
- State 1 = seen one of our keywords with string in first parameter
|
||||
- State 2 = was in state 1 and now saw a left paren
|
||||
- State 3 = seen one of our keywords with string in second parameter
|
||||
- State 4 = was in state 3 and now saw a left paren
|
||||
- State 5 = waiting for comma after being in state 4
|
||||
- State 6 = saw comma after being in state 5 */
|
||||
+ State 1 = seen one of our keywords
|
||||
+ State 2 = waiting for part of an argument */
|
||||
xgettext_lex (&token);
|
||||
switch (token.type)
|
||||
{
|
||||
- case xgettext_token_type_keyword1:
|
||||
+ case xgettext_token_type_keyword:
|
||||
+ if (!extract_all && state == 2)
|
||||
+ {
|
||||
+ if (commas_to_skip == 0)
|
||||
+ {
|
||||
+ error (0, 0,
|
||||
+ _("%s:%d: warning: keyword nested in keyword arg"),
|
||||
+ token.file_name, token.line_number);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ /* Here we should nest properly, but this would require a
|
||||
+ potentially unbounded stack. We haven't run across an
|
||||
+ example that needs this functionality yet. For now,
|
||||
+ we punt and forget the outer keyword. */
|
||||
+ error (0, 0,
|
||||
+ _("%s:%d: warning: keyword between outer keyword and its arg"),
|
||||
+ token.file_name, token.line_number);
|
||||
+ }
|
||||
+ commas_to_skip = token.argnum - 1;
|
||||
state = 1;
|
||||
continue;
|
||||
|
||||
- case xgettext_token_type_keyword2:
|
||||
- state = 3;
|
||||
- continue;
|
||||
-
|
||||
case xgettext_token_type_lp:
|
||||
switch (state)
|
||||
{
|
||||
case 1:
|
||||
+ paren_nesting = 0;
|
||||
state = 2;
|
||||
break;
|
||||
- case 3:
|
||||
- state = 4;
|
||||
+ case 2:
|
||||
+ paren_nesting++;
|
||||
break;
|
||||
- default:
|
||||
- state = 0;
|
||||
}
|
||||
continue;
|
||||
|
||||
+ case xgettext_token_type_rp:
|
||||
+ if (state == 2 && paren_nesting != 0)
|
||||
+ paren_nesting--;
|
||||
+ else
|
||||
+ state = 0;
|
||||
+ continue;
|
||||
+
|
||||
case xgettext_token_type_comma:
|
||||
- state = state == 5 ? 6 : 0;
|
||||
+ if (state == 2 && commas_to_skip != 0)
|
||||
+ commas_to_skip -= paren_nesting == 0;
|
||||
+ else
|
||||
+ state = 0;
|
||||
continue;
|
||||
|
||||
case xgettext_token_type_string_literal:
|
||||
- if (extract_all || state == 2 || state == 6)
|
||||
- {
|
||||
- remember_a_message (mlp, &token);
|
||||
- state = 0;
|
||||
- }
|
||||
+ if (extract_all || (state == 2 && commas_to_skip == 0))
|
||||
+ remember_a_message (mlp, &token);
|
||||
else
|
||||
{
|
||||
free (token.string);
|
||||
- state = (state == 4 || state == 5) ? 5 : 0;
|
||||
+ state = state == 2 ? 2 : 0;
|
||||
}
|
||||
continue;
|
||||
|
||||
case xgettext_token_type_symbol:
|
||||
- state = (state == 4 || state == 5) ? 5 : 0;
|
||||
+ state = state == 2 ? 2 : 0;
|
||||
continue;
|
||||
|
||||
default:
|
||||
- state = 0;
|
||||
- continue;
|
||||
+ abort ();
|
||||
|
||||
case xgettext_token_type_eof:
|
||||
break;
|
||||
===================================================================
|
||||
RCS file: po/Makefile.in.in,v
|
||||
retrieving revision 0.10.35.0
|
||||
retrieving revision 0.10.35.5
|
||||
diff -u -r0.10.35.0 -r0.10.35.5
|
||||
--- po/Makefile.in.in 1998/07/20 20:20:38 0.10.35.0
|
||||
+++ po/Makefile.in.in 1998/07/26 09:07:52 0.10.35.5
|
||||
@@ -62,7 +62,7 @@
|
||||
$(COMPILE) $<
|
||||
|
||||
.po.pox:
|
||||
- $(MAKE) $(PACKAGE).pot
|
||||
+ $(MAKE) $(srcdir)/$(PACKAGE).pot
|
||||
$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
|
||||
|
||||
.po.mo:
|
||||
@@ -79,7 +79,7 @@
|
||||
|
||||
all: all-@USE_NLS@
|
||||
|
||||
-all-yes: cat-id-tbl.c $(CATALOGS)
|
||||
+all-yes: $(srcdir)/cat-id-tbl.c $(CATALOGS)
|
||||
all-no:
|
||||
|
||||
$(srcdir)/$(PACKAGE).pot: $(POTFILES)
|
||||
@@ -90,8 +90,8 @@
|
||||
|| ( rm -f $(srcdir)/$(PACKAGE).pot \
|
||||
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
|
||||
|
||||
-$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
|
||||
-$(srcdir)/stamp-cat-id: $(PACKAGE).pot
|
||||
+$(srcdir)/cat-id-tbl.c: $(srcdir)/stamp-cat-id; @:
|
||||
+$(srcdir)/stamp-cat-id: $(srcdir)/$(PACKAGE).pot
|
||||
rm -f cat-id-tbl.tmp
|
||||
sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
|
||||
| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
|
||||
@@ -180,7 +180,8 @@
|
||||
|
||||
check: all
|
||||
|
||||
-cat-id-tbl.o: ../intl/libgettext.h
|
||||
+cat-id-tbl.o: $(srcdir)/cat-id-tbl.c $(top_srcdir)/intl/libgettext.h
|
||||
+ $(COMPILE) $(srcdir)/cat-id-tbl.c
|
||||
|
||||
dvi info tags TAGS ID:
|
||||
|
||||
@@ -196,7 +197,7 @@
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
- rm -f $(GMOFILES)
|
||||
+ rm -f $(GMOFILES) cat-id-tbl.c stamp-cat-id
|
||||
|
||||
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir: update-po $(DISTFILES)
|
||||
@@ -207,7 +208,7 @@
|
||||
done
|
||||
|
||||
update-po: Makefile
|
||||
- $(MAKE) $(PACKAGE).pot
|
||||
+ $(MAKE) $(srcdir)/$(PACKAGE).pot
|
||||
PATH=`pwd`/../src:$$PATH; \
|
||||
cd $(srcdir); \
|
||||
catalogs='$(CATALOGS)'; \
|
||||
226
gcc/ABOUT-NLS
Normal file
226
gcc/ABOUT-NLS
Normal file
@@ -0,0 +1,226 @@
|
||||
Notes on the Free Translation Project
|
||||
*************************************
|
||||
|
||||
Free software is going international! The Free Translation Project
|
||||
is a way to get maintainers of free software, translators, and users all
|
||||
together, so that will gradually become able to speak many languages.
|
||||
A few packages already provide translations for their messages.
|
||||
|
||||
If you found this `ABOUT-NLS' file inside a distribution, you may
|
||||
assume that the distributed package does use GNU `gettext' internally,
|
||||
itself available at your nearest GNU archive site. But you do *not*
|
||||
need to install GNU `gettext' prior to configuring, installing or using
|
||||
this package with messages translated.
|
||||
|
||||
Installers will find here some useful hints. These notes also
|
||||
explain how users should proceed for getting the programs to use the
|
||||
available translations. They tell how people wanting to contribute and
|
||||
work at translations should contact the appropriate team.
|
||||
|
||||
When reporting bugs in the `intl/' directory or bugs which may be
|
||||
related to internationalization, you should tell about the version of
|
||||
`gettext' which is used. The information can be found in the
|
||||
`intl/VERSION' file, in internationalized packages.
|
||||
|
||||
One advise in advance
|
||||
=====================
|
||||
|
||||
If you want to exploit the full power of internationalization, you
|
||||
should configure it using
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to force usage of internationalizing routines provided within this
|
||||
package, despite the existence of internationalizing capabilities in the
|
||||
operating system where this package is being installed. So far, only
|
||||
the `gettext' implementation in the GNU C library version 2 provides as
|
||||
many features (such as locale alias or message inheritance) as the
|
||||
implementation here. It is also not possible to offer this additional
|
||||
functionality on top of a `catgets' implementation. Future versions of
|
||||
GNU `gettext' will very likely convey even more functionality. So it
|
||||
might be a good idea to change to GNU `gettext' as soon as possible.
|
||||
|
||||
So you need not provide this option if you are using GNU libc 2 or
|
||||
you have installed a recent copy of the GNU gettext package with the
|
||||
included `libintl'.
|
||||
|
||||
INSTALL Matters
|
||||
===============
|
||||
|
||||
Some packages are "localizable" when properly installed; the
|
||||
programs they contain can be made to speak your own native language.
|
||||
Most such packages use GNU `gettext'. Other packages have their own
|
||||
ways to internationalization, predating GNU `gettext'.
|
||||
|
||||
By default, this package will be installed to allow translation of
|
||||
messages. It will automatically detect whether the system provides
|
||||
usable `catgets' (if using this is selected by the installer) or
|
||||
`gettext' functions. If neither is available, the GNU `gettext' own
|
||||
library will be used. This library is wholly contained within this
|
||||
package, usually in the `intl/' subdirectory, so prior installation of
|
||||
the GNU `gettext' package is *not* required. Installers may use
|
||||
special options at configuration time for changing the default
|
||||
behaviour. The commands:
|
||||
|
||||
./configure --with-included-gettext
|
||||
./configure --with-catgets
|
||||
./configure --disable-nls
|
||||
|
||||
will respectively bypass any pre-existing `catgets' or `gettext' to use
|
||||
the internationalizing routines provided within this package, enable
|
||||
the use of the `catgets' functions (if found on the locale system), or
|
||||
else, *totally* disable translation of messages.
|
||||
|
||||
When you already have GNU `gettext' installed on your system and run
|
||||
configure without an option for your new package, `configure' will
|
||||
probably detect the previously built and installed `libintl.a' file and
|
||||
will decide to use this. This might be not what is desirable. You
|
||||
should use the more recent version of the GNU `gettext' library. I.e.
|
||||
if the file `intl/VERSION' shows that the library which comes with this
|
||||
package is more recent, you should use
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to prevent auto-detection.
|
||||
|
||||
By default the configuration process will not test for the `catgets'
|
||||
function and therefore they will not be used. The reasons are already
|
||||
given above: the emulation on top of `catgets' cannot provide all the
|
||||
extensions provided by the GNU `gettext' library. If you nevertheless
|
||||
want to use the `catgets' functions use
|
||||
|
||||
./configure --with-catgets
|
||||
|
||||
to enable the test for `catgets' (this causes no harm if `catgets' is
|
||||
not available on your system). If you really select this option we
|
||||
would like to hear about the reasons because we cannot think of any
|
||||
good one ourself.
|
||||
|
||||
Internationalized packages have usually many `po/LL.po' files, where
|
||||
LL gives an ISO 639 two-letter code identifying the language. Unless
|
||||
translations have been forbidden at `configure' time by using the
|
||||
`--disable-nls' switch, all available translations are installed
|
||||
together with the package. However, the environment variable `LINGUAS'
|
||||
may be set, prior to configuration, to limit the installed set.
|
||||
`LINGUAS' should then contain a space separated list of two-letter
|
||||
codes, stating which languages are allowed.
|
||||
|
||||
Using This Package
|
||||
==================
|
||||
|
||||
As a user, if your language has been installed for this package, you
|
||||
only have to set the `LANG' environment variable to the appropriate
|
||||
ISO 639 `LL' two-letter code prior to using the programs in the
|
||||
package. For example, let's suppose that you speak German. At the
|
||||
shell prompt, merely execute `setenv LANG de' (in `csh'),
|
||||
`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This
|
||||
can be done from your `.login' or `.profile' file, once and for all.
|
||||
|
||||
An operating system might already offer message localization for
|
||||
many of its programs, while other programs have been installed locally
|
||||
with the full capabilities of GNU `gettext'. Just using `gettext'
|
||||
extended syntax for `LANG' would break proper localization of already
|
||||
available operating system programs. In this case, users should set
|
||||
both `LANGUAGE' and `LANG' variables in their environment, as programs
|
||||
using GNU `gettext' give preference to `LANGUAGE'. For example, some
|
||||
Swedish users would rather read translations in German than English for
|
||||
when Swedish is not available. This is easily accomplished by setting
|
||||
`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
|
||||
|
||||
Translating Teams
|
||||
=================
|
||||
|
||||
For the Free Translation Project to be a success, we need interested
|
||||
people who like their own language and write it well, and who are also
|
||||
able to synergize with other translators speaking the same language.
|
||||
Each translation team has its own mailing list, courtesy of Linux
|
||||
International. You may reach your translation team at the address
|
||||
`LL@li.org', replacing LL by the two-letter ISO 639 code for your
|
||||
language. Language codes are *not* the same as the country codes given
|
||||
in ISO 3166. The following translation teams exist, as of December
|
||||
1997:
|
||||
|
||||
Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
|
||||
Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
|
||||
`hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
|
||||
Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
|
||||
`pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
|
||||
Swedish `sv', and Turkish `tr'.
|
||||
|
||||
For example, you may reach the Chinese translation team by writing to
|
||||
`zh@li.org'.
|
||||
|
||||
If you'd like to volunteer to *work* at translating messages, you
|
||||
should become a member of the translating team for your own language.
|
||||
The subscribing address is *not* the same as the list itself, it has
|
||||
`-request' appended. For example, speakers of Swedish can send a
|
||||
message to `sv-request@li.org', having this message body:
|
||||
|
||||
subscribe
|
||||
|
||||
Keep in mind that team members are expected to participate
|
||||
*actively* in translations, or at solving translational difficulties,
|
||||
rather than merely lurking around. If your team does not exist yet and
|
||||
you want to start one, or if you are unsure about what to do or how to
|
||||
get started, please write to `translation@iro.umontreal.ca' to reach the
|
||||
coordinator for all translator teams.
|
||||
|
||||
The English team is special. It works at improving and uniformizing
|
||||
the terminology in use. Proven linguistic skill are praised more than
|
||||
programming skill, here.
|
||||
|
||||
Available Packages
|
||||
==================
|
||||
|
||||
Languages are not equally supported in all packages. The following
|
||||
matrix shows the current state of internationalization, as of December
|
||||
1997. The matrix shows, in regard of each package, for which languages
|
||||
PO files have been submitted to translation coordination.
|
||||
|
||||
Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv
|
||||
.----------------------------------------------------.
|
||||
bash | [] [] [] | 3
|
||||
bison | [] [] [] | 3
|
||||
clisp | [] [] [] [] | 4
|
||||
cpio | [] [] [] [] [] [] | 6
|
||||
diffutils | [] [] [] [] [] | 5
|
||||
enscript | [] [] [] [] [] [] | 6
|
||||
fileutils | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
findutils | [] [] [] [] [] [] [] [] [] | 9
|
||||
flex | [] [] [] [] | 4
|
||||
gcal | [] [] [] [] [] | 5
|
||||
gettext | [] [] [] [] [] [] [] [] [] [] [] | 12
|
||||
grep | [] [] [] [] [] [] [] [] [] [] | 10
|
||||
hello | [] [] [] [] [] [] [] [] [] [] [] | 11
|
||||
id-utils | [] [] [] | 3
|
||||
indent | [] [] [] [] [] | 5
|
||||
libc | [] [] [] [] [] [] [] | 7
|
||||
m4 | [] [] [] [] [] [] | 6
|
||||
make | [] [] [] [] [] [] | 6
|
||||
music | [] [] | 2
|
||||
ptx | [] [] [] [] [] [] [] [] | 8
|
||||
recode | [] [] [] [] [] [] [] [] [] | 9
|
||||
sh-utils | [] [] [] [] [] [] [] [] | 8
|
||||
sharutils | [] [] [] [] [] [] | 6
|
||||
tar | [] [] [] [] [] [] [] [] [] [] [] | 11
|
||||
texinfo | [] [] [] | 3
|
||||
textutils | [] [] [] [] [] [] [] [] [] | 9
|
||||
wdiff | [] [] [] [] [] [] [] [] | 8
|
||||
`----------------------------------------------------'
|
||||
17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv
|
||||
27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179
|
||||
|
||||
Some counters in the preceding matrix are higher than the number of
|
||||
visible blocks let us expect. This is because a few extra PO files are
|
||||
used for implementing regional variants of languages, or language
|
||||
dialects.
|
||||
|
||||
For a PO file in the matrix above to be effective, the package to
|
||||
which it applies should also have been internationalized and
|
||||
distributed as such by its maintainer. There might be an observable
|
||||
lag between the mere existence a PO file and its wide availability in a
|
||||
distribution.
|
||||
|
||||
If December 1997 seems to be old, you may fetch a more recent copy
|
||||
of this `ABOUT-NLS' file on most GNU archive sites.
|
||||
|
||||
340
gcc/COPYING
Normal file
340
gcc/COPYING
Normal file
@@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
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.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
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.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
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.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
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.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
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.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
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.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
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.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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.
|
||||
482
gcc/COPYING.LIB
Normal file
482
gcc/COPYING.LIB
Normal file
@@ -0,0 +1,482 @@
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, 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 library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, 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 companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, 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 library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
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.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
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 Library, 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 Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of 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 satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. 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.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
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.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
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 Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. 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 library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
10652
gcc/ChangeLog
Normal file
10652
gcc/ChangeLog
Normal file
File diff suppressed because it is too large
Load Diff
6671
gcc/ChangeLog.0
Normal file
6671
gcc/ChangeLog.0
Normal file
File diff suppressed because it is too large
Load Diff
9207
gcc/ChangeLog.1
Normal file
9207
gcc/ChangeLog.1
Normal file
File diff suppressed because it is too large
Load Diff
10185
gcc/ChangeLog.10
Normal file
10185
gcc/ChangeLog.10
Normal file
File diff suppressed because it is too large
Load Diff
10652
gcc/ChangeLog.11
Normal file
10652
gcc/ChangeLog.11
Normal file
File diff suppressed because it is too large
Load Diff
7229
gcc/ChangeLog.2
Normal file
7229
gcc/ChangeLog.2
Normal file
File diff suppressed because it is too large
Load Diff
8063
gcc/ChangeLog.3
Normal file
8063
gcc/ChangeLog.3
Normal file
File diff suppressed because it is too large
Load Diff
10783
gcc/ChangeLog.4
Normal file
10783
gcc/ChangeLog.4
Normal file
File diff suppressed because it is too large
Load Diff
8954
gcc/ChangeLog.5
Normal file
8954
gcc/ChangeLog.5
Normal file
File diff suppressed because it is too large
Load Diff
8173
gcc/ChangeLog.6
Normal file
8173
gcc/ChangeLog.6
Normal file
File diff suppressed because it is too large
Load Diff
10376
gcc/ChangeLog.7
Normal file
10376
gcc/ChangeLog.7
Normal file
File diff suppressed because it is too large
Load Diff
11080
gcc/ChangeLog.8
Normal file
11080
gcc/ChangeLog.8
Normal file
File diff suppressed because it is too large
Load Diff
9968
gcc/ChangeLog.9
Normal file
9968
gcc/ChangeLog.9
Normal file
File diff suppressed because it is too large
Load Diff
24
gcc/NEWS
24
gcc/NEWS
@@ -3,12 +3,17 @@ Noteworthy changes in GCC version 2.8.0:
|
||||
The -specs=file switch allows you to override default specs used in invoking
|
||||
programs like cc1, as, etc.
|
||||
|
||||
Options -Wall and -Wimplicit now cause GCC to warn about implicit int
|
||||
in declarations (e.g. `register i;'), since the C Standard committee
|
||||
has decided to disallow this in the next revision of the standard.
|
||||
|
||||
The following new targets are supported:
|
||||
|
||||
Solaris 2.5 running on UltraSPARC's.
|
||||
The sparclet cpu (a.out file format).
|
||||
Solaris 2.51 running on PowerPC's.
|
||||
Linux running on PowerPC's.
|
||||
Embedded target m32r-elf.
|
||||
|
||||
New features for the Hitachi H8/300(H).
|
||||
|
||||
@@ -23,6 +28,17 @@ New features for SPARC-based systems:
|
||||
-mtune=xxx
|
||||
-mimpure-text and -mno-impure-text
|
||||
|
||||
New features for all rs6000 and PowerPC systems:
|
||||
|
||||
-mcpu=604e
|
||||
-mcpu=801
|
||||
-mcpu=823
|
||||
-mtune=xxx
|
||||
-mupdate
|
||||
-mno-update
|
||||
-mfused-madd
|
||||
-mno-fused-madd
|
||||
|
||||
New features for PowerPC-based systems running either System V, Linux, Solaris,
|
||||
or embedded systems:
|
||||
|
||||
@@ -33,10 +49,16 @@ or embedded systems:
|
||||
-mcall-sysv-eabi
|
||||
-mcall-sysv-noeabi
|
||||
-msdata
|
||||
-msdata=none
|
||||
-msdata=default
|
||||
-msdata=sysv
|
||||
-msdata=eabi
|
||||
-memb
|
||||
-mtune=xxx
|
||||
-msim
|
||||
-mmvme
|
||||
wchar_t is now of type long, not unsigned short as per ABI.
|
||||
-p/-pg support
|
||||
-mcpu=403 now implies -mstrict-align.
|
||||
|
||||
Options -mno-v8 and -mno-sparclite are no longer supported on SPARC
|
||||
targets. Options -mcypress, -mv8, -msupersparc, -msparclite, -mf930,
|
||||
|
||||
26
gcc/README
Normal file
26
gcc/README
Normal file
@@ -0,0 +1,26 @@
|
||||
This directory contains the version 2.7.2 release of the GNU C
|
||||
compiler. It includes all of the support for compiling C++ and
|
||||
Objective C, including a run-time library for Objective C.
|
||||
|
||||
The GNU C compiler is free software. See the file COPYING for copying
|
||||
permission.
|
||||
|
||||
See the file gcc.texi (together with other files that it includes) for
|
||||
installation and porting information. The file INSTALL contains a
|
||||
copy of the installation information, as plain ASCII.
|
||||
|
||||
Installing this package will create various files in subdirectories of
|
||||
/usr/local/lib, which are passes used by the compiler and a library
|
||||
named libgcc.a. It will also create /usr/local/bin/gcc, which is
|
||||
the user-level command to do a compilation.
|
||||
|
||||
See the Bugs chapter of the GCC Manual for how to report bugs
|
||||
usefully. An online readable version of the manual is in the files
|
||||
gcc.info*.
|
||||
|
||||
The files pself.c and pself1.c are not part of GCC.
|
||||
They are programs that print themselves on standard output.
|
||||
They were written by Dario Dariol and Giovanni Cozzi, and are
|
||||
included for your hacking pleasure. Likewise pself2.c
|
||||
(Who is the author of that?) and pself3.c (by Vlad Taeerov and Rashit
|
||||
Fakhreyev).
|
||||
39
gcc/TESTS.FLUNK
Normal file
39
gcc/TESTS.FLUNK
Normal file
@@ -0,0 +1,39 @@
|
||||
This is a collection of things that test suites have
|
||||
said were "wrong" with GCC--but that I don't agree with.
|
||||
|
||||
First, test suites sometimes test for compatibility with
|
||||
traditional C. GCC with -traditional is not completely
|
||||
compatible with traditional C, and in some ways I think it
|
||||
should not be.
|
||||
|
||||
* K&R C allowed \x to appear in a string literal (or character
|
||||
literal?) even in cases where it is *not* followed by a sequence of
|
||||
hex digits. I'm not convinced this is desirable.
|
||||
|
||||
* K&R compilers allow comments to cross over an inclusion boundary (i.e.
|
||||
started in an include file and ended in the including file).
|
||||
I think this would be quite ugly and can't imagine it could
|
||||
be needed.
|
||||
|
||||
Sometimes tests disagree with GCC's interpretation of the ANSI standard.
|
||||
|
||||
* One test claims that this function should return 1.
|
||||
|
||||
enum {A, B} foo;
|
||||
|
||||
func (enum {B, A} arg)
|
||||
{
|
||||
return B;
|
||||
}
|
||||
|
||||
I think it should return 0, because the definition of B that
|
||||
applies is the one in func.
|
||||
|
||||
* Some tests report failure when the compiler does not produce
|
||||
an error message for a certain program.
|
||||
|
||||
ANSI C requires a "diagnostic" message for certain kinds of invalid
|
||||
programs, but a warning counts as a diagnostic. If GCC produces
|
||||
a warning but not an error, that is correct ANSI support.
|
||||
When test suites call this "failure", the tests are broken.
|
||||
|
||||
25
gcc/c-decl.c
25
gcc/c-decl.c
@@ -4339,7 +4339,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
|
||||
|
||||
/* Long double is a special combination. */
|
||||
|
||||
if ((specbits & 1 << (int) RID_LONG)
|
||||
if ((specbits & 1 << (int) RID_LONG) && ! longlong
|
||||
&& TYPE_MAIN_VARIANT (type) == double_type_node)
|
||||
{
|
||||
specbits &= ~ (1 << (int) RID_LONG);
|
||||
@@ -4353,11 +4353,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
|
||||
{
|
||||
int ok = 0;
|
||||
|
||||
if (TREE_CODE (type) != INTEGER_TYPE)
|
||||
error ("long, short, signed or unsigned invalid for `%s'", name);
|
||||
else if ((specbits & 1 << (int) RID_LONG)
|
||||
&& (specbits & 1 << (int) RID_SHORT))
|
||||
error ("long and short specified together for `%s'", name);
|
||||
if ((specbits & 1 << (int) RID_LONG)
|
||||
&& (specbits & 1 << (int) RID_SHORT))
|
||||
error ("both long and short specified for `%s'", name);
|
||||
else if (((specbits & 1 << (int) RID_LONG)
|
||||
|| (specbits & 1 << (int) RID_SHORT))
|
||||
&& explicit_char)
|
||||
@@ -4365,10 +4363,21 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
|
||||
else if (((specbits & 1 << (int) RID_LONG)
|
||||
|| (specbits & 1 << (int) RID_SHORT))
|
||||
&& TREE_CODE (type) == REAL_TYPE)
|
||||
error ("long or short specified with floating type for `%s'", name);
|
||||
{
|
||||
static int already = 0;
|
||||
|
||||
error ("long or short specified with floating type for `%s'", name);
|
||||
if (! already && ! pedantic)
|
||||
{
|
||||
error ("the only valid combination is `long double'");
|
||||
already = 1;
|
||||
}
|
||||
}
|
||||
else if ((specbits & 1 << (int) RID_SIGNED)
|
||||
&& (specbits & 1 << (int) RID_UNSIGNED))
|
||||
error ("signed and unsigned given together for `%s'", name);
|
||||
error ("both signed and unsigned specified for `%s'", name);
|
||||
else if (TREE_CODE (type) != INTEGER_TYPE)
|
||||
error ("long, short, signed or unsigned invalid for `%s'", name);
|
||||
else
|
||||
{
|
||||
ok = 1;
|
||||
|
||||
186
gcc/c-gperf.h
Normal file
186
gcc/c-gperf.h
Normal file
@@ -0,0 +1,186 @@
|
||||
/* C code produced by gperf version 2.5 (GNU C++ version) */
|
||||
/* Command-line: gperf -p -j1 -i 1 -g -o -t -G -N is_reserved_word -k1,3,$ ./c-parse.gperf */
|
||||
/* Command-line: gperf -p -j1 -i 1 -g -o -t -N is_reserved_word -k1,3,$ c-parse.gperf */
|
||||
struct resword { char *name; short token; enum rid rid; };
|
||||
|
||||
#define TOTAL_KEYWORDS 79
|
||||
#define MIN_WORD_LENGTH 2
|
||||
#define MAX_WORD_LENGTH 20
|
||||
#define MIN_HASH_VALUE 10
|
||||
#define MAX_HASH_VALUE 144
|
||||
/* maximum key range = 135, duplicates = 0 */
|
||||
|
||||
#ifdef __GNUC__
|
||||
inline
|
||||
#endif
|
||||
static unsigned int
|
||||
hash (str, len)
|
||||
register char *str;
|
||||
register int unsigned len;
|
||||
{
|
||||
static unsigned char asso_values[] =
|
||||
{
|
||||
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
||||
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
||||
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
||||
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
||||
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
||||
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
||||
145, 145, 145, 145, 25, 145, 145, 145, 145, 145,
|
||||
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
||||
145, 145, 145, 145, 145, 145, 145, 145, 145, 145,
|
||||
145, 145, 145, 145, 145, 1, 145, 46, 8, 15,
|
||||
61, 6, 36, 48, 3, 5, 145, 18, 63, 25,
|
||||
29, 76, 1, 145, 13, 2, 1, 51, 37, 9,
|
||||
9, 1, 3, 145, 145, 145, 145, 145,
|
||||
};
|
||||
register int hval = len;
|
||||
|
||||
switch (hval)
|
||||
{
|
||||
default:
|
||||
case 3:
|
||||
hval += asso_values[str[2]];
|
||||
case 2:
|
||||
case 1:
|
||||
hval += asso_values[str[0]];
|
||||
break;
|
||||
}
|
||||
return hval + asso_values[str[len - 1]];
|
||||
}
|
||||
|
||||
static struct resword wordlist[] =
|
||||
{
|
||||
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
|
||||
{"",},
|
||||
{"int", TYPESPEC, RID_INT},
|
||||
{"",}, {"",},
|
||||
{"__typeof__", TYPEOF, NORID},
|
||||
{"__signed__", TYPESPEC, RID_SIGNED},
|
||||
{"__imag__", IMAGPART, NORID},
|
||||
{"switch", SWITCH, NORID},
|
||||
{"__inline__", SCSPEC, RID_INLINE},
|
||||
{"else", ELSE, NORID},
|
||||
{"__iterator__", SCSPEC, RID_ITERATOR},
|
||||
{"__inline", SCSPEC, RID_INLINE},
|
||||
{"__extension__", EXTENSION, NORID},
|
||||
{"struct", STRUCT, NORID},
|
||||
{"__real__", REALPART, NORID},
|
||||
{"__const", TYPE_QUAL, RID_CONST},
|
||||
{"while", WHILE, NORID},
|
||||
{"__const__", TYPE_QUAL, RID_CONST},
|
||||
{"case", CASE, NORID},
|
||||
{"__complex__", TYPESPEC, RID_COMPLEX},
|
||||
{"__iterator", SCSPEC, RID_ITERATOR},
|
||||
{"bycopy", TYPE_QUAL, RID_BYCOPY},
|
||||
{"",}, {"",}, {"",},
|
||||
{"__complex", TYPESPEC, RID_COMPLEX},
|
||||
{"",},
|
||||
{"in", TYPE_QUAL, RID_IN},
|
||||
{"break", BREAK, NORID},
|
||||
{"@defs", DEFS, NORID},
|
||||
{"",}, {"",}, {"",},
|
||||
{"extern", SCSPEC, RID_EXTERN},
|
||||
{"if", IF, NORID},
|
||||
{"typeof", TYPEOF, NORID},
|
||||
{"typedef", SCSPEC, RID_TYPEDEF},
|
||||
{"__typeof", TYPEOF, NORID},
|
||||
{"sizeof", SIZEOF, NORID},
|
||||
{"",},
|
||||
{"return", RETURN, NORID},
|
||||
{"const", TYPE_QUAL, RID_CONST},
|
||||
{"__volatile__", TYPE_QUAL, RID_VOLATILE},
|
||||
{"@private", PRIVATE, NORID},
|
||||
{"@selector", SELECTOR, NORID},
|
||||
{"__volatile", TYPE_QUAL, RID_VOLATILE},
|
||||
{"__asm__", ASM_KEYWORD, NORID},
|
||||
{"",}, {"",},
|
||||
{"continue", CONTINUE, NORID},
|
||||
{"__alignof__", ALIGNOF, NORID},
|
||||
{"__imag", IMAGPART, NORID},
|
||||
{"__attribute__", ATTRIBUTE, NORID},
|
||||
{"",}, {"",},
|
||||
{"__attribute", ATTRIBUTE, NORID},
|
||||
{"for", FOR, NORID},
|
||||
{"",},
|
||||
{"@encode", ENCODE, NORID},
|
||||
{"id", OBJECTNAME, RID_ID},
|
||||
{"static", SCSPEC, RID_STATIC},
|
||||
{"@interface", INTERFACE, NORID},
|
||||
{"",},
|
||||
{"__signed", TYPESPEC, RID_SIGNED},
|
||||
{"",},
|
||||
{"__label__", LABEL, NORID},
|
||||
{"",}, {"",},
|
||||
{"__asm", ASM_KEYWORD, NORID},
|
||||
{"char", TYPESPEC, RID_CHAR},
|
||||
{"",},
|
||||
{"inline", SCSPEC, RID_INLINE},
|
||||
{"out", TYPE_QUAL, RID_OUT},
|
||||
{"register", SCSPEC, RID_REGISTER},
|
||||
{"__real", REALPART, NORID},
|
||||
{"short", TYPESPEC, RID_SHORT},
|
||||
{"",},
|
||||
{"enum", ENUM, NORID},
|
||||
{"inout", TYPE_QUAL, RID_INOUT},
|
||||
{"",},
|
||||
{"oneway", TYPE_QUAL, RID_ONEWAY},
|
||||
{"union", UNION, NORID},
|
||||
{"",},
|
||||
{"__alignof", ALIGNOF, NORID},
|
||||
{"",},
|
||||
{"@implementation", IMPLEMENTATION, NORID},
|
||||
{"",},
|
||||
{"@class", CLASS, NORID},
|
||||
{"",},
|
||||
{"@public", PUBLIC, NORID},
|
||||
{"asm", ASM_KEYWORD, NORID},
|
||||
{"",}, {"",}, {"",}, {"",}, {"",},
|
||||
{"default", DEFAULT, NORID},
|
||||
{"",},
|
||||
{"void", TYPESPEC, RID_VOID},
|
||||
{"",},
|
||||
{"@protected", PROTECTED, NORID},
|
||||
{"@protocol", PROTOCOL, NORID},
|
||||
{"",}, {"",}, {"",},
|
||||
{"volatile", TYPE_QUAL, RID_VOLATILE},
|
||||
{"",}, {"",},
|
||||
{"signed", TYPESPEC, RID_SIGNED},
|
||||
{"float", TYPESPEC, RID_FLOAT},
|
||||
{"@end", END, NORID},
|
||||
{"",}, {"",},
|
||||
{"unsigned", TYPESPEC, RID_UNSIGNED},
|
||||
{"@compatibility_alias", ALIAS, NORID},
|
||||
{"double", TYPESPEC, RID_DOUBLE},
|
||||
{"",}, {"",},
|
||||
{"auto", SCSPEC, RID_AUTO},
|
||||
{"",},
|
||||
{"goto", GOTO, NORID},
|
||||
{"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",}, {"",},
|
||||
{"do", DO, NORID},
|
||||
{"",}, {"",}, {"",}, {"",},
|
||||
{"long", TYPESPEC, RID_LONG},
|
||||
};
|
||||
|
||||
#ifdef __GNUC__
|
||||
inline
|
||||
#endif
|
||||
struct resword *
|
||||
is_reserved_word (str, len)
|
||||
register char *str;
|
||||
register unsigned int len;
|
||||
{
|
||||
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
||||
{
|
||||
register int key = hash (str, len);
|
||||
|
||||
if (key <= MAX_HASH_VALUE && key >= 0)
|
||||
{
|
||||
register char *s = wordlist[key].name;
|
||||
|
||||
if (*s == *str && !strcmp (str + 1, s + 1))
|
||||
return &wordlist[key];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
674
gcc/cccp.1
Normal file
674
gcc/cccp.1
Normal file
@@ -0,0 +1,674 @@
|
||||
.\" Copyright (c) 1991, 1992, 1993 Free Software Foundation \-*-Text-*-
|
||||
.\" See section COPYING for conditions for redistribution
|
||||
.TH cpp 1 "30apr1993" "GNU Tools" "GNU Tools"
|
||||
.SH NAME
|
||||
cccp, cpp \- The GNU C-Compatible Compiler Preprocessor.
|
||||
.SH SYNOPSIS
|
||||
.hy 0
|
||||
.na
|
||||
.TP
|
||||
.B cccp
|
||||
.RB "[\|" \-$ "\|]"
|
||||
.RB "[\|" \-A \c
|
||||
.I predicate\c
|
||||
.RB [ (\c
|
||||
.I value\c
|
||||
.BR ) ]\|]
|
||||
.RB "[\|" \-C "\|]"
|
||||
.RB "[\|" \-D \c
|
||||
.I name\c
|
||||
.RB [ =\c
|
||||
.I definition\c
|
||||
\&]\|]
|
||||
.RB "[\|" \-dD "\|]"
|
||||
.RB "[\|" \-dM "\|]"
|
||||
.RB "[\|" "\-I\ "\c
|
||||
.I directory\c
|
||||
\&\|]
|
||||
.RB "[\|" \-H "\|]"
|
||||
.RB "[\|" \-I\- "\|]"
|
||||
.RB "[\|" "\-imacros\ "\c
|
||||
.I file\c
|
||||
\&\|]
|
||||
.RB "[\|" "\-include\ "\c
|
||||
.I file\c
|
||||
\&\|]
|
||||
.RB "[\|" "\-idirafter\ "\c
|
||||
.I dir\c
|
||||
\&\|]
|
||||
.RB "[\|" "\-iprefix\ "\c
|
||||
.I prefix\c
|
||||
\&\|]
|
||||
.RB "[\|" "\-iwithprefix\ "\c
|
||||
.I dir\c
|
||||
\&\|]
|
||||
.RB "[\|" \-lang\-c "\|]"
|
||||
.RB "[\|" \-lang\-c++ "\|]"
|
||||
.RB "[\|" \-lang\-objc "\|]"
|
||||
.RB "[\|" \-lang\-objc++ "\|]"
|
||||
.RB "[\|" \-lint "\|]"
|
||||
.RB "[\|" \-M\ [ \-MG "\|]]"
|
||||
.RB "[\|" \-MM\ [ \-MG "\|]]"
|
||||
.RB "[\|" \-MD\ \c
|
||||
.I file\ \c
|
||||
\&\|]
|
||||
.RB "[\|" \-MMD\ \c
|
||||
.I file\ \c
|
||||
\&\|]
|
||||
.RB "[\|" \-nostdinc "\|]"
|
||||
.RB "[\|" \-nostdinc++ "\|]"
|
||||
.RB "[\|" \-P "\|]"
|
||||
.RB "[\|" \-pedantic "\|]"
|
||||
.RB "[\|" \-pedantic\-errors "\|]"
|
||||
.RB "[\|" \-traditional "\|]"
|
||||
.RB "[\|" \-trigraphs "\|]"
|
||||
.RB "[\|" \-U \c
|
||||
.I name\c
|
||||
\&\|]
|
||||
.RB "[\|" \-undef "\|]"
|
||||
.RB "[\|" \-Wtrigraphs "\|]"
|
||||
.RB "[\|" \-Wcomment "\|]"
|
||||
.RB "[\|" \-Wall "\|]"
|
||||
.RB "[\|" \-Wtraditional "\|]"
|
||||
.br
|
||||
.RB "[\|" \c
|
||||
.I infile\c
|
||||
.RB | \- "\|]"
|
||||
.RB "[\|" \c
|
||||
.I outfile\c
|
||||
.RB | \- "\|]"
|
||||
.ad b
|
||||
.hy 1
|
||||
.SH DESCRIPTION
|
||||
The C preprocessor is a \c
|
||||
.I macro processor\c
|
||||
\& that is used automatically by
|
||||
the C compiler to transform your program before actual compilation. It is
|
||||
called a macro processor because it allows you to define \c
|
||||
.I macros\c
|
||||
\&,
|
||||
which are brief abbreviations for longer constructs.
|
||||
|
||||
The C preprocessor provides four separate facilities that you can use as
|
||||
you see fit:
|
||||
.TP
|
||||
\(bu
|
||||
Inclusion of header files. These are files of declarations that can be
|
||||
substituted into your program.
|
||||
.TP
|
||||
\(bu
|
||||
Macro expansion. You can define \c
|
||||
.I macros\c
|
||||
\&, which are abbreviations
|
||||
for arbitrary fragments of C code, and then the C preprocessor will
|
||||
replace the macros with their definitions throughout the program.
|
||||
.TP
|
||||
\(bu
|
||||
Conditional compilation. Using special preprocessing directives, you
|
||||
can include or exclude parts of the program according to various
|
||||
conditions.
|
||||
.TP
|
||||
\(bu
|
||||
Line control. If you use a program to combine or rearrange source files into
|
||||
an intermediate file which is then compiled, you can use line control
|
||||
to inform the compiler of where each source line originally came from.
|
||||
.PP
|
||||
C preprocessors vary in some details. For a full explanation of the
|
||||
GNU C preprocessor, see the
|
||||
.B info
|
||||
file `\|\c
|
||||
.B cpp.info\c
|
||||
\&\|', or the manual
|
||||
.I The C Preprocessor\c
|
||||
\&. Both of these are built from the same documentation source file, `\|\c
|
||||
.B cpp.texinfo\c
|
||||
\&\|'. The GNU C
|
||||
preprocessor provides a superset of the features of ANSI Standard C.
|
||||
|
||||
ANSI Standard C requires the rejection of many harmless constructs commonly
|
||||
used by today's C programs. Such incompatibility would be inconvenient for
|
||||
users, so the GNU C preprocessor is configured to accept these constructs
|
||||
by default. Strictly speaking, to get ANSI Standard C, you must use the
|
||||
options `\|\c
|
||||
.B \-trigraphs\c
|
||||
\&\|', `\|\c
|
||||
.B \-undef\c
|
||||
\&\|' and `\|\c
|
||||
.B \-pedantic\c
|
||||
\&\|', but in
|
||||
practice the consequences of having strict ANSI Standard C make it
|
||||
undesirable to do this.
|
||||
|
||||
Most often when you use the C preprocessor you will not have to invoke it
|
||||
explicitly: the C compiler will do so automatically. However, the
|
||||
preprocessor is sometimes useful individually.
|
||||
|
||||
When you call the preprocessor individually, either name
|
||||
(\c
|
||||
.B cpp\c
|
||||
\& or \c
|
||||
.B cccp\c
|
||||
\&) will do\(em\&they are completely synonymous.
|
||||
|
||||
The C preprocessor expects two file names as arguments, \c
|
||||
.I infile\c
|
||||
\& and
|
||||
\c
|
||||
.I outfile\c
|
||||
\&. The preprocessor reads \c
|
||||
.I infile\c
|
||||
\& together with any other
|
||||
files it specifies with `\|\c
|
||||
.B #include\c
|
||||
\&\|'. All the output generated by the
|
||||
combined input files is written in \c
|
||||
.I outfile\c
|
||||
\&.
|
||||
|
||||
Either \c
|
||||
.I infile\c
|
||||
\& or \c
|
||||
.I outfile\c
|
||||
\& may be `\|\c
|
||||
.B \-\c
|
||||
\&\|', which as \c
|
||||
.I infile\c
|
||||
\&
|
||||
means to read from standard input and as \c
|
||||
.I outfile\c
|
||||
\& means to write to
|
||||
standard output. Also, if \c
|
||||
.I outfile\c
|
||||
\& or both file names are omitted,
|
||||
the standard output and standard input are used for the omitted file names.
|
||||
.SH OPTIONS
|
||||
Here is a table of command options accepted by the C preprocessor.
|
||||
These options can also be given when compiling a C program; they are
|
||||
passed along automatically to the preprocessor when it is invoked by
|
||||
the compiler.
|
||||
.TP
|
||||
.B \-P
|
||||
Inhibit generation of `\|\c
|
||||
.B #\c
|
||||
\&\|'-lines with line-number information in
|
||||
the output from the preprocessor. This might be
|
||||
useful when running the preprocessor on something that is not C code
|
||||
and will be sent to a program which might be confused by the
|
||||
`\|\c
|
||||
.B #\c
|
||||
\&\|'-lines.
|
||||
.TP
|
||||
.B \-C
|
||||
Do not discard comments: pass them through to the output file.
|
||||
Comments appearing in arguments of a macro call will be copied to the
|
||||
output before the expansion of the macro call.
|
||||
.TP
|
||||
.B \-traditional
|
||||
Try to imitate the behavior of old-fashioned C, as opposed to ANSI C.
|
||||
.TP
|
||||
.B \-trigraphs
|
||||
Process ANSI standard trigraph sequences. These are three-character
|
||||
sequences, all starting with `\|\c
|
||||
.B ??\c
|
||||
\&\|', that are defined by ANSI C to
|
||||
stand for single characters. For example, `\|\c
|
||||
.B ??/\c
|
||||
\&\|' stands for
|
||||
`\|\c
|
||||
.BR "\e" "\|',"
|
||||
so `\|\c
|
||||
.B '??/n'\c
|
||||
\&\|' is a character constant for a newline.
|
||||
Strictly speaking, the GNU C preprocessor does not support all
|
||||
programs in ANSI Standard C unless `\|\c
|
||||
.B \-trigraphs\c
|
||||
\&\|' is used, but if
|
||||
you ever notice the difference it will be with relief.
|
||||
|
||||
You don't want to know any more about trigraphs.
|
||||
.TP
|
||||
.B \-pedantic
|
||||
Issue warnings required by the ANSI C standard in certain cases such
|
||||
as when text other than a comment follows `\|\c
|
||||
.B #else\c
|
||||
\&\|' or `\|\c
|
||||
.B #endif\c
|
||||
\&\|'.
|
||||
.TP
|
||||
.B \-pedantic\-errors
|
||||
Like `\|\c
|
||||
.B \-pedantic\c
|
||||
\&\|', except that errors are produced rather than
|
||||
warnings.
|
||||
.TP
|
||||
.B \-Wtrigraphs
|
||||
Warn if any trigraphs are encountered (assuming they are enabled).
|
||||
.TP
|
||||
.B \-Wcomment
|
||||
.TP
|
||||
.B \-Wcomments
|
||||
Warn whenever a comment-start sequence `\|\c
|
||||
.B /*\c
|
||||
\&\|' appears in a comment.
|
||||
(Both forms have the same effect).
|
||||
.TP
|
||||
.B \-Wall
|
||||
Requests both `\|\c
|
||||
.B \-Wtrigraphs\c
|
||||
\&\|' and `\|\c
|
||||
.B \-Wcomment\c
|
||||
\&\|' (but not
|
||||
`\|\c
|
||||
.B \-Wtraditional\c
|
||||
\&\|').
|
||||
.TP
|
||||
.B \-Wtraditional
|
||||
Warn about certain constructs that behave differently in traditional and
|
||||
ANSI C.
|
||||
.TP
|
||||
.BI "\-I " directory\c
|
||||
\&
|
||||
Add the directory \c
|
||||
.I directory\c
|
||||
\& to the end of the list of
|
||||
directories to be searched for header files.
|
||||
This can be used to override a system header file, substituting your
|
||||
own version, since these directories are searched before the system
|
||||
header file directories. If you use more than one `\|\c
|
||||
.B \-I\c
|
||||
\&\|' option,
|
||||
the directories are scanned in left-to-right order; the standard
|
||||
system directories come after.
|
||||
.TP
|
||||
.B \-I\-
|
||||
Any directories specified with `\|\c
|
||||
.B \-I\c
|
||||
\&\|' options before the `\|\c
|
||||
.B \-I\-\c
|
||||
\&\|'
|
||||
option are searched only for the case of `\|\c
|
||||
.B #include "\c
|
||||
.I file\c
|
||||
\&"\c
|
||||
\&\|';
|
||||
they are not searched for `\|\c
|
||||
.B #include <\c
|
||||
.I file\c
|
||||
\&>\c
|
||||
\&\|'.
|
||||
|
||||
If additional directories are specified with `\|\c
|
||||
.B \-I\c
|
||||
\&\|' options after
|
||||
the `\|\c
|
||||
.B \-I\-\c
|
||||
\&\|', these directories are searched for all `\|\c
|
||||
.B #include\c
|
||||
\&\|'
|
||||
directives.
|
||||
|
||||
In addition, the `\|\c
|
||||
.B \-I\-\c
|
||||
\&\|' option inhibits the use of the current
|
||||
directory as the first search directory for `\|\c
|
||||
.B #include "\c
|
||||
.I file\c
|
||||
\&"\c
|
||||
\&\|'.
|
||||
Therefore, the current directory is searched only if it is requested
|
||||
explicitly with `\|\c
|
||||
.B \-I.\c
|
||||
\&\|'. Specifying both `\|\c
|
||||
.B \-I\-\c
|
||||
\&\|' and `\|\c
|
||||
.B \-I.\c
|
||||
\&\|'
|
||||
allows you to control precisely which directories are searched before
|
||||
the current one and which are searched after.
|
||||
.TP
|
||||
.B \-nostdinc
|
||||
Do not search the standard system directories for header files.
|
||||
Only the directories you have specified with `\|\c
|
||||
.B \-I\c
|
||||
\&\|' options
|
||||
(and the current directory, if appropriate) are searched.
|
||||
.TP
|
||||
.B \-nostdinc++
|
||||
Do not search for header files in the C++ specific standard
|
||||
directories, but do still search the other standard directories.
|
||||
(This option is used when building libg++.)
|
||||
.TP
|
||||
.BI "\-D " "name"\c
|
||||
\&
|
||||
Predefine \c
|
||||
.I name\c
|
||||
\& as a macro, with definition `\|\c
|
||||
.B 1\c
|
||||
\&\|'.
|
||||
.TP
|
||||
.BI "\-D " "name" = definition
|
||||
\&
|
||||
Predefine \c
|
||||
.I name\c
|
||||
\& as a macro, with definition \c
|
||||
.I definition\c
|
||||
\&.
|
||||
There are no restrictions on the contents of \c
|
||||
.I definition\c
|
||||
\&, but if
|
||||
you are invoking the preprocessor from a shell or shell-like program
|
||||
you may need to use the shell's quoting syntax to protect characters
|
||||
such as spaces that have a meaning in the shell syntax. If you use more than
|
||||
one `\|\c
|
||||
.B \-D\c
|
||||
\&\|' for the same
|
||||
.I name\c
|
||||
\&, the rightmost definition takes effect.
|
||||
.TP
|
||||
.BI "\-U " "name"\c
|
||||
\&
|
||||
Do not predefine \c
|
||||
.I name\c
|
||||
\&. If both `\|\c
|
||||
.B \-U\c
|
||||
\&\|' and `\|\c
|
||||
.B \-D\c
|
||||
\&\|' are
|
||||
specified for one name, the `\|\c
|
||||
.B \-U\c
|
||||
\&\|' beats the `\|\c
|
||||
.B \-D\c
|
||||
\&\|' and the name
|
||||
is not predefined.
|
||||
.TP
|
||||
.B \-undef
|
||||
Do not predefine any nonstandard macros.
|
||||
.TP
|
||||
.BI "\-A " "name(" value )
|
||||
Assert (in the same way as the \c
|
||||
.B #assert\c
|
||||
\& directive)
|
||||
the predicate \c
|
||||
.I name\c
|
||||
\& with tokenlist \c
|
||||
.I value\c
|
||||
\&. Remember to escape or quote the parentheses on
|
||||
shell command lines.
|
||||
|
||||
You can use `\|\c
|
||||
.B \-A-\c
|
||||
\&\|' to disable all predefined assertions; it also
|
||||
undefines all predefined macros.
|
||||
.TP
|
||||
.B \-dM
|
||||
Instead of outputting the result of preprocessing, output a list of
|
||||
`\|\c
|
||||
.B #define\c
|
||||
\&\|' directives for all the macros defined during the
|
||||
execution of the preprocessor, including predefined macros. This gives
|
||||
you a way of finding out what is predefined in your version of the
|
||||
preprocessor; assuming you have no file `\|\c
|
||||
.B foo.h\c
|
||||
\&\|', the command
|
||||
.sp
|
||||
.br
|
||||
touch\ foo.h;\ cpp\ \-dM\ foo.h
|
||||
.br
|
||||
.sp
|
||||
will show the values of any predefined macros.
|
||||
.TP
|
||||
.B \-dD
|
||||
Like `\|\c
|
||||
.B \-dM\c
|
||||
\&\|' except in two respects: it does \c
|
||||
.I not\c
|
||||
\& include the
|
||||
predefined macros, and it outputs \c
|
||||
.I both\c
|
||||
\& the `\|\c
|
||||
.B #define\c
|
||||
\&\|'
|
||||
directives and the result of preprocessing. Both kinds of output go to
|
||||
the standard output file.
|
||||
.PP
|
||||
.TP
|
||||
.BR \-M\ [ \-MG ]
|
||||
Instead of outputting the result of preprocessing, output a rule
|
||||
suitable for \c
|
||||
.B make\c
|
||||
\& describing the dependencies of the main
|
||||
source file. The preprocessor outputs one \c
|
||||
.B make\c
|
||||
\& rule containing
|
||||
the object file name for that source file, a colon, and the names of
|
||||
all the included files. If there are many included files then the
|
||||
rule is split into several lines using `\|\c
|
||||
.B \\\\\c
|
||||
\&\|'-newline.
|
||||
|
||||
`\|\c
|
||||
.B \-MG\c
|
||||
\&\|' says to treat missing header files as generated files and assume \c
|
||||
they live in the same directory as the source file. It must be specified \c
|
||||
in addition to `\|\c
|
||||
.B \-M\c
|
||||
\&\|'.
|
||||
|
||||
This feature is used in automatic updating of makefiles.
|
||||
.TP
|
||||
.BR \-MM\ [ \-MG ]
|
||||
Like `\|\c
|
||||
.B \-M\c
|
||||
\&\|' but mention only the files included with `\|\c
|
||||
.B #include
|
||||
"\c
|
||||
.I file\c
|
||||
\&"\c
|
||||
\&\|'. System header files included with `\|\c
|
||||
.B #include
|
||||
<\c
|
||||
.I file\c
|
||||
\&>\c
|
||||
\&\|' are omitted.
|
||||
.TP
|
||||
.BI \-MD\ file
|
||||
Like `\|\c
|
||||
.B \-M\c
|
||||
\&\|' but the dependency information is written to `\|\c
|
||||
.I file\c
|
||||
\&\|'. This is in addition to compiling the file as
|
||||
specified\(em\&`\|\c
|
||||
.B \-MD\c
|
||||
\&\|' does not inhibit ordinary compilation the way
|
||||
`\|\c
|
||||
.B \-M\c
|
||||
\&\|' does.
|
||||
|
||||
When invoking gcc, do not specify the `\|\c
|
||||
.I file\c
|
||||
\&\|' argument. Gcc will create file names made by replacing `\|\c
|
||||
.B .c\c
|
||||
\&\|' with `\|\c
|
||||
.B .d\c
|
||||
\&\|' at the end of the input file names.
|
||||
|
||||
In Mach, you can use the utility \c
|
||||
.B md\c
|
||||
\& to merge multiple files
|
||||
into a single dependency file suitable for using with the `\|\c
|
||||
.B make\c
|
||||
\&\|'
|
||||
command.
|
||||
.TP
|
||||
.BI \-MMD\ file
|
||||
Like `\|\c
|
||||
.B \-MD\c
|
||||
\&\|' except mention only user header files, not system
|
||||
header files.
|
||||
.TP
|
||||
.B \-H
|
||||
Print the name of each header file used, in addition to other normal
|
||||
activities.
|
||||
.TP
|
||||
.BI "\-imacros " "file"\c
|
||||
\&
|
||||
Process \c
|
||||
.I file\c
|
||||
\& as input, discarding the resulting output, before
|
||||
processing the regular input file. Because the output generated from
|
||||
\c
|
||||
.I file\c
|
||||
\& is discarded, the only effect of `\|\c
|
||||
.B \-imacros \c
|
||||
.I file\c
|
||||
\&\c
|
||||
\&\|' is to
|
||||
make the macros defined in \c
|
||||
.I file\c
|
||||
\& available for use in the main
|
||||
input. The preprocessor evaluates any `\|\c
|
||||
.B \-D\c
|
||||
\&\|' and `\|\c
|
||||
.B \-U\c
|
||||
\&\|' options
|
||||
on the command line before processing `\|\c
|
||||
.B \-imacros \c
|
||||
.I file\c
|
||||
\&\|' \c
|
||||
\&.
|
||||
.TP
|
||||
.BI "\-include " "file"
|
||||
Process
|
||||
.I file
|
||||
as input, and include all the resulting output,
|
||||
before processing the regular input file.
|
||||
.TP
|
||||
.BI "-idirafter " "dir"\c
|
||||
\&
|
||||
Add the directory \c
|
||||
.I dir\c
|
||||
\& to the second include path. The directories
|
||||
on the second include path are searched when a header file is not found
|
||||
in any of the directories in the main include path (the one that
|
||||
`\|\c
|
||||
.B \-I\c
|
||||
\&\|' adds to).
|
||||
.TP
|
||||
.BI "-iprefix " "prefix"\c
|
||||
\&
|
||||
Specify \c
|
||||
.I prefix\c
|
||||
\& as the prefix for subsequent `\|\c
|
||||
.B \-iwithprefix\c
|
||||
\&\|'
|
||||
options.
|
||||
.TP
|
||||
.BI "-iwithprefix " "dir"\c
|
||||
\&
|
||||
Add a directory to the second include path. The directory's name is
|
||||
made by concatenating \c
|
||||
.I prefix\c
|
||||
\& and \c
|
||||
.I dir\c
|
||||
\&, where \c
|
||||
.I prefix\c
|
||||
\&
|
||||
was specified previously with `\|\c
|
||||
.B \-iprefix\c
|
||||
\&\|'.
|
||||
.TP
|
||||
.B \-lang-c
|
||||
.TP
|
||||
.B \-lang-c++
|
||||
.TP
|
||||
.B \-lang-objc
|
||||
.TP
|
||||
.B \-lang-objc++
|
||||
Specify the source language. `\|\c
|
||||
.B \-lang-c++\c
|
||||
\&\|' makes the preprocessor
|
||||
handle C++ comment syntax, and includes extra default include
|
||||
directories for C++, and `\|\c
|
||||
.B \-lang-objc\c
|
||||
\&\|' enables the Objective C
|
||||
`\|\c
|
||||
.B #import\c
|
||||
\&\|' directive. `\|\c
|
||||
.B \-lang-c\c
|
||||
\&\|' explicitly turns off both of
|
||||
these extensions, and `\|\c
|
||||
.B \-lang-objc++\c
|
||||
\&\|' enables both.
|
||||
|
||||
These options are generated by the compiler driver \c
|
||||
.B gcc\c
|
||||
\&, but not
|
||||
passed from the `\|\c
|
||||
.B gcc\c
|
||||
\&\|' command line.
|
||||
.TP
|
||||
.B \-lint
|
||||
Look for commands to the program checker \c
|
||||
.B lint\c
|
||||
\& embedded in
|
||||
comments, and emit them preceded by `\|\c
|
||||
.B #pragma lint\c
|
||||
\&\|'. For example,
|
||||
the comment `\|\c
|
||||
.B /* NOTREACHED */\c
|
||||
\&\|' becomes `\|\c
|
||||
.B #pragma lint
|
||||
NOTREACHED\c
|
||||
\&\|'.
|
||||
|
||||
This option is available only when you call \c
|
||||
.B cpp\c
|
||||
\& directly;
|
||||
\c
|
||||
.B gcc\c
|
||||
\& will not pass it from its command line.
|
||||
.TP
|
||||
.B \-$
|
||||
Forbid the use of `\|\c
|
||||
.B $\c
|
||||
\&\|' in identifiers. This was formerly required for strict conformance
|
||||
to the C Standard before the standard was corrected. \c
|
||||
|
||||
This option is available only when you call \c
|
||||
.B cpp\c
|
||||
\& directly;
|
||||
.B gcc\c
|
||||
\& will not pass it from its command line.
|
||||
.SH "SEE ALSO"
|
||||
.RB "`\|" Cpp "\|'"
|
||||
entry in
|
||||
.B info\c
|
||||
\&;
|
||||
.I The C Preprocessor\c
|
||||
, Richard M. Stallman.
|
||||
.br
|
||||
.BR gcc "(" 1 ");"
|
||||
.RB "`\|" Gcc "\|'"
|
||||
entry in
|
||||
.B info\c
|
||||
\&;
|
||||
.I
|
||||
Using and Porting GNU CC (for version 2.0)\c
|
||||
, Richard M. Stallman.
|
||||
.SH COPYING
|
||||
Copyright (c) 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
.PP
|
||||
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.
|
||||
.PP
|
||||
Permission is granted to copy and distribute modified versions of this
|
||||
manual under the conditions for verbatim copying, provided that the
|
||||
entire resulting derived work is distributed under the terms of a
|
||||
permission notice identical to this one.
|
||||
.PP
|
||||
Permission is granted to copy and distribute translations of this
|
||||
manual into another language, under the above conditions for modified
|
||||
versions, except that this permission notice may be included in
|
||||
translations approved by the Free Software Foundation instead of in
|
||||
the original English.
|
||||
@@ -267,6 +267,23 @@ extern void override_options ();
|
||||
/* Define to enable software floating point emulation. */
|
||||
#define REAL_ARITHMETIC
|
||||
|
||||
/* The following #defines are used when compiling the routines in
|
||||
libgcc1.c. Since the Alpha calling conventions require single
|
||||
precision floats to be passed in the floating-point registers
|
||||
(rather than in the general registers) we have to build the
|
||||
libgcc1.c routines in such a way that they know the actual types
|
||||
of their formal arguments and the actual types of their return
|
||||
values. Otherwise, gcc will generate calls to the libgcc1.c
|
||||
routines, passing arguments in the floating-point registers,
|
||||
but the libgcc1.c routines will expect their arguments on the
|
||||
stack (where the Alpha calling conventions require structs &
|
||||
unions to be passed). */
|
||||
|
||||
#define FLOAT_VALUE_TYPE double
|
||||
#define INTIFY(FLOATVAL) (FLOATVAL)
|
||||
#define FLOATIFY(INTVAL) (INTVAL)
|
||||
#define FLOAT_ARG_TYPE double
|
||||
|
||||
/* Define the size of `int'. The default is the same as the word size. */
|
||||
#define INT_TYPE_SIZE 32
|
||||
|
||||
|
||||
104
gcc/config/alpha/crtbegin.asm
Normal file
104
gcc/config/alpha/crtbegin.asm
Normal file
@@ -0,0 +1,104 @@
|
||||
# Copyright (C) 1996, 1998 Free Software Foundation, Inc.
|
||||
# Contributed by Richard Henderson (rth@tamu.edu)
|
||||
#
|
||||
# This file 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, or (at your option) any
|
||||
# later version.
|
||||
#
|
||||
# In addition to the permissions in the GNU General Public License, the
|
||||
# Free Software Foundation gives you unlimited permission to link the
|
||||
# compiled version of this file with other programs, and to distribute
|
||||
# those programs without any restriction coming from the use of this
|
||||
# file. (The General Public License restrictions do apply in other
|
||||
# respects; for example, they cover modification of the file, and
|
||||
# distribution when not linked into another program.)
|
||||
#
|
||||
# This file 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; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception, if you link this library with files
|
||||
# compiled with GCC to produce an executable, this does not cause
|
||||
# the resulting executable to be covered by the GNU General Public License.
|
||||
# This exception does not however invalidate any other reasons why
|
||||
# the executable file might be covered by the GNU General Public License.
|
||||
|
||||
#
|
||||
# Heads of the constructor/destructor lists.
|
||||
#
|
||||
|
||||
# The __*TOR_LIST__ symbols are not global because when this file is used
|
||||
# in a shared library, we do not want the symbol to fall over to the
|
||||
# application's lists.
|
||||
|
||||
.section .ctors,"aw"
|
||||
|
||||
.align 3
|
||||
__CTOR_LIST__:
|
||||
.quad -1
|
||||
|
||||
.section .dtors,"aw"
|
||||
|
||||
.align 3
|
||||
__DTOR_LIST__:
|
||||
.quad -1
|
||||
|
||||
|
||||
#
|
||||
# Fragment of the ELF _fini routine that invokes our dtor cleanup.
|
||||
#
|
||||
|
||||
.section .fini,"ax"
|
||||
|
||||
# Since the bits of the _fini function are spread across many
|
||||
# object files, each potentially with its own GP, we must
|
||||
# assume we need to load ours. Further, our .fini section
|
||||
# can easily be more than 4MB away from our .text bits so we
|
||||
# can't use bsr.
|
||||
|
||||
br $29,1f
|
||||
1: ldgp $29,0($29)
|
||||
jsr $26,__do_global_dtors_aux
|
||||
|
||||
# Must match the alignment we got from crti.o else we get
|
||||
# zero-filled holes in our _fini function and then SIGILL.
|
||||
.align 3
|
||||
|
||||
#
|
||||
# Invoke our destructors in order.
|
||||
#
|
||||
|
||||
.text
|
||||
|
||||
.align 3
|
||||
.ent __do_global_dtors_aux
|
||||
|
||||
__do_global_dtors_aux:
|
||||
ldgp $29,0($27)
|
||||
lda $30,-16($30)
|
||||
.frame $30,16,$26,0
|
||||
stq $26,0($30)
|
||||
.mask 0x4000000,-16
|
||||
.prologue 1
|
||||
|
||||
lda $1,__DTOR_LIST__
|
||||
br 1f
|
||||
0: stq $1,8($30)
|
||||
jsr $26,($27)
|
||||
ldq $1,8($30)
|
||||
1: ldq $27,8($1)
|
||||
addq $1,8,$1
|
||||
bne $27,0b
|
||||
|
||||
ldq $26,0($30)
|
||||
lda $30,16($30)
|
||||
ret
|
||||
|
||||
.end __do_global_dtors_aux
|
||||
105
gcc/config/alpha/crtend.asm
Normal file
105
gcc/config/alpha/crtend.asm
Normal file
@@ -0,0 +1,105 @@
|
||||
# Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
# Contributed by Richard Henderson (rth@tamu.edu)
|
||||
#
|
||||
# This file 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, or (at your option) any
|
||||
# later version.
|
||||
#
|
||||
# In addition to the permissions in the GNU General Public License, the
|
||||
# Free Software Foundation gives you unlimited permission to link the
|
||||
# compiled version of this file with other programs, and to distribute
|
||||
# those programs without any restriction coming from the use of this
|
||||
# file. (The General Public License restrictions do apply in other
|
||||
# respects; for example, they cover modification of the file, and
|
||||
# distribution when not linked into another program.)
|
||||
#
|
||||
# This file 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; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception, if you link this library with files
|
||||
# compiled with GCC to produce an executable, this does not cause
|
||||
# the resulting executable to be covered by the GNU General Public License.
|
||||
# This exception does not however invalidate any other reasons why
|
||||
# the executable file might be covered by the GNU General Public License.
|
||||
|
||||
#
|
||||
# Tails of the constructor/destructor lists.
|
||||
#
|
||||
|
||||
# The __*TOR_END__ symbols are not global because when this file is used
|
||||
# in a shared library, we do not want the symbol to fall over to the
|
||||
# application's lists.
|
||||
|
||||
.section .ctors,"aw"
|
||||
|
||||
.align 3
|
||||
__CTOR_END__:
|
||||
.quad 0
|
||||
|
||||
.section .dtors,"aw"
|
||||
|
||||
.align 3
|
||||
__DTOR_END__:
|
||||
.quad 0
|
||||
|
||||
|
||||
#
|
||||
# Fragment of the ELF _init routine that invokes our ctor startup
|
||||
#
|
||||
|
||||
.section .init,"ax"
|
||||
|
||||
# Since the bits of the _init function are spread across many
|
||||
# object files, each potentially with its own GP, we must
|
||||
# assume we need to load ours. Further, our .init section
|
||||
# can easily be more than 4MB away from our .text bits so we
|
||||
# can't use bsr.
|
||||
|
||||
br $29,1f
|
||||
1: ldgp $29,0($29)
|
||||
jsr $26,__do_global_ctors_aux
|
||||
|
||||
# Must match the alignment we got from crti.o else we get
|
||||
# zero-filled holes in our _init function and thense SIGILL.
|
||||
.align 3
|
||||
|
||||
#
|
||||
# Invoke our destructors in order.
|
||||
#
|
||||
|
||||
.text
|
||||
|
||||
.align 3
|
||||
.ent __do_global_ctors_aux
|
||||
|
||||
__do_global_ctors_aux:
|
||||
ldgp $29,0($27)
|
||||
lda $30,-16($30)
|
||||
.frame $30,16,$26,0
|
||||
stq $9,8($30)
|
||||
stq $26,0($30)
|
||||
.mask 0x4000200,-16
|
||||
.prologue 1
|
||||
|
||||
lda $9,__CTOR_END__
|
||||
br 1f
|
||||
0: jsr $26,($27)
|
||||
1: ldq $27,-8($9)
|
||||
subq $9,8,$9
|
||||
not $27,$0
|
||||
bne $0,0b
|
||||
|
||||
ldq $26,0($30)
|
||||
ldq $9,8($30)
|
||||
lda $30,16($30)
|
||||
ret
|
||||
|
||||
.end __do_global_ctors_aux
|
||||
9
gcc/config/alpha/t-crtbe
Normal file
9
gcc/config/alpha/t-crtbe
Normal file
@@ -0,0 +1,9 @@
|
||||
# Effectively disable the crtbegin/end rules using crtstuff.c
|
||||
T = disable
|
||||
|
||||
# Assemble startup files.
|
||||
crtbegin.o: $(srcdir)/config/alpha/crtbegin.asm $(GCC_PASSES)
|
||||
$(GCC_FOR_TARGET) -c -o crtbegin.o -x assembler $(srcdir)/config/alpha/crtbegin.asm
|
||||
|
||||
crtend.o: $(srcdir)/config/alpha/crtend.asm $(GCC_PASSES)
|
||||
$(GCC_FOR_TARGET) -c -o crtend.o -x assembler $(srcdir)/config/alpha/crtend.asm
|
||||
22
gcc/config/alpha/vms-tramp.asm
Normal file
22
gcc/config/alpha/vms-tramp.asm
Normal file
@@ -0,0 +1,22 @@
|
||||
;# New Alpha OpenVMS trampoline
|
||||
;#
|
||||
.set noreorder
|
||||
.set volatile
|
||||
.set noat
|
||||
.file 1 "tramp.s"
|
||||
.text
|
||||
.align 3
|
||||
.globl __tramp
|
||||
.ent __tramp
|
||||
__tramp..en:
|
||||
|
||||
.link
|
||||
.align 3
|
||||
__tramp:
|
||||
.pdesc __tramp..en,null
|
||||
.text
|
||||
ldq $1,24($27)
|
||||
ldq $27,16($27)
|
||||
ldq $28,8($27)
|
||||
jmp $31,($28),0
|
||||
.end __tramp
|
||||
57
gcc/config/alpha/vxworks.h
Normal file
57
gcc/config/alpha/vxworks.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* Definitions of target machine for GNU compiler. Vxworks Alpha version.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file just exists to give specs for the Alpha running on VxWorks. */
|
||||
|
||||
#undef CPP_SPEC
|
||||
#define CPP_SPEC "\
|
||||
%{mvxsim:-DCPU=SIMALPHADUNIX} \
|
||||
%{!mvxsim: %{!mcpu*:-DCPU=21064} \
|
||||
%{mcpu=21064:-DCPU=21064} \
|
||||
%{mcpu=21164:-DCPU=21164}} \
|
||||
%{posix: -D_POSIX_SOURCE} \
|
||||
%{!.S: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}} \
|
||||
%{.S: -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}}"
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "\
|
||||
-D__vxworks -D__alpha_vxworks -Asystem(vxworks) \
|
||||
-Asystem(embedded) -D_LONGLONG -Acpu(alpha) -Amachine(alpha)"
|
||||
|
||||
/* VxWorks does all the library stuff itself. */
|
||||
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC ""
|
||||
|
||||
/* VxWorks uses object files, not loadable images. make linker just
|
||||
combine objects. */
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-r"
|
||||
|
||||
/* VxWorks provides the functionality of crt0.o and friends itself. */
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC ""
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
#define ENDFILE_SPEC ""
|
||||
|
||||
#undef TRANSFER_FROM_TRAMPOLINE
|
||||
2212
gcc/config/arc/arc.c
Normal file
2212
gcc/config/arc/arc.c
Normal file
File diff suppressed because it is too large
Load Diff
1643
gcc/config/arc/arc.h
Normal file
1643
gcc/config/arc/arc.h
Normal file
File diff suppressed because it is too large
Load Diff
1630
gcc/config/arc/arc.md
Normal file
1630
gcc/config/arc/arc.md
Normal file
File diff suppressed because it is too large
Load Diff
157
gcc/config/arc/initfini.c
Normal file
157
gcc/config/arc/initfini.c
Normal file
@@ -0,0 +1,157 @@
|
||||
/* .init/.fini section handling + C++ global constructor/destructor handling.
|
||||
This file is based on crtstuff.c, sol2-crti.asm, sol2-crtn.asm.
|
||||
|
||||
Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* As a special exception, if you link this file with files
|
||||
compiled with GCC to produce an executable, this does not cause
|
||||
the resulting executable to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
/* Declare a pointer to void function type. */
|
||||
typedef void (*func_ptr) (void);
|
||||
|
||||
#ifdef CRT_INIT
|
||||
|
||||
/* NOTE: In order to be able to support SVR4 shared libraries, we arrange
|
||||
to have one set of symbols { __CTOR_LIST__, __DTOR_LIST__, __CTOR_END__,
|
||||
__DTOR_END__ } per root executable and also one set of these symbols
|
||||
per shared library. So in any given whole process image, we may have
|
||||
multiple definitions of each of these symbols. In order to prevent
|
||||
these definitions from conflicting with one another, and in order to
|
||||
ensure that the proper lists are used for the initialization/finalization
|
||||
of each individual shared library (respectively), we give these symbols
|
||||
only internal (i.e. `static') linkage, and we also make it a point to
|
||||
refer to only the __CTOR_END__ symbol in crtfini.o and the __DTOR_LIST__
|
||||
symbol in crtinit.o, where they are defined. */
|
||||
|
||||
static func_ptr __CTOR_LIST__[1] __attribute__ ((section (".ctors")))
|
||||
= { (func_ptr) (-1) };
|
||||
|
||||
static func_ptr __DTOR_LIST__[1] __attribute__ ((section (".dtors")))
|
||||
= { (func_ptr) (-1) };
|
||||
|
||||
/* Run all the global destructors on exit from the program. */
|
||||
|
||||
/* Some systems place the number of pointers in the first word of the
|
||||
table. On SVR4 however, that word is -1. In all cases, the table is
|
||||
null-terminated. On SVR4, we start from the beginning of the list and
|
||||
invoke each per-compilation-unit destructor routine in order
|
||||
until we find that null.
|
||||
|
||||
Note that this function MUST be static. There will be one of these
|
||||
functions in each root executable and one in each shared library, but
|
||||
although they all have the same code, each one is unique in that it
|
||||
refers to one particular associated `__DTOR_LIST__' which belongs to the
|
||||
same particular root executable or shared library file. */
|
||||
|
||||
static void __do_global_dtors ()
|
||||
asm ("__do_global_dtors") __attribute__ ((section (".text")));
|
||||
|
||||
static void
|
||||
__do_global_dtors ()
|
||||
{
|
||||
func_ptr *p;
|
||||
for (p = __DTOR_LIST__ + 1; *p; p++)
|
||||
(*p) ();
|
||||
}
|
||||
|
||||
/* .init section start.
|
||||
This must appear at the start of the .init section. */
|
||||
|
||||
asm ("
|
||||
.section .init\n
|
||||
.global init\n
|
||||
.word 0\n
|
||||
init:\n
|
||||
st blink,[sp,4]\n
|
||||
st fp,[sp]\n
|
||||
mov fp,sp\n
|
||||
sub sp,sp,16\n
|
||||
");
|
||||
|
||||
/* .fini section start.
|
||||
This must appear at the start of the .init section. */
|
||||
|
||||
asm ("
|
||||
.section .fini\n
|
||||
.global fini\n
|
||||
.word 0\n
|
||||
fini:\n
|
||||
st blink,[sp,4]\n
|
||||
st fp,[sp]\n
|
||||
mov fp,sp\n
|
||||
sub sp,sp,16\n
|
||||
bl.nd __do_global_dtors
|
||||
");
|
||||
|
||||
#endif /* CRT_INIT */
|
||||
|
||||
#ifdef CRT_FINI
|
||||
|
||||
/* Put a word containing zero at the end of each of our two lists of function
|
||||
addresses. Note that the words defined here go into the .ctors and .dtors
|
||||
sections of the crtend.o file, and since that file is always linked in
|
||||
last, these words naturally end up at the very ends of the two lists
|
||||
contained in these two sections. */
|
||||
|
||||
static func_ptr __CTOR_END__[1] __attribute__ ((section (".ctors")))
|
||||
= { (func_ptr) 0 };
|
||||
|
||||
static func_ptr __DTOR_END__[1] __attribute__ ((section (".dtors")))
|
||||
= { (func_ptr) 0 };
|
||||
|
||||
/* Run all global constructors for the program.
|
||||
Note that they are run in reverse order. */
|
||||
|
||||
static void __do_global_ctors ()
|
||||
asm ("__do_global_ctors") __attribute__ ((section (".text")));
|
||||
|
||||
static void
|
||||
__do_global_ctors ()
|
||||
{
|
||||
func_ptr *p;
|
||||
for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--)
|
||||
(*p) ();
|
||||
}
|
||||
|
||||
/* .init section end.
|
||||
This must live at the end of the .init section. */
|
||||
|
||||
asm ("
|
||||
.section .init\n
|
||||
bl.nd __do_global_ctors
|
||||
ld blink,[fp,4]\n
|
||||
j.d blink\n
|
||||
ld.a fp,[sp,16]\n
|
||||
");
|
||||
|
||||
/* .fini section end.
|
||||
This must live at the end of the .fini section. */
|
||||
|
||||
asm ("
|
||||
.section .fini\n
|
||||
ld blink,[fp,4]\n
|
||||
j.d blink\n
|
||||
ld.a fp,[sp,16]\n
|
||||
");
|
||||
|
||||
#endif /* CRT_FINI */
|
||||
273
gcc/config/arc/lib1funcs.asm
Normal file
273
gcc/config/arc/lib1funcs.asm
Normal file
@@ -0,0 +1,273 @@
|
||||
; libgcc1 routines for ARC cpu.
|
||||
|
||||
/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file 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, or (at your option) any
|
||||
later version.
|
||||
|
||||
In addition to the permissions in the GNU General Public License, the
|
||||
Free Software Foundation gives you unlimited permission to link the
|
||||
compiled version of this file with other programs, and to distribute
|
||||
those programs without any restriction coming from the use of this
|
||||
file. (The General Public License restrictions do apply in other
|
||||
respects; for example, they cover modification of the file, and
|
||||
distribution when not linked into another program.)
|
||||
|
||||
This file 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with other files,
|
||||
some of which are compiled with GCC, to produce an executable,
|
||||
this library does not by itself cause the resulting executable
|
||||
to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
#ifdef L_mulsi3
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
#ifdef __base__
|
||||
.cpu base
|
||||
.global ___mulsi3
|
||||
___mulsi3:
|
||||
|
||||
/* This the simple version.
|
||||
|
||||
while (a)
|
||||
{
|
||||
if (a & 1)
|
||||
r += b;
|
||||
a >>= 1;
|
||||
b <<= 1;
|
||||
}
|
||||
*/
|
||||
mov r2,0 ; Accumulate result here.
|
||||
.Lloop:
|
||||
sub.f 0,r0,0 ; while (a)
|
||||
nop
|
||||
beq.nd .Ldone
|
||||
and.f 0,r0,1 ; if (a & 1)
|
||||
add.nz r2,r2,r1 ; r += b
|
||||
lsr r0,r0 ; a >>= 1
|
||||
b.d .Lloop
|
||||
lsl r1,r1 ; b <<= 1
|
||||
.Ldone:
|
||||
j.d blink
|
||||
mov r0,r2
|
||||
#endif
|
||||
|
||||
#endif /* L_mulsi3 */
|
||||
|
||||
#ifdef L_umulsidi3
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
#ifdef __base__
|
||||
.cpu base
|
||||
.global ___umulsidi3
|
||||
___umulsidi3:
|
||||
|
||||
/* This the simple version.
|
||||
|
||||
while (a)
|
||||
{
|
||||
if (a & 1)
|
||||
r += b;
|
||||
a >>= 1;
|
||||
b <<= 1;
|
||||
}
|
||||
*/
|
||||
mov r2,0 ; Top part of b.
|
||||
mov r3,0 ; Accumulate result here.
|
||||
mov r4,0
|
||||
.Lloop:
|
||||
sub.f 0,r0,0 ; while (a)
|
||||
nop
|
||||
beq.nd .Ldone
|
||||
and.f 0,r0,1 ; if (a & 1)
|
||||
add.nz r4,r4,r1 ; r += b
|
||||
adc.nz r3,r3,r2
|
||||
lsr r0,r0 ; a >>= 1
|
||||
lsl.f r1,r1 ; b <<= 1
|
||||
b.d .Lloop
|
||||
rlc r2,r2
|
||||
.Ldone:
|
||||
#ifdef __big_endian__
|
||||
mov r1,r4
|
||||
j.d blink
|
||||
mov r0,r3
|
||||
#else
|
||||
mov r0,r4
|
||||
j.d blink
|
||||
mov r1,r3
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* L_umulsidi3 */
|
||||
|
||||
#ifdef L_divmod_tools
|
||||
|
||||
; Utilities used by all routines.
|
||||
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
; inputs: r0 = numerator, r1 = denominator
|
||||
; outputs: positive r0/r1,
|
||||
; r6.bit1 = sign of numerator, r6.bit0 = sign of result
|
||||
|
||||
.global ___divnorm
|
||||
___divnorm:
|
||||
mov r6,0 ; keep sign in r6
|
||||
sub.f 0,r0,0 ; is numerator -ve?
|
||||
sub.lt r0,0,r0 ; negate numerator
|
||||
mov.lt r6,3 ; sign is -ve
|
||||
sub.f 0,r1,0 ; is denominator -ve?
|
||||
sub.lt r1,0,r1 ; negate denominator
|
||||
xor.lt r6,r6,1 ; toggle sign
|
||||
j.nd blink
|
||||
|
||||
/*
|
||||
unsigned long
|
||||
udivmodsi4(int modwanted, unsigned long num, unsigned long den)
|
||||
{
|
||||
unsigned long bit = 1;
|
||||
unsigned long res = 0;
|
||||
|
||||
while (den < num && bit && !(den & (1L<<31)))
|
||||
{
|
||||
den <<=1;
|
||||
bit <<=1;
|
||||
}
|
||||
while (bit)
|
||||
{
|
||||
if (num >= den)
|
||||
{
|
||||
num -= den;
|
||||
res |= bit;
|
||||
}
|
||||
bit >>=1;
|
||||
den >>=1;
|
||||
}
|
||||
if (modwanted) return num;
|
||||
return res;
|
||||
}
|
||||
*/
|
||||
|
||||
; inputs: r0 = numerator, r1 = denominator
|
||||
; outputs: r0 = quotient, r1 = remainder, r2/r3 trashed
|
||||
|
||||
.global ___udivmodsi4
|
||||
___udivmodsi4:
|
||||
mov r2,1 ; bit = 1
|
||||
mov r3,0 ; res = 0
|
||||
.Lloop1:
|
||||
sub.f 0,r1,r0 ; while (den < num
|
||||
nop
|
||||
bnc.nd .Lloop2
|
||||
sub.f 0,r2,0 ; && bit
|
||||
nop
|
||||
bz.nd .Lloop2
|
||||
lsl.f 0,r1 ; && !(den & (1<<31))
|
||||
nop
|
||||
bc.nd .Lloop2
|
||||
lsl r1,r1 ; den <<= 1
|
||||
b.d .Lloop1
|
||||
lsl r2,r2 ; bit <<= 1
|
||||
.Lloop2:
|
||||
sub.f 0,r2,0 ; while (bit)
|
||||
nop
|
||||
bz.nd .Ldivmodend
|
||||
sub.f 0,r0,r1 ; if (num >= den)
|
||||
nop
|
||||
bc.nd .Lshiftdown
|
||||
sub r0,r0,r1 ; num -= den
|
||||
or r3,r3,r2 ; res |= bit
|
||||
.Lshiftdown:
|
||||
lsr r2,r2 ; bit >>= 1
|
||||
b.d .Lloop2
|
||||
lsr r1,r1 ; den >>= 1
|
||||
.Ldivmodend:
|
||||
mov r1,r0 ; r1 = mod
|
||||
j.d blink
|
||||
mov r0,r3 ; r0 = res
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef L_udivsi3
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
#ifdef __base__
|
||||
.cpu base
|
||||
.global ___udivsi3
|
||||
___udivsi3:
|
||||
mov r7,blink
|
||||
bl.nd ___udivmodsi4
|
||||
j.nd r7
|
||||
#endif
|
||||
|
||||
#endif /* L_udivsi3 */
|
||||
|
||||
#ifdef L_divsi3
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
#ifdef __base__
|
||||
.cpu base
|
||||
.global ___divsi3
|
||||
___divsi3:
|
||||
mov r7,blink
|
||||
bl.nd ___divnorm
|
||||
bl.nd ___udivmodsi4
|
||||
and.f 0,r6,1
|
||||
sub.nz r0,0,r0 ; cannot go in delay slot, has limm value
|
||||
j.nd r7
|
||||
#endif
|
||||
|
||||
#endif /* L_divsi3 */
|
||||
|
||||
#ifdef L_umodsi3
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
#ifdef __base__
|
||||
.cpu base
|
||||
.global ___umodsi3
|
||||
___umodsi3:
|
||||
mov r7,blink
|
||||
bl.nd ___udivmodsi4
|
||||
j.d r7
|
||||
mov r0,r1
|
||||
#endif
|
||||
|
||||
#endif /* L_umodsi3 */
|
||||
|
||||
#ifdef L_modsi3
|
||||
.section .text
|
||||
.align 4
|
||||
|
||||
#ifdef __base__
|
||||
.cpu base
|
||||
.global ___modsi3
|
||||
___modsi3:
|
||||
mov r7,blink
|
||||
bl.nd ___divnorm
|
||||
bl.nd ___udivmodsi4
|
||||
and.f 0,r6,2
|
||||
sub.nz r1,0,r1
|
||||
j.d r7
|
||||
mov r0,r1
|
||||
#endif
|
||||
|
||||
#endif /* L_modsi3 */
|
||||
72
gcc/config/arc/t-arc
Normal file
72
gcc/config/arc/t-arc
Normal file
@@ -0,0 +1,72 @@
|
||||
CROSS_LIBGCC1 = libgcc1-asm.a
|
||||
LIB1ASMSRC = arc/lib1funcs.asm
|
||||
LIB1ASMFUNCS = _mulsi3 _umulsidi3 _udivsi3 _divsi3 _umodsi3 _modsi3 _divmod_tools
|
||||
|
||||
# We need libgcc routines to be mangled according to which cpu they
|
||||
# were compiled for.
|
||||
# ??? -mmangle-cpu passed by default for now.
|
||||
#LIBGCC2_CFLAGS = -g1 -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) -mmangle-cpu
|
||||
|
||||
# These are really part of libgcc1, but this will cause them to be
|
||||
# built correctly, so...
|
||||
|
||||
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
|
||||
|
||||
dp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
echo '#ifndef __big_endian__' > dp-bit.c
|
||||
echo '#define FLOAT_BIT_ORDER_MISMATCH' >> dp-bit.c
|
||||
echo '#endif' >> dp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c >> dp-bit.c
|
||||
|
||||
fp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
echo '#define FLOAT' > fp-bit.c
|
||||
echo '#ifndef __big_endian__' >> fp-bit.c
|
||||
echo '#define FLOAT_BIT_ORDER_MISMATCH' >> fp-bit.c
|
||||
echo '#endif' >> fp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
|
||||
|
||||
# .init/.fini section routines
|
||||
|
||||
x-crtinit.o: $(srcdir)/config/arc/initfini.c $(GCC_PASSES) $(CONFIG_H)
|
||||
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
|
||||
-DCRT_INIT -finhibit-size-directive -fno-inline-functions \
|
||||
-g0 -c $(srcdir)/config/arc/initfini.c -o $(dir)/crtinit.o
|
||||
|
||||
x-crtfini.o: $(srcdir)/config/arc/initfini.c $(GCC_PASSES) $(CONFIG_H)
|
||||
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS) \
|
||||
-DCRT_FINI -finhibit-size-directive -fno-inline-functions \
|
||||
-g0 -c $(srcdir)/config/arc/initfini.c -o $(dir)/crtfini.o
|
||||
|
||||
MULTILIB_OPTIONS = EB
|
||||
MULTILIB_DIRNAMES = be
|
||||
|
||||
# We need our own versions to build multiple copies of crt*.o.
|
||||
# ??? Use new support in Makefile.
|
||||
|
||||
LIBGCC = stmp-multilib-arc
|
||||
INSTALL_LIBGCC = install-multilib-arc
|
||||
|
||||
stmp-multilib-arc: stmp-multilib
|
||||
for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
|
||||
dir=`echo $$i | sed -e 's/;.*$$//'`; \
|
||||
flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
|
||||
$(MAKE) GCC_FOR_TARGET="$(GCC_FOR_TARGET)" \
|
||||
CC="$(CC)" CFLAGS="$(CFLAGS)" \
|
||||
HOST_PREFIX="$(HOST_PREFIX)" HOST_PREFIX_1="$(HOST_PREFIX_1)" \
|
||||
GCC_CFLAGS="$(GCC_CFLAGS) $${flags}" \
|
||||
INCLUDES="$(INCLUDES)" CRTSTUFF_T_CFLAGS=$(CRTSTUFF_T_CFLAGS) \
|
||||
dir="$${dir}" x-crtinit.o x-crtfini.o; \
|
||||
if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
|
||||
done
|
||||
touch stmp-multilib-arc
|
||||
|
||||
install-multilib-arc: install-multilib
|
||||
for i in `$(GCC_FOR_TARGET) --print-multi-lib`; do \
|
||||
dir=`echo $$i | sed -e 's/;.*$$//'`; \
|
||||
rm -f $(libsubdir)/$${dir}/crtinit.o; \
|
||||
$(INSTALL_DATA) $${dir}/crtinit.o $(libsubdir)/$${dir}/crtinit.o; \
|
||||
chmod a-x $(libsubdir)/$${dir}/crtinit.o; \
|
||||
rm -f $(libsubdir)/$${dir}/crtfini.o; \
|
||||
$(INSTALL_DATA) $${dir}/crtfini.o $(libsubdir)/$${dir}/crtfini.o; \
|
||||
chmod a-x $(libsubdir)/$${dir}/crtfini.o; \
|
||||
done
|
||||
47
gcc/config/arc/xm-arc.h
Normal file
47
gcc/config/arc/xm-arc.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* Configuration for GNU C-compiler for the ARC processor.
|
||||
Copyright (C) 1994, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#define HOST_BITS_PER_CHAR 8
|
||||
#define HOST_BITS_PER_SHORT 16
|
||||
#define HOST_BITS_PER_INT 32
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
#define HOST_BITS_PER_LONGLONG 64
|
||||
|
||||
/* Doubles are stored in memory with the high order word first. This
|
||||
matters when cross-compiling. */
|
||||
#define HOST_WORDS_BIG_ENDIAN 1
|
||||
|
||||
/* target machine dependencies.
|
||||
tm.h is a symbolic link to the actual target specific file. */
|
||||
#include "tm.h"
|
||||
|
||||
/* Arguments to use with `exit'. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
#define FATAL_EXIT_CODE 33
|
||||
|
||||
/* If compiled with Sun CC, the use of alloca requires this #include. */
|
||||
#ifndef __GNUC__
|
||||
#include "alloca.h"
|
||||
#endif
|
||||
96
gcc/config/float-i128.h
Normal file
96
gcc/config/float-i128.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/* float.h for target with IEEE 32, 64 and 128 bit floating point formats */
|
||||
#ifndef _FLOAT_H_
|
||||
#define _FLOAT_H_
|
||||
/* Produced by enquire version 4.3, CWI, Amsterdam */
|
||||
|
||||
/* Radix of exponent representation */
|
||||
#undef FLT_RADIX
|
||||
#define FLT_RADIX 2
|
||||
/* Number of base-FLT_RADIX digits in the significand of a float */
|
||||
#undef FLT_MANT_DIG
|
||||
#define FLT_MANT_DIG 24
|
||||
/* Number of decimal digits of precision in a float */
|
||||
#undef FLT_DIG
|
||||
#define FLT_DIG 6
|
||||
/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */
|
||||
#undef FLT_ROUNDS
|
||||
#define FLT_ROUNDS 1
|
||||
/* Difference between 1.0 and the minimum float greater than 1.0 */
|
||||
#undef FLT_EPSILON
|
||||
#define FLT_EPSILON 1.19209290e-07F
|
||||
/* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
|
||||
#undef FLT_MIN_EXP
|
||||
#define FLT_MIN_EXP (-125)
|
||||
/* Minimum normalised float */
|
||||
#undef FLT_MIN
|
||||
#define FLT_MIN 1.17549435e-38F
|
||||
/* Minimum int x such that 10**x is a normalised float */
|
||||
#undef FLT_MIN_10_EXP
|
||||
#define FLT_MIN_10_EXP (-37)
|
||||
/* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
|
||||
#undef FLT_MAX_EXP
|
||||
#define FLT_MAX_EXP 128
|
||||
/* Maximum float */
|
||||
#undef FLT_MAX
|
||||
#define FLT_MAX 3.40282347e+38F
|
||||
/* Maximum int x such that 10**x is a representable float */
|
||||
#undef FLT_MAX_10_EXP
|
||||
#define FLT_MAX_10_EXP 38
|
||||
|
||||
/* Number of base-FLT_RADIX digits in the significand of a double */
|
||||
#undef DBL_MANT_DIG
|
||||
#define DBL_MANT_DIG 53
|
||||
/* Number of decimal digits of precision in a double */
|
||||
#undef DBL_DIG
|
||||
#define DBL_DIG 15
|
||||
/* Difference between 1.0 and the minimum double greater than 1.0 */
|
||||
#undef DBL_EPSILON
|
||||
#define DBL_EPSILON 2.2204460492503131e-16
|
||||
/* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
|
||||
#undef DBL_MIN_EXP
|
||||
#define DBL_MIN_EXP (-1021)
|
||||
/* Minimum normalised double */
|
||||
#undef DBL_MIN
|
||||
#define DBL_MIN 2.2250738585072014e-308
|
||||
/* Minimum int x such that 10**x is a normalised double */
|
||||
#undef DBL_MIN_10_EXP
|
||||
#define DBL_MIN_10_EXP (-307)
|
||||
/* Maximum int x such that FLT_RADIX**(x-1) is a representable double */
|
||||
#undef DBL_MAX_EXP
|
||||
#define DBL_MAX_EXP 1024
|
||||
/* Maximum double */
|
||||
#undef DBL_MAX
|
||||
#define DBL_MAX 1.7976931348623157e+308
|
||||
/* Maximum int x such that 10**x is a representable double */
|
||||
#undef DBL_MAX_10_EXP
|
||||
#define DBL_MAX_10_EXP 308
|
||||
|
||||
/* Number of base-FLT_RADIX digits in the significand of a long double */
|
||||
#undef LDBL_MANT_DIG
|
||||
#define LDBL_MANT_DIG 113
|
||||
/* Number of decimal digits of precision in a long double */
|
||||
#undef LDBL_DIG
|
||||
#define LDBL_DIG 33
|
||||
/* Difference between 1.0 and the minimum long double greater than 1.0 */
|
||||
#undef LDBL_EPSILON
|
||||
#define LDBL_EPSILON 1.925929944387235853055977942584927319E-34L
|
||||
/* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */
|
||||
#undef LDBL_MIN_EXP
|
||||
#define LDBL_MIN_EXP (-16381)
|
||||
/* Minimum normalised long double */
|
||||
#undef LDBL_MIN
|
||||
#define LDBL_MIN 3.362103143112093506262677817321752603E-4932L
|
||||
/* Minimum int x such that 10**x is a normalised long double */
|
||||
#undef LDBL_MIN_10_EXP
|
||||
#define LDBL_MIN_10_EXP (-4931)
|
||||
/* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */
|
||||
#undef LDBL_MAX_EXP
|
||||
#define LDBL_MAX_EXP 16384
|
||||
/* Maximum long double */
|
||||
#undef LDBL_MAX
|
||||
#define LDBL_MAX 1.189731495357231765085759326628007016E+4932L
|
||||
/* Maximum int x such that 10**x is a representable long double */
|
||||
#undef LDBL_MAX_10_EXP
|
||||
#define LDBL_MAX_10_EXP 4932
|
||||
|
||||
#endif /* _FLOAT_H_ */
|
||||
33
gcc/config/i386/crtdll.h
Normal file
33
gcc/config/i386/crtdll.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/* Operating system specific defines to be used when targeting GCC for
|
||||
hosting on Windows32, using GNU tools and the Windows32 API Library,
|
||||
as distinct from winnt.h, which is used to build GCC for use with a
|
||||
windows style library and tool set and uses the Microsoft tools.
|
||||
This variant uses CRTDLL.DLL insted of MSVCRTDLL.DLL.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#undef LIBGCC_SPEC
|
||||
#define LIBGCC_SPEC "-lmingw32 -lgcc -lmoldname -lcrtdll"
|
||||
|
||||
/* Specify a different entry point when linking a DLL */
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC "%{mdll:dllcrt1%O%s} %{!mdll:crt1%O%s}"
|
||||
|
||||
#undef MATH_LIBRARY
|
||||
#define MATH_LIBRARY "-lcrtdll"
|
||||
@@ -25,7 +25,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
#include "i386/sysv4.h"
|
||||
|
||||
#ifndef VERSION_INFO2
|
||||
#define VERSION_INFO2 "$Revision: 1.5 $"
|
||||
#define VERSION_INFO2 "$Revision: 1.1 $"
|
||||
#endif
|
||||
|
||||
#ifndef VERSION_STRING
|
||||
|
||||
65
gcc/config/i386/osf1-ci.asm
Normal file
65
gcc/config/i386/osf1-ci.asm
Normal file
@@ -0,0 +1,65 @@
|
||||
! crti.s for OSF/1, x86; derived from sol2-ci.asm.
|
||||
|
||||
! Copyright (C) 1993, 1998 Free Software Foundation, Inc.
|
||||
! Written By Fred Fish, Nov 1992
|
||||
!
|
||||
! This file 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, or (at your option) any
|
||||
! later version.
|
||||
!
|
||||
! In addition to the permissions in the GNU General Public License, the
|
||||
! Free Software Foundation gives you unlimited permission to link the
|
||||
! compiled version of this file with other programs, and to distribute
|
||||
! those programs without any restriction coming from the use of this
|
||||
! file. (The General Public License restrictions do apply in other
|
||||
! respects; for example, they cover modification of the file, and
|
||||
! distribution when not linked into another program.)
|
||||
!
|
||||
! This file 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; see the file COPYING. If not, write to
|
||||
! the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
! Boston, MA 02111-1307, USA.
|
||||
!
|
||||
! As a special exception, if you link this library with files
|
||||
! compiled with GCC to produce an executable, this does not cause
|
||||
! the resulting executable to be covered by the GNU General Public License.
|
||||
! This exception does not however invalidate any other reasons why
|
||||
! the executable file might be covered by the GNU General Public License.
|
||||
!
|
||||
|
||||
! This file just supplies labeled starting points for the .init and .fini
|
||||
! sections. It is linked in before the values-Xx.o files and also before
|
||||
! crtbegin.o.
|
||||
|
||||
.file "crti.s"
|
||||
.ident "GNU C crti.s"
|
||||
|
||||
.section .init
|
||||
.globl _init
|
||||
.type _init,@function
|
||||
_init:
|
||||
|
||||
.section .fini
|
||||
.globl _fini
|
||||
.type _fini,@function
|
||||
_fini:
|
||||
|
||||
.globl _init_init_routine
|
||||
.data
|
||||
.align 4
|
||||
.type _init_init_routine,@object
|
||||
.size _init_init_routine,4
|
||||
_init_init_routine:
|
||||
.long _init
|
||||
.globl _init_fini_routine
|
||||
.align 4
|
||||
.type _init_fini_routine,@object
|
||||
.size _init_fini_routine,4
|
||||
_init_fini_routine:
|
||||
.long _fini
|
||||
46
gcc/config/i386/osf1-cn.asm
Normal file
46
gcc/config/i386/osf1-cn.asm
Normal file
@@ -0,0 +1,46 @@
|
||||
! crtn.s for OSF/1, x86; derived from sol2-cn.asm.
|
||||
|
||||
! Copyright (C) 1993, 1998 Free Software Foundation, Inc.
|
||||
! Written By Fred Fish, Nov 1992
|
||||
!
|
||||
! This file 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, or (at your option) any
|
||||
! later version.
|
||||
!
|
||||
! In addition to the permissions in the GNU General Public License, the
|
||||
! Free Software Foundation gives you unlimited permission to link the
|
||||
! compiled version of this file with other programs, and to distribute
|
||||
! those programs without any restriction coming from the use of this
|
||||
! file. (The General Public License restrictions do apply in other
|
||||
! respects; for example, they cover modification of the file, and
|
||||
! distribution when not linked into another program.)
|
||||
!
|
||||
! This file 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; see the file COPYING. If not, write to
|
||||
! the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
! Boston, MA 02111-1307, USA.
|
||||
!
|
||||
! As a special exception, if you link this library with files
|
||||
! compiled with GCC to produce an executable, this does not cause
|
||||
! the resulting executable to be covered by the GNU General Public License.
|
||||
! This exception does not however invalidate any other reasons why
|
||||
! the executable file might be covered by the GNU General Public License.
|
||||
!
|
||||
|
||||
! This file just supplies returns for the .init and .fini sections. It is
|
||||
! linked in after all other files.
|
||||
|
||||
.file "crtn.o"
|
||||
.ident "GNU C crtn.o"
|
||||
|
||||
.section .init
|
||||
ret $0x0
|
||||
|
||||
.section .fini
|
||||
ret $0x0
|
||||
260
gcc/config/i386/osf1elf.h
Normal file
260
gcc/config/i386/osf1elf.h
Normal file
@@ -0,0 +1,260 @@
|
||||
/* OSF/1 1.3 now is compitable with SVR4, so include sysv4.h, and
|
||||
put difference here. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "i386/sysv4.h" /* Base i386 target machine definitions */
|
||||
#define _sys_siglist sys_siglist
|
||||
extern char *sys_siglist[];
|
||||
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (i386 OSF/1)");
|
||||
|
||||
/* WORD_SWITCH_TAKES_ARG defined in svr4 is not correct. We also
|
||||
need an extra -soname */
|
||||
#undef WORD_SWITCH_TAKES_ARG
|
||||
#define WORD_SWITCH_TAKES_ARG(STR) \
|
||||
(DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \
|
||||
|| !strcmp (STR, "Tdata") || !strcmp (STR, "Ttext") \
|
||||
|| !strcmp (STR, "Tbss") || !strcmp (STR, "soname"))
|
||||
|
||||
/* Note, -fpic and -fPIC are equivalent */
|
||||
#undef CPP_SPEC
|
||||
#define CPP_SPEC "\
|
||||
%{fpic: -D__SHARED__} %{fPIC: %{!fpic: -D__SHARED__}} \
|
||||
%{.S: %{!ansi:%{!traditional:%{!traditional-cpp:%{!ftraditional: -traditional}}}}} \
|
||||
%{.S: -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
|
||||
%{.cc: -D__LANGUAGE_C_PLUS_PLUS} \
|
||||
%{.cxx: -D__LANGUAGE_C_PLUS_PLUS} \
|
||||
%{.C: -D__LANGUAGE_C_PLUS_PLUS} \
|
||||
%{.m: -D__LANGUAGE_OBJECTIVE_C} \
|
||||
%{!.S: -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}"
|
||||
|
||||
/* -mmcount or -mno-mcount should be used with -pg or -p */
|
||||
#undef CC1_SPEC
|
||||
#define CC1_SPEC "%{p: %{!mmcount: %{!mno-mcount: -mno-mcount }}} \
|
||||
%{!p: %{pg: %{!mmcount: %{!mno-mcount: -mno-mcount }}}}"
|
||||
|
||||
/* Note, -D__NO_UNDERSCORES__ -D__ELF__ are provided in the older version of
|
||||
OSF/1 gcc. We keep them here, so that old /usr/include/i386/asm.h works.
|
||||
*/
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES \
|
||||
"-D__NO_UNDERSCORES__ -D__ELF__ -DOSF -DOSF1 -Di386 -Dunix -Asystem(xpg4) -Asystem(osf1) -Acpu(i386) -Amachine(i386)"
|
||||
|
||||
/* current OSF/1 doesn't provide separate crti.o and gcrti.o (and also, crtn.o
|
||||
and gcrtn.o) for profile. */
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC "%{!shared: \
|
||||
%{!symbolic: \
|
||||
%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
|
||||
crti.o%s \
|
||||
crtbegin.o%s"
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
|
||||
|
||||
#undef ASM_SPEC
|
||||
#define ASM_SPEC "%{v*: -v}"
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "%{v*: -v} \
|
||||
%{h*} %{z*} \
|
||||
%{dy:-call_shared} %{dn:-static} \
|
||||
%{static:-static} \
|
||||
%{shared:-shared} \
|
||||
%{call_shared:-call_shared} \
|
||||
%{symbolic:-Bsymbolic -shared -call_shared} \
|
||||
%{!dy: %{!dn: %{!static: %{!shared: %{!symbolic: \
|
||||
%{noshrlib: -static } \
|
||||
%{!noshrlib: -call_shared}}}}}}"
|
||||
|
||||
#undef MD_EXEC_PREFIX
|
||||
#define MD_EXEC_PREFIX "/usr/ccs/gcc/"
|
||||
|
||||
#undef MD_STARTFILE_PREFIX
|
||||
#define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
|
||||
|
||||
/* Define this macro meaning that gcc should find the library 'libgcc.a'
|
||||
by hand, rather than passing the argument '-lgcc' to tell the linker
|
||||
to do the search */
|
||||
#define LINK_LIBGCC_SPECIAL
|
||||
|
||||
/* This goes with LINK_LIBGCC_SPECIAL, we need tell libgcc.a differently */
|
||||
#undef LIBGCC_SPEC
|
||||
#define LIBGCC_SPEC "%{!shared:%{!symbolic:libgcc.a%s}}"
|
||||
|
||||
/* A C statement to output assembler commands which will identify the object
|
||||
file as having been compile with GNU CC. We don't need or want this for
|
||||
OSF1. */
|
||||
#undef ASM_IDENTIFY_GCC
|
||||
#define ASM_IDENTIFY_GCC(FILE)
|
||||
|
||||
/* Identify the front-end which produced this file. To keep symbol
|
||||
space down, and not confuse kdb, only do this if the language is
|
||||
not C. */
|
||||
#define ASM_IDENTIFY_LANGUAGE(STREAM) \
|
||||
{ \
|
||||
if (strcmp (lang_identify (), "c") != 0) \
|
||||
output_lang_identify (STREAM); \
|
||||
}
|
||||
|
||||
/* Specify size_t, ptrdiff_t, and wchar_t types. */
|
||||
#undef SIZE_TYPE
|
||||
#undef PTRDIFF_TYPE
|
||||
#undef WCHAR_TYPE
|
||||
#undef WCHAR_TYPE_SIZE
|
||||
|
||||
#define SIZE_TYPE "long unsigned int"
|
||||
#define PTRDIFF_TYPE "int"
|
||||
#define WCHAR_TYPE "unsigned int"
|
||||
#define WCHAR_TYPE_SIZE BITS_PER_WORD
|
||||
|
||||
/* Turn off long double being 96 bits. */
|
||||
#undef LONG_DOUBLE_TYPE_SIZE
|
||||
#define LONG_DOUBLE_TYPE_SIZE 64
|
||||
|
||||
/* Work with OSF/1 profile */
|
||||
#define MASK_NO_MCOUNT 000200000000 /* profiling uses mcount_ptr */
|
||||
|
||||
#define TARGET_MCOUNT ((target_flags & MASK_NO_MCOUNT) == 0)
|
||||
|
||||
#undef SUBTARGET_SWITCHES
|
||||
#define SUBTARGET_SWITCHES \
|
||||
{ "mcount", -MASK_NO_MCOUNT}, \
|
||||
{ "no-mcount", MASK_NO_MCOUNT},
|
||||
|
||||
/* This macro generates the assembly code for function entry.
|
||||
FILE is a stdio stream to output the code to.
|
||||
SIZE is an int: how many units of temporary storage to allocate.
|
||||
Refer to the array `regs_ever_live' to determine which registers
|
||||
to save; `regs_ever_live[I]' is nonzero if register number I
|
||||
is ever used in the function. This macro is responsible for
|
||||
knowing which registers should not be saved even if used.
|
||||
|
||||
We override it here to allow for the new profiling code to go before
|
||||
the prologue and the old mcount code to go after the prologue (and
|
||||
after %ebx has been set up for ELF shared library support). */
|
||||
#if 0
|
||||
#define OSF_PROFILE_BEFORE_PROLOGUE \
|
||||
(!TARGET_MCOUNT \
|
||||
&& !current_function_needs_context \
|
||||
&& (!flag_pic \
|
||||
|| !frame_pointer_needed \
|
||||
|| (!current_function_uses_pic_offset_table \
|
||||
&& !current_function_uses_const_pool)))
|
||||
#else
|
||||
#define OSF_PROFILE_BEFORE_PROLOGUE 0
|
||||
#endif
|
||||
#undef FUNCTION_PROLOGUE
|
||||
#define FUNCTION_PROLOGUE(FILE, SIZE) \
|
||||
do \
|
||||
{ \
|
||||
char *prefix = ""; \
|
||||
char *lprefix = LPREFIX; \
|
||||
int labelno = profile_label_no; \
|
||||
\
|
||||
if (profile_flag && OSF_PROFILE_BEFORE_PROLOGUE) \
|
||||
{ \
|
||||
if (!flag_pic) \
|
||||
{ \
|
||||
fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
|
||||
fprintf (FILE, "\tcall *%s_mcount_ptr\n", prefix); \
|
||||
} \
|
||||
\
|
||||
else \
|
||||
{ \
|
||||
static int call_no = 0; \
|
||||
\
|
||||
fprintf (FILE, "\tcall %sPc%d\n", lprefix, call_no); \
|
||||
fprintf (FILE, "%sPc%d:\tpopl %%eax\n", lprefix, call_no); \
|
||||
fprintf (FILE, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-%sPc%d],%%eax\n", \
|
||||
lprefix, call_no++); \
|
||||
fprintf (FILE, "\tleal %sP%d@GOTOFF(%%eax),%%edx\n", \
|
||||
lprefix, labelno); \
|
||||
fprintf (FILE, "\tmovl %s_mcount_ptr@GOT(%%eax),%%eax\n", \
|
||||
prefix); \
|
||||
fprintf (FILE, "\tcall *(%%eax)\n"); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
function_prologue (FILE, SIZE); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* A C statement or compound statement to output to FILE some assembler code to
|
||||
call the profiling subroutine `mcount'. Before calling, the assembler code
|
||||
must load the address of a counter variable into a register where `mcount'
|
||||
expects to find the address. The name of this variable is `LP' followed by
|
||||
the number LABELNO, so you would generate the name using `LP%d' in a
|
||||
`fprintf'.
|
||||
|
||||
The details of how the address should be passed to `mcount' are determined
|
||||
by your operating system environment, not by GNU CC. To figure them out,
|
||||
compile a small program for profiling using the system's installed C
|
||||
compiler and look at the assembler code that results. */
|
||||
|
||||
#undef FUNCTION_PROFILER
|
||||
#define FUNCTION_PROFILER(FILE, LABELNO) \
|
||||
do \
|
||||
{ \
|
||||
if (!OSF_PROFILE_BEFORE_PROLOGUE) \
|
||||
{ \
|
||||
char *prefix = ""; \
|
||||
char *lprefix = LPREFIX; \
|
||||
int labelno = LABELNO; \
|
||||
\
|
||||
/* Note that OSF/rose blew it in terms of calling mcount, \
|
||||
since OSF/rose prepends a leading underscore, but mcount's \
|
||||
doesn't. At present, we keep this kludge for ELF as well \
|
||||
to allow old kernels to build profiling. */ \
|
||||
\
|
||||
if (flag_pic \
|
||||
&& !current_function_uses_pic_offset_table \
|
||||
&& !current_function_uses_const_pool) \
|
||||
abort (); \
|
||||
\
|
||||
if (TARGET_MCOUNT && flag_pic) \
|
||||
{ \
|
||||
fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
|
||||
lprefix, labelno); \
|
||||
fprintf (FILE, "\tcall *%smcount@GOT(%%ebx)\n", prefix); \
|
||||
} \
|
||||
\
|
||||
else if (TARGET_MCOUNT) \
|
||||
{ \
|
||||
fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
|
||||
fprintf (FILE, "\tcall %smcount\n", prefix); \
|
||||
} \
|
||||
\
|
||||
else if (flag_pic && frame_pointer_needed) \
|
||||
{ \
|
||||
fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \
|
||||
fprintf (FILE, "\tpushl %%ecx\n"); \
|
||||
fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
|
||||
lprefix, labelno); \
|
||||
fprintf (FILE, "\tmovl _mcount_ptr@GOT(%%ebx),%%eax\n"); \
|
||||
fprintf (FILE, "\tcall *(%%eax)\n"); \
|
||||
fprintf (FILE, "\tpopl %%eax\n"); \
|
||||
} \
|
||||
\
|
||||
else if (frame_pointer_needed) \
|
||||
{ \
|
||||
fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \
|
||||
fprintf (FILE, "\tpushl %%ecx\n"); \
|
||||
fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
|
||||
fprintf (FILE, "\tcall *_mcount_ptr\n"); \
|
||||
fprintf (FILE, "\tpopl %%eax\n"); \
|
||||
} \
|
||||
\
|
||||
else \
|
||||
abort (); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#if defined (CROSS_COMPILE) && defined (HOST_BITS_PER_INT) && defined (HOST_BITS_PER_LONG) && defined (HOST_BITS_PER_LONGLONG)
|
||||
#if (HOST_BITS_PER_INT==32) && (HOST_BITS_PER_LONG==64) && (HOST_BITS_PER_LONGLONG==64)
|
||||
#define REAL_ARITHMETIC
|
||||
#endif
|
||||
#endif
|
||||
7
gcc/config/i386/osf1elfgdb.h
Normal file
7
gcc/config/i386/osf1elfgdb.h
Normal file
@@ -0,0 +1,7 @@
|
||||
/* Target definitions for GNU compiler for Intel 80386 running OSF/1 1.3+
|
||||
with gas and gdb. */
|
||||
|
||||
/* Use stabs instead of DWARF debug format. */
|
||||
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
|
||||
|
||||
#include "i386/osf1elf.h"
|
||||
169
gcc/config/i386/rtemself.h
Normal file
169
gcc/config/i386/rtemself.h
Normal file
@@ -0,0 +1,169 @@
|
||||
/* Definitions for Intel 386 running Linux-based GNU systems with ELF format.
|
||||
Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Eric Youngdale.
|
||||
Modified for stabs-in-ELF by H.J. Lu.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define LINUX_DEFAULT_ELF
|
||||
|
||||
/* A lie, I guess, but the general idea behind linux/ELF is that we are
|
||||
supposed to be outputting something that will assemble under SVr4.
|
||||
This gets us pretty close. */
|
||||
#include <i386/i386.h> /* Base i386 target machine definitions */
|
||||
#include <i386/att.h> /* Use the i386 AT&T assembler syntax */
|
||||
#include <linux.h> /* some common stuff */
|
||||
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (i386 RTEMS with ELF)");
|
||||
|
||||
/* The svr4 ABI for the i386 says that records and unions are returned
|
||||
in memory. */
|
||||
#undef DEFAULT_PCC_STRUCT_RETURN
|
||||
#define DEFAULT_PCC_STRUCT_RETURN 1
|
||||
|
||||
/* This is how to output an element of a case-vector that is relative.
|
||||
This is only used for PIC code. See comments by the `casesi' insn in
|
||||
i386.md for an explanation of the expression this outputs. */
|
||||
#undef ASM_OUTPUT_ADDR_DIFF_ELT
|
||||
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
|
||||
fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
|
||||
|
||||
/* Indicate that jump tables go in the text section. This is
|
||||
necessary when compiling PIC code. */
|
||||
#define JUMP_TABLES_IN_TEXT_SECTION
|
||||
|
||||
/* Copy this from the svr4 specifications... */
|
||||
/* Define the register numbers to be used in Dwarf debugging information.
|
||||
The SVR4 reference port C compiler uses the following register numbers
|
||||
in its Dwarf output code:
|
||||
0 for %eax (gnu regno = 0)
|
||||
1 for %ecx (gnu regno = 2)
|
||||
2 for %edx (gnu regno = 1)
|
||||
3 for %ebx (gnu regno = 3)
|
||||
4 for %esp (gnu regno = 7)
|
||||
5 for %ebp (gnu regno = 6)
|
||||
6 for %esi (gnu regno = 4)
|
||||
7 for %edi (gnu regno = 5)
|
||||
The following three DWARF register numbers are never generated by
|
||||
the SVR4 C compiler or by the GNU compilers, but SDB on x86/svr4
|
||||
believes these numbers have these meanings.
|
||||
8 for %eip (no gnu equivalent)
|
||||
9 for %eflags (no gnu equivalent)
|
||||
10 for %trapno (no gnu equivalent)
|
||||
It is not at all clear how we should number the FP stack registers
|
||||
for the x86 architecture. If the version of SDB on x86/svr4 were
|
||||
a bit less brain dead with respect to floating-point then we would
|
||||
have a precedent to follow with respect to DWARF register numbers
|
||||
for x86 FP registers, but the SDB on x86/svr4 is so completely
|
||||
broken with respect to FP registers that it is hardly worth thinking
|
||||
of it as something to strive for compatibility with.
|
||||
The version of x86/svr4 SDB I have at the moment does (partially)
|
||||
seem to believe that DWARF register number 11 is associated with
|
||||
the x86 register %st(0), but that's about all. Higher DWARF
|
||||
register numbers don't seem to be associated with anything in
|
||||
particular, and even for DWARF regno 11, SDB only seems to under-
|
||||
stand that it should say that a variable lives in %st(0) (when
|
||||
asked via an `=' command) if we said it was in DWARF regno 11,
|
||||
but SDB still prints garbage when asked for the value of the
|
||||
variable in question (via a `/' command).
|
||||
(Also note that the labels SDB prints for various FP stack regs
|
||||
when doing an `x' command are all wrong.)
|
||||
Note that these problems generally don't affect the native SVR4
|
||||
C compiler because it doesn't allow the use of -O with -g and
|
||||
because when it is *not* optimizing, it allocates a memory
|
||||
location for each floating-point variable, and the memory
|
||||
location is what gets described in the DWARF AT_location
|
||||
attribute for the variable in question.
|
||||
Regardless of the severe mental illness of the x86/svr4 SDB, we
|
||||
do something sensible here and we use the following DWARF
|
||||
register numbers. Note that these are all stack-top-relative
|
||||
numbers.
|
||||
11 for %st(0) (gnu regno = 8)
|
||||
12 for %st(1) (gnu regno = 9)
|
||||
13 for %st(2) (gnu regno = 10)
|
||||
14 for %st(3) (gnu regno = 11)
|
||||
15 for %st(4) (gnu regno = 12)
|
||||
16 for %st(5) (gnu regno = 13)
|
||||
17 for %st(6) (gnu regno = 14)
|
||||
18 for %st(7) (gnu regno = 15)
|
||||
*/
|
||||
#undef DBX_REGISTER_NUMBER
|
||||
#define DBX_REGISTER_NUMBER(n) \
|
||||
((n) == 0 ? 0 \
|
||||
: (n) == 1 ? 2 \
|
||||
: (n) == 2 ? 1 \
|
||||
: (n) == 3 ? 3 \
|
||||
: (n) == 4 ? 6 \
|
||||
: (n) == 5 ? 7 \
|
||||
: (n) == 6 ? 5 \
|
||||
: (n) == 7 ? 4 \
|
||||
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
|
||||
: (-1))
|
||||
|
||||
/* Output assembler code to FILE to increment profiler label # LABELNO
|
||||
for profiling a function entry. */
|
||||
|
||||
#undef FUNCTION_PROFILER
|
||||
#define FUNCTION_PROFILER(FILE, LABELNO) \
|
||||
{ \
|
||||
if (flag_pic) \
|
||||
{ \
|
||||
fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \
|
||||
LPREFIX, (LABELNO)); \
|
||||
fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \
|
||||
fprintf (FILE, "\tcall mcount\n"); \
|
||||
} \
|
||||
}
|
||||
|
||||
#undef SIZE_TYPE
|
||||
#define SIZE_TYPE "unsigned int"
|
||||
|
||||
#undef PTRDIFF_TYPE
|
||||
#define PTRDIFF_TYPE "int"
|
||||
|
||||
#undef WCHAR_TYPE
|
||||
#define WCHAR_TYPE "long int"
|
||||
|
||||
#undef WCHAR_TYPE_SIZE
|
||||
#define WCHAR_TYPE_SIZE BITS_PER_WORD
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-Di386 -Drtems -D__rtems__ \
|
||||
-Asystem(rtems) -Acpu(i386) -Amachine(i386)"
|
||||
|
||||
/* Get perform_* macros to build libgcc.a. */
|
||||
#include "i386/perform.h"
|
||||
|
||||
/* A C statement (sans semicolon) to output to the stdio stream
|
||||
FILE the assembler definition of uninitialized global DECL named
|
||||
NAME whose size is SIZE bytes and alignment is ALIGN bytes.
|
||||
Try to use asm_output_aligned_bss to implement this macro. */
|
||||
|
||||
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
|
||||
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC "crt0.o%s"
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
|
||||
18
gcc/config/i386/t-osf1elf
Normal file
18
gcc/config/i386/t-osf1elf
Normal file
@@ -0,0 +1,18 @@
|
||||
# Assemble startup files.
|
||||
crti.o: $(srcdir)/config/i386/osf1-ci.asm $(GCC_PASSES)
|
||||
sed -e '/^!/d' <$(srcdir)/config/i386/osf1-ci.asm >crti.s
|
||||
$(GCC_FOR_TARGET) -c -o crti.o crti.s
|
||||
crtn.o: $(srcdir)/config/i386/osf1-cn.asm $(GCC_PASSES)
|
||||
sed -e '/^!/d' <$(srcdir)/config/i386/osf1-cn.asm >crtn.s
|
||||
$(GCC_FOR_TARGET) -c -o crtn.o crtn.s
|
||||
|
||||
# The pushl in CTOR initialization interferes with frame pointer elimination.
|
||||
|
||||
# We need to use -fPIC when we are using gcc to compile the routines in
|
||||
# crtstuff.c. This is only really needed when we are going to use gcc/g++
|
||||
# to produce a shared library, but since we don't know ahead of time when
|
||||
# we will be doing that, we just always use -fPIC when compiling the
|
||||
# routines in crtstuff.c.
|
||||
|
||||
CRTSTUFF_T_CFLAGS = -fPIC -fno-omit-frame-pointer
|
||||
TARGET_LIBGCC2_CFLAGS = -fPIC
|
||||
8
gcc/config/i386/x-osf1elf
Normal file
8
gcc/config/i386/x-osf1elf
Normal file
@@ -0,0 +1,8 @@
|
||||
# Defaults for OSF/1 1.3+
|
||||
CC = $(OLDCC)
|
||||
CLIB = -lld
|
||||
INSTALL = installbsd -c
|
||||
OLDCC = /usr/ccs/gcc/gcc
|
||||
X_CFLAGS = -static
|
||||
|
||||
# FIXPROTO_DEFINES = -D_XOPEN_SOURCE
|
||||
6
gcc/config/i386/xm-osf1elf.h
Normal file
6
gcc/config/i386/xm-osf1elf.h
Normal file
@@ -0,0 +1,6 @@
|
||||
/* Configuration for GCC for Intel i386 running OSF/1 1.3. */
|
||||
|
||||
#ifndef HZ
|
||||
#include <machine/machtime.h>
|
||||
#define HZ DEFAULT_CLK_TCK
|
||||
#endif
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Definitions of target machine for GNU compiler, for Intel 860.
|
||||
Copyright (C) 1989, 1991, 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
Hacked substantially by Ron Guilmette (rfg@segfault.us.com) to cater to
|
||||
Copyright (C) 1989, 91, 93, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Hacked substantially by Ron Guilmette (rfg@monkeys.com) to cater to
|
||||
the whims of the System V Release 4 assembler.
|
||||
|
||||
This file is part of GNU CC.
|
||||
@@ -1369,7 +1369,7 @@ extern unsigned long sfmode_constant_to_ulong ();
|
||||
stack (where the i860 calling conventions require structs &
|
||||
unions to be passed). */
|
||||
|
||||
#define FLOAT_TYPE_VALUE float
|
||||
#define FLOAT_VALUE_TYPE float
|
||||
#define INTIFY(FLOATVAL) (FLOATVAL)
|
||||
#define FLOATIFY(INTVAL) (INTVAL)
|
||||
#define FLOAT_ARG_TYPE float
|
||||
|
||||
@@ -97,7 +97,7 @@ LOCAL_LABEL(isatty):
|
||||
|
||||
#ifdef STRING
|
||||
SECTION (.comment)
|
||||
STRING ("$Id: crt0.S,v 1.6 1995/12/07 17:17:47 manfred Exp $\n")
|
||||
STRING ("$Id: mot3300-crt0.S,v 1.1 1997/08/11 15:57:32 law Exp $\n")
|
||||
STRING ("Contributed by manfred@lts.sel.alcatel.de (Manfred Hollstein, Germany)\n")
|
||||
#else
|
||||
byte 'C,'o,'n,'t,'r,'i,'b,'u,'t,'e,'d,' ,'b,'y
|
||||
|
||||
@@ -143,7 +143,7 @@ LOCAL_LABEL(endofstart):
|
||||
|
||||
#ifdef STRING
|
||||
SECTION (.comment)
|
||||
STRING ("$Id: mcrt0.S,v 1.5 1995/12/07 17:23:39 manfred Exp $\n")
|
||||
STRING ("$Id: mot3300Mcrt0.S,v 1.1 1997/08/11 15:57:32 law Exp $\n")
|
||||
STRING ("Contributed by manfred@lts.sel.alcatel.de (Manfred Hollstein, Germany)\n")
|
||||
#else
|
||||
byte 'C,'o,'n,'t,'r,'i,'b,'u,'t,'e,'d,' ,'b,'y
|
||||
|
||||
@@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA. */
|
||||
(TARGET_SVR4 ? DWARF_DEBUG : SDB_DEBUG)
|
||||
|
||||
#ifndef VERSION_INFO2
|
||||
#define VERSION_INFO2 "$Revision: 1.23 $"
|
||||
#define VERSION_INFO2 "$Revision: 1.24 $"
|
||||
#endif
|
||||
#ifndef NO_BUGS
|
||||
#define AS_BUG_IMMEDIATE_LABEL
|
||||
|
||||
@@ -198,13 +198,13 @@ extern char * reg_names[];
|
||||
Redefined in sysv4.h, and luna.h. */
|
||||
#define VERSION_INFO1 "m88k, "
|
||||
#ifndef VERSION_INFO2
|
||||
#define VERSION_INFO2 "$Revision: 1.72 $"
|
||||
#define VERSION_INFO2 "$Revision: 1.1 $"
|
||||
#endif
|
||||
|
||||
#ifndef VERSION_STRING
|
||||
#define VERSION_STRING version_string
|
||||
#ifdef __STDC__
|
||||
#define TM_RCS_ID "@(#)" __FILE__ " $Revision: 1.72 $ " __DATE__
|
||||
#define TM_RCS_ID "@(#)" __FILE__ " $Revision: 1.1 $ " __DATE__
|
||||
#else
|
||||
#define TM_RCS_ID "$What: <@(#) m88k.h,v 1.1.1.2.2.2> $"
|
||||
#endif /* __STDC__ */
|
||||
|
||||
71
gcc/config/mips/r3900.h
Normal file
71
gcc/config/mips/r3900.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/* Definitions of MIPS sub target machine for GNU compiler.
|
||||
Toshiba r3900. You should include mips.h after this.
|
||||
|
||||
Copyright (C) 1989, 90-6, 1997 Free Software Foundation, Inc.
|
||||
Contributed by Gavin Koch (gavin@cygnus.com).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define SUBTARGET_CPP_SPEC "\
|
||||
%{!mabi=32: %{!mabi=n32: %{!mabi=64: -D__mips_eabi}}} \
|
||||
%{!msingle-float:-D__mips_soft_float} \
|
||||
%{mhard-float:%e-mhard-float not supported.} \
|
||||
%{msingle-float:%{msoft-float: \
|
||||
%e-msingle-float and -msoft-float can not both be specified.}}"
|
||||
|
||||
/* The following is needed because -mips3 and -mips4 set gp64 which in
|
||||
combination with abi=eabi, causes long64 to be set. */
|
||||
#define SUBTARGET_CPP_SIZE_SPEC "\
|
||||
%{mips3:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
|
||||
%{mips4:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int} \
|
||||
%{!mips3:%{!mips4:%{!m4650:\
|
||||
-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int}}} "
|
||||
|
||||
/* by default (if not mips-something-else) produce code for the r3900 */
|
||||
#define SUBTARGET_CC1_SPEC "\
|
||||
%{mhard-float:%e-mhard-float not supported.} \
|
||||
%{msingle-float:%{msoft-float: \
|
||||
%e-msingle-float and -msoft-float can not both be specified.}}"
|
||||
|
||||
#define TARGET_DEFAULT (MASK_SOFT_FLOAT | MASK_MIPS3900)
|
||||
#define MIPS_CPU_STRING_DEFAULT "R3900"
|
||||
#define MIPS_ISA_DEFAULT 1
|
||||
|
||||
#define MULTILIB_DEFAULTS { "EB", "mips1", "msoft-float" }
|
||||
|
||||
/* We use the MIPS EABI by default. */
|
||||
#define MIPS_ABI_DEFAULT ABI_EABI
|
||||
|
||||
|
||||
/* Debugging */
|
||||
|
||||
#define DWARF2_DEBUGGING_INFO
|
||||
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
||||
|
||||
/* For the 'preferred' cases ("gN" and "ggdbN") we need to tell the
|
||||
gnu assembler "dwarf-2" */
|
||||
|
||||
#define SUBTARGET_ASM_DEBUGGING_SPEC "\
|
||||
%{!mmips-as: \
|
||||
%{g:-gdwarf-2} %{g0:-gdwarf-2} %{g1:-gdwarf-2} %{g2:-gdwarf-2} %{g3:-gdwarf-2} \
|
||||
%{ggdb:-gdwarf-2} %{ggdb0:-gdwarf-2} %{ggdb1:-gdwarf-2} %{ggdb2:-gdwarf-2} %{ggdb3:-gdwarf-2} \
|
||||
%{gdwarf-2*:-gdwarf-2}} \
|
||||
%{gstabs:-g} %{gstabs0:-g0} %{gstabs1:-g1} %{gstabs2:-g2} %{gstabs3:-g3} \
|
||||
%{gstabs+:-g} %{gstabs+0:-g0} %{gstabs+1:-g1} %{gstabs+2:-g2} %{gstabs+3:-g3} \
|
||||
%{gcoff:-g} %{gcoff0:-g0} %{gcoff1:-g1} %{gcoff2:-g2} %{gcoff3:-g3}"
|
||||
|
||||
35
gcc/config/sh/rtems.h
Normal file
35
gcc/config/sh/rtems.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/* Definitions for rtems targetting a SH using elf.
|
||||
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
Contributed by Joel Sherrill (joel@OARcorp.com).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "sh/elf.h"
|
||||
|
||||
/* Specify predefined symbols in preprocessor. */
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-D__sh__ -D__ELF__ -Drtems -D__rtems__ \
|
||||
-Asystem(rtems) -Acpu(sh) -Amachine(sh)"
|
||||
|
||||
#undef SUBTARGET_SWITCHES
|
||||
#define SUBTARGET_SWITCHES \
|
||||
{ "rtems", 0 },
|
||||
|
||||
/* end of sparc/rtems.h */
|
||||
42
gcc/config/sparc/elf.h
Normal file
42
gcc/config/sparc/elf.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/* Definitions of target machine for GNU compiler,
|
||||
for SPARC running in an embedded environment using the ELF file format.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "sol2.h"
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-Dsparc -D__elf__ -Acpu(sparc) -Amachine(sparc)"
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s"
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
|
||||
|
||||
/* Use the default. */
|
||||
#undef LINK_SPEC
|
||||
|
||||
/* Don't set the target flags, this is done by the linker script */
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC ""
|
||||
|
||||
/* FIXME: until fixed */
|
||||
#undef LONG_DOUBLE_TYPE_SIZE
|
||||
#define LONG_DOUBLE_TYPE_SIZE 64
|
||||
33
gcc/config/sparc/hal.h
Normal file
33
gcc/config/sparc/hal.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/* Definitions of target machine for GNU compiler, for HAL
|
||||
SPARC running Solaris 2 HALOS
|
||||
Copyright 1998 Free Software Foundation, Inc.
|
||||
Contributed by Carol LePage (carolo@hal.com)
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Need different command line for assembler */
|
||||
|
||||
#undef ASM_SPEC
|
||||
#define ASM_SPEC \
|
||||
"%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -e1 \
|
||||
%{fpic:-K PIC} %{fPIC:-K PIC}"
|
||||
|
||||
/* Need DWARF for debuggers. */
|
||||
|
||||
#undef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG
|
||||
238
gcc/config/sparc/linux64.h
Normal file
238
gcc/config/sparc/linux64.h
Normal file
@@ -0,0 +1,238 @@
|
||||
/* Definitions for 64-bit SPARC running Linux with ELF
|
||||
Copyright 1996, 1997 Free Software Foundation, Inc.
|
||||
Contributed by David S. Miller (davem@caip.rutgers.edu)
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define LINUX_DEFAULT_ELF
|
||||
|
||||
/* This is a v9 only compiler. -mv8 is not expected to work. If you want
|
||||
a v8/v9 compiler, this isn't the place to do it. */
|
||||
|
||||
#define SPARC_V9 1 /* See sparc.h. */
|
||||
#define SPARC_ARCH64 1
|
||||
|
||||
/* Don't assume anything about the header files. */
|
||||
#define NO_IMPLICIT_EXTERN_C
|
||||
|
||||
#undef HAVE_ATEXIT
|
||||
#define HAVE_ATEXIT
|
||||
|
||||
#include <sparc/sysv4.h>
|
||||
|
||||
#undef MD_EXEC_PREFIX
|
||||
#undef MD_STARTFILE_PREFIX
|
||||
|
||||
/* Output at beginning of assembler file. */
|
||||
/* The .file command should always begin the output. */
|
||||
#undef ASM_FILE_START
|
||||
#define ASM_FILE_START(FILE) \
|
||||
do { \
|
||||
output_file_directive (FILE, main_input_filename); \
|
||||
fprintf (FILE, "\t.version\t\"01.01\"\n"); \
|
||||
} while (0)
|
||||
|
||||
#undef ASM_DEFAULT_SPEC
|
||||
#define ASM_DEFAULT_SPEC "-Av9a"
|
||||
|
||||
#undef LIBGCC_SPEC
|
||||
#define LIBGCC_SPEC \
|
||||
"%{!shared:-lgcc}"
|
||||
|
||||
/* Provide a STARTFILE_SPEC appropriate for Linux. Here we add
|
||||
the Linux magical crtbegin.o file (see crtstuff.c) which
|
||||
provides part of the support for getting C++ file-scope static
|
||||
object constructed before entering `main'. */
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC \
|
||||
"%{!shared: \
|
||||
%{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\
|
||||
crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
|
||||
|
||||
/* Provide a ENDFILE_SPEC appropriate for Linux. Here we tack on
|
||||
the Linux magical crtend.o file (see crtstuff.c) which
|
||||
provides part of the support for getting C++ file-scope static
|
||||
object constructed before entering `main', followed by a normal
|
||||
Linux "finalizer" file, `crtn.o'. */
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
#define ENDFILE_SPEC \
|
||||
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
|
||||
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (sparc64 Linux/ELF)");
|
||||
|
||||
/* A v9 compiler with stack-bias, 32 bit integers, 64 bit longs and
|
||||
64 bit pointers, in a Medium/Anywhere code model environment. */
|
||||
|
||||
#undef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT \
|
||||
(MASK_V9 + MASK_ARCH64 + MASK_LONG64 + MASK_PTR64 /* + MASK_HARD_QUAD */ \
|
||||
+ MASK_STACK_BIAS + MASK_MEDANY + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU)
|
||||
|
||||
#undef SIZE_TYPE
|
||||
#define SIZE_TYPE "long long unsigned int"
|
||||
|
||||
#undef PTRDIFF_TYPE
|
||||
#define PTRDIFF_TYPE "long long int"
|
||||
|
||||
#undef WCHAR_TYPE
|
||||
#define WCHAR_TYPE "long int"
|
||||
|
||||
#undef WCHAR_TYPE_SIZE
|
||||
#define WCHAR_TYPE_SIZE BITS_PER_WORD
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-D__sparc__ -D__sparc__ -D__sparc_v9__ -D__arch64__ -D__ELF__ -Dunix -Dsparc -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(sparc) -Amachine(sparc)"
|
||||
|
||||
#undef CPP_SPEC
|
||||
#define CPP_SPEC "\
|
||||
%{fPIC:-D__PIC__ -D__pic__} \
|
||||
%{fpic:-D__PIC__ -D__pic__} \
|
||||
%{mint64:-D__INT_MAX__=9223372036854775807LL -D__LONG_MAX__=9223372036854775807LL} \
|
||||
%{mlong64:-D__LONG_MAX__=9223372036854775807LL} \
|
||||
%{mlittle-endian:-D__LITTLE_ENDIAN__} \
|
||||
%{msparclite:-D__sparclite__} \
|
||||
%{mv8:-D__sparc_v8__} \
|
||||
%{msupersparc:-D__supersparc__ -D__sparc_v8__} \
|
||||
%{posix:-D_POSIX_SOURCE} \
|
||||
"
|
||||
/* We no longer link with libc_p.a or libg.a by default. If you
|
||||
* want to profile or debug the Linux C library, please add
|
||||
* -lc_p or -ggdb to LDFLAGS at the link time, respectively.
|
||||
*/
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC \
|
||||
"%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
|
||||
%{!ggdb:-lc} %{ggdb:-lg}}"
|
||||
|
||||
/* Provide a LINK_SPEC appropriate for Linux. Here we provide support
|
||||
for the special GCC options -static and -shared, which allow us to
|
||||
link things in one of these three modes by applying the appropriate
|
||||
combinations of options at link-time. We like to support here for
|
||||
as many of the other GNU linker options as possible. But I don't
|
||||
have the time to search for those flags. I am sure how to add
|
||||
support for -soname shared_object_name. H.J.
|
||||
|
||||
I took out %{v:%{!V:-V}}. It is too much :-(. They can use
|
||||
-Wl,-V.
|
||||
|
||||
When the -shared link option is used a final link is not being
|
||||
done. */
|
||||
|
||||
/* If ELF is the default format, we should not use /lib/elf. */
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib %{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!ibcs: \
|
||||
%{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
|
||||
%{static:-static}}} \
|
||||
%{mlittle-endian:-EL} \
|
||||
"
|
||||
|
||||
/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
|
||||
It's safe to pass -s always, even if -g is not used. */
|
||||
#undef ASM_SPEC
|
||||
#define ASM_SPEC "\
|
||||
%{V} \
|
||||
%{v:%{!V:-V}} \
|
||||
%{!Qn:-Qy} \
|
||||
%{n} \
|
||||
%{T} \
|
||||
%{Ym,*} \
|
||||
%{Wa,*:%*} \
|
||||
-s %{fpic:-K PIC} %{fPIC:-K PIC} \
|
||||
%{mlittle-endian:-EL} \
|
||||
%(asm_cpu) \
|
||||
"
|
||||
|
||||
/* Same as sparc.h */
|
||||
#undef DBX_REGISTER_NUMBER
|
||||
#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
|
||||
|
||||
/* System V Release 4 uses DWARF debugging info. Buf DWARF1 doesn't do
|
||||
64-bit anything, so we use DWARF2. */
|
||||
|
||||
#undef DWARF2_DEBUGGING_INFO
|
||||
#undef DWARF_DEBUGGING_INFO
|
||||
#undef DBX_DEBUGGING_INFO
|
||||
#define DWARF2_DEBUGGING_INFO
|
||||
#define DBX_DEBUGGING_INFO
|
||||
|
||||
#undef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_LOCAL
|
||||
#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
|
||||
do { \
|
||||
fputs ("\t.local\t", (FILE)); \
|
||||
assemble_name ((FILE), (NAME)); \
|
||||
putc ('\n', (FILE)); \
|
||||
ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
|
||||
} while (0)
|
||||
|
||||
#undef COMMON_ASM_OP
|
||||
#define COMMON_ASM_OP "\t.common"
|
||||
|
||||
/* This is how to output a definition of an internal numbered label where
|
||||
PREFIX is the class of label and NUM is the number within the class. */
|
||||
|
||||
#undef ASM_OUTPUT_INTERNAL_LABEL
|
||||
#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
|
||||
fprintf (FILE, ".L%s%d:\n", PREFIX, NUM)
|
||||
|
||||
/* This is how to output a reference to an internal numbered label where
|
||||
PREFIX is the class of label and NUM is the number within the class. */
|
||||
|
||||
#undef ASM_OUTPUT_INTERNAL_LABELREF
|
||||
#define ASM_OUTPUT_INTERNAL_LABELREF(FILE,PREFIX,NUM) \
|
||||
fprintf (FILE, ".L%s%d", PREFIX, NUM)
|
||||
|
||||
/* This is how to store into the string LABEL
|
||||
the symbol_ref name of an internal numbered label where
|
||||
PREFIX is the class of label and NUM is the number within the class.
|
||||
This is suitable for output with `assemble_name'. */
|
||||
|
||||
#undef ASM_GENERATE_INTERNAL_LABEL
|
||||
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
|
||||
sprintf (LABEL, "*.L%s%d", PREFIX, NUM)
|
||||
|
||||
/* Stabs doesn't use this, and it confuses a simulator. */
|
||||
/* ??? Need to see what DWARF needs, if anything. */
|
||||
#undef ASM_IDENTIFY_GCC
|
||||
#define ASM_IDENTIFY_GCC(FILE)
|
||||
|
||||
/* Define the names of various pseudo-ops used by the Sparc/svr4 assembler.
|
||||
??? If ints are 64 bits then UNALIGNED_INT_ASM_OP (defined elsewhere) is
|
||||
misnamed. These should all refer to explicit sizes (half/word/xword?),
|
||||
anything other than short/int/long/etc. */
|
||||
|
||||
#define UNALIGNED_DOUBLE_INT_ASM_OP ".uaxword"
|
||||
|
||||
/* DWARF bits. */
|
||||
|
||||
/* Follow Irix 6 and not the Dwarf2 draft in using 64-bit offsets.
|
||||
Obviously the Dwarf2 folks havn't tried to actually build systems
|
||||
with their spec. On a 64-bit system, only 64-bit relocs become
|
||||
RELATIVE relocations. */
|
||||
|
||||
/* #define DWARF_OFFSET_SIZE PTR_SIZE */
|
||||
18
gcc/config/sparc/sol2-sld.h
Normal file
18
gcc/config/sparc/sol2-sld.h
Normal file
@@ -0,0 +1,18 @@
|
||||
/* Definitions of target machine for GNU compiler, for SPARC running Solaris 2
|
||||
using the system linker. */
|
||||
|
||||
#include "sparc/sol2.h"
|
||||
|
||||
/* Disable any support for DWARF and DWARF2 if we are using the system linker.
|
||||
At least up through Solaris 2.6,
|
||||
the system linker does not work with DWARF or DWARF2,
|
||||
since it does not have working support for relocations
|
||||
to unaligned data. */
|
||||
|
||||
#ifdef DWARF2_DEBUGGING_INFO
|
||||
#undef DWARF2_DEBUGGING_INFO
|
||||
#endif
|
||||
|
||||
#ifdef DWARF_DEBUGGING_INFO
|
||||
#undef DWARF_DEBUGGING_INFO
|
||||
#endif
|
||||
27
gcc/config/sparc/sun4gas.h
Normal file
27
gcc/config/sparc/sun4gas.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/* Definitions of target machine for GNU compiler, for SunOS 4.x with gas
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* gas supports unaligned data. */
|
||||
#define UNALIGNED_DOUBLE_INT_ASM_OP ".uaxword"
|
||||
#define UNALIGNED_INT_ASM_OP ".uaword"
|
||||
#define UNALIGNED_SHORT_ASM_OP ".uahalf"
|
||||
|
||||
/* defaults.h will define DWARF2_UNWIND_INFO for us. */
|
||||
#undef DWARF2_UNWIND_INFO
|
||||
39
gcc/config/sparc/t-elf
Normal file
39
gcc/config/sparc/t-elf
Normal file
@@ -0,0 +1,39 @@
|
||||
# we need to supply our own assembly versions of libgcc1.c files,
|
||||
# since the user may not have native 'cc' available
|
||||
|
||||
CROSS_LIBGCC1 = libgcc1-asm.a
|
||||
LIB1ASMSRC = sparc/lb1spc.asm
|
||||
LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3
|
||||
|
||||
# crt0 is built elsewhere
|
||||
LIBGCC1_TEST =
|
||||
|
||||
# These are really part of libgcc1, but this will cause them to be
|
||||
# built correctly, so...
|
||||
|
||||
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
|
||||
|
||||
dp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c > dp-bit.c
|
||||
|
||||
fp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
echo '#define FLOAT' > fp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
|
||||
|
||||
# MULTILIB_OPTIONS should have msparclite too, but we'd have to make
|
||||
# gas build...
|
||||
#MULTILIB_OPTIONS = msoft-float mcpu=v8
|
||||
MULTILIB_OPTIONS = msoft-float
|
||||
#MULTILIB_DIRNAMES = soft v8
|
||||
MULTILIB_DIRNAMES = soft
|
||||
#MULTILIB_MATCHES = msoft-float=mno-fpu mcpu?v8=mv8
|
||||
MULTILIB_MATCHES = msoft-float=mno-fpu
|
||||
|
||||
LIBGCC = stmp-multilib
|
||||
INSTALL_LIBGCC = install-multilib
|
||||
|
||||
# Assemble startup files.
|
||||
crti.o: $(srcdir)/config/sparc/sol2-ci.asm $(GCC_PASSES)
|
||||
$(GCC_FOR_TARGET) -c -o crti.o -x assembler $(srcdir)/config/sparc/sol2-ci.asm
|
||||
crtn.o: $(srcdir)/config/sparc/sol2-cn.asm $(GCC_PASSES)
|
||||
$(GCC_FOR_TARGET) -c -o crtn.o -x assembler $(srcdir)/config/sparc/sol2-cn.asm
|
||||
2
gcc/config/sparc/t-halos
Normal file
2
gcc/config/sparc/t-halos
Normal file
@@ -0,0 +1,2 @@
|
||||
# For a native HALOS compile, we need to set -e1 for the assembler
|
||||
AS=as -e1
|
||||
25
gcc/config/sparc/xm-sp64.h
Normal file
25
gcc/config/sparc/xm-sp64.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/* Configuration for GCC for Sparc v9 running 64-bit native.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <sparc/xm-sparc.h>
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#undef HOST_BITS_PER_LONG
|
||||
#define HOST_BITS_PER_LONG 64
|
||||
1271
gcc/config/v850/lib1funcs.asm
Normal file
1271
gcc/config/v850/lib1funcs.asm
Normal file
File diff suppressed because it is too large
Load Diff
54
gcc/config/v850/t-v850
Normal file
54
gcc/config/v850/t-v850
Normal file
@@ -0,0 +1,54 @@
|
||||
# CYGNUS LOCAL entire file v850/law
|
||||
CROSS_LIBGCC1 = libgcc1-asm.a
|
||||
LIB1ASMSRC = v850/lib1funcs.asm
|
||||
LIB1ASMFUNCS = _mulsi3 \
|
||||
_divsi3 \
|
||||
_udivsi3 \
|
||||
_modsi3 \
|
||||
_umodsi3 \
|
||||
_save_2 \
|
||||
_save_20 \
|
||||
_save_21 \
|
||||
_save_22 \
|
||||
_save_23 \
|
||||
_save_24 \
|
||||
_save_25 \
|
||||
_save_26 \
|
||||
_save_27 \
|
||||
_save_28 \
|
||||
_save_29 \
|
||||
_save_2c \
|
||||
_save_20c \
|
||||
_save_21c \
|
||||
_save_22c \
|
||||
_save_23c \
|
||||
_save_24c \
|
||||
_save_25c \
|
||||
_save_26c \
|
||||
_save_27c \
|
||||
_save_28c \
|
||||
_save_29c \
|
||||
_save_31c \
|
||||
_save_varargs \
|
||||
_save_interrupt \
|
||||
_save_all_interrupt
|
||||
|
||||
|
||||
# These are really part of libgcc1, but this will cause them to be
|
||||
# built correctly, so...
|
||||
|
||||
LIB2FUNCS_EXTRA = fp-bit.c dp-bit.c
|
||||
|
||||
dp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
echo '#ifdef __LITTLE_ENDIAN__' > dp-bit.c
|
||||
echo '#define FLOAT_BIT_ORDER_MISMATCH' >>dp-bit.c
|
||||
echo '#endif' >> dp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c >> dp-bit.c
|
||||
|
||||
fp-bit.c: $(srcdir)/config/fp-bit.c
|
||||
echo '#define FLOAT' > fp-bit.c
|
||||
echo '#ifdef __LITTLE_ENDIAN__' >> fp-bit.c
|
||||
echo '#define FLOAT_BIT_ORDER_MISMATCH' >>fp-bit.c
|
||||
echo '#endif' >> fp-bit.c
|
||||
cat $(srcdir)/config/fp-bit.c >> fp-bit.c
|
||||
#END CYGNUS LOCAL
|
||||
1942
gcc/config/v850/v850.c
Normal file
1942
gcc/config/v850/v850.c
Normal file
File diff suppressed because it is too large
Load Diff
1406
gcc/config/v850/v850.h
Normal file
1406
gcc/config/v850/v850.h
Normal file
File diff suppressed because it is too large
Load Diff
1852
gcc/config/v850/v850.md
Normal file
1852
gcc/config/v850/v850.md
Normal file
File diff suppressed because it is too large
Load Diff
51
gcc/config/v850/xm-v850.h
Normal file
51
gcc/config/v850/xm-v850.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/* CYGNUS LOCAL entire file v850/law */
|
||||
/* Configuration for NEC V850.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
Contributed by Cygnus Support.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#define HOST_BITS_PER_CHAR 8
|
||||
#define HOST_BITS_PER_SHORT 16
|
||||
#define HOST_BITS_PER_INT 32
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
#define HOST_BITS_PER_LONGLONG 64
|
||||
|
||||
/* Arguments to use with `exit'. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
#define FATAL_EXIT_CODE 33
|
||||
|
||||
#ifdef __v850__
|
||||
#ifndef __STDC__
|
||||
extern char *malloc (), *realloc (), *calloc ();
|
||||
#else
|
||||
extern void *malloc (), *realloc (), *calloc ();
|
||||
#endif
|
||||
extern void free ();
|
||||
#endif
|
||||
|
||||
/* target machine dependencies.
|
||||
tm.h is a symbolic link to the actual target specific file. */
|
||||
|
||||
#include "tm.h"
|
||||
/* END CYGNUS LOCAL */
|
||||
4
gcc/config/xm-alloca.h
Normal file
4
gcc/config/xm-alloca.h
Normal file
@@ -0,0 +1,4 @@
|
||||
/* If not compiled with GNU C, use the portable alloca. */
|
||||
#ifndef __GNUC__
|
||||
#define USE_C_ALLOCA
|
||||
#endif
|
||||
6
gcc/config/xm-siglist.h
Normal file
6
gcc/config/xm-siglist.h
Normal file
@@ -0,0 +1,6 @@
|
||||
/* Some systems provide no sys_siglist, but do offer the same data under
|
||||
another name. */
|
||||
|
||||
#define sys_siglist _sys_siglist
|
||||
#undef SYS_SIGLIST_DECLARED
|
||||
#define SYS_SIGLIST_DECLARED
|
||||
34
gcc/config/xm-std32.h
Normal file
34
gcc/config/xm-std32.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/* Configuration for GNU C-compiler for standard 32-bit host machine.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* #defines that need visibility everywhere. */
|
||||
#define FALSE 0
|
||||
#define TRUE 1
|
||||
|
||||
/* This describes the machine the compiler is hosted on. */
|
||||
#define HOST_BITS_PER_CHAR 8
|
||||
#define HOST_BITS_PER_SHORT 16
|
||||
#define HOST_BITS_PER_INT 32
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
#define HOST_BITS_PER_LONGLONG 64
|
||||
|
||||
/* Arguments to use with `exit'. */
|
||||
#define SUCCESS_EXIT_CODE 0
|
||||
#define FATAL_EXIT_CODE 33
|
||||
9451
gcc/cp/ChangeLog.1
Normal file
9451
gcc/cp/ChangeLog.1
Normal file
File diff suppressed because it is too large
Load Diff
139
gcc/cp/NEWS
Normal file
139
gcc/cp/NEWS
Normal file
@@ -0,0 +1,139 @@
|
||||
*** Changes since G++ version 2.7.2:
|
||||
|
||||
* A public review copy of the December 1996 Draft of the ANSI C++
|
||||
proto-standard is now available. See
|
||||
|
||||
http://www.cygnus.com/misc/wp/
|
||||
|
||||
for more information.
|
||||
|
||||
* Default function arguments in templates will not be evaluated (or
|
||||
checked for semantic validity) unless they are needed.
|
||||
|
||||
* The -ftemplate-depth-NN flag can be used to increase the maximum
|
||||
recursive template instantiation depth, defaulting to 17. If you need
|
||||
to use this flag, the compiler will tell you.
|
||||
|
||||
* The internal interface between RTTI-using code and the RTTI support
|
||||
library has changed, so code that uses dynamic_cast should be
|
||||
recompiled. The RTTI support library has moved from libstdc++ to
|
||||
libgcc, so you no longer need to link against libstdc++ for a program
|
||||
that doesn't use the "hosted" library.
|
||||
|
||||
* bool is now always the same size as another built-in type. Previously,
|
||||
a 64-bit RISC target using a 32-bit ABI would have 32-bit pointers and a
|
||||
64-bit bool. This should only affect Irix 6, which was not supported in
|
||||
2.7.2.
|
||||
|
||||
* new (nothrow) is now supported.
|
||||
|
||||
* A flag -Weffc++ has been added for violations of some of the style
|
||||
guidelines in Scott Meyers' _Effective C++_ books.
|
||||
|
||||
* On ELF systems, duplicate copies of symbols with 'initialized common'
|
||||
linkage (such as template instantiations, vtables, and extern inlines)
|
||||
will now be discarded by the GNU linker, so you don't need to use -frepo.
|
||||
This support requires GNU ld from binutils 2.8 or later.
|
||||
|
||||
* Partial specialization of class templates is now supported.
|
||||
|
||||
* The overload resolution code has been rewritten to conform to the latest
|
||||
C++ Working Paper. Built-in operators are now considered as candidates
|
||||
in operator overload resolution. Function template overloading chooses
|
||||
the more specialized template, and handles base classes in type deduction
|
||||
and guiding declarations properly. In this release the old code can
|
||||
still be selected with -fno-ansi-overloading, although this is not
|
||||
supported and will be removed in a future release.
|
||||
|
||||
* RTTI support has been rewritten to work properly and is now on by default.
|
||||
This means code that uses virtual functions will have a modest space
|
||||
overhead. You can use the -fno-rtti flag to disable RTTI support.
|
||||
|
||||
* Synthesized destructors are no longer made virtual just because the class
|
||||
already has virtual functions, only if they override a virtual destructor
|
||||
in a base class. The compiler will warn if this affects your code.
|
||||
|
||||
* The g++ driver no longer links with libg++ by default; it is now
|
||||
functionally identical to the c++ driver.
|
||||
|
||||
* (void *)0 is no longer considered a null pointer constant; NULL in
|
||||
<stddef.h> is now defined as __null, a magic constant of type (void *)
|
||||
normally, or (size_t) with -ansi.
|
||||
|
||||
* The new 'template <>' specialization syntax is now accepted and ignored.
|
||||
|
||||
* The name of a class is now implicitly declared in its own scope; A::A
|
||||
refers to A.
|
||||
|
||||
* g++ now uses a new implementation of templates. The basic idea is that
|
||||
now templates are minimally parsed when seen and then expanded later.
|
||||
This allows conformant early name binding and instantiation controls,
|
||||
since instantiations no longer have to go through the parser.
|
||||
|
||||
What you get:
|
||||
|
||||
+ Inlining of template functions works without any extra effort or
|
||||
modifications.
|
||||
+ Instantiations of class templates and methods defined in the class
|
||||
body are deferred until they are actually needed (unless
|
||||
-fexternal-templates is specified).
|
||||
+ Nested types in class templates work.
|
||||
+ Static data member templates work.
|
||||
|
||||
Possible problems:
|
||||
|
||||
+ Types and class templates used in templates must be declared
|
||||
first, or the compiler will assume they are not types, and fail.
|
||||
+ Similarly, nested types of template type parameters must be tagged
|
||||
with the 'typename' keyword. In many cases, the compiler will tell
|
||||
you where you need to add 'typename'.
|
||||
+ Syntax errors in templates that are never instantiated will now be
|
||||
diagnosed.
|
||||
|
||||
* Synthesized methods are now emitted in any translation units that need
|
||||
an out-of-line copy. They are no longer affected by #pragma interface
|
||||
or #pragma implementation.
|
||||
|
||||
* Local classes are now supported.
|
||||
|
||||
* -Wall no longer implies -W.
|
||||
The new warning flag, -Wsign-compare, included in -Wall, warns about
|
||||
dangerous comparisons of signed and unsigned values. Only the flag is
|
||||
new; it was previously part of -W.
|
||||
|
||||
* The new flag, -fno-weak, disables the use of weak symbols.
|
||||
|
||||
* __attribute__ can now be attached to types as well as declarations.
|
||||
|
||||
* -Woverloaded-virtual now warns if a virtual function in a base class is
|
||||
hidden in a derived class, rather than warning about virtual functions
|
||||
being overloaded (even if all of the inherited signatures are
|
||||
overridden) as it did before.
|
||||
|
||||
* The compiler no longer emits a warning if an ellipsis is used as a
|
||||
function's argument list.
|
||||
|
||||
* Exception handling support has been significantly improved and is on by
|
||||
default. This can result in significant runtime overhead. You can turn
|
||||
it off with -fno-exceptions.
|
||||
|
||||
* Definition of nested types outside of their containing class is now
|
||||
supported. Use the following source code, as an example.
|
||||
|
||||
struct A {
|
||||
struct B;
|
||||
B* bp;
|
||||
};
|
||||
|
||||
struct A::B {
|
||||
int member;
|
||||
};
|
||||
|
||||
* Explicit instantiation of template constructors and destructors is now
|
||||
supported. Use the following source code, as an example.
|
||||
|
||||
template A<int>::A(const A&);
|
||||
|
||||
* On the HPPA, some classes that do not define a copy constructor
|
||||
will be passed and returned in memory again so that functions
|
||||
returning those types can be inlined.
|
||||
2158
gcc/cp/g++FAQ.texi
Normal file
2158
gcc/cp/g++FAQ.texi
Normal file
File diff suppressed because it is too large
Load Diff
100
gcc/dyn-string.c
Normal file
100
gcc/dyn-string.c
Normal file
@@ -0,0 +1,100 @@
|
||||
/* An abstract string datatype.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
Contributed by Mark Mitchell (mark@markmitchell.com).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "gansidecl.h"
|
||||
#include "dyn-string.h"
|
||||
|
||||
extern char *xmalloc ();
|
||||
extern char *xrealloc ();
|
||||
|
||||
/* Create a new dynamic string capable of holding at least SPACE
|
||||
characters, including the terminating NUL. If SPACE is 0, it
|
||||
will be silently increased to 1. */
|
||||
|
||||
dyn_string_t
|
||||
dyn_string_new (space)
|
||||
int space;
|
||||
{
|
||||
dyn_string_t result = (dyn_string_t) xmalloc (sizeof (struct dyn_string));
|
||||
|
||||
if (space == 0)
|
||||
/* We need at least one byte in which to store the terminating
|
||||
NUL. */
|
||||
space = 1;
|
||||
|
||||
result->allocated = space;
|
||||
result->s = (char*) xmalloc (space);
|
||||
result->length = 0;
|
||||
result->s[0] = '\0';
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Free the memory used by DS. */
|
||||
|
||||
void
|
||||
dyn_string_delete (ds)
|
||||
dyn_string_t ds;
|
||||
{
|
||||
free (ds->s);
|
||||
free (ds);
|
||||
}
|
||||
|
||||
/* Append the NUL-terminated string S to DS, resizing DS if
|
||||
necessary. */
|
||||
|
||||
dyn_string_t
|
||||
dyn_string_append (ds, s)
|
||||
dyn_string_t ds;
|
||||
char *s;
|
||||
{
|
||||
int len = strlen (s);
|
||||
dyn_string_resize (ds, ds->length + len + 1 /* '\0' */);
|
||||
strcpy (ds->s + ds->length, s);
|
||||
ds->length += len;
|
||||
|
||||
return ds;
|
||||
}
|
||||
|
||||
/* Increase the capacity of DS so that it can hold at least SPACE
|
||||
characters, including the terminating NUL. This function will not
|
||||
(at present) reduce the capacity of DS. */
|
||||
|
||||
dyn_string_t
|
||||
dyn_string_resize (ds, space)
|
||||
dyn_string_t ds;
|
||||
int space;
|
||||
{
|
||||
int new_allocated = ds->allocated;
|
||||
|
||||
while (space > new_allocated)
|
||||
new_allocated *= 2;
|
||||
|
||||
if (new_allocated != ds->allocated)
|
||||
{
|
||||
/* We actually need more space. */
|
||||
ds->allocated = new_allocated;
|
||||
ds->s = (char*) xrealloc (ds->s, ds->allocated);
|
||||
}
|
||||
|
||||
return ds;
|
||||
}
|
||||
31
gcc/dyn-string.h
Normal file
31
gcc/dyn-string.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* An abstract string datatype.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
Contributed by Mark Mitchell (mark@markmitchell.com).
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
typedef struct dyn_string
|
||||
{
|
||||
int allocated; /* The amount of space allocated for the string. */
|
||||
int length; /* The actual length of the string. */
|
||||
char *s; /* The string itself, NUL-terminated. */
|
||||
}* dyn_string_t;
|
||||
|
||||
extern dyn_string_t dyn_string_new PROTO((int));
|
||||
extern void dyn_string_delete PROTO((dyn_string_t));
|
||||
extern dyn_string_t dyn_string_append PROTO((dyn_string_t, char*));
|
||||
extern dyn_string_t dyn_string_resize PROTO((dyn_string_t, int));
|
||||
118
gcc/exgettext
Executable file
118
gcc/exgettext
Executable file
@@ -0,0 +1,118 @@
|
||||
#! /bin/sh
|
||||
# Wrapper around gettext for GCC sources.
|
||||
# Copyright 1998 Free Software Foundation, Inc.
|
||||
|
||||
# Written by Paul Eggert <eggert@twinsun.com>.
|
||||
|
||||
# This file is part of GNU CC.
|
||||
|
||||
# GNU CC 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, or (at your option)
|
||||
# any later version.
|
||||
|
||||
# GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
# Boston, MA 02111-1307, USA.
|
||||
|
||||
# Set environment to default value, if not already set.
|
||||
: ${AWK=awk}
|
||||
|
||||
# The argument to this wrapper is the xgettext command to be executed.
|
||||
# Extract the xgettext program name from the rest of the command.
|
||||
xgettext=${1?}
|
||||
shift
|
||||
|
||||
# Save work if we're just wrapping a no-op.
|
||||
case $xgettext in
|
||||
:) exit;;
|
||||
esac
|
||||
|
||||
# Find the files to be scanned, and the directory to scan them from.
|
||||
directory=.
|
||||
files=
|
||||
for i
|
||||
do
|
||||
case $i in
|
||||
--directory=*)
|
||||
directory=`expr " $i" : ' --directory=\(.*\)'`;;
|
||||
--files-from=*)
|
||||
files_from=`expr " $i" : ' --files-from=\(.*\)'`
|
||||
files=`$AWK '/^[^#]/ { print }' $files_from`;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Generate keyword options for xgettext,
|
||||
# by scanning for declarations of functions
|
||||
# whose parameter names end in "msgid".
|
||||
generate_keyword_options='
|
||||
/^[A-Z_a-z].*\(.*msgid[,)]/ {
|
||||
|
||||
paren_index = index($0, "(")
|
||||
|
||||
name = substr($0, 1, paren_index - 1)
|
||||
sub(/[^0-9A-Z_a-z]*$/, "", name)
|
||||
sub(/[ ]+PARAMS/, "", name)
|
||||
sub(/[ ]+VPROTO/, "", name)
|
||||
sub(/.*[^0-9A-Z_a-z]/, "", name)
|
||||
|
||||
args = substr($0, paren_index)
|
||||
sub(/msgid[,)].*/, "", args)
|
||||
for (n = 1; sub(/^[^,]*,/, "", args); n++) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (n == 1) {
|
||||
keyword = name
|
||||
} else {
|
||||
keyword = name ":" n
|
||||
}
|
||||
|
||||
if (! keyword_seen[keyword]++) {
|
||||
print "--keyword=" keyword
|
||||
}
|
||||
}
|
||||
'
|
||||
keyword_options=`(
|
||||
cd $directory &&
|
||||
$AWK "$generate_keyword_options" $files < /dev/null
|
||||
)` || exit
|
||||
|
||||
# Generate temporary file reflecting the %e strings in the scanned files.
|
||||
tmp=tmp-emsgids.c
|
||||
|
||||
generate_emsgids='
|
||||
/%e.*}/ {
|
||||
line = $0
|
||||
while ((percent_index = index(line, "%e")) != 0) {
|
||||
line = substr(line, percent_index + 2)
|
||||
bracket_index = index(line, "}")
|
||||
if (bracket_index == 0) {
|
||||
continue
|
||||
}
|
||||
msgid = substr(line, 1, bracket_index - 1)
|
||||
if (index(msgid, "%") != 0) {
|
||||
continue
|
||||
}
|
||||
printf "#line %d \"%s\"\n", FNR, FILENAME
|
||||
printf "_(\"%s\")\n", msgid
|
||||
line = substr(line, bracket_index + 1)
|
||||
}
|
||||
}
|
||||
'
|
||||
(cd $directory &&
|
||||
$AWK "$generate_emsgids" $files < /dev/null
|
||||
) > $directory/$tmp || exit
|
||||
|
||||
# Run the xgettext command, with temporary added as a file to scan.
|
||||
"$xgettext" $keyword_options ${1+"$@"} $tmp || exit
|
||||
|
||||
# Clean up.
|
||||
# If we don't get here, `make clean' will remove this file later.
|
||||
rm -f $directory/$tmp
|
||||
86
gcc/fixinc.wrap
Executable file
86
gcc/fixinc.wrap
Executable file
@@ -0,0 +1,86 @@
|
||||
#! /bin/sh
|
||||
# Create wrappers for include files instead of replacing them.
|
||||
#
|
||||
# This script is designed for systems whose include files can be fixed
|
||||
# by creating small wrappers around them.
|
||||
# An advantage of this method is that if the system include files are changed
|
||||
# (e.g. by OS upgrade), you need not re-run fixincludes.
|
||||
#
|
||||
# See README-fixinc for more information.
|
||||
|
||||
# Directory containing the original header files.
|
||||
# (This was named INCLUDES, but that conflicts with a name in Makefile.in.)
|
||||
INPUT=${2-${INPUT-/usr/include}}
|
||||
|
||||
# Directory in which to store the results.
|
||||
LIB=${1?"fixincludes: output directory not specified"}
|
||||
|
||||
# Make sure it exists.
|
||||
if [ ! -d $LIB ]; then
|
||||
mkdir $LIB || exit 1
|
||||
fi
|
||||
|
||||
echo Building fixed headers in ${LIB}
|
||||
|
||||
# Some math.h files define struct exception, which conflicts with
|
||||
# the class exception defined in the C++ file std/stdexcept.h. We
|
||||
# redefine it to __math_exception. This is not a great fix, but I
|
||||
# haven't been able to think of anything better.
|
||||
file=math.h
|
||||
if [ -r $INPUT/$file ]; then
|
||||
echo Checking $INPUT/$file
|
||||
if grep 'struct exception' $INPUT/$file >/dev/null
|
||||
then
|
||||
echo Fixed $file
|
||||
rm -f $LIB/$file
|
||||
cat <<'__EOF__' >$LIB/$file
|
||||
#ifndef _MATH_H_WRAPPER
|
||||
#ifdef __cplusplus
|
||||
# define exception __math_exception
|
||||
#endif
|
||||
#include_next <math.h>
|
||||
#ifdef __cplusplus
|
||||
# undef exception
|
||||
#endif
|
||||
#define _MATH_H_WRAPPER
|
||||
#endif /* _MATH_H_WRAPPER */
|
||||
__EOF__
|
||||
# Define _MATH_H_WRAPPER at the end of the wrapper, not the start,
|
||||
# so that if #include_next gets another instance of the wrapper,
|
||||
# this will follow the #include_next chain until we arrive at
|
||||
# the real <math.h>.
|
||||
chmod a+r $LIB/$file
|
||||
fi
|
||||
fi
|
||||
|
||||
# Avoid the definition of the bool type in the Solaris 2.x curses.h when using
|
||||
# g++, since it's now an official type in the C++ language.
|
||||
file=curses.h
|
||||
if [ -r $INPUT/$file ]; then
|
||||
echo Checking $INPUT/$file
|
||||
w='[ ]'
|
||||
if grep "typedef$w$w*char$w$w*bool$w*;" $INPUT/$file >/dev/null
|
||||
then
|
||||
echo Fixed $file
|
||||
rm -f $LIB/$file
|
||||
cat <<'__EOF__' >$LIB/$file
|
||||
#ifndef _CURSES_H_WRAPPER
|
||||
#ifdef __cplusplus
|
||||
# define bool __curses_bool_t
|
||||
#endif
|
||||
#include_next <curses.h>
|
||||
#ifdef __cplusplus
|
||||
# undef bool
|
||||
#endif
|
||||
#define _CURSES_H_WRAPPER
|
||||
#endif /* _CURSES_H_WRAPPER */
|
||||
__EOF__
|
||||
# Define _CURSES_H_WRAPPER at the end of the wrapper, not the start,
|
||||
# so that if #include_next gets another instance of the wrapper,
|
||||
# this will follow the #include_next chain until we arrive at
|
||||
# the real <curses.h>.
|
||||
chmod a+r $LIB/$file
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
607
gcc/frame.c
Normal file
607
gcc/frame.c
Normal file
@@ -0,0 +1,607 @@
|
||||
/* Subroutines needed for unwinding stack frames for exception handling. */
|
||||
/* Compile this one with gcc. */
|
||||
/* Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
Contributed by Jason Merrill <jason@cygnus.com>.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* As a special exception, if you link this library with other files,
|
||||
some of which are compiled with GCC, to produce an executable,
|
||||
this library does not by itself cause the resulting executable
|
||||
to be covered by the GNU General Public License.
|
||||
This exception does not however invalidate any other reasons why
|
||||
the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
/* It is incorrect to include config.h here, because this file is being
|
||||
compiled for the target, and hence definitions concerning only the host
|
||||
do not apply. */
|
||||
|
||||
#include "tconfig.h"
|
||||
#include "defaults.h"
|
||||
|
||||
#ifdef DWARF2_UNWIND_INFO
|
||||
#include "dwarf2.h"
|
||||
#include "frame.h"
|
||||
#include <stddef.h>
|
||||
|
||||
/* Don't use `fancy_abort' here even if config.h says to use it. */
|
||||
#ifdef abort
|
||||
#undef abort
|
||||
#endif
|
||||
|
||||
/* Some types used by the DWARF 2 spec. */
|
||||
|
||||
typedef unsigned int uword __attribute__ ((mode (SI)));
|
||||
typedef unsigned int uaddr __attribute__ ((mode (pointer)));
|
||||
typedef int saddr __attribute__ ((mode (pointer)));
|
||||
typedef unsigned char ubyte;
|
||||
|
||||
/* The first few fields of a CIE. The CIE_id field is 0xffffffff for a CIE,
|
||||
to distinguish it from a valid FDE. FDEs are aligned to an addressing
|
||||
unit boundary, but the fields within are unaligned. */
|
||||
|
||||
struct dwarf_cie {
|
||||
uword length;
|
||||
uaddr CIE_id;
|
||||
ubyte version;
|
||||
char augmentation[0];
|
||||
} __attribute__ ((packed, aligned (__alignof__ (void *))));
|
||||
|
||||
/* The first few fields of an FDE. */
|
||||
|
||||
struct dwarf_fde {
|
||||
uword length;
|
||||
struct dwarf_cie* CIE_pointer;
|
||||
void* pc_begin;
|
||||
uaddr pc_range;
|
||||
} __attribute__ ((packed, aligned (__alignof__ (void *))));
|
||||
|
||||
typedef struct dwarf_fde fde;
|
||||
|
||||
/* The representation for an "object" to be searched for frame unwind info.
|
||||
For targets with named sections, one object is an executable or shared
|
||||
library; for other targets, one object is one translation unit. */
|
||||
|
||||
struct object {
|
||||
void *pc_begin;
|
||||
void *pc_end;
|
||||
fde *fde_begin;
|
||||
fde ** fde_array;
|
||||
size_t count;
|
||||
struct object *next;
|
||||
};
|
||||
|
||||
static struct object *objects;
|
||||
|
||||
/* The information we care about from a CIE. */
|
||||
|
||||
struct cie_info {
|
||||
char *augmentation;
|
||||
int code_align;
|
||||
int data_align;
|
||||
unsigned ra_regno;
|
||||
};
|
||||
|
||||
/* The current unwind state, plus a saved copy for DW_CFA_remember_state. */
|
||||
|
||||
struct frame_state_internal
|
||||
{
|
||||
struct frame_state s;
|
||||
struct frame_state_internal *saved_state;
|
||||
};
|
||||
|
||||
/* Decode the unsigned LEB128 constant at BUF into the variable pointed to
|
||||
by R, and return the new value of BUF. */
|
||||
|
||||
static void *
|
||||
decode_uleb128 (unsigned char *buf, unsigned *r)
|
||||
{
|
||||
unsigned shift = 0;
|
||||
unsigned result = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
unsigned byte = *buf++;
|
||||
result |= (byte & 0x7f) << shift;
|
||||
if ((byte & 0x80) == 0)
|
||||
break;
|
||||
shift += 7;
|
||||
}
|
||||
*r = result;
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* Decode the signed LEB128 constant at BUF into the variable pointed to
|
||||
by R, and return the new value of BUF. */
|
||||
|
||||
static void *
|
||||
decode_sleb128 (unsigned char *buf, int *r)
|
||||
{
|
||||
unsigned shift = 0;
|
||||
unsigned result = 0;
|
||||
unsigned byte;
|
||||
|
||||
while (1)
|
||||
{
|
||||
byte = *buf++;
|
||||
result |= (byte & 0x7f) << shift;
|
||||
shift += 7;
|
||||
if ((byte & 0x80) == 0)
|
||||
break;
|
||||
}
|
||||
if (shift < (sizeof (*r) * 8) && (byte & 0x40) != 0)
|
||||
result |= - (1 << shift);
|
||||
|
||||
*r = result;
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* Read unaligned data from the instruction buffer. */
|
||||
|
||||
union unaligned {
|
||||
void *p;
|
||||
unsigned b2 __attribute__ ((mode (HI)));
|
||||
unsigned b4 __attribute__ ((mode (SI)));
|
||||
unsigned b8 __attribute__ ((mode (DI)));
|
||||
} __attribute__ ((packed));
|
||||
static inline void *
|
||||
read_pointer (void *p)
|
||||
{ union unaligned *up = p; return up->p; }
|
||||
static inline unsigned
|
||||
read_1byte (void *p)
|
||||
{ return *(unsigned char *)p; }
|
||||
static inline unsigned
|
||||
read_2byte (void *p)
|
||||
{ union unaligned *up = p; return up->b2; }
|
||||
static inline unsigned
|
||||
read_4byte (void *p)
|
||||
{ union unaligned *up = p; return up->b4; }
|
||||
static inline unsigned long
|
||||
read_8byte (void *p)
|
||||
{ union unaligned *up = p; return up->b8; }
|
||||
|
||||
/* Ordering function for FDEs. Functions can't overlap, so we just compare
|
||||
their starting addresses. */
|
||||
|
||||
static inline saddr
|
||||
fde_compare (fde *x, fde *y)
|
||||
{
|
||||
return (saddr)x->pc_begin - (saddr)y->pc_begin;
|
||||
}
|
||||
|
||||
/* Return the address of the FDE after P. */
|
||||
|
||||
static inline fde *
|
||||
next_fde (fde *p)
|
||||
{
|
||||
return (fde *)(((char *)p) + p->length + sizeof (p->length));
|
||||
}
|
||||
|
||||
/* One iteration of an insertion sort, for adding new FDEs to the array.
|
||||
Usually the new FDE will go in at the end, so we can expect close to
|
||||
O(n) performance. If this turns out to be overly optimistic, we can have
|
||||
the linker sort the FDEs so we don't have to do it at run time. */
|
||||
|
||||
static void
|
||||
fde_insert (fde **array, size_t i, fde *this_fde)
|
||||
{
|
||||
array[i] = this_fde;
|
||||
|
||||
for (; i > 0 && fde_compare (array[i], array[i-1]) < 0; --i)
|
||||
{
|
||||
this_fde = array[i];
|
||||
array[i] = array[i-1];
|
||||
array[i-1] = this_fde;
|
||||
}
|
||||
}
|
||||
|
||||
static size_t
|
||||
count_fdes (fde *this_fde)
|
||||
{
|
||||
size_t count;
|
||||
|
||||
for (count = 0; this_fde->length != 0; this_fde = next_fde (this_fde))
|
||||
{
|
||||
/* Skip CIEs. */
|
||||
if ((uaddr)(this_fde->CIE_pointer) == (uaddr)-1)
|
||||
continue;
|
||||
|
||||
++count;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static void
|
||||
add_fdes (fde *this_fde, fde **array, size_t *i_ptr,
|
||||
void **beg_ptr, void **end_ptr)
|
||||
{
|
||||
size_t i = *i_ptr;
|
||||
void *pc_begin = *beg_ptr;
|
||||
void *pc_end = *end_ptr;
|
||||
|
||||
for (; this_fde->length != 0; this_fde = next_fde (this_fde))
|
||||
{
|
||||
/* Skip CIEs. */
|
||||
if ((uaddr)(this_fde->CIE_pointer) == (uaddr)-1)
|
||||
continue;
|
||||
|
||||
fde_insert (array, i++, this_fde);
|
||||
|
||||
if (this_fde->pc_begin < pc_begin)
|
||||
pc_begin = this_fde->pc_begin;
|
||||
if (this_fde->pc_begin + this_fde->pc_range > pc_end)
|
||||
pc_end = this_fde->pc_begin + this_fde->pc_range;
|
||||
}
|
||||
|
||||
*i_ptr = i;
|
||||
*beg_ptr = pc_begin;
|
||||
*end_ptr = pc_end;
|
||||
}
|
||||
|
||||
/* Set up a sorted array of pointers to FDEs for a loaded object. We
|
||||
count up the entries before allocating the array because it's likely to
|
||||
be faster. */
|
||||
|
||||
static void
|
||||
frame_init (struct object* ob)
|
||||
{
|
||||
fde *this_fde;
|
||||
size_t count;
|
||||
fde **array;
|
||||
void *pc_begin, *pc_end;
|
||||
|
||||
if (ob->fde_array)
|
||||
{
|
||||
fde **p = ob->fde_array;
|
||||
for (count = 0; *p; ++p)
|
||||
count += count_fdes (*p);
|
||||
}
|
||||
else
|
||||
count = count_fdes (ob->fde_begin);
|
||||
|
||||
ob->count = count;
|
||||
array = (fde **) malloc (sizeof (fde *) * count);
|
||||
|
||||
pc_begin = (void*)(uaddr)-1;
|
||||
pc_end = 0;
|
||||
count = 0;
|
||||
|
||||
if (ob->fde_array)
|
||||
{
|
||||
fde **p = ob->fde_array;
|
||||
for (; *p; ++p)
|
||||
add_fdes (*p, array, &count, &pc_begin, &pc_end);
|
||||
}
|
||||
else
|
||||
add_fdes (ob->fde_begin, array, &count, &pc_begin, &pc_end);
|
||||
|
||||
ob->fde_array = array;
|
||||
ob->pc_begin = pc_begin;
|
||||
ob->pc_end = pc_end;
|
||||
}
|
||||
|
||||
/* Return a pointer to the FDE for the function containing PC. */
|
||||
|
||||
static fde *
|
||||
find_fde (void *pc)
|
||||
{
|
||||
struct object *ob;
|
||||
size_t lo, hi;
|
||||
|
||||
for (ob = objects; ob; ob = ob->next)
|
||||
{
|
||||
if (ob->pc_begin == 0)
|
||||
frame_init (ob);
|
||||
if (pc >= ob->pc_begin && pc < ob->pc_end)
|
||||
break;
|
||||
}
|
||||
|
||||
if (ob == 0)
|
||||
return 0;
|
||||
|
||||
/* Standard binary search algorithm. */
|
||||
for (lo = 0, hi = ob->count; lo < hi; )
|
||||
{
|
||||
size_t i = (lo + hi) / 2;
|
||||
fde *f = ob->fde_array[i];
|
||||
|
||||
if (pc < f->pc_begin)
|
||||
hi = i;
|
||||
else if (pc > f->pc_begin + f->pc_range)
|
||||
lo = i + 1;
|
||||
else
|
||||
return f;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Extract any interesting information from the CIE for the translation
|
||||
unit F belongs to. */
|
||||
|
||||
static void *
|
||||
extract_cie_info (fde *f, struct cie_info *c)
|
||||
{
|
||||
void *p;
|
||||
int i;
|
||||
|
||||
c->augmentation = f->CIE_pointer->augmentation;
|
||||
|
||||
if (strcmp (c->augmentation, "") != 0
|
||||
&& strcmp (c->augmentation, "e") != 0
|
||||
&& c->augmentation[0] != 'z')
|
||||
return 0;
|
||||
|
||||
p = c->augmentation + strlen (c->augmentation) + 1;
|
||||
|
||||
p = decode_uleb128 (p, &c->code_align);
|
||||
p = decode_sleb128 (p, &c->data_align);
|
||||
c->ra_regno = *(unsigned char *)p++;
|
||||
|
||||
/* If the augmentation starts with 'z', we now see the length of the
|
||||
augmentation fields. */
|
||||
if (c->augmentation[0] == 'z')
|
||||
{
|
||||
p = decode_uleb128 (p, &i);
|
||||
p += i;
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Decode one instruction's worth of of DWARF 2 call frame information.
|
||||
Used by __frame_state_for. Takes pointers P to the instruction to
|
||||
decode, STATE to the current register unwind information, INFO to the
|
||||
current CIE information, and PC to the current PC value. Returns a
|
||||
pointer to the next instruction. */
|
||||
|
||||
static void *
|
||||
execute_cfa_insn (void *p, struct frame_state_internal *state,
|
||||
struct cie_info *info, void **pc)
|
||||
{
|
||||
unsigned insn = *(unsigned char *)p++;
|
||||
unsigned reg;
|
||||
int offset;
|
||||
|
||||
if (insn & DW_CFA_advance_loc)
|
||||
*pc += ((insn & 0x3f) * info->code_align);
|
||||
else if (insn & DW_CFA_offset)
|
||||
{
|
||||
reg = (insn & 0x3f);
|
||||
p = decode_uleb128 (p, &offset);
|
||||
offset *= info->data_align;
|
||||
state->s.saved[reg] = REG_SAVED_OFFSET;
|
||||
state->s.reg_or_offset[reg] = offset;
|
||||
}
|
||||
else if (insn & DW_CFA_restore)
|
||||
{
|
||||
reg = (insn & 0x3f);
|
||||
state->s.saved[reg] = REG_UNSAVED;
|
||||
}
|
||||
else switch (insn)
|
||||
{
|
||||
case DW_CFA_set_loc:
|
||||
*pc = read_pointer (p);
|
||||
p += sizeof (void *);
|
||||
break;
|
||||
case DW_CFA_advance_loc1:
|
||||
*pc += read_1byte (p);
|
||||
p += 1;
|
||||
break;
|
||||
case DW_CFA_advance_loc2:
|
||||
*pc += read_2byte (p);
|
||||
p += 2;
|
||||
break;
|
||||
case DW_CFA_advance_loc4:
|
||||
*pc += read_4byte (p);
|
||||
p += 4;
|
||||
break;
|
||||
|
||||
case DW_CFA_offset_extended:
|
||||
p = decode_uleb128 (p, ®);
|
||||
p = decode_uleb128 (p, &offset);
|
||||
offset *= info->data_align;
|
||||
state->s.saved[reg] = REG_SAVED_OFFSET;
|
||||
state->s.reg_or_offset[reg] = offset;
|
||||
break;
|
||||
case DW_CFA_restore_extended:
|
||||
p = decode_uleb128 (p, ®);
|
||||
state->s.saved[reg] = REG_UNSAVED;
|
||||
break;
|
||||
|
||||
case DW_CFA_undefined:
|
||||
case DW_CFA_same_value:
|
||||
case DW_CFA_nop:
|
||||
break;
|
||||
|
||||
case DW_CFA_register:
|
||||
{
|
||||
unsigned reg2;
|
||||
p = decode_uleb128 (p, ®);
|
||||
p = decode_uleb128 (p, ®2);
|
||||
state->s.saved[reg] = REG_SAVED_REG;
|
||||
state->s.reg_or_offset[reg] = reg2;
|
||||
}
|
||||
break;
|
||||
|
||||
case DW_CFA_def_cfa:
|
||||
p = decode_uleb128 (p, ®);
|
||||
p = decode_uleb128 (p, &offset);
|
||||
state->s.cfa_reg = reg;
|
||||
state->s.cfa_offset = offset;
|
||||
break;
|
||||
case DW_CFA_def_cfa_register:
|
||||
p = decode_uleb128 (p, ®);
|
||||
state->s.cfa_reg = reg;
|
||||
break;
|
||||
case DW_CFA_def_cfa_offset:
|
||||
p = decode_uleb128 (p, &offset);
|
||||
state->s.cfa_offset = offset;
|
||||
break;
|
||||
|
||||
case DW_CFA_remember_state:
|
||||
{
|
||||
struct frame_state_internal *save =
|
||||
(struct frame_state_internal *)
|
||||
malloc (sizeof (struct frame_state_internal));
|
||||
memcpy (save, state, sizeof (struct frame_state_internal));
|
||||
state->saved_state = save;
|
||||
}
|
||||
break;
|
||||
case DW_CFA_restore_state:
|
||||
{
|
||||
struct frame_state_internal *save = state->saved_state;
|
||||
memcpy (state, save, sizeof (struct frame_state_internal));
|
||||
free (save);
|
||||
}
|
||||
break;
|
||||
|
||||
/* FIXME: Hardcoded for SPARC register window configuration. */
|
||||
case DW_CFA_GNU_window_save:
|
||||
for (reg = 16; reg < 32; ++reg)
|
||||
{
|
||||
state->s.saved[reg] = REG_SAVED_OFFSET;
|
||||
state->s.reg_or_offset[reg] = (reg - 16) * sizeof (void *);
|
||||
}
|
||||
break;
|
||||
|
||||
case DW_CFA_GNU_args_size:
|
||||
p = decode_uleb128 (p, &offset);
|
||||
state->s.args_size = offset;
|
||||
break;
|
||||
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Called from crtbegin.o to register the unwind info for an object. */
|
||||
|
||||
void
|
||||
__register_frame (void *begin)
|
||||
{
|
||||
struct object *ob = (struct object *) malloc (sizeof (struct object));
|
||||
|
||||
ob->fde_begin = begin;
|
||||
|
||||
ob->pc_begin = ob->pc_end = 0;
|
||||
ob->fde_array = 0;
|
||||
ob->count = 0;
|
||||
|
||||
ob->next = objects;
|
||||
objects = ob;
|
||||
}
|
||||
|
||||
/* Similar, but BEGIN is actually a pointer to a table of unwind entries
|
||||
for different translation units. Called from the file generated by
|
||||
collect2. */
|
||||
|
||||
void
|
||||
__register_frame_table (void *begin)
|
||||
{
|
||||
struct object *ob = (struct object *) malloc (sizeof (struct object));
|
||||
|
||||
ob->fde_begin = begin;
|
||||
ob->fde_array = begin;
|
||||
|
||||
ob->pc_begin = ob->pc_end = 0;
|
||||
ob->count = 0;
|
||||
|
||||
ob->next = objects;
|
||||
objects = ob;
|
||||
}
|
||||
|
||||
/* Called from crtend.o to deregister the unwind info for an object. */
|
||||
|
||||
void
|
||||
__deregister_frame (void *begin)
|
||||
{
|
||||
struct object **p = &objects;
|
||||
|
||||
while (*p)
|
||||
{
|
||||
if ((*p)->fde_begin == begin)
|
||||
{
|
||||
struct object *ob = *p;
|
||||
*p = (*p)->next;
|
||||
|
||||
if (ob->fde_array)
|
||||
free (ob->fde_array);
|
||||
free (ob);
|
||||
|
||||
return;
|
||||
}
|
||||
p = &((*p)->next);
|
||||
}
|
||||
abort ();
|
||||
}
|
||||
|
||||
/* Called from __throw to find the registers to restore for a given
|
||||
PC_TARGET. The caller should allocate a local variable of `struct
|
||||
frame_state' (declared in frame.h) and pass its address to STATE_IN. */
|
||||
|
||||
struct frame_state *
|
||||
__frame_state_for (void *pc_target, struct frame_state *state_in)
|
||||
{
|
||||
fde *f;
|
||||
void *insn, *end, *pc;
|
||||
struct cie_info info;
|
||||
struct frame_state_internal state;
|
||||
|
||||
f = find_fde (pc_target);
|
||||
if (f == 0)
|
||||
return 0;
|
||||
|
||||
insn = extract_cie_info (f, &info);
|
||||
if (insn == 0)
|
||||
return 0;
|
||||
|
||||
memset (&state, 0, sizeof (state));
|
||||
state.s.retaddr_column = info.ra_regno;
|
||||
|
||||
/* First decode all the insns in the CIE. */
|
||||
end = next_fde ((fde*) f->CIE_pointer);
|
||||
while (insn < end)
|
||||
insn = execute_cfa_insn (insn, &state, &info, 0);
|
||||
|
||||
insn = ((fde *)f) + 1;
|
||||
|
||||
if (info.augmentation[0] == 'z')
|
||||
{
|
||||
int i;
|
||||
insn = decode_uleb128 (insn, &i);
|
||||
insn += i;
|
||||
}
|
||||
else if (strcmp (info.augmentation, "e") == 0)
|
||||
{
|
||||
state.s.eh_ptr = read_pointer (insn);
|
||||
insn += sizeof (void *);
|
||||
}
|
||||
|
||||
/* Then the insns in the FDE up to our target PC. */
|
||||
end = next_fde (f);
|
||||
pc = f->pc_begin;
|
||||
while (insn < end && pc < pc_target)
|
||||
insn = execute_cfa_insn (insn, &state, &info, &pc);
|
||||
|
||||
memcpy (state_in, &state.s, sizeof (state.s));
|
||||
return state_in;
|
||||
}
|
||||
#endif /* DWARF2_UNWIND_INFO */
|
||||
35
gcc/frame.h
Normal file
35
gcc/frame.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/* Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of GNU CC. */
|
||||
|
||||
typedef struct frame_state
|
||||
{
|
||||
void *cfa;
|
||||
void *eh_ptr;
|
||||
long cfa_offset;
|
||||
long args_size;
|
||||
long reg_or_offset[FIRST_PSEUDO_REGISTER+1];
|
||||
unsigned short cfa_reg;
|
||||
unsigned short retaddr_column;
|
||||
char saved[FIRST_PSEUDO_REGISTER+1];
|
||||
} frame_state;
|
||||
|
||||
/* Values for 'saved' above. */
|
||||
#define REG_UNSAVED 0
|
||||
#define REG_SAVED_OFFSET 1
|
||||
#define REG_SAVED_REG 2
|
||||
|
||||
/* Called either from crtbegin.o or a static constructor to register the
|
||||
unwind info for an object or translation unit, respectively. */
|
||||
|
||||
extern void __register_frame (void *);
|
||||
|
||||
/* Called from crtend.o to deregister the unwind info for an object. */
|
||||
|
||||
extern void __deregister_frame (void *);
|
||||
|
||||
/* Called from __throw to find the registers to restore for a given
|
||||
PC_TARGET. The caller should allocate a local variable of `struct
|
||||
frame_state' (declared in frame.h) and pass its address to STATE_IN.
|
||||
Returns NULL on failure, otherwise returns STATE_IN. */
|
||||
|
||||
extern struct frame_state *__frame_state_for (void *, struct frame_state *);
|
||||
60
gcc/gcc.c
60
gcc/gcc.c
@@ -4302,6 +4302,11 @@ main (argc, argv)
|
||||
signal (SIGPIPE, fatal_error);
|
||||
#endif
|
||||
|
||||
{ /* Warn users they are using developmental software. */
|
||||
static void snapshot_warning ();
|
||||
snapshot_warning ();
|
||||
}
|
||||
|
||||
argbuf_length = 10;
|
||||
argbuf = (char **) xmalloc (argbuf_length * sizeof (char *));
|
||||
|
||||
@@ -5441,3 +5446,58 @@ print_multilib_info ()
|
||||
++p;
|
||||
}
|
||||
}
|
||||
|
||||
/* For snapshots only.
|
||||
Warn the user that this version of gcc is for testing and developing only.
|
||||
If this is unix, we can restrict the warning to once per day.
|
||||
Otherwise always issue it. */
|
||||
|
||||
#define TIMESTAMP_FILE ".gcc-test-time"
|
||||
#define ONE_DAY (24*60*60)
|
||||
|
||||
static void
|
||||
snapshot_warning ()
|
||||
{
|
||||
char *home;
|
||||
int print_p = 1;
|
||||
|
||||
#ifdef unix
|
||||
home = getenv ("HOME");
|
||||
if (home != NULL)
|
||||
{
|
||||
char *file_name = (char *) alloca (strlen (home) + 1 + sizeof (TIMESTAMP_FILE));
|
||||
struct stat statbuf;
|
||||
time_t now = time (NULL);
|
||||
int s;
|
||||
|
||||
sprintf (file_name, "%s/%s", home, TIMESTAMP_FILE);
|
||||
s = stat (file_name, &statbuf);
|
||||
if (s == 0
|
||||
&& (statbuf.st_mtime + ONE_DAY > now))
|
||||
print_p = 0;
|
||||
else
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
if ((f = fopen (file_name, "w")) == NULL)
|
||||
{
|
||||
/* Ensure we have write access. */
|
||||
chmod (file_name, s == 0 ? (statbuf.st_mode + 0200) : 0644);
|
||||
f = fopen (file_name, "w");
|
||||
}
|
||||
if (f != NULL)
|
||||
{
|
||||
fputc ('\n', f);
|
||||
fclose (f);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (print_p)
|
||||
{
|
||||
fprintf (stderr, "*** This is a development snapshot of GCC.\n");
|
||||
fprintf (stderr, "*** It is not reliable release, and the GCC developers\n");
|
||||
fprintf (stderr, "*** warn you not to use it for anything except to test it.\n");
|
||||
}
|
||||
}
|
||||
|
||||
406
gcc/gcc.hlp
Normal file
406
gcc/gcc.hlp
Normal file
@@ -0,0 +1,406 @@
|
||||
1 GCC
|
||||
|
||||
The GCC command invokes the GNU C compiler.
|
||||
|
||||
GCC file-spec
|
||||
|
||||
2 Parameters
|
||||
|
||||
file-spec
|
||||
|
||||
A C source file. If no input file extension is specified, GNU C
|
||||
assumes .C as the default extension unless the /PLUS qualifier is
|
||||
given, in which case .CC is assumed as the default extension.
|
||||
|
||||
If an extension of .CPP is given, then the source file is assumed to
|
||||
be the output of the preprocessor, and thus the preprocessor is not
|
||||
executed.
|
||||
|
||||
If an extension of .S is given, then the source file is assumed to be
|
||||
the assembly code output of the compiler, and only the assembler is
|
||||
called to generate an object file.
|
||||
|
||||
2 Qualifiers
|
||||
|
||||
GNU C command qualifiers modify the way the compiler handles the
|
||||
compilation.
|
||||
|
||||
The following is the list of available qualifiers for GNU C:
|
||||
|
||||
/CASE_HACK
|
||||
/CC1_OPTIONS=(option [,option...]])
|
||||
/DEBUG
|
||||
/DEFINE=(identifier[=definition][,...])
|
||||
/G_FLOAT
|
||||
/INCLUDE_DIRECTORY=(path [,path...]])
|
||||
/LIST[=filename]
|
||||
/MACHINE_CODE
|
||||
/OBJECT[=filename]
|
||||
/OPTIMIZE
|
||||
/PLUS
|
||||
/PROFILE[=identifier]
|
||||
/SCAN=(file[,file...])
|
||||
/SHOW[=option]
|
||||
/UNDEFINE=(identifier[,identifier,...])
|
||||
/VERBOSE
|
||||
/VERSION
|
||||
/WARNING
|
||||
|
||||
2 Linking
|
||||
|
||||
When linking programs compiled with GNU C, you should include the GNU
|
||||
C library before the VAX C library. For example,
|
||||
|
||||
LINK object-file,GNU_CC:[000000]GCCLIB/LIB,SYS$LIBRARY:VAXCRTL/LIB
|
||||
|
||||
You can also link your program with the shared VAX C library. This
|
||||
can reduce the size of the .EXE file, as well as make it smaller when
|
||||
it's running. For example,
|
||||
|
||||
$ LINK object-file, GNU_CC:[000000]GCCLIB/LIB,SYS$INPUT/OPT
|
||||
SYS$SHARE:VAXCRTL/SHARE
|
||||
|
||||
(If you use the second example and type it in by hand, be sure to
|
||||
type ^Z after the last carriage return). A simpler alternative would
|
||||
be to place the single line:
|
||||
|
||||
SYS$SHARE:VAXCRTL/SHARE
|
||||
|
||||
into a file called VAXCRTL.OPT, and then use the link command:
|
||||
|
||||
$ LINK object-file, GNU_CC:[000000]GCCLIB/LIB,VAXCRTL.OPT/OPT
|
||||
|
||||
If a program has been compiled with /G_FLOAT, then the linking
|
||||
instructions are slightly different. If you are linking with the
|
||||
non-shared library, then the command that you should use would be:
|
||||
|
||||
LINK object-file,GNU_CC:[000000]GCCLIB/LIB,SYS$LIBRARY:VAXCRTLG/LIB -
|
||||
,SYS$LIBRARY:VAXCRTL/LIB
|
||||
|
||||
Note that both VAXCRTL and VAXCRTLG must be linked to. If you are
|
||||
using the shared VAX C library, then you should use a command like:
|
||||
|
||||
$ LINK object-file, GNU_CC:[000000]GCCLIB/LIB,SYS$INPUT:/OPTIONS
|
||||
SYS$SHARE:VAXCRTLG/SHARE
|
||||
|
||||
In the case of the sharable library, only one library needs to be
|
||||
linked to.
|
||||
|
||||
If you need to link to libg++, it is easiest to use the command
|
||||
procedure supplied with libg++ to link your program.
|
||||
|
||||
2 /CASE_HACK
|
||||
|
||||
/[NO]CASE_HACK D=/CASE_HACK
|
||||
|
||||
Since the VMS Linker and Librarian are not case sensitive with
|
||||
respect to symbol names, a "case-hack" is appended to a symbol name
|
||||
when the symbol contains upper case characters.
|
||||
|
||||
There are cases where this is undesirable, (mainly when using certain
|
||||
applications where modules have been precompiled, perhaps in another
|
||||
language) and we want to compile without case hacking. In these
|
||||
cases the /NOCASE_HACK switch disables case hacking.
|
||||
|
||||
2 /CC1_OPTIONS
|
||||
|
||||
This specifies additional switches to the compiler itself which
|
||||
cannot be set by means of the compiler driver.
|
||||
|
||||
2 /DEBUG
|
||||
|
||||
/DEBUG includes additional information in the object file output so
|
||||
that the program can be debugged with the VAX Symbolic Debugger.
|
||||
|
||||
To use the debugger it is also necessary to link the debugger to your
|
||||
program, which is done by specifying the /DEBUG qualifier to the link
|
||||
command. With the debugger it is possible to set breakpoints,
|
||||
examine variables, and set variables to new values. See the VAX
|
||||
Symbolic Debugger manual for more information, or type "HELP" from
|
||||
the debugger prompt.
|
||||
|
||||
2 /DEFINE
|
||||
|
||||
/DEFINE=(identifier[=definition][,...])
|
||||
|
||||
/DEFINE defines a string or macro ('definition') to be substituted
|
||||
for every occurrence of a given string ('identifier') in a program.
|
||||
It is equivalent to the #define preprocessor directive.
|
||||
|
||||
All definitions and identifiers are converted to uppercase unless
|
||||
they are in quotation marks.
|
||||
|
||||
The simple form of the /DEFINE qualifier:
|
||||
|
||||
/DEFINE=vms
|
||||
|
||||
results in a definition equivalent to the preprocessor directive:
|
||||
|
||||
#define VMS 1
|
||||
|
||||
You must enclose macro definitions in quotation marks, as in this
|
||||
example:
|
||||
|
||||
/DEFINE="C(x)=((x) & 0xff)"
|
||||
|
||||
This definition is the same as the preprocessor definition:
|
||||
|
||||
#define C(x) ((x) & 0xff)
|
||||
|
||||
If more than one /DEFINE is present on the GCC command line, only the
|
||||
last /DEFINE is used.
|
||||
|
||||
If both /DEFINE and /UNDEFINE are present on a command line, /DEFINE
|
||||
is evaluated before /UNDEFINE.
|
||||
|
||||
2 /G_FLOAT
|
||||
|
||||
Instructs the compiler to use "G" floating point arithmetic instead
|
||||
of "D". The difference is that double precision has a range of
|
||||
approximately +/-0.56e-308 to +/-0.9 e+308, with approximately 15
|
||||
decimal digits precision.
|
||||
|
||||
"D" floating point has the same range as single precision floating
|
||||
point, with approximately 17 decimal digits precision.
|
||||
|
||||
If you use the /G_FLOAT qualifier, the linking instructions are
|
||||
different. See "Linking" for further details.
|
||||
|
||||
2 /LIST
|
||||
|
||||
/LIST[=list_file_name]
|
||||
|
||||
This does not generate a listing file in the usual sense, however it
|
||||
does direct the compiler to save the preprocessor output. If a file
|
||||
is not specified, then this output is written into a file with the
|
||||
same name as the source file and an extension of .CPP.
|
||||
|
||||
2 /INCLUDE_DIRECTORY
|
||||
|
||||
/INCLUDE_DIRECTORY=(path [,path...])
|
||||
|
||||
The /INCLUDE_DIRECTORY qualifier provides additional directories to
|
||||
search for user-defined include files. 'path' can be either a
|
||||
logical name or a directory specification.
|
||||
|
||||
There are two forms for specifying include files - #include
|
||||
"file-spec" and #include <file-spec>. For the #include "file-spec"
|
||||
form, the search order is:
|
||||
|
||||
1. The directory containing the source file.
|
||||
|
||||
2. The directories in the /INCLUDE qualifier (if any).
|
||||
|
||||
3. The directory (or directories) specified in the logical name
|
||||
GNU_CC_INCLUDE.
|
||||
|
||||
4. The directory (or directories) specified in the logical name
|
||||
SYS$LIBRARY.
|
||||
|
||||
For the #include <file-spec> form, the search order is:
|
||||
|
||||
1. The directories specified in the /INCLUDE qualifier (if any).
|
||||
|
||||
2. The directory (or directories) specified in the logical name
|
||||
GNU_CC_INCLUDE.
|
||||
|
||||
3. The directory (or directories) specified in the logical name
|
||||
SYS$LIBRARY.
|
||||
|
||||
2 /MACHINE_CODE
|
||||
|
||||
Tells GNU C to output the machine code generated by the compiler.
|
||||
The machine code is output to a file with the same name as the input
|
||||
file, with the extension .S. An object file is still generated,
|
||||
unless /NOOBJ is also specified.
|
||||
|
||||
2 /OBJECT
|
||||
|
||||
/OBJECT[=filename]
|
||||
/NOOBJECT
|
||||
|
||||
Controls whether or not an object file is generated by the
|
||||
compiler.
|
||||
|
||||
2 /OPTIMIZE
|
||||
|
||||
/[NO]OPTIMIZE
|
||||
|
||||
Controls whether optimization is performed by the compiler. By
|
||||
default, optimization is on. /NOOPTIMIZE turns optimization off.
|
||||
|
||||
2 /PLUS
|
||||
|
||||
Instructs the compiler driver to use the GNU-C++ compiler instead of
|
||||
the GNU-C compiler. Note that the default extension of source files
|
||||
is .CC when this qualifier is in effect.
|
||||
|
||||
2 /PROFILE
|
||||
|
||||
/PROFILE[=identifier]
|
||||
|
||||
Instructs the compiler to generate function profiling code. You must
|
||||
link your program to the profiler when you use this options. The
|
||||
profile statistics are automatically printed out on the terminal
|
||||
during image exit. (i.e. no modifications to your source file are
|
||||
required in order to use the profiler).
|
||||
|
||||
There are three identifiers that can be used with the /PROFILE
|
||||
switch. These are ALL, FUNCTION, and BLOCK. If /PROFILE is given
|
||||
without an identifier, then FUNCTION is assumed.
|
||||
|
||||
3 Block_Profiler
|
||||
|
||||
The block profiler counts how many times control of the program
|
||||
passes certain points in your program. This is useful in determining
|
||||
which portions of a program would benefit from recoding for
|
||||
optimization.
|
||||
|
||||
The report for the block profiler contains the function name, file
|
||||
name, PC, and the source file line number as well as the count of how
|
||||
many times control has passed through the specified source line.
|
||||
|
||||
3 Function_Profiler
|
||||
|
||||
The function profiler counts how many times each function is entered,
|
||||
and keeps track of how much CPU time is used within each function.
|
||||
|
||||
You should be careful about interpreting the results of profiles
|
||||
where there are inline functions. When a function is included as
|
||||
inline, then there is no call to the internal data collection routine
|
||||
used by the profiler, and thus there will be no record of this
|
||||
function being called. The compiler does generate a callable version
|
||||
of each inline function, and if this called version is used, then the
|
||||
profiler's data collection routine will be called.
|
||||
|
||||
2 /SCAN
|
||||
|
||||
/SCAN=(file[,file...])
|
||||
|
||||
This qualifier supplies a list of files that will be read as input,
|
||||
and the output will be discarded before processing the regular input
|
||||
file. Because the output generated from the files is discarded, the
|
||||
only effect of this qualifier is to make the macros defined in the
|
||||
files available for use in the main input.
|
||||
|
||||
2 /SHOW
|
||||
|
||||
/SHOW[=option]
|
||||
|
||||
This causes the preprocessor to generate information other than the
|
||||
preprocessed input file. When this qualifier is used, no assembly
|
||||
code and no object file is generated.
|
||||
|
||||
The output of the preprocessor is placed in the file specified by the
|
||||
/LIST qualifier, if present. If the /LIST qualifier is not present,
|
||||
then the output is placed in a file with the same name as the input
|
||||
file with an extension that depends upon which option that is
|
||||
selected.
|
||||
|
||||
3 DEFINITIONS
|
||||
|
||||
This option causes the preprocessor to dump a list of all of the
|
||||
definitions to the output file. This is useful for debugging
|
||||
purposes, since it lets you determine whether or not everything has
|
||||
been defined properly.
|
||||
|
||||
If the default file name is used for the output, the extension will
|
||||
be .DEF.
|
||||
|
||||
3 RULES
|
||||
|
||||
This option causes the preprocessor to output a rule suitable for
|
||||
MAKE, describing the dependencies of the main source file. The
|
||||
preprocessor outputs one MAKE rule containing the object file name
|
||||
for that source file, a colon, and the names of all the concluded
|
||||
files. If there are many included files then the rule is split into
|
||||
several lines using the '\'-newline.
|
||||
|
||||
When using this option, only files included with the "#include "file"
|
||||
directive are mentioned.
|
||||
|
||||
If the default file name is used for the output, a null extension
|
||||
will be used.
|
||||
|
||||
3 ALL
|
||||
|
||||
This option is similar to RULES, except that it also mentions files
|
||||
included with the "#include <file.h>" directive.
|
||||
|
||||
If the default file name is used for the output, a null extension
|
||||
will be used.
|
||||
|
||||
2 /UNDEFINE
|
||||
|
||||
/UNDEFINE cancels a macro definition. Thus, it is the same as the
|
||||
#undef preprocessor directive.
|
||||
|
||||
If more than one /UNDEFINE is present on the GCC command line, only
|
||||
the last /UNDEFINE is used.
|
||||
|
||||
If both /DEFINE and /UNDEFINE are present on a command line, /DEFINE
|
||||
is evaluated before /UNDEFINE.
|
||||
|
||||
2 /VERBOSE
|
||||
|
||||
Controls whether the user sees the invocation command strings for the
|
||||
preprocessor, compiler, and assembler. The compiler also outputs
|
||||
some statistics on time spent in its various phases.
|
||||
|
||||
2 /VERSION
|
||||
|
||||
Causes the preprocessor and the compiler to identify themselves by
|
||||
their version numbers, and in the case of the compiler, the version
|
||||
number of the compiler that built it.
|
||||
|
||||
2 /WARNING
|
||||
|
||||
When this qualifier is present, warnings about usage that should be
|
||||
avoided are given by the compiler. For more information, see "Using
|
||||
and Porting GNU CC", in the section on command line options, under
|
||||
"-Wall".
|
||||
|
||||
Warnings are also generated by the preprocessor when this qualifier
|
||||
is given.
|
||||
|
||||
2 Known_Incompatibilities_with_VAX-C
|
||||
|
||||
There are several known incompatibilities between GNU-C and VAX-C.
|
||||
Some common ones will be briefly described here. A complete
|
||||
description can be found in "Using and Porting GNU CC" in the chapter
|
||||
entitled "Using GNU CC on VMS".
|
||||
|
||||
GNU-C provides case hacking as a means of giving case sensitivity
|
||||
to symbol names. The case hack is a hexadecimal number appended to
|
||||
the symbol name, with a bit being set for each upper case letter.
|
||||
Symbols with all lower case, or symbols that have a dollar sign ("$")
|
||||
are not case hacked. There are times that this is undesirable,
|
||||
namely when you wish to link your program against a precompiled
|
||||
library which was compiled with a non-GNU-C compiler. X-windows (or
|
||||
DECWindows) is an example of this. In these instances, the
|
||||
/NOCASE_HACK switch should be used.
|
||||
|
||||
If you require case hacking in some cases, but not in others (i.e.
|
||||
Libg++ with DECWindows), then it is recommended that you develop a
|
||||
header file which will define all mixed case functions that should
|
||||
not have a case hack as the lower case equivalents.
|
||||
|
||||
GNU-C does not provide the globaldef and globalref mechanism
|
||||
which is used by VAX-C to coerce the VMS linker to include certain
|
||||
object modules from a library. There are assembler hacks, which are
|
||||
available to the user through the macros defined in gnu_hacks.h,
|
||||
which effectively give you the ability to perform these functions.
|
||||
While not syntactically identical, they do provide most of the
|
||||
functionality.
|
||||
|
||||
Note that globaldefs of enums is not supported in the way that it is
|
||||
under VAX-C. This can be easily simulated, however, by globaldefing
|
||||
an integer variable, and then globalvaluing all of the enumerated
|
||||
states.
|
||||
|
||||
Furthermore, the way that globalvalue is currently implemented, the
|
||||
data type of the globalvalue variable is seen to the compiler to be a
|
||||
pointer to the data type that you specify. This is necessary in
|
||||
order to make the compiler correctly address the globalvalue
|
||||
variables.
|
||||
|
||||
4793
gcc/gcc.texi
Normal file
4793
gcc/gcc.texi
Normal file
File diff suppressed because it is too large
Load Diff
62
gcc/gencheck.c
Normal file
62
gcc/gencheck.c
Normal file
@@ -0,0 +1,62 @@
|
||||
/* Generate check macros for tree codes.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "hconfig.h"
|
||||
#include "system.h"
|
||||
|
||||
#define DEFTREECODE(SYM, NAME, TYPE, LEN) STRINGIFY(SYM),
|
||||
|
||||
char *tree_codes[] = {
|
||||
#include "tree.def"
|
||||
(char*)0
|
||||
};
|
||||
|
||||
void usage ()
|
||||
{
|
||||
fprintf (stderr,"Usage: gencheck\n");
|
||||
}
|
||||
|
||||
int main (argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
int i;
|
||||
switch (argc)
|
||||
{
|
||||
case 1:
|
||||
break;
|
||||
default:
|
||||
usage ();
|
||||
exit (1);
|
||||
}
|
||||
|
||||
printf ("/* This file is generated using gencheck. Do not edit. */\n");
|
||||
for (i = 0; tree_codes[i]; i++)
|
||||
{
|
||||
printf ("#define %s_CHECK(t)\tTREE_CHECK (t, %s)\n",
|
||||
tree_codes[i], tree_codes[i]);
|
||||
printf ("#define %s_CHECK1(t)\tTREE_CHECK1 (t, %s)\n",
|
||||
tree_codes[i], tree_codes[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
287
gcc/gengenrtl.c
Normal file
287
gcc/gengenrtl.c
Normal file
@@ -0,0 +1,287 @@
|
||||
/* Generate code to allocate RTL structures.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC 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 GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
#include "hconfig.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#include "obstack.h"
|
||||
#define obstack_chunk_alloc xmalloc
|
||||
#define obstack_chunk_free free
|
||||
|
||||
#define NO_GENRTL_H
|
||||
#include "rtl.h"
|
||||
|
||||
|
||||
struct rtx_definition
|
||||
{
|
||||
const char *enumname, *name, *format;
|
||||
};
|
||||
|
||||
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) { # ENUM, NAME, FORMAT },
|
||||
|
||||
struct rtx_definition defs[] =
|
||||
{
|
||||
#include "rtl.def" /* rtl expressions are documented here */
|
||||
};
|
||||
|
||||
const char *formats[NUM_RTX_CODE];
|
||||
|
||||
static const char *
|
||||
type_from_format (char c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case 'i':
|
||||
return "int";
|
||||
case 'w':
|
||||
return "HOST_WIDE_INT";
|
||||
case 's':
|
||||
return "char *";
|
||||
case 'e':
|
||||
case 'u':
|
||||
return "rtx";
|
||||
case 'E':
|
||||
return "rtvec";
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
accessor_from_format (char c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case 'i':
|
||||
return "XINT";
|
||||
case 'w':
|
||||
return "XWINT";
|
||||
case 's':
|
||||
return "XSTR";
|
||||
case 'e':
|
||||
case 'u':
|
||||
return "XEXP";
|
||||
case 'E':
|
||||
return "XVEC";
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
special_format (fmt)
|
||||
const char *fmt;
|
||||
{
|
||||
return (strchr (fmt, '*') != 0
|
||||
|| strchr (fmt, 'V') != 0
|
||||
|| strchr (fmt, 'S') != 0
|
||||
|| strchr (fmt, 'n') != 0);
|
||||
}
|
||||
|
||||
static int
|
||||
special_rtx (idx)
|
||||
int idx;
|
||||
{
|
||||
return (strcmp (defs[idx].enumname, "CONST_INT") == 0
|
||||
|| strcmp (defs[idx].enumname, "REG") == 0);
|
||||
}
|
||||
|
||||
static void
|
||||
find_formats ()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_RTX_CODE; ++i)
|
||||
{
|
||||
const char **f;
|
||||
|
||||
if (special_format (defs[i].format))
|
||||
continue;
|
||||
|
||||
for (f = formats; *f ; ++f)
|
||||
if (!strcmp(*f, defs[i].format))
|
||||
break;
|
||||
|
||||
if (!*f)
|
||||
*f = defs[i].format;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gendecl (f, format)
|
||||
FILE *f;
|
||||
const char *format;
|
||||
{
|
||||
const char *p;
|
||||
int i;
|
||||
|
||||
fprintf (f, "extern rtx gen_rtx_fmt_%s PROTO((RTX_CODE, enum machine_mode mode",
|
||||
format);
|
||||
for (p = format, i = 0; *p ; ++p)
|
||||
if (*p != '0')
|
||||
fprintf (f, ", %s arg%d", type_from_format (*p), i++);
|
||||
fprintf (f, "));\n");
|
||||
}
|
||||
|
||||
static void
|
||||
genmacro (f, idx)
|
||||
FILE *f;
|
||||
int idx;
|
||||
{
|
||||
const char *p;
|
||||
int i;
|
||||
|
||||
fprintf (f, "#define gen_rtx_%s%s(mode",
|
||||
(special_rtx (idx) ? "raw_" : ""), defs[idx].enumname);
|
||||
|
||||
for (p = defs[idx].format, i = 0; *p ; ++p)
|
||||
if (*p != '0')
|
||||
fprintf (f, ", arg%d", i++);
|
||||
fprintf (f, ") ");
|
||||
|
||||
fprintf (f, "gen_rtx_fmt_%s(%s,(mode)", defs[idx].format, defs[idx].enumname);
|
||||
for (p = defs[idx].format, i = 0; *p ; ++p)
|
||||
if (*p != '0')
|
||||
fprintf (f, ",(arg%d)", i++);
|
||||
fprintf (f, ")\n");
|
||||
}
|
||||
|
||||
static void
|
||||
gendef (f, format)
|
||||
FILE *f;
|
||||
const char *format;
|
||||
{
|
||||
const char *p;
|
||||
int i, j;
|
||||
|
||||
fprintf (f, "rtx\ngen_rtx_fmt_%s (code, mode", format);
|
||||
for (p = format, i = 0; *p ; ++p)
|
||||
if (*p != '0')
|
||||
fprintf (f, ", arg%d", i++);
|
||||
|
||||
fprintf (f, ")\n RTX_CODE code;\n enum machine_mode mode;\n");
|
||||
for (p = format, i = 0; *p ; ++p)
|
||||
if (*p != '0')
|
||||
fprintf (f, " %s arg%d;\n", type_from_format (*p), i++);
|
||||
|
||||
/* See rtx_alloc in rtl.c for comments. */
|
||||
fprintf (f, "{\n");
|
||||
fprintf (f, " register int length = sizeof (struct rtx_def)");
|
||||
fprintf (f, " + %d * sizeof (rtunion);\n", strlen (format) - 1);
|
||||
fprintf (f, " rtx rt = (rtx)obstack_alloc (rtl_obstack, length);\n");
|
||||
|
||||
fprintf (f, " if (sizeof(struct rtx_def) - sizeof(rtunion) == sizeof(int))\n");
|
||||
fprintf (f, " *(int *)rt = 0;\n");
|
||||
fprintf (f, " else if (sizeof(struct rtx_def) - sizeof(rtunion) == sizeof(HOST_WIDE_INT))\n");
|
||||
fprintf (f, " *(HOST_WIDE_INT *)rt = 0;\n");
|
||||
fprintf (f, " else\n");
|
||||
fprintf (f, " bzero(rt, sizeof(struct rtx_def) - sizeof(rtunion));\n\n");
|
||||
|
||||
fprintf (f, " PUT_CODE (rt, code);\n");
|
||||
fprintf (f, " PUT_MODE (rt, mode);\n");
|
||||
|
||||
for (p = format, i = j = 0; *p ; ++p, ++i)
|
||||
if (*p != '0')
|
||||
{
|
||||
fprintf (f, " %s (rt, %d) = arg%d;\n",
|
||||
accessor_from_format (*p), i, j++);
|
||||
}
|
||||
|
||||
fprintf (f, "\n return rt;\n}\n\n");
|
||||
}
|
||||
|
||||
static void
|
||||
genlegend (f)
|
||||
FILE *f;
|
||||
{
|
||||
fprintf (f, "/* Generated automaticaly by the program `gengenrtl'\n");
|
||||
fprintf (f, " from the RTL description file `rtl.def' */\n\n");
|
||||
}
|
||||
|
||||
static void
|
||||
genheader (f)
|
||||
FILE *f;
|
||||
{
|
||||
int i;
|
||||
const char **fmt;
|
||||
|
||||
for (fmt = formats; *fmt; ++fmt)
|
||||
gendecl (f, *fmt);
|
||||
|
||||
fprintf(f, "\n");
|
||||
|
||||
for (i = 0; i < NUM_RTX_CODE; i++)
|
||||
{
|
||||
if (special_format (defs[i].format))
|
||||
continue;
|
||||
genmacro (f, i);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gencode (f)
|
||||
FILE *f;
|
||||
{
|
||||
const char **fmt;
|
||||
|
||||
fprintf(f, "#include \"config.h\"\n");
|
||||
fprintf(f, "#include \"obstack.h\"\n");
|
||||
fprintf(f, "#include \"rtl.h\"\n\n");
|
||||
fprintf(f, "extern struct obstack *rtl_obstack;\n\n");
|
||||
|
||||
for (fmt = formats; *fmt; ++fmt)
|
||||
gendef (f, *fmt);
|
||||
}
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
if (argc != 3)
|
||||
exit (1);
|
||||
|
||||
find_formats ();
|
||||
|
||||
f = fopen (argv[1], "w");
|
||||
if (f == NULL)
|
||||
{
|
||||
perror(argv[1]);
|
||||
exit (1);
|
||||
}
|
||||
genlegend (f);
|
||||
genheader (f);
|
||||
fclose(f);
|
||||
|
||||
f = fopen (argv[2], "w");
|
||||
if (f == NULL)
|
||||
{
|
||||
perror(argv[2]);
|
||||
exit (1);
|
||||
}
|
||||
genlegend (f);
|
||||
gencode (f);
|
||||
fclose(f);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
28
gcc/getopt.c
28
gcc/getopt.c
@@ -6,23 +6,23 @@
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
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, or (at your option) any
|
||||
later version.
|
||||
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, 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.
|
||||
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
||||
Ditto for AIX 3.2 and <stdlib.h>. */
|
||||
|
||||
30
gcc/getopt.h
30
gcc/getopt.h
@@ -1,23 +1,23 @@
|
||||
/* Declarations for getopt.
|
||||
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
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, or (at your option) any
|
||||
later version.
|
||||
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, 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.
|
||||
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifndef _GETOPT_H
|
||||
#define _GETOPT_H 1
|
||||
@@ -130,4 +130,4 @@ extern int _getopt_internal ();
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* getopt.h */
|
||||
#endif /* _GETOPT_H */
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||
Copyright (C) 1987,88,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
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, or (at your option) any
|
||||
later version.
|
||||
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, 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.
|
||||
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
|
||||
111
gcc/ginclude/va-arc.h
Normal file
111
gcc/ginclude/va-arc.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/* stdarg/varargs support for the ARC */
|
||||
|
||||
/* Define __gnuc_va_list. */
|
||||
|
||||
#ifndef __GNUC_VA_LIST
|
||||
#define __GNUC_VA_LIST
|
||||
typedef void * __gnuc_va_list;
|
||||
#endif /* not __GNUC_VA_LIST */
|
||||
|
||||
/* If this is for internal libc use, don't define anything but
|
||||
__gnuc_va_list. */
|
||||
#if defined (_STDARG_H) || defined (_VARARGS_H)
|
||||
|
||||
/* In GCC version 2, we want an ellipsis at the end of the declaration
|
||||
of the argument list. GCC version 1 can't parse it. */
|
||||
|
||||
#if __GNUC__ > 1
|
||||
#define __va_ellipsis ...
|
||||
#else
|
||||
#define __va_ellipsis
|
||||
#endif
|
||||
|
||||
/* See arc_setup_incoming_varargs for reasons for the oddity in va_start. */
|
||||
#ifdef _STDARG_H
|
||||
#define va_start(AP, LASTARG) \
|
||||
(AP = (__gnuc_va_list) ((int *) __builtin_next_arg (LASTARG) \
|
||||
+ (__builtin_args_info (0) < 8 \
|
||||
? (__builtin_args_info (0) & 1) \
|
||||
: 0)))
|
||||
#else
|
||||
#define va_alist __builtin_va_alist
|
||||
#define va_dcl int __builtin_va_alist; __va_ellipsis
|
||||
#define va_start(AP) \
|
||||
(AP = (__gnuc_va_list) ((int *) &__builtin_va_alist \
|
||||
+ (__builtin_args_info (0) < 8 \
|
||||
? (__builtin_args_info (0) & 1) \
|
||||
: 0)))
|
||||
#endif
|
||||
|
||||
#ifndef va_end
|
||||
void va_end (__gnuc_va_list); /* Defined in libgcc.a */
|
||||
|
||||
/* Values returned by __builtin_classify_type. */
|
||||
|
||||
enum __va_type_classes {
|
||||
__no_type_class = -1,
|
||||
__void_type_class,
|
||||
__integer_type_class,
|
||||
__char_type_class,
|
||||
__enumeral_type_class,
|
||||
__boolean_type_class,
|
||||
__pointer_type_class,
|
||||
__reference_type_class,
|
||||
__offset_type_class,
|
||||
__real_type_class,
|
||||
__complex_type_class,
|
||||
__function_type_class,
|
||||
__method_type_class,
|
||||
__record_type_class,
|
||||
__union_type_class,
|
||||
__array_type_class,
|
||||
__string_type_class,
|
||||
__set_type_class,
|
||||
__file_type_class,
|
||||
__lang_type_class
|
||||
};
|
||||
|
||||
#endif
|
||||
#define va_end(AP) ((void)0)
|
||||
|
||||
/* Avoid errors if compiling GCC v2 with GCC v1. */
|
||||
#if __GNUC__ == 1
|
||||
#define __extension__
|
||||
#endif
|
||||
|
||||
/* All aggregates are passed by reference. All scalar types larger than 8
|
||||
bytes are passed by reference. */
|
||||
/* We cast to void * and then to TYPE * because this avoids
|
||||
a warning about increasing the alignment requirement.
|
||||
The casts to char * avoid warnings about invalid pointer arithmetic. */
|
||||
|
||||
#define __va_rounded_size(TYPE) \
|
||||
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
|
||||
|
||||
#ifdef __big_endian__
|
||||
#define va_arg(AP,TYPE) \
|
||||
__extension__ \
|
||||
(*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class \
|
||||
|| __va_rounded_size (TYPE) > 8) \
|
||||
? ((AP) = (char *)(AP) + __va_rounded_size (TYPE *), \
|
||||
*(TYPE **) (void *) ((char *)(AP) - __va_rounded_size (TYPE *))) \
|
||||
: ((TYPE *) (void *) \
|
||||
(AP = (void *) ((__alignof__ (TYPE) > 4 \
|
||||
? ((int) AP + 8 - 1) & -8 \
|
||||
: (int) AP) \
|
||||
+ __va_rounded_size (TYPE))) - 1));}))
|
||||
#else
|
||||
#define va_arg(AP,TYPE) \
|
||||
__extension__ \
|
||||
(*({((__builtin_classify_type (*(TYPE*) 0) >= __record_type_class \
|
||||
|| __va_rounded_size (TYPE) > 8) \
|
||||
? ((AP) = (char *)(AP) + __va_rounded_size (TYPE *), \
|
||||
*(TYPE **) (void *) ((char *)(AP) - __va_rounded_size (TYPE *))) \
|
||||
: ((AP = (void *) ((__alignof__ (TYPE) > 4 \
|
||||
? ((int) AP + 8 - 1) & -8 \
|
||||
: (int) AP) \
|
||||
+ __va_rounded_size (TYPE))), \
|
||||
(TYPE *) (void *) (AP - __va_rounded_size (TYPE))));}))
|
||||
#endif
|
||||
|
||||
#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
|
||||
37
gcc/ginclude/va-v850.h
Normal file
37
gcc/ginclude/va-v850.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/* CYGNUS LOCAL v850/law (entire file ) */
|
||||
|
||||
/* Define __gnuc_va_list. */
|
||||
|
||||
#ifndef __GNUC_VA_LIST
|
||||
#define __GNUC_VA_LIST
|
||||
typedef void *__gnuc_va_list;
|
||||
#endif /* not __GNUC_VA_LIST */
|
||||
|
||||
/* If this is for internal libc use, don't define anything but
|
||||
__gnuc_va_list. */
|
||||
#if defined (_STDARG_H) || defined (_VARARGS_H)
|
||||
|
||||
#ifdef _STDARG_H
|
||||
#define va_start(AP, LASTARG) \
|
||||
(AP = ((__gnuc_va_list) __builtin_next_arg (LASTARG)))
|
||||
#else
|
||||
#define __va_ellipsis ...
|
||||
#define va_alist __builtin_va_alist
|
||||
#define va_dcl int __builtin_va_alist; __va_ellipsis
|
||||
#define va_start(AP) AP=(char *) &__builtin_va_alist
|
||||
#endif
|
||||
|
||||
/* Now stuff common to both varargs & stdarg implementations. */
|
||||
#define __va_rounded_size(TYPE) \
|
||||
(((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
|
||||
#undef va_end
|
||||
void va_end (__gnuc_va_list);
|
||||
#define va_end(AP) ((void)0)
|
||||
#define va_arg(AP, TYPE) \
|
||||
(sizeof (TYPE) > 8 \
|
||||
? (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (char *)),\
|
||||
**((TYPE **) (void *) ((char *) (AP) - __va_rounded_size (char *))))\
|
||||
: (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \
|
||||
*((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))))
|
||||
#endif
|
||||
/* END CYGNUS LOCAL */
|
||||
17
gcc/gstab.h
Normal file
17
gcc/gstab.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef __GNU_STAB__
|
||||
|
||||
/* Indicate the GNU stab.h is in use. */
|
||||
|
||||
#define __GNU_STAB__
|
||||
|
||||
#define __define_stab(NAME, CODE, STRING) NAME=CODE,
|
||||
|
||||
enum __stab_debug_code
|
||||
{
|
||||
#include "stab.def"
|
||||
LAST_UNUSED_STAB_CODE
|
||||
};
|
||||
|
||||
#undef __define_stab
|
||||
|
||||
#endif /* __GNU_STAB_ */
|
||||
@@ -179,13 +179,13 @@ make a difference.
|
||||
@cindex Objective C threads
|
||||
@cindex threads, Objective C
|
||||
@item --enable-objcthreads=@var{type}
|
||||
Certain systems, notably Linux, can't be relied on to supply a threads
|
||||
facility for the Objective C runtime and so will default to
|
||||
single-threaded runtime. They may, however, have a library threads
|
||||
implementation available, in which case threads can be enabled with this
|
||||
option by supplying a suitable @var{type}, probably @samp{posix}.
|
||||
The possibilities for @var{type} are @samp{single}, @samp{posix},
|
||||
@samp{win32}, @samp{solaris}, @samp{irix} and @samp{mach}.
|
||||
Certain systems, notably Linux-based GNU systems, can't be relied on to
|
||||
supply a threads facility for the Objective C runtime and so will
|
||||
default to single-threaded runtime. They may, however, have a library
|
||||
threads implementation available, in which case threads can be enabled
|
||||
with this option by supplying a suitable @var{type}, probably
|
||||
@samp{posix}. The possibilities for @var{type} are @samp{single},
|
||||
@samp{posix}, @samp{win32}, @samp{solaris}, @samp{irix} and @samp{mach}.
|
||||
@end table
|
||||
|
||||
The @file{configure} script searches subdirectories of the source
|
||||
@@ -610,7 +610,7 @@ Here is a list of system types:
|
||||
|
||||
@quotation
|
||||
386bsd, aix, acis, amigados, aos, aout, aux, bosx, bsd, clix, coff, ctix, cxux,
|
||||
dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms, genix, gnu, gnu/linux,
|
||||
dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms, genix, gnu, linux-gnu,
|
||||
hiux, hpux, iris, irix, isc, luna, lynxos, mach, minix, msdos, mvs,
|
||||
netbsd, newsos, nindy, ns, osf, osfrose, ptx, riscix, riscos, rtu, sco, sim,
|
||||
solaris, sunos, sym, sysv, udi, ultrix, unicos, uniplus, unos, vms, vsta,
|
||||
@@ -759,15 +759,22 @@ To avoid this behavior, specify @samp{-gstabs+} and use GDB instead of
|
||||
DBX. DEC is now aware of this problem with the assembler and hopes to
|
||||
provide a fix shortly.
|
||||
|
||||
@item arm
|
||||
@item arm-*-aout
|
||||
Advanced RISC Machines ARM-family processors. These are often used in
|
||||
embedded applications. There are no standard Unix configurations.
|
||||
This configuration corresponds to the basic instruction sequences and will
|
||||
produce a.out format object modules.
|
||||
produce @file{a.out} format object modules.
|
||||
|
||||
You may need to make a variant of the file @file{arm.h} for your particular
|
||||
configuration.
|
||||
|
||||
@item arm-*-linuxaout
|
||||
Any of the ARM family processors running the Linux-based GNU system with
|
||||
the @file{a.out} binary format (ELF is not yet supported). You must use
|
||||
version 2.8.1.0.7 or later of the Linux binutils, which you can download
|
||||
from @file{sunsite.unc.edu:/pub/Linux/GCC} and other mirror sites for
|
||||
Linux-based GNU systems.
|
||||
|
||||
@item arm-*-riscix
|
||||
The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD Unix. If
|
||||
you are running a version of RISC iX prior to 1.2 then you must specify
|
||||
@@ -880,19 +887,19 @@ option before building.
|
||||
This port is very preliminary and has many known bugs. We hope to
|
||||
have a higher-quality port for this machine soon.
|
||||
|
||||
@item i386-*-linuxoldld
|
||||
Use this configuration to generate a.out binaries on Linux if you do not
|
||||
have gas/binutils version 2.5.2 or later installed. This is an obsolete
|
||||
configuration.
|
||||
@item i386-*-linux-gnuoldld
|
||||
Use this configuration to generate @file{a.out} binaries on Linux-based
|
||||
GNU systems if you do not have gas/binutils version 2.5.2 or later
|
||||
installed. This is an obsolete configuration.
|
||||
|
||||
@item i386-*-linuxaout
|
||||
Use this configuration to generate a.out binaries on Linux. This configuration
|
||||
is being superseded. You must use gas/binutils version 2.5.2 or
|
||||
later.
|
||||
@item i386-*-linux-gnuaout
|
||||
Use this configuration to generate @file{a.out} binaries on Linux-based
|
||||
GNU systems. This configuration is being superseded. You must use
|
||||
gas/binutils version 2.5.2 or later.
|
||||
|
||||
@item i386-*-linux
|
||||
Use this configuration to generate ELF binaries on Linux. You must
|
||||
use gas/binutils version 2.5.2 or later.
|
||||
@item i386-*-linux-gnu
|
||||
Use this configuration to generate ELF binaries on Linux-based GNU
|
||||
systems. You must use gas/binutils version 2.5.2 or later.
|
||||
|
||||
@item i386-*-sco
|
||||
Compilation with RCC is recommended. Also, it may be a good idea to
|
||||
@@ -1017,7 +1024,7 @@ LynxOS 2.2 and earlier comes with GNU CC 1.x already installed as
|
||||
You can tell GNU CC to use the GNU assembler and linker, by specifying
|
||||
@samp{--with-gnu-as --with-gnu-ld} when configuring. These will produce
|
||||
COFF format object files and executables; otherwise GNU CC will use the
|
||||
installed tools, which produce a.out format executables.
|
||||
installed tools, which produce @file{a.out} format executables.
|
||||
|
||||
@item m32r-*-elf
|
||||
Embedded M32R system.
|
||||
@@ -1378,8 +1385,8 @@ PowerPC system in big endian mode, running System V.4.
|
||||
You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
|
||||
switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
|
||||
|
||||
@item powerpc-*-linux
|
||||
PowerPC system in big endian mode, running Linux.
|
||||
@item powerpc-*-linux-gnu
|
||||
PowerPC system in big endian mode, running the Linux-based GNU system.
|
||||
|
||||
You can specify a default version for the @samp{-mcpu=}@var{cpu_type}
|
||||
switch by using the configure option @samp{--with-cpu-}@var{cpu_type}.
|
||||
|
||||
15
gcc/install1.texi
Normal file
15
gcc/install1.texi
Normal file
@@ -0,0 +1,15 @@
|
||||
@setfilename INSTALL
|
||||
@set INSTALLONLY
|
||||
|
||||
@c This file itself, install1.texi, does not apear in the GCC distribution.
|
||||
@c The immediately following lines apply to the INSTALL file
|
||||
@c which is generated using this file.
|
||||
This file documents the installation of the GNU compiler.
|
||||
Copyright (C) 1988, 1989, 1992, 1994, 1995 Free Software Foundation, Inc.
|
||||
You may copy, distribute, and modify it freely as long as you preserve
|
||||
this copyright notice and permission notice.
|
||||
|
||||
@node Installation,,, (dir)
|
||||
@chapter Installing GNU CC
|
||||
@include install.texi
|
||||
@bye
|
||||
6
gcc/intl.c
Normal file
6
gcc/intl.c
Normal file
@@ -0,0 +1,6 @@
|
||||
/* intl.c - internationalization */
|
||||
|
||||
#include "gansidecl.h"
|
||||
#include "intl.h"
|
||||
|
||||
const char localedir[] = LOCALEDIR;
|
||||
52
gcc/intl.h
Normal file
52
gcc/intl.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/* intl.h - internationalization
|
||||
Copyright 1998 Free Software Foundation, Inc.
|
||||
|
||||
GCC 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, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC 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 GCC; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_LOCALE_H
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SETLOCALE
|
||||
# define setlocale(category, locale) (locale)
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
extern const char localedir[];
|
||||
#else
|
||||
/* Stubs that do something close enough. */
|
||||
# ifdef textdomain
|
||||
# undef textdomain
|
||||
# endif
|
||||
# define textdomain(domain) (domain)
|
||||
# ifdef bindtextdomain
|
||||
# undef bindtextdomain
|
||||
# endif
|
||||
# define bindtextdomain(domain, directory) (domain)
|
||||
# ifdef gettext
|
||||
# undef gettext
|
||||
# endif
|
||||
# define gettext(msgid) (msgid)
|
||||
#endif
|
||||
|
||||
#ifndef _
|
||||
# define _(msgid) gettext (msgid)
|
||||
#endif
|
||||
|
||||
#ifndef N_
|
||||
# define N_(msgid) (msgid)
|
||||
#endif
|
||||
1086
gcc/intl/ChangeLog
Normal file
1086
gcc/intl/ChangeLog
Normal file
File diff suppressed because it is too large
Load Diff
218
gcc/intl/Makefile.in
Normal file
218
gcc/intl/Makefile.in
Normal file
@@ -0,0 +1,218 @@
|
||||
# Makefile for directory with message catalog handling in GNU NLS Utilities.
|
||||
# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = ..
|
||||
VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
transform = @program_transform_name@
|
||||
libdir = $(exec_prefix)/lib
|
||||
includedir = $(prefix)/include
|
||||
datadir = $(prefix)/@DATADIRNAME@
|
||||
localedir = $(datadir)/locale
|
||||
gnulocaledir = $(prefix)/share/locale
|
||||
gettextsrcdir = @datadir@/gettext/intl
|
||||
aliaspath = $(localedir):.
|
||||
subdir = intl
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
|
||||
l = @l@
|
||||
|
||||
AR = ar
|
||||
CC = @CC@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
RANLIB = @RANLIB@
|
||||
|
||||
DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \
|
||||
-DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CFLAGS = @CFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
||||
|
||||
HEADERS = $(COMHDRS) libgettext.h loadinfo.h
|
||||
COMHDRS = gettext.h gettextP.h hash-string.h
|
||||
SOURCES = $(COMSRCS) intl-compat.c cat-compat.c
|
||||
COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
|
||||
finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
|
||||
explodename.c
|
||||
OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
|
||||
finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
|
||||
explodename.$lo
|
||||
CATOBJS = cat-compat.$lo ../po/cat-id-tbl.$lo
|
||||
GETTOBJS = intl-compat.$lo
|
||||
DISTFILES.common = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \
|
||||
xopen-msg.sed $(HEADERS) $(SOURCES)
|
||||
DISTFILES.normal = VERSION
|
||||
DISTFILES.gettext = libintl.glibc intlh.inst.in
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .lo
|
||||
.c.o:
|
||||
$(COMPILE) $<
|
||||
.c.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) $<
|
||||
|
||||
INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir)/lib
|
||||
|
||||
all: all-@USE_INCLUDED_LIBINTL@
|
||||
|
||||
all-yes: libintl.$la intlh.inst
|
||||
all-no:
|
||||
|
||||
libintl.a: $(OBJECTS)
|
||||
rm -f $@
|
||||
$(AR) cru $@ $(OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libintl.la: $(OBJECTS)
|
||||
$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJECTS) \
|
||||
-version-info 1:0 -rpath $(libdir)
|
||||
|
||||
../po/cat-id-tbl.$lo: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot
|
||||
cd ../po && $(MAKE) cat-id-tbl.$lo
|
||||
|
||||
check: all
|
||||
|
||||
# This installation goal is only used in GNU gettext. Packages which
|
||||
# only use the library should use install instead.
|
||||
|
||||
# We must not install the libintl.h/libintl.a files if we are on a
|
||||
# system which has the gettext() function in its C library or in a
|
||||
# separate library or use the catgets interface. A special case is
|
||||
# where configure found a previously installed GNU gettext library.
|
||||
# If you want to use the one which comes with this version of the
|
||||
# package, you have to use `configure --with-included-gettext'.
|
||||
install: install-exec install-data
|
||||
install-exec: all
|
||||
if test "$(PACKAGE)" = "gettext" \
|
||||
&& test '@INTLOBJS@' = '$(GETTOBJS)'; then \
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
$(MKINSTALLDIRS) $(libdir) $(includedir); \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $(libdir) $(includedir); \
|
||||
fi; \
|
||||
$(INSTALL_DATA) intlh.inst $(includedir)/libintl.h; \
|
||||
$(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
install-data: all
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
$(MKINSTALLDIRS) $(gettextsrcdir); \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
|
||||
fi; \
|
||||
$(INSTALL_DATA) VERSION $(gettextsrcdir)/VERSION; \
|
||||
dists="$(DISTFILES.common)"; \
|
||||
for file in $$dists; do \
|
||||
$(INSTALL_DATA) $(srcdir)/$$file $(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
||||
# Define this as empty until I found a useful application.
|
||||
installcheck:
|
||||
|
||||
uninstall:
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
dists="$(DISTFILES.common)"; \
|
||||
for file in $$dists; do \
|
||||
rm -f $(gettextsrcdir)/$$file; \
|
||||
done
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
||||
info dvi:
|
||||
|
||||
$(OBJECTS): ../config.h libgettext.h
|
||||
bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
|
||||
dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
|
||||
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES)
|
||||
here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
|
||||
|
||||
id: ID
|
||||
|
||||
ID: $(HEADERS) $(SOURCES)
|
||||
here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
|
||||
|
||||
|
||||
mostlyclean:
|
||||
rm -f *.a *.o *.lo core core.*
|
||||
|
||||
clean: mostlyclean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile ID TAGS po2msg.sed po2tbl.sed
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
|
||||
# GNU gettext needs not contain the file `VERSION' but contains some
|
||||
# other files which should not be distributed in other packages.
|
||||
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir: Makefile $(DISTFILES)
|
||||
if test "$(PACKAGE)" = gettext; then \
|
||||
additional="$(DISTFILES.gettext)"; \
|
||||
else \
|
||||
additional="$(DISTFILES.normal)"; \
|
||||
fi; \
|
||||
for file in $(DISTFILES.common) $$additional; do \
|
||||
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir); \
|
||||
done
|
||||
|
||||
dist-libc:
|
||||
tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc
|
||||
|
||||
Makefile: Makefile.in ../config.status
|
||||
cd .. \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
# The dependency for intlh.inst is different in gettext and all other
|
||||
# packages. Because we cannot you GNU make features we have to solve
|
||||
# the problem while rewriting Makefile.in.
|
||||
@GT_YES@intlh.inst: intlh.inst.in ../config.status
|
||||
@GT_YES@ cd .. \
|
||||
@GT_YES@ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
|
||||
@GT_YES@ $(SHELL) ./config.status
|
||||
@GT_NO@.PHONY: intlh.inst
|
||||
@GT_NO@intlh.inst:
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
1
gcc/intl/VERSION
Normal file
1
gcc/intl/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
GNU gettext library from gettext-0.10.35
|
||||
203
gcc/intl/bindtextdom.c
Normal file
203
gcc/intl/bindtextdom.c
Normal file
@@ -0,0 +1,203 @@
|
||||
/* Implementation of the bindtextdomain(3) function
|
||||
Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined STDC_HEADERS || defined _LIBC
|
||||
# include <stdlib.h>
|
||||
#else
|
||||
# ifdef HAVE_MALLOC_H
|
||||
# include <malloc.h>
|
||||
# else
|
||||
void free ();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined HAVE_STRING_H || defined _LIBC
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
# ifndef memcpy
|
||||
# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _LIBC
|
||||
# include <libintl.h>
|
||||
#else
|
||||
# include "libgettext.h"
|
||||
#endif
|
||||
#include "gettext.h"
|
||||
#include "gettextP.h"
|
||||
|
||||
/* @@ end of prolog @@ */
|
||||
|
||||
/* Contains the default location of the message catalogs. */
|
||||
extern const char _nl_default_dirname[];
|
||||
|
||||
/* List with bindings of specific domains. */
|
||||
extern struct binding *_nl_domain_bindings;
|
||||
|
||||
|
||||
/* Names for the libintl functions are a problem. They must not clash
|
||||
with existing names and they should follow ANSI C. But this source
|
||||
code is also used in GNU C Library where the names have a __
|
||||
prefix. So we have to make a difference here. */
|
||||
#ifdef _LIBC
|
||||
# define BINDTEXTDOMAIN __bindtextdomain
|
||||
# ifndef strdup
|
||||
# define strdup(str) __strdup (str)
|
||||
# endif
|
||||
#else
|
||||
# define BINDTEXTDOMAIN bindtextdomain__
|
||||
#endif
|
||||
|
||||
/* Specify that the DOMAINNAME message catalog will be found
|
||||
in DIRNAME rather than in the system locale data base. */
|
||||
char *
|
||||
BINDTEXTDOMAIN (domainname, dirname)
|
||||
const char *domainname;
|
||||
const char *dirname;
|
||||
{
|
||||
struct binding *binding;
|
||||
|
||||
/* Some sanity checks. */
|
||||
if (domainname == NULL || domainname[0] == '\0')
|
||||
return NULL;
|
||||
|
||||
for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
|
||||
{
|
||||
int compare = strcmp (domainname, binding->domainname);
|
||||
if (compare == 0)
|
||||
/* We found it! */
|
||||
break;
|
||||
if (compare < 0)
|
||||
{
|
||||
/* It is not in the list. */
|
||||
binding = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (dirname == NULL)
|
||||
/* The current binding has be to returned. */
|
||||
return binding == NULL ? (char *) _nl_default_dirname : binding->dirname;
|
||||
|
||||
if (binding != NULL)
|
||||
{
|
||||
/* The domain is already bound. If the new value and the old
|
||||
one are equal we simply do nothing. Otherwise replace the
|
||||
old binding. */
|
||||
if (strcmp (dirname, binding->dirname) != 0)
|
||||
{
|
||||
char *new_dirname;
|
||||
|
||||
if (strcmp (dirname, _nl_default_dirname) == 0)
|
||||
new_dirname = (char *) _nl_default_dirname;
|
||||
else
|
||||
{
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
new_dirname = strdup (dirname);
|
||||
if (new_dirname == NULL)
|
||||
return NULL;
|
||||
#else
|
||||
size_t len = strlen (dirname) + 1;
|
||||
new_dirname = (char *) malloc (len);
|
||||
if (new_dirname == NULL)
|
||||
return NULL;
|
||||
|
||||
memcpy (new_dirname, dirname, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (binding->dirname != _nl_default_dirname)
|
||||
free (binding->dirname);
|
||||
|
||||
binding->dirname = new_dirname;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We have to create a new binding. */
|
||||
#if !defined _LIBC && !defined HAVE_STRDUP
|
||||
size_t len;
|
||||
#endif
|
||||
struct binding *new_binding =
|
||||
(struct binding *) malloc (sizeof (*new_binding));
|
||||
|
||||
if (new_binding == NULL)
|
||||
return NULL;
|
||||
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
new_binding->domainname = strdup (domainname);
|
||||
if (new_binding->domainname == NULL)
|
||||
return NULL;
|
||||
#else
|
||||
len = strlen (domainname) + 1;
|
||||
new_binding->domainname = (char *) malloc (len);
|
||||
if (new_binding->domainname == NULL)
|
||||
return NULL;
|
||||
memcpy (new_binding->domainname, domainname, len);
|
||||
#endif
|
||||
|
||||
if (strcmp (dirname, _nl_default_dirname) == 0)
|
||||
new_binding->dirname = (char *) _nl_default_dirname;
|
||||
else
|
||||
{
|
||||
#if defined _LIBC || defined HAVE_STRDUP
|
||||
new_binding->dirname = strdup (dirname);
|
||||
if (new_binding->dirname == NULL)
|
||||
return NULL;
|
||||
#else
|
||||
len = strlen (dirname) + 1;
|
||||
new_binding->dirname = (char *) malloc (len);
|
||||
if (new_binding->dirname == NULL)
|
||||
return NULL;
|
||||
memcpy (new_binding->dirname, dirname, len);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Now enqueue it. */
|
||||
if (_nl_domain_bindings == NULL
|
||||
|| strcmp (domainname, _nl_domain_bindings->domainname) < 0)
|
||||
{
|
||||
new_binding->next = _nl_domain_bindings;
|
||||
_nl_domain_bindings = new_binding;
|
||||
}
|
||||
else
|
||||
{
|
||||
binding = _nl_domain_bindings;
|
||||
while (binding->next != NULL
|
||||
&& strcmp (domainname, binding->next->domainname) > 0)
|
||||
binding = binding->next;
|
||||
|
||||
new_binding->next = binding->next;
|
||||
binding->next = new_binding;
|
||||
}
|
||||
|
||||
binding = new_binding;
|
||||
}
|
||||
|
||||
return binding->dirname;
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
/* Alias for function name in GNU C Library. */
|
||||
weak_alias (__bindtextdomain, bindtextdomain);
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user