This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem creating an executable for simulator with newlib


I've created crosscompiler tools that run under Cygwin (even gdb). I'll post how I did this since there were a few tricks after I verify that this actually worked.

Target=powerpc-eabi

Sources (I used Cygwin sources where they had them.
 Although I don't really know how you correspond the Cygwin releases to standard gnu
releases):
newlib-1.11.0
gcc-3.2-3
binutils-20030307-1
gdb-20030303-1

After creating the tools I compile a standard hello.c (actually test.c) file as such:

powerpc-eabi-gcc -v -nostdlib -static -mcpu=603e -msim -g -o test $LIBDIR/sim-crt0.o \
 test.c -lc -lsim -Wl,-Bstatic

It gives me:

Reading specs from /cygdrive/d/powerpcgcc/lib/gcc-lib/powerpc-eabi/3.2/specs
Configured with: ../gcc-3.2-3/configure --target=powerpc-eabi --prefix=/cygdrive/d/powerpcgcc --enable-languages=c,c++ --with-local-prefix=/cygdrive/d/powerpcgcc/powerpc-eabi --with-gnu-as --with-gnu-ld
Thread model: single
gcc version 3.2 20020927 (prerelease)
 /cygdrive/d/powerpcgcc/lib/gcc-lib/powerpc-eabi/3.2/cc1.exe -lang-c -v -iprefix powerpc-eabi/3.2/ -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102 -DPPC -D__embedded__ -D__PPC__ -D__embedded__ -D__PPC -Asystem=embedded -Acpu=powerpc -Amachine=powerpc -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_CALL_SYSV -D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine=bigendian -D_ARCH_PPC test.c -quiet -dumpbase test.c -mcpu=603e -msim -ggdb -version -o /cygdrive/c/DOCUME~1/dlreed/LOCALS~1/Temp/ccnWumgH.s
GNU CPP version 3.2 20020927 (prerelease) (cpplib) (PowerPC Embedded)
GNU C version 3.2 20020927 (prerelease) (powerpc-eabi)
	compiled by GNU C version 3.2 20020927 (prerelease).
ignoring nonexistent directory "powerpc-eabi/3.2/include"
ignoring nonexistent directory "powerpc-eabi/3.2/../../../../powerpc-eabi/sys-include"
ignoring nonexistent directory "powerpc-eabi/3.2/../../../../powerpc-eabi/include"
#include "..." search starts here:
#include <...> search starts here:
 /cygdrive/d/powerpcgcc/include
 /cygdrive/d/powerpcgcc/lib/gcc-lib/powerpc-eabi/3.2/include
 /cygdrive/d/powerpcgcc/powerpc-eabi/sys-include
 /cygdrive/d/powerpcgcc/powerpc-eabi/include
End of search list.
 /cygdrive/d/powerpcgcc/lib/gcc-lib/powerpc-eabi/3.2/../../../../powerpc-eabi/bin/as.exe -mppc -V -Qy -o /cygdrive/c/DOCUME~1/dlreed/LOCALS~1/Temp/ccq1pzIy.o /cygdrive/c/DOCUME~1/dlreed/LOCALS~1/Temp/ccnWumgH.s
GNU assembler version 2.13.90 (powerpc-eabi) using BFD version 2.13.90 20030308
 /cygdrive/d/powerpcgcc/lib/gcc-lib/powerpc-eabi/3.2/collect2.exe -V -Qy -dn -Bstatic -m elf32ppcsim -o test -L -L/cygdrive/d/powerpcgcc/lib/gcc-lib/powerpc-eabi/3.2 -L/cygdrive/d/powerpcgcc/lib/gcc-lib/powerpc-eabi/3.2/../../../../powerpc-eabi/lib -L/3.2/../../.. /cygdrive/d/powerpcgcc/powerpc-eabi/lib/sim-crt0.o /cygdrive/c/DOCUME~1/dlreed/LOCALS~1/Temp/ccq1pzIy.o -lc -lsim -Bstatic
/cygdrive/c/DOCUME~1/dlreed/LOCALS~1/Temp/ccq1pzIy.o(.text+0x14): In function `main':
/cygdrive/d/gnutemp/test.c:4: undefined reference to `__eabi'
GNU ld version 2.13.90 20030308
  Supported emulations:
   elf32ppc
   elf32ppclinux
   elf32ppcsim
collect2: ld returned 1 exit status


Now my question is why is this missing? Shouldn't it be in a library somewhere?

If I break up the call so that I invoke powerpc-eabi-gcc -c & then powerpc-eabi-ld I get the same result(as expected).

If I use yellowknife.ld in the link process I still get the same result:
    undefined reference __eabi

Any clues what I can look at?

Thanks,
Dan

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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