[OpenAFS-devel] Another build problem on sparc-linux

Dean Anderson dean@av8.com
Sat, 13 Sep 2003 16:10:13 -0400 (EDT)


Ok, I think I've made some progress on figuring out what I'm confused
about... But I could use some help from someone who has built sparc linux
afs.  I also tried rebuilding the rpm source distribution (aurora is
redhat on sparc). Same problem, after tweaking a syntax error in the spec
file.

I've also reinstalled from scratch, and am using the distributed compiler.

When you make the loadable modules on ultra sparc, how are they compiled?
Does one use sparc32bash to set a sparc32 environment?

I notice that the aurora webpags note that Sparc64 support only works in
the kernel, so presumably the kernel modules should be compiled as
sparc64, and userspace programs as sparc32. Correct?

gcc -O2 -fomit-frame-pointer -fno-strength-reduce -fno-strict-aliasing
-fno-common -pipe -mcpu=v8 -mno-fpu -fcall-used-g5 -fcall-used-g7
-D__KERNEL__ -DCPU=sparc -DKERNEL -D_KERNEL -DMODULE -D__BOOT_KERNEL_UP=1
-D__BOOT_KERNEL_SMP=0 -I. -I../ -I/usr/src/redhat/SOURCES/openafs-1.2.9/t
libafs/config -c ../afs/afs_analyze.c;  In file included from
linux/fs.h:297,
                 from linux/capability.h:17,
                 from linux/binfmts.h:5,
                 from linux/sched.h:9,
                 from asm/uaccess.h:11,
                 from ../afs/sysincludes.h:65,
                 from ../afs/afs_analyze.c:19:
linux/ext3_fs_i.h:75: field `truncate_sem' has incomplete type
In file included from linux/capability.h:17,
                 from linux/binfmts.h:5,
                 from linux/sched.h:9,
                 from asm/uaccess.h:11,
                 from ../afs/sysincludes.h:65,
                 from ../afs/afs_analyze.c:19:
linux/fs.h:734: field `s_umount' has incomplete type
In file included from asm/uaccess.h:11,
                 from ../afs/sysincludes.h:65,
                 from ../afs/afs_analyze.c:19:
linux/sched.h:219: field `mmap_sem' has incomplete type

The problem is the structure rw_semaphore is not defined. It is defined
generically if the kernel option CONFIG_RWSEM_GENERIC_SPINLOCK is set. It
is not set by default, and the kernel and other modules build just fine.

The rw_semaphore struct is also defined in asm-sparc64/rwsem.h.


From linux/rwsem.h:

struct rw_semaphore;

#ifdef CONFIG_RWSEM_GENERIC_SPINLOCK
#include <linux/rwsem-spinlock.h> /* use a generic implementation */
#else
#include <asm/rwsem.h> /* use an arch-specific implementation */
#endif

I see the kernel uses -nostdinc, so I tried that, no change, so I don't
think it could be confused by /usr/include headers.

Here is the command line from a kernel module that is include with the
linux kernel:

kgcc -D__KERNEL__ -I/usr/src/linux-2.4.20-2.3sparc/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
-fomit-frame-pointer -fomit-frame-pointer -m64 -pipe -mno-fpu
-mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7
-Wno-sign-compare -Wa,--undeclared-regs -DMODULE -DMODVERSIONS -include
/usr/src/linux-2.4.20-2.3sparc/include/linux/modversions.h  -nostdinc
-iwithprefix include -DKBUILD_BASENAME=dn_nsp_out  -c -o dn_nsp_out.o
dn_nsp_out.c


uname -a
Linux dakota.av8.net 2.4.20-2.3sparc #1 Wed Jan 15 18:27:52 EST 2003
sparc64 unknown


It looks very much like the wrong links are setup in libafs to asm, but I
have no idea how this is _supposed_ to build....



		--Dean