[OpenAFS-devel] openafs linux-kernelmodule not buildable on sparc

Derrick J Brashear shadow@dementia.org
Sun, 25 Feb 2007 09:35:22 -0500 (EST)


On Sun, 25 Feb 2007, Marcus Watts wrote:

> When you say "distribution" - do you mean "as distributed by kernel.org"
> or "as distributed by <3rd party distributor X>?"

The kernel version suggests kernel.org, maybe.

> Is there any particularly reason you want to run linux & not solaris?

Maybe he likes having IDE devices.

> Is ppc64 linux important to you?

We should be supporting it.

> You may also want to try openafs 1.5.15.  It is less
> conservative than the 1.4 series so might have improvements that
> haven't made it into 1.4 yet.

None relevant.

> If you want to experiment, find the line in
> src/afs/LINUX/osi_probe.c that says "extern SYSCALLTYPE sys_call_table[] __attribute__((weak));
> "
> and replace this with some other line, say
> #define sys_call_table ((SYSCALLTYPE*)0)
> or perhaps
> static SYSCALLTYPE sys_call_table[1];
> or possibly
> extern SYSCALLTYPE sys_call_table[] __attribute__((weak, alias("__this_symbol_should_not_exist__")));
> this should turn off the weak reference to sys_call_table that libafs.ko is
> probably making in your environment.  With luck, the other logic in osi_probe
> should then find sys_call_table some other way.  This is not a "Better" way,
> but it may be the best the linux developers will provide.

Realistically we should have a configure test that tries harder to guess 
how it's exported.

Of course here there is no leg to stand on for the "we only make new 
symbols GPL only" claim.

If anyone claims sys_call_table is "new", well, there goes their 
credibility.

Untested, might work, apply to your OpenAFS source and let us know.
Basically "try harder to see if a module with a weak ref to sys_call_table 
will work before trying it.

Index: afs/LINUX/osi_probe.c
===================================================================
RCS file: /cvs/openafs/src/afs/LINUX/osi_probe.c,v
retrieving revision 1.1.2.20
diff -u -r1.1.2.20 osi_probe.c
--- afs/LINUX/osi_probe.c       13 Feb 2007 22:54:20 -0000 
1.1.2.20
+++ afs/LINUX/osi_probe.c       25 Feb 2007 14:34:09 -0000
@@ -226,7 +226,9 @@
                                      ) __attribute__((weak));
  #endif

+#ifdef LINUX_EXPORTS_SYS_CALL_TABLE
  extern SYSCALLTYPE sys_call_table[] __attribute__((weak));
+#endif
  extern SYSCALLTYPE ia32_sys_call_table[] __attribute__((weak));
  extern SYSCALLTYPE sys_call_table32[] __attribute__((weak));
  extern SYSCALLTYPE sys_call_table_emu[] __attribute__((weak));
@@ -499,7 +501,11 @@
      0,
  #endif

+#ifdef LINUX_EXPORTS_SYS_CALL_TABLE
      sys_call_table,               /* weak symbol ref */
+#else
+    0,
+#endif
      0, 0,                         /* module parameter answers */
  #ifdef AFS_LINUX_sys_call_table
      AFS_LINUX_sys_call_table,     /* compiled-in answer, if any */
--- cf/linux-test4.m4   22 Feb 2007 21:49:02 -0000      1.20.2.28
+++ cf/linux-test4.m4   25 Feb 2007 14:34:09 -0000
@@ -110,9 +110,9 @@
    AC_CACHE_VAL([ac_cv_linux_exports_sys_call_table], [
      AC_TRY_KBUILD(
  [#include <linux/modversions.h>],
-[#ifndef __ver_sys_call_table
-#error sys_call_table not exported
-#endif],
+[
+extern SYSCALLTYPE sys_call_table[] __attribute__((weak));
+],
        ac_cv_linux_exports_sys_call_table=yes,
        ac_cv_linux_exports_sys_call_table=no)])
    AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)])


Derrick