Subject: Undefined kernel symbols: bcopy, strchr, memset, etc
To: None <port-macppc@netbsd.org>
From: Shawn Pearce <shawnp@nortelnetworks.com>
List: port-macppc
Date: 11/18/1999 17:42:26
This is a multi-part message in MIME format.
--------------684C7107442CC7A5AC30AA70
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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:

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

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.

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?

Since my Linux port went over in about 2 weeks, I'm hoping NetBSD will
be about as quick (*crosses fingers*).

TIA.

--
Shawn.


--------------684C7107442CC7A5AC30AA70
Content-Type: text/plain; charset=us-ascii;
 name="libkern.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="libkern.patch"

*** sys/lib/libkern/Makefile	Thu Mar  4 14:46:09 1999
--- sys/lib/libkern/Makefile.spearce	Thu Nov 18 17:11:54 1999
***************
*** 56,61 ****
--- 56,133 ----
  SRCS+=	strrchr.c
  .endif
  
+ .if empty(SRCS:Mbcopy.S)
+ SRCS+=	bcopy.c
+ .endif
+ 
+ .if empty(SRCS:Mbzero.S)
+ SRCS+=	bzero.c
+ .endif
+ 
+ .if empty(SRCS:Mmemset.S)
+ SRCS+=	memset.c
+ .endif
+ 
+ .if empty(SRCS:Mmemcmp.S)
+ SRCS+=	memcmp.c
+ .endif
+ 
+ .if empty(SRCS:Mmemchr.S)
+ SRCS+=	memchr.c
+ .endif
+ 
+ .if empty(SRCS:Mstrncpy.S)
+ SRCS+=	strncpy.c
+ .endif
+ 
+ .if empty(SRCS:Mstrcpy.S)
+ SRCS+=	strcpy.c
+ .endif
+ 
+ .if empty(SRCS:Mstrcat.S)
+ SRCS+=	strcat.c
+ .endif
+ 
+ .if empty(SRCS:Mstrlen.S)
+ SRCS+=	strlen.c
+ .endif
+ 
+ .if empty(SRCS:Mstrcmp.S)
+ SRCS+=	strcmp.c
+ .endif
+ 
+ .if empty(SRCS:Mstrncmp.S)
+ SRCS+=	strncmp.c
+ .endif
+ 
+ .if empty(SRCS:M__assert.S)
+ SRCS+=	__assert.c
+ .endif
+ 
+ .if empty(SRCS:Mbswap16.S)
+ SRCS+=	bswap16.c
+ .endif
+ 
+ .if empty(SRCS:Mbswap32.S)
+ SRCS+=	bswap32.c
+ .endif
+ 
+ .if empty(SRCS:Mscanc.S)
+ SRCS+=	scanc.c
+ .endif
+ 
+ .if empty(SRCS:Mrandom.S)
+ SRCS+=	random.c
+ .endif
+ 
+ .if empty(SRCS:Mskpc.S)
+ SRCS+=	skpc.c
+ .endif
+ 
+ .if empty(SRCS:Mmin.S)
+ SRCS+=	min.c
+ .endif
+ 
  POBJS+=	mcount.po
  
  # only needed during build

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