Subject: egcs 1.1.1 armv2 compile

From: Chris Rutter <[email-masked]>
Date: Thu, 25 Feb 1999 21:31:05 +0000 (GMT)

I've got my binutils 19a for `armv2-linux' nicely configured and
installed.

I've got the kernel headers from Linux 2.2.1, patched with `rmk4' and
also the latest `philb' copied into /usr/armv2-linux/include/{asm,linux}.

I've configured egcs for `armv2-linux' fine.  I'm trying to build `gcc'.

    «inkvine» /usr/src/egcs-1.1.1-armv2-linux/gcc make LANGUAGES="c"
    gcc -DCROSS_COMPILE -DIN_GCC    -g  -DHAVE_CONFIG_H     -I. -I../../egcs-1.1.1/gcc -I../../egcs-1.1.1/gcc/config \
      -DGCC_INCLUDE_DIR=\"/usr/lib/gcc-lib/armv2-linux/egcs-2.91.60/include\" \
      -DGPLUSPLUS_INCLUDE_DIR=\"/usr/include/g++\" \
      -DOLD_GPLUSPLUS_INCLUDE_DIR=\"/usr/lib/g++-include\" \
      -DLOCAL_INCLUDE_DIR=\"/usr/local/include\" \
      -DCROSS_INCLUDE_DIR=\"/usr/armv2-linux/sys-include\" \
      -DTOOL_INCLUDE_DIR=\"/usr/armv2-linux/include\" \
      -c `echo ../../egcs-1.1.1/gcc/cccp.c | sed 's,^\./,,'`
    ../../egcs-1.1.1/gcc/cccp.c: In function `timestamp':
    ../../egcs-1.1.1/gcc/cccp.c:4085: warning: assignment makes pointer from integer without a cast
    ../../egcs-1.1.1/gcc/cccp.c: In function `special_symbol':
    ../../egcs-1.1.1/gcc/cccp.c:4212: dereferencing pointer to incomplete type
    ../../egcs-1.1.1/gcc/cccp.c:4213: dereferencing pointer to incomplete type
    ../../egcs-1.1.1/gcc/cccp.c:4213: dereferencing pointer to incomplete type
    ../../egcs-1.1.1/gcc/cccp.c:4215: dereferencing pointer to incomplete type
    ../../egcs-1.1.1/gcc/cccp.c:4215: dereferencing pointer to incomplete type
    ../../egcs-1.1.1/gcc/cccp.c:4216: dereferencing pointer to incomplete type
    ../../egcs-1.1.1/gcc/cccp.c: In function `initialize_builtins':
    ../../egcs-1.1.1/gcc/cccp.c:9836: dereferencing pointer to incomplete type
    ../../egcs-1.1.1/gcc/cccp.c:9837: dereferencing pointer to incomplete type
    ../../egcs-1.1.1/gcc/cccp.c:9837: dereferencing pointer to incomplete type
    ../../egcs-1.1.1/gcc/cccp.c:9843: dereferencing pointer to incomplete type
    ../../egcs-1.1.1/gcc/cccp.c:9843: dereferencing pointer to incomplete type
    ../../egcs-1.1.1/gcc/cccp.c:9843: dereferencing pointer to incomplete type
    make: *** [cccp.o] Error 1

Let's look at `cccp.c'.  Line 4212's problem is this:

    sprintf (buf, "\"%s %2d %4d\"", monthnames[timebuf->tm_mon],
 
where |timebuf| is declared in line 4108, like this:

    struct tm *timebuf;

The bundle later on after line 9836 are exactly the same; triggered
by selecting a member from |timebuf|.

|timebuf| is assigned its value a few lines previous like this:

    timebuf = timestamp ();

Where timestamp() is this function:

    static struct tm *timestamp PROTO((void));
    static struct tm *
    timestamp () 
    {
      static struct tm *timebuf;
      if (!timebuf) {
        time_t t = time ((time_t *) 0);
        timebuf = localtime (&t);
      }
      return timebuf;
    }

I'm now stuck -- any ideas?

-- 
Chris <[email-masked]>                         ( http://www.fluff.org/chris )

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]

---

From: Philip Blundell <[email-masked]>
Date: Thu, 25 Feb 1999 22:01:31 +0000

>    ../../egcs-1.1.1/gcc/cccp.c:4212: dereferencing pointer to incomplete type

That error means you did something like

struct foo *bar;
 ..
bar->baz = 1;

without ever actually defining `struct foo'.

>I'm now stuck -- any ideas?

It's weird.  Run that file through gcc -E and find out what's become of the 
definition of struct tm, I guess.

p.