This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


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

Re: Cross-compiling for powerpc


Hi again,

I built my cross-compiler for powerpcle-elf... I installed binutils, gcc
and newlib following the instructions on the CrossGCC FAQ.  Everything
seemed to install correctly.  I can compile a simple program like this:

int main()
{
  while(1);
}


However, if I try to include any function from the library (newlib) with
the following line:
/cross/bin/powerpcle-elf-gcc test.c -o test

I get the following errors:
/tmp/ccNzgwZB.o: In function `main':
/tmp/ccNzgwZB.o(.text+0x38): undefined reference to `memcpy'
/tmp/ccNzgwZB.o(.text+0x44): undefined reference to `strlen'
/tmp/ccNzgwZB.o(.text+0x54): undefined reference to `malloc'
collect2: ld returned 1 exit status

So I tought I should add "-lc" to the end of the gcc command since it
didn't seem to libc.  I got the following:
/cross/powerpcle-elf/lib/libc.a(sbrkr.o): In function `_sbrk_r':
/home/scote1/build-newlib/powerpcle-elf/newlib/libc/reent/../../../../../newlib-1.9.0/newlib/libc/reent/sbrkr.c:61:
undefined reference to `sbrk'
collect2: ld returned 1 exit status


Does anybody know what the problem might be??  Why is it using libs in
the sources directory in the first place???  I have really no idea what
might be wrong!

Thanks!

Sébastien Côté

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