public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Static constuctors
@ 2000-10-06  9:39 Boris V. Guzhov
  2000-10-11 11:05 ` Jonathan Larmour
  0 siblings, 1 reply; 2+ messages in thread
From: Boris V. Guzhov @ 2000-10-06  9:39 UTC (permalink / raw)
  To: ecos-discuss

Hi All!

My host - RedHat Linux 6.2
My target - pc.
I work with latest eCos version from anoncvs.

I have some problems with elix template.

There is a simple test (test.cc):
// -------------
class A
{
public:    A() { printf("A: %d\n", pthread_self());}
};
static A a;
int main(void)
{
   printf("main: %d\n", pthread_self());
   return 0;
}
// --------------

In Linux (not ecos)  environment it prints:
A: 1024
main: 1024

And I see that static constructor  is invoked in main() thread context.

In linux synthetic environment (linux elix template)  there is prints:
A: 0
main: 1024

But I need to invoke static constructors in main() thread context.

Then I tried to make the following:
- I eddited ecos.ecc file:
   CYGSEM_INVOKE_DEFAULT_STATIC_CONSTRUCTORS: user_value 1
  CYGSEM_LIBC_STARTUP_MAIN_THREAD: user_value 1
- "ecosconfig resolve" prints:
"C   CYGPKG_LIBC_STARTUP, "requires" constraint not satisfied:
CYGINT_LIBC_STARTUP_CONTEXT == 1"

And I cannot  run "ecosconfig tree".

What's wrong?

Thanks in advance.

--
Boris Guzhov,
St.Petersburg, Russia


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] Static constuctors
  2000-10-06  9:39 [ECOS] Static constuctors Boris V. Guzhov
@ 2000-10-11 11:05 ` Jonathan Larmour
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Larmour @ 2000-10-11 11:05 UTC (permalink / raw)
  To: Boris V. Guzhov; +Cc: ecos-discuss

"Boris V. Guzhov" wrote:
> But I need to invoke static constructors in main() thread context.
> 
> Then I tried to make the following:
> - I eddited ecos.ecc file:
>    CYGSEM_INVOKE_DEFAULT_STATIC_CONSTRUCTORS: user_value 1

CYGSEM_INVOKE_DEFAULT_STATIC_CONSTRUCTORS is indeed what you are looking
for here.

>   CYGSEM_LIBC_STARTUP_MAIN_THREAD: user_value 1
> - "ecosconfig resolve" prints:
> "C   CYGPKG_LIBC_STARTUP, "requires" constraint not satisfied:
> CYGINT_LIBC_STARTUP_CONTEXT == 1"
> 
> And I cannot  run "ecosconfig tree".
> 
> What's wrong?

It's an oversight in the CDL. For now just edit
language/c/libc/startup/current/cdl/startup.cdl and remove the "requires
CYGSEM_LIBC_STARTUP_MAIN_THREAD" line. I'll fix it properly in the sources
here.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-10-11 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-06  9:39 [ECOS] Static constuctors Boris V. Guzhov
2000-10-11 11:05 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).