This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos 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: Always provide exit() & friends prototypes.


Jonathan Larmour <jifl@eCosCentric.com> writes:

> Sergei Organov wrote:
>>
>> Yeah, I see. I'll first try the CYGSEM_LIBC_STARTUP_MAIN_THREAD that
>> I've somehow missed, then we will see...
>
> It's possible you might have to enable CYGSEM_LIBC_STARTUP_MAIN_OTHER
> as well, I'm not sure. Let me know about any problems (preferably with
> patches ;-)).

After I disable CYGSEM_LIBC_STARTUP_MAIN_THREAD (set it to 0), I get:

C CYGSEM_LIBC_STARTUP_MAIN_OTHER, "requires" constraint not satisfied: CYGINT_LIBC_STARTUP_EXTERNAL_INVOKE_MAIN_POSSIBLE

If I then explicitly enable CYGSEM_LIBC_STARTUP_MAIN_OTHER (set it to
1) as you've suggested, I still get:

C CYGSEM_LIBC_STARTUP_MAIN_OTHER, "requires" constraint not satisfied: CYGINT_LIBC_STARTUP_EXTERNAL_INVOKE_MAIN_POSSIBLE

If I then explicitly *disable* CYGSEM_LIBC_STARTUP_MAIN_OTHER (set it to
0), there are no conflicts anymore, and I get:

U CYGSEM_LIBC_STARTUP_MAIN_INITCONTEXT, new inferred value 1

That lead me to the idea that instead of playing with the above options,
I might try to just enable the CYGSEM_LIBC_STARTUP_MAIN_INITCONTEXT in
the first place, and, bingo, it works! I get:

U CYGSEM_LIBC_STARTUP_MAIN_THREAD, new inferred value 0

and no conflicts.

The only thing that still bothers me is that it was neither obvious nor
easy to find, even with your help :(

Anyway, for now I've decided that setting
CYGSEM_LIBC_STARTUP_MAIN_INITCONTEXT is the way to go, and now my custom
configuration file has the following:

# Prevent creation of "main" thread by eCos. To achieve this, we tell eCos to
# call "main()" from its default cyg_user_start(). Then we are free to provide
# our own cyg_user_start() that doesn't call 'main()'.
#
# NOTE: it would seem to be easier to just 'ecosconfig remove libc_startup'
# instead, but that also removes exit() & friends along with their
# declarations(!) in the <stdlib.h>, the latter being really painful.
cdl_option CYGSEM_LIBC_STARTUP_MAIN_INITCONTEXT {
     user_value 1
};

-- 
Sergei.


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