[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Building RTEMS
- Date: Mon, 15 Feb 1999 10:19:51 -0600 (CST)
- From: joel at OARcorp.com (joel at OARcorp.com)
- Subject: Building RTEMS
Look at the hello world example. You need to invoke the compiler with a
-B option to specify more information and the hello world example does
that right. You are not specifying the BSP and thus not getting any of
the right libraries.
--joel
Joel Sherrill Director of Research & Development
joel at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
On Mon, 15 Feb 1999, Douglas Atique wrote:
>
>
> On Mon, 15 Feb 1999 joel at OARcorp.com wrote:
>
> >
> > On Mon, 15 Feb 1999, Douglas Atique wrote:
> >
> > > x86. My target is sparc and the cross toolset seems to compile fine, but
> > > when I try to compile and link a little program that uses printf the
> > > linker (in my case sparc-rtems-ld) complains about missing symbols. This
> > > problem is causing it not to be able to build the RTEMS proper, beside its
> > > inability to generate any executables.
> > > Anyone has an idea?
> >
> > The basic sequence that should work after untar'ing and patching (don't
> > forget that part) is:
> I patched all distributions according to the Getting started manual.
> >
> > ./bit sparc
> > ./bit_gdb sparc
> > ./bit sparc erc32
> I used
> ./bit sparc
> ./bit_rtems sparc (this failed on linking)
> ./bit_gdb sparc (I expected to find the sis and sis64 executables in the
> INSTALL_POINT but didn't)
> >
> > If you are using the Solaris patch -- not GNU patch, then it is quite
> > possibly that the patch was not applied correctly.
> I am using the GNU patch 2.5. I myself built it, and the path to the GNU
> tools is the first on my PATH.
> >
> > What symbols are undefined?
> Well, there were many. For example, after executing ./bit sparc I tried to
> compile and link a program like this:
> test.c
> #include <stdio.h>
> int main(int argc, char* argv[]) {
> printf("Testing the sparc-on-intel cross-compiler...");
> return 0;
> }
> Look at its output:
>
>
>
> sirius% sparc-rtems-gcc -v -o test test.c
> Reading specs from
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/lib/gcc-lib/sparc-rtems/egcs-2.91.57/specs
> gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
>
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/lib/gcc-lib/sparc-rtems/egcs-2.91.57/cpp
> -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=91 -Dsparc
> -D__GCC_NEW_VARARGS__ -Drtems -D__rtems__ -D__sparc__
> -D__GCC_NEW_VARARGS__ -D__rtems__ -D__rtems__ -D__sparc -D__rtems
> -Asystem(rtems) -Acpu(sparc) -Amachine(sparc) -D__GCC_NEW_VARARGS__
> -Acpu(sparc) -Amachine(sparc) test.c /var/tmp/cca911Re.i
> GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (sparc)
> #include "..." search starts here:
> #include <...> search starts here:
>
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/lib/gcc-lib/sparc-rtems/egcs-2.91.57/include
>
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/sparc-rtems/sys-include
>
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/sparc-rtems/include
> End of search list.
>
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/lib/gcc-lib/sparc-rtems/egcs-2.91.57/cc1
> /var/tmp/cca911Re.i -quiet -dumpbase test.c -version -o
> /var/tmp/ccOw0b4K.s
> GNU C version egcs-2.91.57 19980901 (egcs-1.1 release) (sparc-rtems)
> compiled by GNU C version 2.8.1.
>
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/sparc-rtems/bin/as
> -o /var/tmp/ccqmhoOq.o /var/tmp/ccOw0b4K.s
>
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/lib/gcc-lib/sparc-rtems/egcs-2.91.57/collect2
> -e start -dc -dp -o test
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/sparc-rtems/lib/crt0.o
> -L/opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/lib/gcc-lib/sparc-rtems/egcs-2.91.57
> -L/opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/sparc-rtems/lib
> /var/tmp/ccqmhoOq.o -lgcc -lc -lgcc
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/sparc-rtems/bin/ld:
> warning: cannot find entry symbol start; defaulting to 00002020
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/sparc-rtems/lib/libc.a(stdio.o):
> In function `__sread':
> /export/home/datique/rtems/tools/build-sparc-tools/sparc-rtems/newlib/libc/stdio/../../../../../src/newlib/libc/stdio/stdio.c:40:
> undefined reference to `_read_r'
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/sparc-rtems/lib/libc.a(stdio.o):
> In function `__swrite':
> /export/home/datique/rtems/tools/build-sparc-tools/sparc-rtems/newlib/libc/stdio/../../../../../src/newlib/libc/stdio/stdio.c:60:
> undefined reference to `_lseek_r'
> /export/home/datique/rtems/tools/build-sparc-tools/sparc-rtems/newlib/libc/stdio/../../../../../src/newlib/libc/stdio/stdio.c:62:
> undefined reference to `_write_r'
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/sparc-rtems/lib/libc.a(stdio.o):
> In function `__sseek':
> /export/home/datique/rtems/tools/build-sparc-tools/sparc-rtems/newlib/libc/stdio/../../../../../src/newlib/libc/stdio/stdio.c:74:
> undefined reference to `_lseek_r'
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/sparc-rtems/lib/libc.a(stdio.o):
> In function `__sclose':
> /export/home/datique/rtems/tools/build-sparc-tools/sparc-rtems/newlib/libc/stdio/../../../../../src/newlib/libc/stdio/stdio.c:91:
> undefined reference to `_close_r'
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/sparc-rtems/lib/libc.a(makebuf.o):
> In function `__smakebuf':
> /export/home/datique/rtems/tools/build-sparc-tools/sparc-rtems/newlib/libc/stdio/../../../../../src/newlib/libc/stdio/makebuf.c:50:
> undefined reference to `_fstat_r'
> /opt/gnu/rtems/egcs-1.1b-binutils-2.9.1-newlib-1.8.0/sparc-rtems/sparc-rtems/lib/libc.a(isatty.o):
> In function `isatty':
> /export/home/datique/rtems/tools/build-sparc-tools/sparc-rtems/newlib/libc/posix/../../../../../src/newlib/libc/posix/isatty.c:12:
> undefined reference to `fstat'
> collect2: ld returned 1 exit status
> sirius%
>
>
>
>
> I am not sure, but it looks like all symbols from the stdio library are
> not being resolved.
> >
> > --joel
> > Joel Sherrill Director of Research & Development
> > joel at OARcorp.com On-Line Applications Research
> > Ask me about RTEMS: a free RTOS Huntsville AL 35805
> > Support Available (256) 722-9985
> >
> >
> >
> >
>
>