This is the mail archive of the ecos-devel@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: Strange __cxa_pure_virtual problem


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


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