This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: Undefined reference to '_ctype_'
- From: "J. Johnston" <jjohnstn at redhat dot com>
- To: Doug Broadwell <dougb at value dot net>
- Cc: Newlib Mail List <newlib at sources dot redhat dot com>
- Date: Fri, 18 Oct 2002 14:38:08 -0400
- Subject: Re: Undefined reference to '_ctype_'
- Organization: Red Hat Inc.
- References: <001601c276ce$2bd69960$3cfea8c0@dba03>
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.