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]
Other format: [Raw text]

Re: __main


I'm trying very hard not to modify the source.

I've got to think that others porting GCC to small chips will have the
same issue. For me space is very important. Unfortunately, the bytes count.

Also the standard assembler for this chip does not accept an "_" for
the first character. Don't look at me - I didn't write it, but I do need to
interface with it.

I'll give -ffreestanding a try.

Thanks,
Mike
----- Original Message -----
From: "Fergus Henderson" <fjh@cs.mu.OZ.AU>
To: "Mike Laman" <mlaman@cox.net>
Cc: "GCC" <gcc@gcc.gnu.org>
Sent: Sunday, September 01, 2002 9:04 AM
Subject: Re: __main


> On 29-Aug-2002, Mike Laman <mlaman@cox.net> wrote:
> > When running a C cross compiler where one does not want a call
> > to "__main()" to be emitted, how can one turn it off?
>
> I don't know off-hand if it can be turned off.
> (I doubt if it can, but perhaps with `-ffreestanding'??)
> Of course you can always turn it off by modifying the source code!
>
> Probably the easiest solution is to just define a dummy __main()
> function that does nothing.  You'd better be sure that you don't
> link in any C++ programs or libraries, though, because they might
> not work properly if constructors for static objects are not
> executed.
>
> --
> Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the
pursuit
> The University of Melbourne         |  of excellence is a lethal habit"
> WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


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