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


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

Re: Undefined reference to '_ctype_'


Doug Broadwell wrote:
> 
> Hi,
> 
> I'm getting an "Undefined reference to _ctype_ " error in various newlib
> files (e.g., .../libc/stdio/vfscanf.c) on code using the "isspace()" family
> of functions/macros.  My command line is:
> 
> $GCCBIN/m68k-coff-gcc -nostartfiles -O0 -m68000 -msoft-float -fno-builtin -X
> linker -T -Xlinker \
> 
> ./proto.ld -o so_monitor.coff main.c stubs.c so_monitor.c \
> 
> $GCCBASE/m68k-coff/lib/m68000/libc.a
> 
> Thanks,
> Doug Broadwell

This symbol should be in your libc.a, brought in by the libc/ctype/ctype_.c file.
Can you provide some more details about the error message?

This may be a problem due to the code added to support negative ctype
indexes.  One of the gcc folks warned us a while back that what we were doing
is illegal C.  Take a look at your build_directory/m68k-coff/m68000/newlib/libc/ctype.
There should be a file ctype_.o and if you do a m68k-coff-nm on that file you
should see an externally visible _ctype_ symbol.  If you don't see the symbol, try 
adding #define COMPACT_CTYPE at the top of your src/newlib/libc/ctype/ctype_.c file 
and rebuilding.

--  Jeff J.


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