Re: Does g++ really need to compile main, if c++ code is involved?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 24, 2014 at 12:13 AM, Eric Wolf <eric.wolf@xxxxxxx> wrote:
> Am 03/24/2014 08:04 AM, schrieb Kilian, Jens:
>
>>> From: Florian Weimer [mailto:fw@xxxxxxxxxxxxx]
>>> * Jens Kilian:
>>>>
>>>> I remember only one compiler (HP aCC) which requires compiling main()
>>>> as C++.  As far as I know GCC never needed this.
>>>
>>>
>>> Some systems need collect2 support for initializers:
>>>
>>>    <http://gcc.gnu.org/onlinedocs/gccint/Collect2.html>
>>
>>
>> I interpret this page to mean that GCC will always call the required
>> __main()
>> from main(), even if compiling C code.  In this case you wouldn't need to
>> compile main() using g++ (not gcc).
>
>
> But that's strange. With this little example:

...

> no __main pops up.
>
> Could be inlined though?

You neglected to say what machine you were running on.  __main is only
used on some platforms.  In particular it is not used on GNU/Linux.


> But there is a
> __libc_start_main
> symbol, maybe __main got renamed?

No, that is a different symbol.

Ian




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux