From: hjl@lucon.org (H.J. Lu)
To: svivanov@pdmi.ras.ru (Sergei Ivanov)
Cc: svivanov@pdmi.ras.ru, egcs@cygnus.com
Subject: Re: Why link C with crtstuff? [patch]
Date: Sun, 26 Apr 1998 21:56:00 -0000 [thread overview]
Message-ID: <m0yTcI4-000598C@ocean.lucon.org> (raw)
In-Reply-To: <199804270108.FAA18466@euclid.pdmi.ras.ru>
>
> > > >
> > > > The patch is wrong. Please try this patch.
> > > >
> > > Thanks. It works for all my primitive tests except one.
> > > I have a shared library compiled by gcc-2.8.1 (libvga-1.2.13, but this
> > > should not be important):
> > >
> >
> > Please try this one. BTW, it will only works on systems with crtbeginS.o
> > and crtendS.o.
>
> It fails to apply to Makefile.in
>
> > diff -u -r1.1.1.33 Makefile.in
> > --- Makefile.in 1998/04/26 16:06:39 1.1.1.33
> > +++ Makefile.in 1998/04/26 20:46:39
> > s-crtS: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
>
> No @@ here, patch (2.4) just skips this.
Ooops. Here is the new one.
> Also, it seems to be against a snapshot (there is no s-crtS in 1.0.2).
It is stamp-crtS in 1.0.2. Just apply it by hand for 1.0.2.
> Is it against the latest one?
Yes.
--
H.J. Lu (hjl@gnu.org)
---
Sun Apr 26 13:51:04 1998 H.J. Lu (hjl@gnu.org)
* crtstuff.c (__register_frame_info, __deregister_frame_info):
If CRTSTUFFS_O is not defined and HANDLE_SYSV_PRAGMA is
defined, make them weak and check if they are none-zero before
calling them.
* Makefile.in (crtbeginS.o crtendS.o): Add -fno-exceptions and
-DCRTSTUFFS_O.
Index: crtstuff.c
===================================================================
RCS file: /home/work/cvs/gnu/egcs/gcc/crtstuff.c,v
retrieving revision 1.1.1.9
diff -u -r1.1.1.9 crtstuff.c
--- crtstuff.c 1998/04/05 19:07:15 1.1.1.9
+++ crtstuff.c 1998/04/26 20:44:57
@@ -80,6 +80,11 @@
#endif
#if !defined (EH_FRAME_SECTION_ASM_OP) && defined (DWARF2_UNWIND_INFO) && defined(ASM_OUTPUT_SECTION_NAME)
#define EH_FRAME_SECTION_ASM_OP ".section\t.eh_frame,\"aw\""
+
+#if !defined(CRTSTUFFS_O) && defined(HANDLE_SYSV_PRAGMA)
+#pragma weak __register_frame_info
+#pragma weak __deregister_frame_info
+#endif
#endif
#ifdef OBJECT_FORMAT_ELF
@@ -142,8 +147,11 @@
}
#ifdef EH_FRAME_SECTION_ASM_OP
- __deregister_frame_info (__EH_FRAME_BEGIN__);
+#if !defined(CRTSTUFFS_O) && defined(HANDLE_SYSV_PRAGMA)
+ if (__deregister_frame_info)
#endif
+ __deregister_frame_info (__EH_FRAME_BEGIN__);
+#endif
completed = 1;
}
@@ -170,7 +178,10 @@
frame_dummy ()
{
static struct object object;
- __register_frame_info (__EH_FRAME_BEGIN__, &object);
+#if !defined(CRTSTUFFS_O) && defined(HANDLE_SYSV_PRAGMA)
+ if (__register_frame_info)
+#endif
+ __register_frame_info (__EH_FRAME_BEGIN__, &object);
}
static void
@@ -254,8 +265,11 @@
(*p) ();
#ifdef EH_FRAME_SECTION_ASM_OP
- __deregister_frame_info (__EH_FRAME_BEGIN__);
+#if !defined(CRTSTUFFS_O) && defined(HANDLE_SYSV_PRAGMA)
+ if (__deregister_frame_info)
#endif
+ __deregister_frame_info (__EH_FRAME_BEGIN__);
+#endif
}
#ifdef EH_FRAME_SECTION_ASM_OP
@@ -266,7 +280,10 @@
__frame_dummy ()
{
static struct object object;
- __register_frame_info (__EH_FRAME_BEGIN__, &object);
+#if !defined(CRTSTUFFS_O) && defined(HANDLE_SYSV_PRAGMA)
+ if (__register_frame_info)
+#endif
+ __register_frame_info (__EH_FRAME_BEGIN__, &object);
}
#endif
#endif
Index: Makefile.in
===================================================================
RCS file: /home/work/cvs/gnu/egcs/gcc/Makefile.in,v
retrieving revision 1.1.1.33
diff -u -r1.1.1.33 Makefile.in
--- Makefile.in 1998/04/26 16:06:39 1.1.1.33
+++ Makefile.in 1998/04/26 20:46:39
@@ -1196,12 +1198,12 @@
s-crtS: crtstuff.c $(GCC_PASSES) $(CONFIG_H) \
defaults.h frame.h gbl-ctors.h
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
- -DCRT_BEGIN -finhibit-size-directive -fno-inline-functions \
- -g0 -c $(srcdir)/crtstuff.c
+ -DCRT_BEGIN -DCRTSTUFFS_O -finhibit-size-directive -fno-inline-functions \
+ -fno-exceptions -g0 -c $(srcdir)/crtstuff.c
mv crtstuff$(objext) crtbeginS$(objext)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(CRTSTUFF_T_CFLAGS_S) \
- -DCRT_END -finhibit-size-directive -fno-inline-functions \
- -g0 -c $(srcdir)/crtstuff.c -o crtendS$(objext)
+ -DCRT_END -DCRTSTUFFS_O -finhibit-size-directive -fno-inline-functions \
+ -fno-exceptions -g0 -c $(srcdir)/crtstuff.c -o crtendS$(objext)
touch s-crtS
# Compile the start modules crt0.o and mcrt0.o that are linked with every program
next prev parent reply other threads:[~1998-04-26 21:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m0yTYbl-000598C@ocean.lucon.org>
1998-04-26 17:15 ` Sergei Ivanov
1998-04-26 21:56 ` H.J. Lu [this message]
1998-04-27 13:59 ` Sergei Ivanov
[not found] <m0yU6e1-000B93C@svivano.pdmi.ras.ru>
1998-04-28 14:10 ` H.J. Lu
1998-04-28 10:26 ` Ian Lance Taylor
1998-04-28 10:47 ` H.J. Lu
1998-04-25 17:40 Sergei Ivanov
1998-04-26 0:01 ` Jeffrey A Law
1998-04-26 0:19 ` H.J. Lu
1998-04-26 10:05 ` Jeffrey A Law
1998-04-26 10:26 ` H.J. Lu
1998-04-26 12:08 ` Ian Lance Taylor
1998-04-26 12:45 ` Sergei Ivanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m0yTcI4-000598C@ocean.lucon.org \
--to=hjl@lucon.org \
--cc=egcs@cygnus.com \
--cc=svivanov@pdmi.ras.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).