Subject: gcc 2.6.0 and kernel compiling
To: None <amiga@NetBSD.ORG>
From: Marc Duponcheel <mduponch@cisco.com>
List: amiga
Date: 10/14/1994 11:13:03
Hello Folks

First: I *could* compile netbsd with gcc 2.4.5 ... in fact I only
had to replace the main component (cc1).

now the question:

Michael L. Hitch told me (us)

-   Gcc 2.6.0 now uses memcpy (instead of bcopy) for structure assignments.  To
- use gcc 2.6.0, you will have to add memcpy to the kernel library routines.


What I did is make a file called kern_memcpy.c in src/sys/kern and add it to
the .o list in the makefile ... This gave me a netbsd kernel with 2.6.0
However ... it did not boot correctly :-(

here is the code:
==============
#include <string.h>

void           *
memcpy(void *dst, const void *src, size_t len)
{
	register char  *to = (char *) dst;
	register const char *from = (const char *) src;
	register int    i;
	for (i = 0; i < len; ++i) {
		*to++ = *from++;
	}
	return dst;
}
==============

Maybe I am a bit paranoid but normally gcc 2.6.0 works fine so I thought about
the following possible problems:

1) something wrong with gcc 2.6.0 (happens to show up when compiling NetBSD)
2) something wrong with NetBSD (happens to show up when compiling with gcc 2.6.0)
3) something wrong with my memcpy (maybe because it does not support overlap ...)
   in this case, does someone know a fast memcpy that supports overlap ?

I am asking this because I feel that it makes no sense to stick to gcc 2.4.5 forever ...

ThanX.

PS: thanks for every single help ...

Greetings,

--marc.

                          \|||/
                          (o o)
+----------------------ooO-(_)-Ooo------+----------------------------------+
|         |          |                  |  Cisco Systems Belgium NV/SA     |
|        |||        |||                 |  Complex Antares                 |
|       |||||      |||||                |  71, Avenue des Pleiades         |
|   ..:|||||||:..:|||||||:..            |  1200 Brussels                   |
|                                       |  BELGIUM   EUROPE                |
|     Cisco Systems Europe              |                                  |
|                                       |                                  |
|     Marc Duponcheel                   |  tel:    +32 2 778 42 40         |
|       MIS analyst                     |  e-mail: mduponch@cisco.com      |
+---------------------------------------+----------------------------------+