Exceptions workaround for older systems that don't USE_COLLECT2

Melissa O'Neill oneill@cs.sfu.ca
Tue Sep 15 23:51:00 GMT 1998


I wrote:
>> I built egcs 1.1 last night with [...] configure's nextstep `use_collect2'
>> line changed from `no' to `yes' [...], and the results were disappointing.
>> While egcs builds okay, C++ is nonfunctional.

... and Jeff Law replied:
> __main should be in libgcc.a.  What symbols appear in libgcc.a::_main.o?

libgcc.a(__main.o):
         U ___DTOR_LIST__
00000000 T ___do_global_dtors
0000002c d _p.2

As you see, there is no __main. The culprit is config/nextstep.h, which
defines INIT_SECTION_ASM_OP and undefines INVOKE__main (since it still
expects that NeXT's linker will be handling constructors).

I'll post a patch for this on egcs-patches once I've built egcs with my
changes to nextstep.h (it looks like a pretty obvious fix).

    Melissa.

P.S. The revised nextstep.h also fixes ASM_OUTPUT_CONSTRUCTOR,
ASM_OUTPUT_DESTRUCTOR and ASM_FILE_END -- it's pretty heavily based on
nextstep21.h (NEXTSTEP 2.1 did use collect2, BTW).




More information about the Gcc mailing list