[OpenAFS] Linux2.6, Sparc [64], and Gentoo

Jeffrey Hutzelman jhutz@cmu.edu
Wed, 01 Mar 2006 18:47:12 -0500

On Friday, February 24, 2006 06:07:42 PM -0500 Michael Conrad 
<conradme@email.uc.edu> wrote:

> Hi, I'm attempting to get OpenAFS compiled on Gentoo, kernel 2.6.15, on an
> UltraSparc.  My problem *seems* to be that Gentoo doesn't officially
> support sparc64 by default (and doesn't have 64-bit mode in the compiler
> they supply), and openafs doesn't support linux 2.6 with ordinary 'sparc'.
> the first problem is indicated by
> gcc -O -I.
> -I/var/tmp/portage/openafs-1.4.1_rc8/work/openafs-1.4.1-rc8/src/c onfig
> -I/var/tmp/portage/openafs-1.4.1_rc8/work/openafs-1.4.1-rc8/include -O 2
> -D_LARGEFILE64_SOURCE -m64 -c -o cmd_errors64.o cmd_errors.c
>| gcc: -m64 detected on the command line overrides implicit -m32 added by
> the wrapper.
>| cc1: error: -m64 is not supported by this configuration
>| cc1: error: -mlong-double-64 not allowed with -m64
>| distcc[12784] ERROR: compile cmd_errors.c on localhost failed
>| make[3]: *** [cmd_errors64.o] Error 1
> and the second by
>> find . -name *linux* | grep sparc
> ./src/des/conf-sparc-linux.h
> ./src/des/conf-sparc64-linux.h
> ./src/config/param.sparc64_linux26.h
> ./src/config/param.sparc_linux24_usr.h
> ./src/config/param.sparc_linux22_usr.h
> ./src/config/param.sparc_linux24.h
> ./src/config/param.sparc64_linux24.h
> ./src/config/param.sparc64_linux24_usr.h
> ./src/config/param.sparc_linux22.h
> ./src/config/param.sparc64_linux22_usr.h
> ./src/config/param.sparc64_linux22.h
> Now, in gentoo they have two ebuilds: one named openafs, and one named
> openafs-kernel which appears to just "make only_libafs".  If I let the
> gentoo build system to its own configure, I end up with an error about a
> missing "param.sparc_linux26".  If I let your autoconf system run
> naturally, I end up with a successful configuration that is using
> sparc64_linux26. When building "only_libafs" it actually compiles and
> gives me the kernel module.  However when doing a normal build, it dies
> with the compile error above.
> Any suggestions on what I can/could/should do?

This is ugly, but it _may_ work...

- configure --with-afs-sysname=sparc_linux24 --disable-kernel-module
- build and install user-mode tools
- make distclean
- configure --with-afs-sysname=sparc64_linux26
- make only_libafs

The result will be 32-bit user mode utilities and a kernel module for
whatever kernel you have.  If your kernel is indeed a sparc64 kernel,
then the module will probably even work.

I believe a 32-bit afsd will work with a 64-bit kernel, but I'm not 
positive.  The other tools will definitely work, though of course that's 
not much help if afsd doesn't work.

Another option would be to contribute a sparc_linux26 port.  Given that 
both sparc_linux24 and sparc64_linux26 exist, this will probably not be 
much harder than writing the param.h file and making a few changes in each 
of src/cf/osconf.m4, src/{libafs,libuafs}/MakefileProto.LINUX.in, and maybe 
the top-level Makefile.in.

Good luck...