undefined reference to `_ctype_' using newlib-1.10.0 under CygWin

J. Johnston jjohnstn@redhat.com
Thu Jul 10 22:09:00 GMT 2003


Other than suggesting you move to a more recent version of newlib,
you need:

   m68*)
         machine_dir=m68k
         newlib_cflags="${newlib_cflags} -DCOMPACT_CTYPE"
         ;;

in your configure.host.  It is the -DCOMPACT_CTYPE flag that you need to add.
You will have to rebuild the libc/ctype directory.

-- Jeff J.

Colin Trubshaw wrote:
> Hi
> 
> I am using newlib-1.10.0 with the following patches applied:
> 
> http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/libgloss/m68k/configure.dif
> f?cvsroot=src&r1=1.2&r2=1.3
> 
> http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/libgloss/m68k/configure.in.
> diff?cvsroot=src&r1=1.1&r2=1.2
> I am also using binutils-2.13.2.1 and gcc-3.2.3.
> My environment is:
>     host=i686-pc-cygwin
>     target=m68k-coff
>     prefix=/work/m68k
>     CC=gcc-2
>     PATH=$PATH:/$prefix/bin
> I am using CygWin 1.3.22-1 under W2K SP3.
> 
> I have successfully built binutils, gcc core, newlib, and full gcc in that
> order.
> 
> The whole tool chain appears to work fine, except that I get the following
> error when linking:
> m68k-coff-ld -L/work/m68k/m68k-coff/lib/m5200/ -L/work/m68k/lib/gcc-lib/m68k
> -coff/3.3/m5200/ --print-map -Map py2.map --cref --script=py2.ld -o py2.out
> <<all my .o files>> -lc -lnosys -lgcc
> /work/m68k/m68k-coff/lib/m5200//libc.a(vfscanf.o): In function
> `__svfscanf_r':
> /work/build-newlib/m68k-coff/m5200/newlib/libc/stdio/../../../../../../src/n
> ewlib-1.10.0/newlib/libc/stdio/vfscanf.c:493: undefined reference to
> `_ctype_'
> /work/build-newlib/m68k-coff/m5200/newlib/libc/stdio/../../../../../../src/n
> ewlib-1.10.0/newlib/libc/stdio/vfscanf.c:635: undefined reference to
> `_ctype_'
> /work/build-newlib/m68k-coff/m5200/newlib/libc/stdio/../../../../../../src/n
> ewlib-1.10.0/newlib/libc/stdio/vfscanf.c:648: undefined reference to
> `_ctype_'
> /work/build-newlib/m68k-coff/m5200/newlib/libc/stdio/../../../../../../src/n
> ewlib-1.10.0/newlib/libc/stdio/vfscanf.c:473: undefined reference to
> `_ctype_'
> /work/build-newlib/m68k-coff/m5200/newlib/libc/stdio/../../../../../../src/n
> ewlib-1.10.0/newlib/libc/stdio/vfscanf.c:400: undefined reference to
> `_ctype_'
> 
> Using 'nm' on libc.a, I get this:
> ctype_.o:
> 00000184 b .bss
> 00000180 d .data
> 00000184 N .stab
> 00000340 N .stabstr
> 00000000 t .text
> 00000180 D __ctype_ptr
> 00000000 t _ctype_b
> 
> Can anyone suggest what I might do to resolve this problem?
> 
> Many thanks
> ColinT
> p.s. I have spent several weeks getting this far, so if anyone else is
> struggling to do what I have done, I am happy to provide instructions.
> 
> 




More information about the Newlib mailing list