Subject: Re: libkern Makefile.inc
To: James MacKinnon <jmack@Phys.UAlberta.Ca>
From: Simon Burge <simonb@melb.cpr.itg.telecom.com.au>
List: port-pmax
Date: 04/06/1995 11:18:28
On Apr 5,  9:45am, James MacKinnon wrote:
> # bmake depend
> sh: printf: not found

I had to compile up netbsd's printf for Ultrix.  If you want, I can email
you source and/or binary of something that compiles.

> No suffix list.
> Make:  Don't know how to make xxx.  Stop.
> "../../../../lib/libkern/Makefile.inc", line 8: warning: Couldn't read 
> shell's output
> "../../../../lib/libkern/Makefile.inc", line 8: warning: "cd $(KERNDIR);  
> printf "xxx:\n\techo \$${.OBJDIR}\n" | $(MAKE) -r -s -f - xxx" returned 
> non-zero
> 
> Makefile.inc in src/sys/lib/libkern  has this odd section which is at
> issue (what is  xxx ???):
> 
> KERNLIBDIR!=cd $(KERNDIR); \
>         printf "xxx:\n\techo \$${.OBJDIR}\n" | $(MAKE) -r -s -f - xxx
> 
> 
> Since libkern's Makefile.inc fails, LIBKERN gets defined as '/libkern.a'
> but there is also perhaps something else critcally missing when this 
> fails.
> 
> The source files will all compile to object form with little complaint, but 
> the link loader then fails (after modifiying to a suitable good path to 
> libkern.a) with several dozen undefined symbols: 
> 
> ...
> 
> ld -x -N -o netbsd -e start -Ttext 80030000 ${SYSTEM_OBJ} vers.o ../libkern.a
> /bin/ld:
> Undefined:
> _mach_init _cpu _fpu _main _panic _whichqs _qs _nullproc _curproc 
> _cnt_want_resched _pmap_alloc_tlbpid _machExceptionTable _trap _interrupt
> _astpending _softintr _Sysmapsize _Sysmap _printf _machFPCurProcPtr
> _MachEmulateBranch _trapsignal _machDataCacheSize _machInstCacheSize
> copyinstr bcopy splx memcpy copyout suword splsoftclock setsoftclock 
> splhigh copyin sigcode esigcode copyoutstr setrunqueue spl0 subyte remrq
> cpu_switch fuswintr suswintr ovbcopy copystr setsoftnet _insque _remque
> MachEmptyWriteBuffer nclist MachTLBWriteIndexed MachSetPID MachUTLBMissEnd
> MachUTLBMiss MachExceptionEnd MachException MachConfigCache MachFlushCache
> Mach_spl1 Mach_spl0 Mach_spl2 Mach_spl3 badaddr MachSaveCurFPState savectx
> blkclr MachTLBFlushAddr MachTLBUpdate MachFlushICache MachTLBFlush 
> MachKernIntr MachKernGenException MachTLBMissException MachUserIntr
> MachUserGenException onfault_table fuiword suiword MachSwitchFPState
> MachFPInterrupt clearsoftclock clearsoftnet cpu_getregs copykstack
> 
> ...

This looks like the underscore problem - the DEC compiler doesn't
prepend an underscore to the symbol name.  I think there's a define or
option in the config file you can set to help here, but I can't recall
exactly.  May Ted can answer this?

> What am I missing or doing wrong?
> 
> Source tree is netbsd-current, sup'ed yesterday. There was no sys/arch 
> ???? via sup, so I got the arch subtree out of the tar-files/sys.tar.gz
> via ftp.
> 
> Build is on a DS5000 running Ultrix 4.3a, with a GENERIC.pmax copy
> with only 1 minor addition '-D_KERNEL' added, since sys/proc.h has
> '_KERNEL' instead of 'KERNEL'
> 
> vnode_if.sh is using /bin/sh5, and awk is /bin/nawk
> 
> --
> James S. MacKinnon           Office: P-139 Avahd-Bhatia Physics Lab
> Department of Physics        Voice : (403) 492-8226
> University of Alberta        email : Jim.MacKinnon@Phys.UAlberta.CA
> Edmonton, Canada T6G 2N5
>         WWW:   http://www.phys.ualberta.ca/~jmack/jmack.html   

Simon.