This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Static constuctors
- To: <ecos-discuss at sourceware dot cygnus dot com>
- Subject: [ECOS] Static constuctors
- From: "Boris V. Guzhov" <borg at int dot spb dot ru>
- Date: Fri, 6 Oct 2000 20:25:38 +0400
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