[OpenAFS] sparc64_linux24 woes

Pavel Semerad semerad@ss1000.ms.mff.cuni.cz
Tue, 12 Aug 2003 09:29:52 +0200


> > >
> > > >
> > > > I'm having issues building the kernel module for sparc64_linux24.  To
> > > > get the kernel module to compile, I had to copy the definitions of
> > > > old_gid_t from kernel headers into osi_group.c (obviously bad) and

  In recent kernels they have changed old_gid_t to u16 (in 32bit
setgroups function), this patch solves it:

--- src/afs/LINUX/osi_module.c  29 Jul 2003 02:01:02 -0000      1.16.2.22
+++ src/afs/LINUX/osi_module.c  12 Aug 2003 07:26:54 -0000
@ -88,7 +88,7 @@ static void **ia32_sys_call_table;
 #endif

 static void *ia32_ni_syscall = 0;
-asmlinkage long (*sys32_setgroupsp)(int gidsetsize, old_gid_t *grouplist);
+asmlinkage long (*sys32_setgroupsp)(int gidsetsize, u16 *grouplist);
 #if defined(__NR_ia32_setgroups32)
 asmlinkage long (*sys32_setgroups32p)(int gidsetsize, gid_t *grouplist);
 #endif /* __NR_ia32_setgroups32 */
--- src/afs/LINUX/osi_groups.c  22 May 2003 04:08:03 -0000      1.10.2.6
+++ src/afs/LINUX/osi_groups.c  12 Aug 2003 07:21:21 -0000
@ -178,8 +178,8 @@ asmlinkage long afs_xsetgroups32(int gid

 #if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_AMD64_LINUX20_ENV)
 /* Intercept the uid16 system call as used by 32bit programs. */
-extern long (*sys32_setgroupsp)(int gidsetsize, old_gid_t *grouplist);
-asmlinkage long afs32_xsetgroups(int gidsetsize, old_gid_t *grouplist)
+extern long (*sys32_setgroupsp)(int gidsetsize, u16 *grouplist);
+asmlinkage long afs32_xsetgroups(int gidsetsize, u16 *grouplist)
 {
     long code;
     cred_t *cr = crref();


> > > > when I try to load the module, I get 'unresolved symbol
> > > > sys_call_table32'
> > > >
> > > > I'm building on debian/woody against a 2.4.21 kernel.
> > >
> > > What does grep sys_call_table /proc/ksyms say?
> >
> > 000000000040e400 sys_call_table_Rdfdb18bd
> 
> I've never seen a sparc64 system which doesn't provide 32 bit
> compatibility. We should probably have configure tests for this, but can I
> guess you did something like decide you didn't need something-or-other
> compatibility and compiled it out, and brazenly suggest over-optimization
> sucks? If debian is providing kernels with no sparc32 support, I'd just
> like to say "ew".
> 
> That aside, /afs/andrew.cmu.edu/usr/shadow/osi_module.c-sparc64, dropped
> in src/afs/LINUX as osi_module.c, might work. It was 30 seconds work with
> emacs, and I didn't test it. Or, just re-enable (probably sparc32 binary
> compatibility, but I'm guessing) and rebuild the kernel.

  sys_call_table32 is exported only when Solaris emulation is enabled
(look at arch/sparc64/kernel/sparc64_ksyms.c), or use this patch to
export it always:

--- ./arch/sparc64/kernel/sparc64_ksyms.c.afs   Thu Aug 29 15:47:56 2002
+++ ./arch/sparc64/kernel/sparc64_ksyms.c       Tue Sep  3 17:58:54 2002
@ -301,6 +301,7 @@ EXPORT_SYMBOL(strpbrk);
 EXPORT_SYMBOL(strtok);
 EXPORT_SYMBOL(strstr);

+EXPORT_SYMBOL(sys_call_table32);
 #ifdef CONFIG_SOLARIS_EMUL_MODULE
 EXPORT_SYMBOL(linux_sparc_syscall);
 EXPORT_SYMBOL(rtrap);
@ -308,7 +309,6 @@ EXPORT_SYMBOL(show_regs);
 EXPORT_SYMBOL(solaris_syscall);
 EXPORT_SYMBOL(syscall_trace);
 EXPORT_SYMBOL(sunos_sys_table);
-EXPORT_SYMBOL(sys_call_table32);
 EXPORT_SYMBOL(tl0_solaris);
 EXPORT_SYMBOL(sys_sigsuspend);
 EXPORT_SYMBOL(sys_getppid);


Pavel Semerad