Subject: Re: Undefined kernel symbols: bcopy, strchr, memset, etc
To: Shawn Pearce <shawnp@nortelnetworks.com>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: port-macppc
Date: 11/18/1999 15:36:03
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--------------684C7107442CC7A5AC30AA70
Content-Type: TEXT/PLAIN; CHARSET=us-ascii
Content-ID: <Pine.SOL.3.96.991118151859.5289O@marcy.nas.nasa.gov>

On Thu, 18 Nov 1999, Shawn Pearce wrote:

> I just downloaded and attempted to build the NetBSD port of MacPPC from
> the 1.4.1 distribution.  However, after getting make, config, lorder and
> getting a ppcmake script I found off the web all installed (not to
> mention a working powerpc-netbsd-gcc), the NetBSD kernel wouldn't link
> because of undefined symbols.  These were:

What does this ppcmake script look like?

>     bcopy
>     bzero
>     memset
>     memcmp
>     memchr
>     strncpy
>     strcpy
>     strcat
>     strlen
>     strcmp
>     strncmp
>     __assert
>     bswap16
>     bswap32
>     scanc
>     random
>     skpc
>     min

My 1.4-release kernel (a little past 1.4.1)'s lib/kern directory has
bzero.o, memchr.o, memcmp.o, memset.o, strncmp.o, strcnp.o, strcat.o,
strlen.o, strcmp.o, strncmp.o, __assert.o, bswap16.o, bswap32.o, scanc.o,
random.o, skpc.o, and min.o . I think bcopy has been replaced with
memmove, and my kernel has memmove.o.

What are you setting MACHINE_ARCH to? It should be "powerpc".

> I'm fairly new to NetBSD, but I'm _not_ new to Unix.  ;-)  I have
> already ported Linux to the target platform that I am now attempting to
> port NetBSD to now, and aside from having fights with glibc 2.1.2, it
> runs perfectly fine.  Its an MPC8260, the PowerQUICC II from Motorola
> running on an embedded board.  I'd really prefer to use NetBSD or
> OpenBSD instead of Linux for the task at hand, but I am more familiar
> with Linux right now.
> 
> What I did for Linux was start with the PPC Linux port and work from
> there, so I decided to do the same with NetBSD.  I chose to start with
> the macppc port, as that seemed to be the more complete port of the
> bebox/macppc/ofppc/powerpc group.  Since our board doesn't have OF, the
> OF code isn't needed.

powerpc isn't a real "port" - it is the machine independent, processor
specific bits of code. The idea is that bebox, macppc, and ofppc will all
share code which deals with the PPC cpu's. :-)

> Anyway, I know have a (seemingly) working cross-compile environment for
> NetBSD working from my hppa-hpux desktop, and after applying the
> attached patch file to the NetBSD 1.4.1 sources I was able to
> sucessfully link a netbsd kernel.
> 
> My question to the group is, why did i get these undefined symbols, and
> is there a different fix than the included patch?  Also, should I really
> be starting with the macppc port, or should I be working from a
> different port?

You should have (csh syntax):
setenv MACHINE macppc
setenv MACHINE_ARCH powerpc

Take care,

Bill

--------------684C7107442CC7A5AC30AA70--