This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Patches for egcs/OSR5 Was: controlling exception type per target
- To: Jason Merrill <jason at cygnus dot com>
- Subject: Patches for egcs/OSR5 Was: controlling exception type per target
- From: Robert Lipe <robertl at dgii dot com>
- Date: Thu, 2 Oct 1997 00:58:34 -0500
- Cc: egcs at cygnus dot com
- References: <19970925123013.42080@dgii.com> <19970928233930.41615.cygnus.egcs@dgii.com> <u9pvpo29bg.fsf@yorick.cygnus.com>
> Sorry I haven't gotten back to you before.
'Tis quite OK. I'm glad I waited for your reply, becuase I was
indeed headed down a bad path. Your suggestions took me where
I needed to go. Thanx, Jason!
> I think this should be handled
> by setting up exceptions_via_longjmp in main(), with a simple
>
> #ifdef DWARF2_UNWIND_INFO
> exceptions_via_longjmp = DWARF2_UNWIND_INFO;
> #endif
The negative logic definitions took a while for me to grok.
I'll leave submitting/applying that patch to you. I stuck it in
my copy in what seemed like an OK place. It is required.
*** toplev.c_ Mon Sep 15 21:07:28 1997
--- toplev.c Wed Oct 1 22:47:54 1997
***************
*** 4289,4294 ****
--- 4289,4298 ----
OVERRIDE_OPTIONS;
#endif
+ #ifdef DWARF2_UNWIND_INFO
+ exceptions_via_longjmp = DWARF2_UNWIND_INFO ;
+ #endif
+
if (profile_block_flag == 3)
{
warning ("`-ax' and `-a' are conflicting options. `-a' ignored.");
> > Should I expand this scheme on into crtstuff as well?
>
> You can tell whether you are doing COFF or ELF with #ifdefs, right? I
> would think you could special-case the SCO tm.h so that when CRT_BEGIN or
> CRT_END are defined, you use unconditional defines. irix6.h does something
> similar for n32/n64 multilibbing.
You could. I think I've found that if I just let crtstuff spill
the eh sections, it's OK as long as I pick a name that makes the
assembler not vomit. It seems that they're never referenced. I decided
to go ahead and put the scaffolding for EH_FRAMEs in for COFF in case
they come in handy in the future.
I haven't rerun the full make bootstrap/runtest with it, but I did
do a 'make bootstrap3 followed by a
nice runtest --outdir ${COFFDIR} --tool g++ \
--srcdir ${SRC}/gcc/testsuite \
--target_board 'unix{-mcoff,-melf}' \
GXX_UNDER_TEST=negcs \
CXXFLAGS="-g -O" \
old-deja.exp=eh*
and got really promising results:
Test Run By robertl on Thu Oct 2 00:41:57 1997
Native configuration is i586-pc-sco3.2v5.0.4
=== g++ tests ===
Running target unix/-mcoff
Running /play/egcs-970917/gcc/testsuite/g++.old-deja/old-deja.exp ...
=== g++ Summary for unix/-mcoff ===
# of expected passes 103
Running target unix/-melf
Running /play/egcs-970917/gcc/testsuite/g++.old-deja/old-deja.exp ...
=== g++ Summary for unix/-melf ===
# of expected passes 103
=== g++ Summary ===
# of expected passes 206
negcs version egcs-2.90.11 970929 (gcc2-970802 experimental)
So please consider this patch for inclusion:
Thu Oct 2 00:30:15 1997 Robert Lipe (robertl@dgii.com)
* sco5.h: Let ELF use dwarf2 unwinding. COFF uses sjlj
(EH_FRAME_SECTION_ASM_OP, EH_FRAME_SECTION_ASM_OP_ELF): Defined.
(EH_FRAME_SECTION_ASM_OP_COFF): Likewise.
(DWARF2_UNWIND_INFO): Let this track object file format.
(EXTRA_SECTIONS): Add in_eh.
(EH_FRAME_SECTION_ASM_OP, EH_FRAME_SECTION_ASM_OP_ELF, EH_FRAME_SECTION_ASM_OP_COFF): defined
*** config/i386/sco5.h_ Wed Oct 1 22:35:32 1997
--- config/i386/sco5.h Wed Oct 1 23:17:35 1997
***************
*** 76,81 ****
--- 76,92 ----
#undef GLOBAL_ASM_OP
#define GLOBAL_ASM_OP "\t.globl"
+ #undef EH_FRAME_SECTION_ASM_OP
+ #define EH_FRAME_SECTION_ASM_OP_COFF "\t.section\t.ehfram, \"x\""
+ #define EH_FRAME_SECTION_ASM_OP_ELF "\t.section\t.eh_frame, \"aw\""
+ #define EH_FRAME_SECTION_ASM_OP \
+ ((TARGET_ELF) ? EH_FRAME_SECTION_ASM_OP_ELF : EH_FRAME_SECTION_ASM_OP_COFF)
+
+ /* Avoid problems (long sectino names, forward assembler refs) with DWARF
+ exception unwinding when we're generating COFF */
+ #define DWARF2_UNWIND_INFO \
+ ((TARGET_ELF) ? 1 : 0 )
+
#undef CONST_SECTION_ASM_OP
#define CONST_SECTION_ASM_OP_COFF "\t.section\t.rodata, \"x\""
#define CONST_SECTION_ASM_OP_ELF "\t.section\t.rodata"
***************
*** 563,569 ****
((TARGET_ELF) ? DWARF_DEBUG: SDB_DEBUG)
#undef EXTRA_SECTIONS
! #define EXTRA_SECTIONS in_const, in_init, in_fini, in_ctors, in_dtors
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
--- 574,580 ----
((TARGET_ELF) ? DWARF_DEBUG: SDB_DEBUG)
#undef EXTRA_SECTIONS
! #define EXTRA_SECTIONS in_const, in_init, in_fini, in_ctors, in_dtors, in_eh
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
***************
*** 901,906 ****
--- 912,918 ----
# undef FINI_SECTION_ASM_OP
# undef CTORS_SECTION_ASM_OP
# undef DTORS_SECTION_ASM_OP
+ # undef EH_FRAME_SECTION_ASM_OP
# undef CTOR_LIST_BEGIN
# undef CTOR_LIST_END
# undef DO_GLOBAL_CTORS_BODY
***************
*** 912,922 ****
--- 924,936 ----
# define FINI_SECTION_ASM_OP FINI_SECTION_ASM_OP_ELF
# define DTORS_SECTION_ASM_OP DTORS_SECTION_ASM_OP_ELF
# define CTORS_SECTION_ASM_OP CTORS_SECTION_ASM_OP_ELF
+ # define EH_FRAME_SECTION_ASM_OP EH_FRAME_SECTION_ASM_OP_ELF
# else /* ! _SCO_ELF */
# define INIT_SECTION_ASM_OP INIT_SECTION_ASM_OP_COFF
# define FINI_SECTION_ASM_OP FINI_SECTION_ASM_OP_COFF
# define DTORS_SECTION_ASM_OP DTORS_SECTION_ASM_OP_COFF
# define CTORS_SECTION_ASM_OP CTORS_SECTION_ASM_OP_COFF
+ # define EH_FRAME_SECTION_ASM_OP ""
# define CTOR_LIST_BEGIN asm (INIT_SECTION_ASM_OP); asm ("pushl $0")
# define CTOR_LIST_END CTOR_LIST_BEGIN
# define DO_GLOBAL_CTORS_BODY \