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

Bill Studenmund wrote:

> 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?

I attached into this email.  I should have been more specific about it
earlier, but it sets the environment variables up for my cross compiler
toolchain as well as to use bsdmake (instead of the default GNU make we have
here).  It also does set MACHINE and MACHINE_ARCH as you suggseted in your
email.

> 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.

These object files were not compiled without applying the patch I had
attached to my prior email first.  I couldn't find any reference to how they
should have been built without that patch, hence my inquiry to the mailing
list regarding it.  ;-)

Should I be using a different version of the netbsd kernel?

> 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. :-)

Makes sense.  ;-)  Now I know why the macppc directory is so bare.  :-)

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

Already set via the ppcmake script I'm using.  (See attached)

--
Shawn.


--------------76A3EDD7E2610B9C45F5AA9E
Content-Type: text/plain; charset=us-ascii;
 name="ppcmake"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ppcmake"

#!/bin/sh
DESTDIR=/scratch/src/netbsd.obj export DESTDIR
MACHINE=macppc export MACHINE
MACHINE_ARCH=powerpc export MACHINE_ARCH
WHICH=powerpc-netbsd

#LOCAL=/usr/pkg
#BINDIR=$LOCAL/cross/bin
#PATH=$PATH:$BINDIR:$LOCAL/cross/$WHICH/bin:$PATH:$LOCAL/cross/bin export PATH

BINDIR=/scratch/netbsd/bin

GCC_EXEC_PREFIX=$WHICH

AR=$BINDIR/$WHICH-ar export AR
AS=$BINDIR/$WHICH-as export AS
CC=$BINDIR/$WHICH-gcc export CC
CPP=`$CC -print-prog-name=cpp` export CPP
CXX=$BINDIR/$WHICH-c++ export CXX
FC=$BINDIR/$WHICH-f77 export FC
LD=$BINDIR/$WHICH-ld export LD
NM=$BINDIR/$WHICH-nm export NM
RANLIB=$BINDIR/$WHICH-ranlib export RANLIB
SIZE=$BINDIR/$WHICH-size export SIZE
ADDR2LINE=$BINDIR/$WHICH-addr2line export ADDR2LINE
GASP=$BINDIR/$WHICH-gasp export GASP
OBJCOPY=$BINDIR/$WHICH-objcopy export OBJCOPY
OBJDUMP=$BINDIR/$WHICH-objdump export OBJDUMP
STRINGS=$BINDIR/$WHICH-strings export STRINGS
STRIP=$BINDIR/$WHICH-strip export STRIP

MKPROFILE=no export MKPROFILE
MKPIC=no export MKPIC
MKMAN=no export MKMAN
MKLINT=no export MKLINT

HOSTED_CC=gcc export HOSTED_CC

MAKE=bsdmake export MAKE
#MAKE="make -f ${bsd_root}/usr/share/mk/sys.mk -f Makefile"; export MAKE
#MAKEFLAGS="-I/scratch/src/netbsd/usr/src/share/mk" ; export MAKEFLAGS

exec $MAKE "$@"

--------------76A3EDD7E2610B9C45F5AA9E--