public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
From: cetoni GmbH - Uwe Kindler <uwe.kindler@cetoni.de>
To: ecos-devel@sourceware.org
Cc: Bart Veer <bartv@ecoscentric.com>,
	  Sergei Gavrikov <sergei.gavrikov@gmail.com>
Subject: Re: Strange __cxa_pure_virtual problem
Date: Wed, 19 Aug 2009 14:35:00 -0000	[thread overview]
Message-ID: <4A8C0D9B.1010406@cetoni.de> (raw)

Hi Bart,

I compiled an eCos library from default template with arm-eabi toolchain 
from eCos homepage. These are teh compiler switches:

-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual 
-Wno-write-strings  -mno-thumb-interwork -mcpu=arm7tdmi -g2 -O0 
-ffunction-sections -fdata-sections -fno-rtti -fno-exceptions

I used a makfile from examples directory to build my application and 
link againts the library.

If I compile the following main file __cxa_guard_release() is not pulled in:

class Simple
{
private:
     int m_i;
public:
     Simple(int i)
         : m_i(i) {}
};

static Simple simple(1);

int main(int argc, char *argv[])
{
     return 0;
}


If I compile the following main file __cxa_guard_release() is pulled in:

class Simple
{
private:
     int m_i;
public:
     Simple(int i)
         : m_i(i) {}
};


int main(int argc, char *argv[])
{
     static Simple simple(1);
     return 0;
}

I found a message from a mailing list with a similar problem:

http://lists.apple.com/archives/darwin-drivers/2005/May/msg00061.html

The message states:

....
Evidently the compiler generates these as a by-product of the class 
instantiation. By moving the class instantiation out of the function, 
into global space, the symbols were not generated.
...

So this seems like a compiler issue for me. You can easily confirm this 
behaviour by building my simple application. It is important to link 
against a debug build of the library (-g2 -O0) to reproduce this behaviour.

Can anyone confirm that compiler behaviour of the arm-eabi toolchain?
Sergei, can you reproduce this. Can you reproduce this with any other 
toolchain (x86)?

Regards, Uwe

             reply	other threads:[~2009-08-19 14:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-19 14:35 cetoni GmbH - Uwe Kindler [this message]
2009-08-19 16:05 ` John Dallaway
2009-08-21 14:55 ` Bart Veer
  -- strict thread matches above, loose matches on Subject: below --
2009-08-12 17:49 Uwe Kindler
2009-08-12 19:07 ` Bart Veer
2009-08-13  8:00   ` Uwe Kindler
2009-08-19 10:37     ` Bart Veer
     [not found] <4A827EDC.3030004@cetoni.de>
2009-08-12 14:15 ` Jonathan Larmour
2009-08-12  9:10 cetoni GmbH - Uwe Kindler
2009-08-08  6:04 Uwe Kindler
2009-08-07 11:35 cetoni GmbH - Uwe Kindler
2009-08-07 12:04 ` John Dallaway
2009-08-07 13:40   ` Bart Veer
2009-08-07 15:08     ` John Dallaway
2009-08-07 15:42       ` Bart Veer
2009-08-11  9:05       ` Daniel Néri
2009-08-07 16:31     ` Sergei Gavrikov
2009-08-12  1:34     ` Jonathan Larmour
2009-08-05 18:55 Uwe Kindler
2009-08-07  9:35 ` John Dallaway

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A8C0D9B.1010406@cetoni.de \
    --to=uwe.kindler@cetoni.de \
    --cc=bartv@ecoscentric.com \
    --cc=ecos-devel@sourceware.org \
    --cc=sergei.gavrikov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).