This is the mail archive of the newlib@sourceware.org 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: can't build for z8k-coff


Christian,

Let's start with your output. You'll notice that argz_insert.c is failing to compile. For some reason, ptrdiff_t appears to be undefined by your compiler's stddef.h when __need_ptrdiff_t is set. From libc/argz_insert.c.

#include <errno.h>
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
#include <argz.h>
#define __need_ptrdiff_t
#include <stddef.h>

error_t
_DEFUN (argz_insert, (argz, argz_len, before, entry),
       char **argz _AND
       size_t *argz_len _AND
       char *before _AND
       const char *entry)
{
  int len = 0;

  if (before == NULL)
    return argz_add(argz, argz_len, entry);

  if (before < *argz || before >= *argz + *argz_len)
    return EINVAL;

  while (before != *argz && before[-1])
    before--;

  /* delta will always be non-negative, and < *argz_len */
  ptrdiff_t delta = before - *argz;


z8k-coff-gcc -B/local/newlib-cvs/b-z8k-coff/z8k-coff/z8001/newlib/ -isystem /local/newlib-cvs/b-z8k-coff/z8k-coff/z8001/newlib/targ-include -isystem /local/newlib-cvs/src/newlib/libc/include -mz8001 -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"1.15.0\" -DPACKAGE_STRING=\"newlib\ 1.15.0\" -DPACKAGE_BUGREPORT=\"\" -I. -I/local/newlib-cvs/src/newlib/libc/argz -O2 -fno-builtin -O2 -g -O2 -mz8001 -c -o lib_a-argz_insert.o `test -f 'argz_insert.c' || echo '/local/newlib-cvs/src/newlib/libc/argz/'`argz_insert.c
/local/newlib-cvs/src/newlib/libc/argz/argz_insert.c: In function `argz_insert':
/local/newlib-cvs/src/newlib/libc/argz/argz_insert.c:34: syntax error before `delta'
/local/newlib-cvs/src/newlib/libc/argz/argz_insert.c:41: `delta' undeclared (first use this function)
/local/newlib-cvs/src/newlib/libc/argz/argz_insert.c:41: (Each undeclared identifier is reported only once
/local/newlib-cvs/src/newlib/libc/argz/argz_insert.c:41: for each function it appears in.)
z8k-coff-gcc: file path prefix `/local/newlib-cvs/b-z8k-coff/z8k-coff/z8001/newlib/' never used
make[8]: *** [lib_a-argz_insert.o] Error 1


I don't know why the error appears only as an error 1 instead of an error 2. The build should have stopped there.

Your build then later fails because it is assuming that libc/argz/lib.a exists which it doesn't.

So, see if you can find out why that line is marked in error and subsequently why make didn't fail where it should have.

-- Jeff J.


Christian Groessler wrote:
Hi Jeff,

On Mon, 4 Jun 2007, Jeff Johnston wrote:

  I am skeptical that the patch is at fault since no other embedded platforms
are reporting problems.

I tried going back in one month decrements until it worked again.
It didn't work until I checked out with -D20060411, but with -D20060412 it fails a bit differently than current HEAD:


configure: configuring in libc
configure: running /bin/sh '../../../../src-pre/newlib/libc/configure' --prefix=/tmp/xxx '--cache-file=./config.cache' '--build=i686-pc-linux-gnu' '--host=z8k-coff' '--target=z8k-coff' '--with-newlib' '--enable-multilib' '--with-cross-host=i686-pc-linux-gnu' '--prefix=/tmp/xxx' '--program-transform-name=s,^,z8k-coff-,; ' '--with-target-subdir=z8k-coff' '--srcdir=../../../src-pre/newlib' 'CC=z8k-coff-gcc -B/local/newlib-cvs/b-test/z8k-coff/newlib/ -isystem /local/newlib-cvs/b-test/z8k-coff/newlib/targ-include -isystem /local/newlib-cvs/src-pre/newlib/libc/include' 'CFLAGS=-O2 -g -O2 ' 'CPPFLAGS=' 'LDFLAGS=' 'build_alias=i686-pc-linux-gnu' 'host_alias=z8k-coff' 'target_alias=z8k-coff' --cache-file=.././config.cache --srcdir=../../../../src-pre/newlib/libc
configure: loading cache .././config.cache
configure: error: `CFLAGS' has changed since the previous run:
configure: former value: -O2 -g -O2 configure: current value: -O2 -g -O2 configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm .././config.cache' and start over
configure: error: /bin/sh '../../../../src-pre/newlib/libc/configure' failed for libc
make[1]: *** [configure-target-newlib] Error 1
make[1]: Leaving directory `/local/newlib-cvs/b-test'
make: *** [all] Error 2



  Can you please perform a fresh build into a completely empty build
directory?  Specify full directory paths for now and save the output of both
your configure and build.  Perhaps a tool isn't configuring properly for some
reason.

Attached. I used cvs HEAD from right now.


regards,
chris


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