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]
Other format: [Raw text]

Re: GCC Cross-compilers for eCos: --enable-threads --enable-__cxa_atexit?


>>>>> "Richard" == Richard CHAN Shih-Ping <cshihpin@dso.org.sg> writes:

    Richard> Just wondering what configure options are sensible for
    Richard> building the cross-compilers for i386 and arm.

    Richard> At least on linux/i386 for native compilers on 3.2.1 and
    Richard> later we are supposed to use

    Richard>     --enable-threads=posix --enable-__cxa_atexit (C++ ABI compatible flag)

    Richard> Do these options make sense for (cross) compilers
    Richard> i386-elf and arm-elf? (Good news: 3.2.1 seems to have
    Richard> fixed the problem with weak symbols/alias stuff.)

As a general rule if you are building tools for use with eCos, avoid
passing any configure options like these. Just stick to a minimal
set, as per the build instructions on the eCos web pages (--target,
--prefix, --with-gnu-as, --with-gnu-ld, --with-newlib). For example, I
suspect that --enable-__cxa_atexit is intended mainly for Linux
applications built with glibc, and that routine will not be available
in any other environment.

    Richard> BTW using a native compiler (GCC 3.2.x) on linux
    Richard> synthetic target I am now getting undefined symbols
    Richard> __dso_handle and __cxa_atexit. I'm sure that this is due
    Richard> to the system compiler being built for C++ ABI
    Richard> compatibility. As I'm not sure how these symbols are
    Richard> resolved natively does anyone know a workaround for eCos?

I'll have to look into this, because at some point Linux distributions
may ship with a compiler that behaves like this by default. At first
glance I suspect it will be necessary to add a dummy function

    void __cxa_atexit(void (*arg1)(void*), void* arg2, void* arg3)
    {
    }

to CYGPKG_HAL_SYNTH, and similarly a dummy variable

    void* __dso_handle = &__dso_handle;

That should satisfy the linkage requirements, but more may be needed,
I'll have to build current gcc sources and do some experimenting to be
sure. You could try adding the above to your application code and see
what happens.

Bart

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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