This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Avoid __main from being called in main()?


Dear gcc-users,

I am trying to find out how to avoid __main from being called in
main(). After reading 'info gcc' I thought that "-DHAS_INIT_SECTION"
would accomplish this, but it didn't.

The reason for why I want to avoid it is that some tests performed by
the autoconf ./configure script try to compile short main() functions
in order to test for various features. The gcc I use returns "undefined
refernce to `__main'" unless I append -lgcc to the gcc command line.

The problem is that, as far as I know, I can only set CC before calling
./configure which makes it impossible to append -lgcc to the command
line.

For what it's worth, I am primarily using egcs-971225 for Tornado 2.0
(VxWorks real time operating system), but the behaviour is the same for
egcs-2.91.57 (CygWin). However, there is no call to __main when
compiled with gcc 2.7.2.3 (Linux).

Thanks in advance!

Best regards,

Henrik Bergström

- --
Henrik Bergstrom  +46-8-628 28 28  henrik.bergstrom@intertex.se
Intertex Data AB  (fax) 628 64 14


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]