How to configure to use my stubs.

Doug Broadwell dougb@value.net
Mon Sep 30 12:20:00 GMT 2002


Hi,

I'm trying to build an embedded 68000 system using cross-gcc on
i686-pc-linux-gnu and newlib.  The tool chain seems to be working, but I'm
having problems figuring out how to configure gcc to use the stubs I want.
Here's the results of the compile with my questions interspersed:


++ /opt/xgcc/run/bin/m68k-coff-as -o crt0.o crt0.S

++ /opt/xgcc/run/bin/m68k-coff-gcc -v -fno-builtin -Xlinker -T -Xlinker
./test.ld test.c

Reading specs from /opt/xgcc/run/lib/gcc-lib/m68k-coff/3.2/specs

Configured with:
../gcc-3.2/configure --target=m68k-coff --prefix=/opt/xgcc/run --with-gnu-as
 --with-local-prefix=/opt/xgcc/run/m68k-coff --with-gnu-ld --nfp --enable-la
nguages=c --with-newlib

Thread model: single
gcc version 3.2

/opt/xgcc/run/lib/gcc-lib/m68k-coff/3.2/cc1 -lang-c -v -D__GNUC__=3 -D__GNUC
_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102 -Dmc68000 -D__emb
edded__ -D__mc68000__ -D__embedded__ -D__mc68000 -Asystem=embedded -Amachine
=mc68000 -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D__HAVE_68881__ -Dmc68020 -D__
mc68020 -D__mc68020__ test.c -quiet -dumpbase
test.c -version -fno-builtin -o /tmp/ccOqq5B9.s

** What is the best way to get rid of the "-D__HAVE_68881__",
"-Dmc68020",etc.?  Should I edit the "specs" file to eliminate them?  Use
command line options to overwrite (i.e., "-U__HAVE_68881__")?  Edit
configure.in?  Add command line options "-m68000", "-msoft-float"?
Something else? **

** Do I need to add a "-DMSOFT_FLOAT" and "-DMNO-68881" or something?  Do
the command line options force use of software floating-point? **

** Why the "-D__NO_INLINE__" ? (just for my info) **

** What does "-D__STDC_HOSTED__" do? (just for my info) **

GNU CPP version 3.2 (cpplib) (68k, Motorola syntax)
GNU C version 3.2 (m68k-coff)
 compiled by GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release).

#include "..." search starts here:
#include <...> search starts here:
 /opt/xgcc/run/include
 /opt/xgcc/run/lib/gcc-lib/m68k-coff/3.2/include
 /opt/xgcc/run/m68k-coff/sys-include
 /opt/xgcc/run/m68k-coff/include
End of search list.


/opt/xgcc/run/lib/gcc-lib/m68k-coff/3.2/../../../../m68k-coff/bin/as --tradi
tional-format -mc68020 -o /tmp/ccdepuva.o /tmp/ccOqq5B9.s


/opt/xgcc/run/lib/gcc-lib/m68k-coff/3.2/collect2 -L/opt/xgcc/run/lib/gcc-lib
/m68k-coff/3.2 -L/opt/xgcc/run/lib/gcc-lib/m68k-coff/3.2/../../../../m68k-co
ff/lib -T ./test.ld
/tmp/ccdepuva.o -lgcc -lc -lgcc/opt/xgcc/run/lib/gcc-lib/m68k-coff/3.2/../..
/../../m68k-coff/lib/libc.a(makebuf.o): In function `__smakebuf':

** It's using ~/m68k-coff/lib/libc.a,  shouldn't it be using the
~/m68k-coff/lib/m68000/libc.a (or whatever it is)? **

/opt/xgcc/build/bld-newlib/m68k-coff/newlib/libc/stdio/../../../../../newlib
-1.10.0/newlib/libc/stdio/makebuf.c:93: undefined reference to `isatty'
/opt/xgcc/run/lib/gcc-lib/m68k-coff/3.2/../../../../m68k-coff/lib/libc.a(rea
dr.o): In function `_read_r':
/opt/xgcc/build/bld-newlib/m68k-coff/newlib/libc/reent/../../../../../newlib
-1.10.0/newlib/libc/reent/readr.c:58: undefined reference to `read'
/opt/xgcc/run/lib/gcc-lib/m68k-coff/3.2/../../../../m68k-coff/lib/libc.a(lse
ekr.o): In function `_lseek_r':

** It looks like here it linked in the reentrant stubs.  I don't need them
(although if I did, could I use library calls that use these in my interrupt
service routines?).  How do I get it to use the stubs in
newlib-1.10.0/libgloss/m68k ?**

/opt/xgcc/build/bld-newlib/m68k-coff/newlib/libc/reent/../../../../../newlib
-1.10.0/newlib/libc/reent/lseekr.c:58: undefined reference to `lseek'
/opt/xgcc/run/lib/gcc-lib/m68k-coff/3.2/../../../../m68k-coff/lib/libc.a(wri
ter.o): In function
`_write_r':/opt/xgcc/build/bld-newlib/m68k-coff/newlib/libc/reent/../../../.
./../newlib-1.10.0/newlib/libc/reent/writer.c:58: undefined reference to
`write'
/opt/xgcc/run/lib/gcc-lib/m68k-coff/3.2/../../../../m68k-coff/lib/libc.a(clo
ser.o): In function
`_close_r':/opt/xgcc/build/bld-newlib/m68k-coff/newlib/libc/reent/../../../.
./../newlib-1.10.0/newlib/libc/reent/closer.c:53: undefined reference to
`close'
...

collect2: ld returned 1 exit status



Thanks!




More information about the Gcc-help mailing list