This is the mail archive of the ecos-discuss@sources.redhat.com 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]

Re: ...porting software developed under cygwin with gcc to diab compiler...


>>>>> "Luca" == luca spinacci <luca.spinacci@marconicomms.com> writes:

    Luca> I'm working with a real time operative system (for Windows
    Luca> NT) whose compiler is DIAB (cross compiler).
    Luca> I' m trying to compile with the above a project developed,
    Luca> compiled and built under cygwin with GCC compiler and link
    Luca> that project with an existing project compiled under DIAB.
    Luca> I haven't succeeded so far since there are C++ features
    Luca> (template functions in template class...) that the DIAB
    Luca> compiler isn't able to solve. I used eCOS on my PC and
    Luca> successfully compiled the imported project. I tried to GCC
    Luca> compile those same files generating the assembly code and
    Luca> then to build the project by means of DIAB.
    Luca> Obviously I got linking problems due to different name
    Luca> mangling of GCC and DIAB. I know name mangling is different
    Luca> on different compilers but it would be helpful to know if
    Luca> GCC has compiler options to standardize its name mangling or
    Luca> there's a standard follwed by some compilers.

There is no such compiler option, deliberately so. Traditionally the
code generated by different C++ compilers is incompatible in numerous
ways, e.g. layout of the virtual function table. Any attempt to mix
code generated by different compilers is pretty much doomed to
failure. The use of incompatible name mangling schemes acts as a
safety net, it ensures that you will get errors at link-time rather
than weird and undebuggable crashes at run-time.

There is work in progress on standardizing a C++ ABI for certain
platforms. On the g++ side this ABI should be supported when gcc 3.0
gets released, see http://gcc.gnu.org for more information.

Bart

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