[OpenAFS-devel] OpenAFS on FreeBSD 6.1-BETA (lwp and -fPIC problems)

David G. Andersen dga+@cs.cmu.edu
Sat, 18 Feb 2006 13:55:05 -0500


On Sat, Feb 18, 2006 at 01:40:36PM -0500, Jim Rees scribed:
> process.o is not part of the kernel module.  So either you've got a bug in
> the module building or, more likely, "unexpected relocation type 7" is
> coming from somewhere else.
> 
> First step would be to use nm to verify that process.o is not getting linked
> in with your libafs.ko.
> 
> The message could just be a side-effect of the undefined copyinstr symbol,
> so the next step would be to fix that.
> 
> I will be installing the 6.1 beta as soon as a snapshot is available and can
> help out a bit more then, although I will have i386, not amd64.

Ahh.  You're right.  Thanks - I've never poked around the openafs code 
before (clearly :).  Part of the problem is that the afs freebsd steps 
for building the .ko are copied from the i386 "way" and not the amd64 way,
as defined in /usr/src/sys/conf/kmod.mk.  i386 builds the .kld and
then invokes LD -Bshareable to create the .ko;  amd64 creates the .ko
directly in the first pass.

I may have implemented it wrong, but changing to this results in a huge
slew of errors as well:

Feb 18 12:48:48 moo kernel: kldload: unexpected relocation type 4
Feb 18 12:48:48 moo kernel: kldload: unexpected relocation type 9
Feb 18 12:48:48 moo kernel: kldload: unexpected relocation type 4
Feb 18 12:48:48 moo kernel: kldload: unexpected relocation type 4
(100+ times)
Feb 18 12:48:48 moo kernel: link_elf_obj: symbol bzero undefined
Feb 18 12:48:48 moo kernel: kldload: Unsupported file type

(I believe the bzero failure is a result of the unexpected relocation
type preventing symbol resolution, and not vise-versa.)

I'll keep poking at it.  The snapshot of 6.1 beta-1 is available on the
FreeBSD FTP sites.  If you or another developer would like an account
on an amd64 FreeBSD 6.1-beta1 machine, just let me know -- the machine
I'm trying to install is a new server I just bought and it's completely
unused.  I'm happy to defer moving it into production for a bit if it
means AFS support. :)

  -Dave