changeset 448:c3adb3b974a2

Update synthetic target to cope with recent gcc changes
author bartv
date Tue, 03 Dec 2002 21:07:24 +0000
parents 44f818173f96
children 2f7c7863d579
files packages/hal/synth/arch/current/ChangeLog packages/hal/synth/arch/current/src/synth_entry.c
diffstat 2 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/packages/hal/synth/arch/current/ChangeLog
+++ b/packages/hal/synth/arch/current/ChangeLog
@@ -1,3 +1,10 @@
+2002-12-03  Bart Veer  <bartv@ecoscentric.com>
+
+	* 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  <bartv@ecoscentric.com>
 
 	* host/configure.in:
--- 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