This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: printing exceptions?
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: tromey at redhat dot com, Jeff Sturm <jsturm at one-point dot com>, Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>, Java Discuss List <java at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Date: 30 Mar 2002 22:02:53 -0300
- Subject: Re: printing exceptions?
- Organization: GCC Team, Red Hat
- References: <Pine.LNX.4.10.10203052317220.6889-100000@mars.deadcafe.org><orsn7dtpij.fsf@free.redhat.lsd.ic.unicamp.br><87u1rt4948.fsf@creche.redhat.com><orwuwps5h1.fsf@free.redhat.lsd.ic.unicamp.br><87664947pt.fsf@creche.redhat.com><orpu25sb8g.fsf@free.redhat.lsd.ic.unicamp.br><20020315152842.A26146@redhat.com><orelilqu9g.fsf@free.redhat.lsd.ic.unicamp.br><oradsqfm78.fsf@free.redhat.lsd.ic.unicamp.br><20020330115605.A20488@redhat.com>
On Mar 30, 2002, Richard Henderson <rth@redhat.com> wrote:
> On Sat, Mar 30, 2002 at 06:18:19AM -0300, Alexandre Oliva wrote:
>> * gcc.c (LIBGCC_SPEC): Folded %L and duplicate %G here...
>> (LINK_COMMAND_SPEC): ... from here.
>> (init_gcc_specs): Duplicate it here too, omitting
>> shared_name in the second copy.
>> (init_spec): Test for duplicate
>> * config/i386/djgpp.h (LINK_COMMAND_SPEC): Remove `%L %G'.
> Ok.
Hmm... Unfortunately this broke libjava's overriding of the lib spec,
introducing infinite mutual recursion between the overridden libc and
libgcc. I wonder if this means we shouldn't mess up with the lib
spec...
Anyway, here's a patch that adjusts libjava specs to work with the
reworked specs.
This time, bootstrap is complete, and libjava testing looks good
(except for a number of ICEs that were already present before).
There are no changes in the patch for gcc, only changes in libjava
were added.
Ok to install?
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* gcc.c (LIBGCC_SPEC): Folded %L and duplicate %G here...
(LINK_COMMAND_SPEC): ... from here.
(init_gcc_specs): Duplicate it here too, omitting
shared_name in the second copy.
(init_spec): Test for duplicate
* config/i386/djgpp.h (LINK_COMMAND_SPEC): Remove `%L %G'.
Index: gcc/gcc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcc.c,v
retrieving revision 1.304
diff -u -p -r1.304 gcc.c
--- gcc/gcc.c 2002/03/26 21:38:40 1.304
+++ gcc/gcc.c 2002/03/30 09:07:56
@@ -558,9 +558,9 @@ proper position among the other output f
#ifndef LIBGCC_SPEC
#if defined(LINK_LIBGCC_SPECIAL) || defined(LINK_LIBGCC_SPECIAL_1)
/* Have gcc do the search for libgcc.a. */
-#define LIBGCC_SPEC "libgcc.a%s"
+#define LIBGCC_SPEC "libgcc.a%s %L libgcc.a%s"
#else
-#define LIBGCC_SPEC "-lgcc"
+#define LIBGCC_SPEC "-lgcc %L -lgcc"
#endif
#endif
@@ -620,7 +620,7 @@ proper position among the other output f
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r} %{s} %{t}\
%{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
- %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
+ %{static:} %{L*} %(link_libgcc) %o %{!nostdlib:%{!nodefaultlibs:%G}}\
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
#endif
@@ -1426,7 +1426,16 @@ init_gcc_specs (obstack, shared_name, st
#else
shared_name,
#endif
- "}}}", NULL);
+ "}}} %L ",
+ "%{static|static-libgcc:", static_name, " ", eh_name,
+ "}%{!static:%{!static-libgcc:",
+ "%{!shared:%{!shared-libgcc:", static_name, " ",
+ eh_name, "}%{shared-libgcc:",
+ static_name, "}}",
+#ifdef LINK_EH_SPEC
+ "%{shared:%{!shared-libgcc:", static_name, "}}",
+#endif
+ "}}", NULL);
obstack_grow (obstack, buf, strlen (buf));
free (buf);
@@ -1507,7 +1516,7 @@ init_spec ()
when given the proper command line arguments. */
while (*p)
{
- if (in_sep && *p == '-' && strncmp (p, "-lgcc", 5) == 0)
+ if (in_sep && *p == '-' && strncmp (p, "-lgcc %L -lgcc", 14) == 0)
{
init_gcc_specs (&obstack,
#ifdef NO_SHARED_LIBGCC_MULTILIB
@@ -1518,10 +1527,11 @@ init_spec ()
,
"-lgcc",
"-lgcc_eh");
- p += 5;
+ p += 14;
in_sep = 0;
}
- else if (in_sep && *p == 'l' && strncmp (p, "libgcc.a%s", 10) == 0)
+ else if (in_sep && *p == 'l'
+ && strncmp (p, "libgcc.a%s %L libgcc.a%s", 24) == 0)
{
/* Ug. We don't know shared library extensions. Hope that
systems that use this form don't do shared libraries. */
@@ -1534,7 +1544,7 @@ init_spec ()
,
"libgcc.a%s",
"libgcc_eh.a%s");
- p += 10;
+ p += 24;
in_sep = 0;
}
else
Index: gcc/config/i386/djgpp.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/djgpp.h,v
retrieving revision 1.33
diff -u -p -r1.33 djgpp.h
--- gcc/config/i386/djgpp.h 2002/01/28 18:11:13 1.33
+++ gcc/config/i386/djgpp.h 2002/03/30 09:07:56
@@ -1,5 +1,5 @@
/* Configuration for an i386 running MS-DOS with DJGPP.
- Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -106,7 +106,7 @@ Boston, MA 02111-1307, USA. */
\t%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
\t%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
\t%{static:} %{L*} %D %o\
-\t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
+\t%{!nostdlib:%{!nodefaultlibs:%G}}\
\t%{!A:%{!nostdlib:%{!nostartfiles:%E}}}\
\t-Tdjgpp.djl %{T*}}}}}}}\n\
%{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}"
Index: libjava/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* libgcj.spec.in: Override libgcc, not lib.
* libgcj-test.spec.in: Likewise.
Index: libjava/libgcj.spec.in
===================================================================
RCS file: /cvs/gcc/egcs/libjava/libgcj.spec.in,v
retrieving revision 1.21
diff -u -p -r1.21 libgcj.spec.in
--- libjava/libgcj.spec.in 2002/03/27 16:41:35 1.21
+++ libjava/libgcj.spec.in 2002/03/31 00:56:28
@@ -3,7 +3,7 @@
# It is used to specify the standard libraries we need in order
# to link with libgcj.
#
-%rename lib liborig
-*lib: -lgcj -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) %(liborig)
+%rename libgcc libgccorig
+*libgcc: -lgcj -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgccorig)
*jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ -fkeep-inline-functions
Index: libjava/libgcj-test.spec.in
===================================================================
RCS file: /cvs/gcc/egcs/libjava/libgcj-test.spec.in,v
retrieving revision 1.1
diff -u -p -r1.1 libgcj-test.spec.in
--- libjava/libgcj-test.spec.in 2000/03/04 21:50:19 1.1
+++ libjava/libgcj-test.spec.in 2002/03/31 00:56:28
@@ -2,6 +2,6 @@
# This spec file is read by gcj when linking.
# It is only used by the testing harnesses (in libjava and gdb).
#
-%rename lib liborig2
-*lib: @LIBGCJTESTSPEC@ @GCTESTSPEC@ @ZLIBTESTSPEC@ %(liborig2)
+%rename libgcc libgccorig2
+*libgcc: @LIBGCJTESTSPEC@ @GCTESTSPEC@ @ZLIBTESTSPEC@ %(libgccorig2)
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer