A few tweaks, easing the life of c++filt...

documentation for rationale behind new config.
This commit is contained in:
espie 1999-01-13 13:58:45 +00:00
parent 4efff76354
commit 0b0a68840b
6 changed files with 210 additions and 36 deletions

View File

@ -3,7 +3,7 @@
# Date created: 25 sep 98
# Whom: Marc Espie
#
# $OpenBSD: Makefile,v 1.18 1999/01/13 00:09:03 espie Exp $
# $OpenBSD: Makefile,v 1.19 1999/01/13 13:58:45 espie Exp $
#
# This is a configuration file for egcs, snapshot flavor
# PLEASE use the regular egcs-stable for serious work, resort to this one
@ -19,9 +19,10 @@ CATEGORIES= lang
MAINTAINER= Marc.Espie@openbsd.org
MIRROR_DISTFILE=no
# with some help from Jason L.Wright & Marco S.Hyman for sparc,
# from Michael Shalayeff for hppa,
# from Wim Van Deputte for alpha.
# Testers for the new configurations:
# Jason L.Wright & Marco S.Hyman for sparc,
# Michael Shalayeff for hppa,
# Wim Van Deputte for alpha.
ONLY_FOR_ARCHS = i386 sparc m68k alpha pa
# user configuration section
@ -35,7 +36,7 @@ ONLY_FOR_ARCHS = i386 sparc m68k alpha pa
MAKE_TESTS=yes
MAKE_GXX=yes
MAKE_FORTRAN=yes
MAKE_CHILL=yes
#MAKE_CHILL=yes
MAKE_OBJC=yes
MAKE_JAVA=yes

69
lang/egcs-snapshot/README Normal file
View File

@ -0,0 +1,69 @@
$OpenBSD: README,v 1.1 1999/01/13 13:58:46 espie Exp $
Warning: highly experimental port.
It is assumed you know what you are doing by playing with this.
I am currently rewriting the openbsd configuration files, mostly from
scratch, in order to clean them up. Goal is to have something I can
file up with the FSF as soon as possible, so that egcs 1.1.2 will have
*official* openbsd support.
There are copyright issues involved.
If configuration for your favorite processor does not work, there are
two possibilities:
- you can send me complete bug reports, telling me what's wrong, and I will
try to get a viable configuration.
- you can do it yourself but, for any non-trivial change, you *MUST* file
a copyright assignment with the FSF. Otherwise, your patch won't make it
to the official egcs distribution, and we all lose.
One point of the clean-up is to be able to trace the configuration
precisely, so that it becomes easier to track newer versions of egcs,
or port OpenBSD to other architectures. Accordingly, each code fragment
has to be tagged with the place it originally came from, and variations
from standard practice have to be thoroughly documented.
For instance, if you have to change CC1_SPEC for OpenBSD, it is important
to know what you changed from that default processor configuration: when
egcs evolves and add new specs, it's easier to know what to pick up, and
what to leave alone.
As another example, netbsd recently added '.globl' to ASM_WEAKEN_LABEL,
and I don't know why yet... I am trying to figure out why, and whether
we need it to.
As a final example, it turns out that a large part of openbsd configuration
information in gcc 2.8.1 was just random cut&paste which didn't make much
sense in many cases... Ultimately, I hope that all egcs/gcc openbsd flavors
will use the same configuration files.
From a technical point of view, part of the challenge is that some bugs
may come from the compiler, some from the assembler, and from the linker.
It's likely that the only way to resolve many bugs will be to finally
upgrade to a recent binutils... For instance, C++ currently has to resort
to substandard setjump/longjump exceptions as we don't handle dwarf2 unwind
info correctly.
Accordingly, if you use this port, you MUST track current. For instance,
Jason recently fixed a bug in gas that showed up during sparc bootstrap.
Please read the Makefile before attempting to build this port. There might
be some tweaks involved. Start with make patch, then read the
documentation, and decide on changes. For instance, C++ folks may wish to
play with -fsquangle: since this is an option you need to activate for
building the library, you had better decide from the start.
On the other hand, there are several known situations which confuse our
specific flavor of gas. For instance, recent snapshots build fine on the
older machines with default CFLAGS (-O2 -g), but crash when -g is removed.
Once you get through all those caveats, and manage to build egcs, one
nice point is that you get fairly good C, C++, f77, objective-C, and
java compilers.
--
Marc Espie

View File

@ -1,4 +1,4 @@
/* $OpenBSD: openbsd.h,v 1.5 1999/01/12 11:27:40 espie Exp $ */
/* $OpenBSD: openbsd.h,v 1.6 1999/01/13 13:58:46 espie Exp $ */
/* vi:ts=8:
*/
@ -52,7 +52,13 @@
still uses a special flavor of gas that needs to be told when generating
pic code. */
#undef ASM_SPEC
#define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k -K}"
#define ASM_SPEC "%| %{fpic:-k} %{fPIC:-k -K}"
#else
/* Since we use gas, stdin -> - is a good idea, but we don't want to
override native specs just for that. */
#ifndef ASM_SPEC
#define ASM_SPEC "%|"
#endif
#endif
@ -100,10 +106,10 @@
/* Support of shared libraries, mostly imported from svr4.h through netbsd. */
/* Two differences from svr4.h:
- we use .-_func instead of a local label,
- we put a space after commas in expressions such as
.type _func, @function
This is more readable, for a human being as well as for the C++ demangler.
- we use .- _func instead of a local label,
- we put extra spaces in expressions such as
.type _func , @function
This is more readable for a human being and confuses c++filt less.
*/
/* These macros are needed for correct pic code generation, but they
should not break anything even if that specific system does not yet handle
@ -150,7 +156,7 @@
do { \
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
assemble_name (FILE, NAME); \
fputs (", ", FILE); \
fputs (" , ", FILE); \
fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
putc ('\n', FILE); \
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
@ -165,7 +171,7 @@
{ \
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
assemble_name (FILE, (FNAME)); \
fputs(", .-", FILE); \
fputs(" , .- ", FILE); \
assemble_name (FILE, (FNAME)); \
putc ('\n', FILE); \
} \
@ -177,7 +183,7 @@
do { \
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
assemble_name (FILE, NAME); \
fputs (", ", FILE); \
fputs (" , ", FILE); \
fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
putc ('\n', FILE); \
size_directive_output = 0; \
@ -186,7 +192,7 @@
size_directive_output = 1; \
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
assemble_name (FILE, NAME); \
fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
fprintf (FILE, " , %d\n", int_size_in_bytes (TREE_TYPE (DECL)));\
} \
ASM_OUTPUT_LABEL(FILE, NAME); \
} while (0)
@ -208,22 +214,33 @@ do { \
size_directive_output = 1; \
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
assemble_name (FILE, name); \
fprintf (FILE, ", %d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
fprintf (FILE, " , %d\n", int_size_in_bytes (TREE_TYPE (DECL)));\
} \
} while (0)
/* Those are `generic' ways to weaken/globalize a label. We shouldn't need
to override a processor specific definition. Hence, #ifndef ASM_*
In case overriding turns out to be needed, one can always #undef ASM_*
before including this file. */
/* Tell the assembler that a symbol is weak. */
/* XXX binutils assembler should make weak labels global itself. If you
need to emit a .globl here, it's likely your assembler is broken. */
#undef ASM_WEAKEN_LABEL
#ifndef ASM_WEAKEN_LABEL
#define ASM_WEAKEN_LABEL(FILE,NAME) \
do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
fputc ('\n', FILE); } while (0)
#endif
/* Tell the assembler that a symbol is global. */
#undef ASM_GLOBALIZE_LABEL
#ifndef ASM_GLOBALIZE_LABEL
#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
do { fputs ("\t.globl\t", FILE); assemble_name (FILE, NAME); \
fputc ('\n', FILE); } while(0)
#endif
/* Use VTABLE_THUNKS always: we don't have to worry about binary
compatibility with older C++ code. */
#define DEFAULT_VTABLE_THUNKS 1

View File

@ -3,7 +3,7 @@
# Date created: 25 sep 98
# Whom: Marc Espie
#
# $OpenBSD: Makefile,v 1.18 1999/01/13 00:09:03 espie Exp $
# $OpenBSD: Makefile,v 1.19 1999/01/13 13:58:45 espie Exp $
#
# This is a configuration file for egcs, snapshot flavor
# PLEASE use the regular egcs-stable for serious work, resort to this one
@ -19,9 +19,10 @@ CATEGORIES= lang
MAINTAINER= Marc.Espie@openbsd.org
MIRROR_DISTFILE=no
# with some help from Jason L.Wright & Marco S.Hyman for sparc,
# from Michael Shalayeff for hppa,
# from Wim Van Deputte for alpha.
# Testers for the new configurations:
# Jason L.Wright & Marco S.Hyman for sparc,
# Michael Shalayeff for hppa,
# Wim Van Deputte for alpha.
ONLY_FOR_ARCHS = i386 sparc m68k alpha pa
# user configuration section
@ -35,7 +36,7 @@ ONLY_FOR_ARCHS = i386 sparc m68k alpha pa
MAKE_TESTS=yes
MAKE_GXX=yes
MAKE_FORTRAN=yes
MAKE_CHILL=yes
#MAKE_CHILL=yes
MAKE_OBJC=yes
MAKE_JAVA=yes

69
lang/egcs/snapshot/README Normal file
View File

@ -0,0 +1,69 @@
$OpenBSD: README,v 1.1 1999/01/13 13:58:46 espie Exp $
Warning: highly experimental port.
It is assumed you know what you are doing by playing with this.
I am currently rewriting the openbsd configuration files, mostly from
scratch, in order to clean them up. Goal is to have something I can
file up with the FSF as soon as possible, so that egcs 1.1.2 will have
*official* openbsd support.
There are copyright issues involved.
If configuration for your favorite processor does not work, there are
two possibilities:
- you can send me complete bug reports, telling me what's wrong, and I will
try to get a viable configuration.
- you can do it yourself but, for any non-trivial change, you *MUST* file
a copyright assignment with the FSF. Otherwise, your patch won't make it
to the official egcs distribution, and we all lose.
One point of the clean-up is to be able to trace the configuration
precisely, so that it becomes easier to track newer versions of egcs,
or port OpenBSD to other architectures. Accordingly, each code fragment
has to be tagged with the place it originally came from, and variations
from standard practice have to be thoroughly documented.
For instance, if you have to change CC1_SPEC for OpenBSD, it is important
to know what you changed from that default processor configuration: when
egcs evolves and add new specs, it's easier to know what to pick up, and
what to leave alone.
As another example, netbsd recently added '.globl' to ASM_WEAKEN_LABEL,
and I don't know why yet... I am trying to figure out why, and whether
we need it to.
As a final example, it turns out that a large part of openbsd configuration
information in gcc 2.8.1 was just random cut&paste which didn't make much
sense in many cases... Ultimately, I hope that all egcs/gcc openbsd flavors
will use the same configuration files.
From a technical point of view, part of the challenge is that some bugs
may come from the compiler, some from the assembler, and from the linker.
It's likely that the only way to resolve many bugs will be to finally
upgrade to a recent binutils... For instance, C++ currently has to resort
to substandard setjump/longjump exceptions as we don't handle dwarf2 unwind
info correctly.
Accordingly, if you use this port, you MUST track current. For instance,
Jason recently fixed a bug in gas that showed up during sparc bootstrap.
Please read the Makefile before attempting to build this port. There might
be some tweaks involved. Start with make patch, then read the
documentation, and decide on changes. For instance, C++ folks may wish to
play with -fsquangle: since this is an option you need to activate for
building the library, you had better decide from the start.
On the other hand, there are several known situations which confuse our
specific flavor of gas. For instance, recent snapshots build fine on the
older machines with default CFLAGS (-O2 -g), but crash when -g is removed.
Once you get through all those caveats, and manage to build egcs, one
nice point is that you get fairly good C, C++, f77, objective-C, and
java compilers.
--
Marc Espie

View File

@ -1,4 +1,4 @@
/* $OpenBSD: openbsd.h,v 1.5 1999/01/12 11:27:40 espie Exp $ */
/* $OpenBSD: openbsd.h,v 1.6 1999/01/13 13:58:46 espie Exp $ */
/* vi:ts=8:
*/
@ -52,7 +52,13 @@
still uses a special flavor of gas that needs to be told when generating
pic code. */
#undef ASM_SPEC
#define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k -K}"
#define ASM_SPEC "%| %{fpic:-k} %{fPIC:-k -K}"
#else
/* Since we use gas, stdin -> - is a good idea, but we don't want to
override native specs just for that. */
#ifndef ASM_SPEC
#define ASM_SPEC "%|"
#endif
#endif
@ -100,10 +106,10 @@
/* Support of shared libraries, mostly imported from svr4.h through netbsd. */
/* Two differences from svr4.h:
- we use .-_func instead of a local label,
- we put a space after commas in expressions such as
.type _func, @function
This is more readable, for a human being as well as for the C++ demangler.
- we use .- _func instead of a local label,
- we put extra spaces in expressions such as
.type _func , @function
This is more readable for a human being and confuses c++filt less.
*/
/* These macros are needed for correct pic code generation, but they
should not break anything even if that specific system does not yet handle
@ -150,7 +156,7 @@
do { \
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
assemble_name (FILE, NAME); \
fputs (", ", FILE); \
fputs (" , ", FILE); \
fprintf (FILE, TYPE_OPERAND_FMT, "function"); \
putc ('\n', FILE); \
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
@ -165,7 +171,7 @@
{ \
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
assemble_name (FILE, (FNAME)); \
fputs(", .-", FILE); \
fputs(" , .- ", FILE); \
assemble_name (FILE, (FNAME)); \
putc ('\n', FILE); \
} \
@ -177,7 +183,7 @@
do { \
fprintf (FILE, "\t%s\t ", TYPE_ASM_OP); \
assemble_name (FILE, NAME); \
fputs (", ", FILE); \
fputs (" , ", FILE); \
fprintf (FILE, TYPE_OPERAND_FMT, "object"); \
putc ('\n', FILE); \
size_directive_output = 0; \
@ -186,7 +192,7 @@
size_directive_output = 1; \
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
assemble_name (FILE, NAME); \
fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
fprintf (FILE, " , %d\n", int_size_in_bytes (TREE_TYPE (DECL)));\
} \
ASM_OUTPUT_LABEL(FILE, NAME); \
} while (0)
@ -208,22 +214,33 @@ do { \
size_directive_output = 1; \
fprintf (FILE, "\t%s\t ", SIZE_ASM_OP); \
assemble_name (FILE, name); \
fprintf (FILE, ", %d\n", int_size_in_bytes (TREE_TYPE (DECL))); \
fprintf (FILE, " , %d\n", int_size_in_bytes (TREE_TYPE (DECL)));\
} \
} while (0)
/* Those are `generic' ways to weaken/globalize a label. We shouldn't need
to override a processor specific definition. Hence, #ifndef ASM_*
In case overriding turns out to be needed, one can always #undef ASM_*
before including this file. */
/* Tell the assembler that a symbol is weak. */
/* XXX binutils assembler should make weak labels global itself. If you
need to emit a .globl here, it's likely your assembler is broken. */
#undef ASM_WEAKEN_LABEL
#ifndef ASM_WEAKEN_LABEL
#define ASM_WEAKEN_LABEL(FILE,NAME) \
do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
fputc ('\n', FILE); } while (0)
#endif
/* Tell the assembler that a symbol is global. */
#undef ASM_GLOBALIZE_LABEL
#ifndef ASM_GLOBALIZE_LABEL
#define ASM_GLOBALIZE_LABEL(FILE,NAME) \
do { fputs ("\t.globl\t", FILE); assemble_name (FILE, NAME); \
fputc ('\n', FILE); } while(0)
#endif
/* Use VTABLE_THUNKS always: we don't have to worry about binary
compatibility with older C++ code. */
#define DEFAULT_VTABLE_THUNKS 1