# HG changeset patch # User bartv # Date 1057447049 0 # Node ID c04ca65eec48ce02e82a0e187a53f9409afb556e # Parent 3764201565e4b588ed704f9aff60e7140f4a6078 Try to resolve linking problems for C++ code built with the native Linux tools. 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,9 @@ +2003-07-05 Bart Veer + + * src/synth_entry.c: + Add more dummy functions to cope with dependencies introduced by + various versions of g++. + 2003-06-27 Jonathan Larmour * src/synth.ld: Synthetic linux at least needs libgcc_eh.a in the 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 @@ -169,6 +169,18 @@ void _linux_entry( void ) } // ---------------------------------------------------------------------------- +// Stub functions needed for linking with various versions of gcc +// configured for Linux rather than i386-elf. + +#if (__GNUC__ < 3) +// 2.95.x libgcc.a __pure_virtual() calls __write(). +int __write(void) +{ + return -1; +} +#endif + +#if (__GNUC__ >= 3) // 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 @@ -187,5 +199,17 @@ void } void* __dso_handle = (void*) &__dso_handle; +// gcc 3.2.2 (approx). The libsupc++ version of the new operator pulls +// in exception handling code, even when using the nothrow version and +// building with -fno-exceptions. libgcc_eh.a provides the necessary +// functions, but requires a dl_iterate_phdr() function. That is related +// to handling dynamically loaded code so is not applicable to eCos. +int +dl_iterate_phdr(void* arg1, void* arg2) +{ + return -1; +} +#endif + //----------------------------------------------------------------------------- // End of entry.c