This is the mail archive of the ecos-devel@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: Problems with C and Math libraries


I'm using GNU assembler and linker version 2.11.93. Is this ok or I
should use a newer version?

I want to ask you another question. I have written a simply program to
test if the C and Math libraries are linked OK or not. It's attached as
"test.c". If I compile it with the "-S" flag, to obtain the assembler
file I can't see any call to "cyg_package_start", "cyg_iso_c_start",
etc. But when compiled and linked completely, if I use eCos 1.3.1 the
libc initializing functions are present (cyg_iso_c_start,
cyg_libc_main_thread, etc), but if I use eCos 2.0 there are not
present.Is it normal? Do I have to add something to the source file to
indicate that it must use the C library initialization? In which stage,
or how, does the linker realize that he must include the C library
initializing routines?

I hope I'm not boring you with such a lot of questions, but I have been
working on it a long time and I'm a bit desperated :-(

Thanks a lot,

Pablo Huerta



El mar, 04-11-2003 a las 11:57, Andrew Lunn escribiÃ:
> On Tue, Nov 04, 2003 at 11:16:07AM +0100, Pablo Huerta wrote:
> > First of all, thanks for your answer.
> > 
> > The target is OpenRISC 1000 architecture.
> 
> > I attach the file export.out with an export with the minimal
> > configuration.
> 
> I just tried your configuration on the synth target by just changing
> the HAL packages. It worked fine.
> 
> > 
> > About a possible compiler problem, I have already thinked about it, and
> > with GCC versions 3.3.1 and 3.4 it's possible that the compiler is not
> > 100% accurate, but the port of version 2.95.3 has been deeply tested
> > with ecos 1.3.1 and other aplications and it seems to work 100% OK.
> 
> What binutils are you using. It could be a linker problem as well. You
> need to find out why the linker is throwing out the constructor. 
> 
>      Andrew

#include <pkgconf/libm.h>   // Configuration header
#include <pkgconf/libc.h>   // Configuration header

#include <cyg/infra/cyg_type.h>    // Common type definitions and support
#include <cyg/infra/testcase.h>    // Test infrastructure
#include <math.h>                  // Header for this package
#include <sys/ieeefp.h>            // Cyg_libm_ieee_double_shape_type


int main (int argc, char *argv[])
{

double a = 100;
a = cos(a);
return 0;

}

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