# HG changeset patch # User bartv # Date 1038949644 0 # Node ID c3adb3b974a2878c85a2f1af042ef3ff2c9780cc # Parent 44f818173f96bc10d06a305a3750a0d1bb6834f7 Update synthetic target to cope with recent gcc changes diff --git a/packages/hal/synth/arch/current/ChangeLog b/packages/hal/synth/arch/current/ChangeLog --- a/packages/hal/synth/arch/current/ChangeLog +++ b/packages/hal/synth/arch/current/ChangeLog @@ -1,3 +1,10 @@ +2002-12-03 Bart Veer + + * src/synth_entry.c: + Provide dummy versions of __cxa_atexit() and __dso_handle, to + satisfy requirements of recent versions of the compiler configured + for native Linux development. + 2002-09-22 Bart Veer * host/configure.in: diff --git a/packages/hal/synth/arch/current/src/synth_entry.c b/packages/hal/synth/arch/current/src/synth_entry.c --- a/packages/hal/synth/arch/current/src/synth_entry.c +++ b/packages/hal/synth/arch/current/src/synth_entry.c @@ -168,5 +168,24 @@ void _linux_entry( void ) cyg_hal_sys_exit(0); } +// ---------------------------------------------------------------------------- +// Versions of gcc/g++ after 3.0 (approx.), when configured for Linux +// native development (specifically, --with-__cxa_enable), have +// additional dependencies related to the destructors for static +// objects. When compiling C++ code with static objects the compiler +// inserts a call to __cxa_atexit() with __dso_handle as one of the +// arguments. __cxa_atexit() would normally be provided by glibc, and +// __dso_handle is part of crtstuff.c. Synthetic target applications +// are linked rather differently, so either a differently-configured +// compiler is needed or dummy versions of these symbols should be +// provided. If these symbols are not actually used then providing +// them is still harmless, linker garbage collection will remove them. + +void +__cxa_atexit(void (*arg1)(void*), void* arg2, void* arg3) +{ +} +void* __dso_handle = (void*) &__dso_handle; + //----------------------------------------------------------------------------- // End of entry.c