Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 176050 - net-fs/openafs-1.4.4 for sparc
Summary: net-fs/openafs-1.4.4 for sparc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: Sparc Linux
: High normal (vote)
Assignee: Stefaan De Roeck (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-26 00:25 UTC by Arkadi Shishlov
Modified: 2011-01-25 21:04 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
autoconfigure platform detect fix (openafs-1.5.19-sparc-acinclude.patch,317 bytes, patch)
2007-04-26 00:26 UTC, Arkadi Shishlov
Details | Diff
syscal table gpl hack (openafs-1.4.4-mod-license-gpl.patch,353 bytes, patch)
2007-04-26 00:27 UTC, Arkadi Shishlov
Details | Diff
openafs ebuild (openafs-1.4.4-r1.ebuild.diff,735 bytes, patch)
2007-04-26 00:28 UTC, Arkadi Shishlov
Details | Diff
openafs-kernel ebuild (openafs-kernel-1.4.4-r1.ebuild.diff,709 bytes, patch)
2007-04-26 00:29 UTC, Arkadi Shishlov
Details | Diff
jmp_buf pointer mangling (openafs-1.4.4-ptr-mangle.patch,1.50 KB, patch)
2007-04-28 00:19 UTC, Arkadi Shishlov
Details | Diff
openafs ebuild (openafs-1.4.4-r1.ebuild.diff,789 bytes, patch)
2007-04-28 00:20 UTC, Arkadi Shishlov
Details | Diff
jmp_buf pointer mangling try2 (openafs-1.4.4-ptr-mangle.patch,1.51 KB, patch)
2007-04-30 10:43 UTC, Arkadi Shishlov
Details | Diff
Patch attempting to fix the gpl syscall problem (openafs-sparc.patch,1.53 KB, patch)
2007-09-19 16:22 UTC, Stefaan De Roeck (RETIRED)
Details | Diff
autoconfigure platform detect fix due to /bin/arch deprecation in util-linux-2.13 (openafs-acinclude.patch,538 bytes, patch)
2007-10-31 21:39 UTC, Arkadi Shishlov
Details | Diff
remove old kernel kludge (openafs-osi_module.patch,344 bytes, patch)
2007-10-31 21:40 UTC, Arkadi Shishlov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arkadi Shishlov 2007-04-26 00:25:39 UTC
OpenAFS can be built on sparc with simple patch - openafs-1.5.19-sparc-acinclude.patch.
Bug opened upstream http://rt.central.org/rt/Ticket/Display.html?id=60288

openafs-1.4.4-mod-license-gpl.patch is unrelated to sparc but is here for completeness because in kernel 2.6.20 syscall table is GPL and AFS module cannot be built w/o this hack.

Portage 2.1.2.2 (default-linux/sparc/sparc64/2006.1, gcc-3.4.6, glibc-2.5-r1, 2.6.20-gentoo sparc64)
=================================================================
System uname: 2.6.20-gentoo sparc64 sun4u
Gentoo Base System release 1.12.9
Timestamp of tree: Sat, 21 Apr 2007 17:00:01 +0000
distcc 2.18.3 sparc-unknown-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r6
ACCEPT_KEYWORDS="sparc ~sparc"
AUTOCLEAN="yes"
CBUILD="sparc-unknown-linux-gnu"
CFLAGS="-O2 -mcpu=ultrasparc -mvis -Wa,-Av8plusa -pipe"
CHOST="sparc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -mcpu=ultrasparc -mvis -Wa,-Av8plusa -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distlocks metadata-transfer notitles parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo http://gentoo.osuosl.edu/ http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X apache2 berkdb bitmap-fonts cli cracklib crypt dri eds emboss encode fbcon foomaticdb gcc64 gdbm gif gstreamer gtk2 iconv imlib isdnlog jpeg libwww mad midi mikmod mpeg ncurses nls nptl nptlonly objc ogg pam pcre png pppd python qt3 readline reflection samba sdl server session sparc spell spl ssl tcpd truetype truetype-fonts type1-fonts unicode vorbis xml xorg xv zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="sunffb"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Arkadi Shishlov 2007-04-26 00:26:47 UTC
Created attachment 117280 [details, diff]
autoconfigure platform detect fix
Comment 2 Arkadi Shishlov 2007-04-26 00:27:33 UTC
Created attachment 117281 [details, diff]
syscal table gpl hack
Comment 3 Arkadi Shishlov 2007-04-26 00:28:32 UTC
Created attachment 117282 [details, diff]
openafs ebuild
Comment 4 Arkadi Shishlov 2007-04-26 00:29:05 UTC
Created attachment 117283 [details, diff]
openafs-kernel ebuild
Comment 5 Arkadi Shishlov 2007-04-28 00:19:03 UTC
Starting with glibc 2.4 pointers in jmp_buf are mangled (using XOR). Standard upstream solution is to switch to ucontext_t functions which is not available on sparc. The attached patch mangle pointers where needed.
Bug opened upstream http://rt.central.org/rt/Ticket/Display.html?id=60440
References:
http://www.archivesat.com/OpenAFS_Developers/thread236068.htm
http://sourceware.org/ml/libc-hacker/2006-01/msg00003.html
Comment 6 Arkadi Shishlov 2007-04-28 00:19:49 UTC
Created attachment 117463 [details, diff]
jmp_buf pointer mangling
Comment 7 Arkadi Shishlov 2007-04-28 00:20:38 UTC
Created attachment 117465 [details, diff]
openafs ebuild
Comment 8 Arkadi Shishlov 2007-04-28 21:26:59 UTC
If/when ucontext functions will be implemented the patch should become

--- src/config/param.sparc64_linux26.h~ 2007-04-26 22:59:00.000000000 +0300
+++ src/config/param.sparc64_linux26.h  2007-04-26 23:01:16.000000000 +0300
@@ -74,6 +74,11 @@
 #define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
 #define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
 
+#ifdef __GLIBC__
+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 3)
+#define USE_UCONTEXT
+#endif
+#endif
 
 #ifdef KERNEL
 #ifndef MIN

Reference:
http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg333193.html
Comment 9 Arkadi Shishlov 2007-04-30 10:43:38 UTC
Created attachment 117712 [details, diff]
jmp_buf pointer mangling try2

corrected #ifdef
Comment 10 Stefaan De Roeck (RETIRED) gentoo-dev 2007-09-04 09:06:42 UTC
Could I get a status report on this?  I've only recently discovered this bug report.  Thanks!
Comment 11 Arkadi Shishlov 2007-09-04 18:08:26 UTC
Upstream marked this bug as resolved http://rt.central.org/rt/Ticket/Display.html?id=60440
But 1.4.4 is latest stable release.
1.5.22 release notes http://www.openafs.org/pipermail/openafs-announce/2007/000200.html says "pointer demangling for sparc32 implemented to fix lwp". I didn't checked how exactly this issues was resolved.
The "syscal table gpl hack" and "jmp_buf pointer mangling try2" patches are valid/works for me.
Comment 12 Stefaan De Roeck (RETIRED) gentoo-dev 2007-09-05 06:47:54 UTC
(In reply to comment #11)
> Upstream marked this bug as resolved
> http://rt.central.org/rt/Ticket/Display.html?id=60440
> But 1.4.4 is latest stable release.
I see your fix in the cvs delta's for 1.4.x, applied on may 16th. As such, it appears in the openafs-1.4.4_p20070724 ebuild. 

> The "syscal table gpl hack" and "jmp_buf pointer mangling try2" patches are
> valid/works for me.

What exactly is this syscall table hack for? Is it legal? You say it's unrelated to sparc, but yet openafs works without it on other platforms. Could you elaborate on this?  
Also, you didn't mention the autoconfigure patch, is that one still necessary, or has it been dealt with upstream?
Comment 13 Arkadi Shishlov 2007-09-05 14:45:06 UTC
Autoconfigure fix is marked resolved upstream http://rt.central.org/rt/Ticket/Display.html?id=60288 but it is not in 1.4.4_p20070724.
Module from 1.4.4 cannot be built against 2.6.20-gentoo-r7 until the module license is GPL. The error is:
  LD [M]  /var/tmp/portage/net-fs/openafs-kernel-1.4.4-r1/work/openafs-1.4.4/src/libafs/MODLOAD-2.6.20-gentoo-r7-MP/libafs.o
  Building modules, stage 2.
  MODPOST 1 modules
FATAL: modpost: GPL-incompatible module libafs.ko uses GPL-only symbol 'sys_call_table'
Comment 14 Stefaan De Roeck (RETIRED) gentoo-dev 2007-09-19 16:22:46 UTC
Created attachment 131309 [details, diff]
Patch attempting to fix the gpl syscall problem

Concerning the syscall table GPL hack:
* do you need it on other linux kernels as well?
* if you try this patch I got from the openafs mailing list instead, does it still work?
Comment 15 Arkadi Shishlov 2007-09-19 17:31:29 UTC
With GPL hack
[  173.474915] Found system call table at 0x4164bc (exported)
[  173.474965] Found 32-bit system call table at 0x416000 (exported)

With the patch from OpenAFS-devel
[  410.362210] Warning: failed to find address of system call table
[  410.362241] System call hooks will not be installed; proceeding anyway
[  410.362307] Found 32-bit system call table at 0x416000 (exported)

And openafs client works with both patches.
It is probably 64-bit userspace that will sufer in second case.

Other kernels - you mean other architectures? I don't know, probably not. Other kernel versions on sparc - I think yes.
Comment 16 Stefaan De Roeck (RETIRED) gentoo-dev 2007-09-19 17:54:18 UTC
Patch added in openafs-kernel-1.4.4_p20070724-r2.

The question about the kernels was with respect to different versions of the linux kernel.  

If any problems with 64-bit arise, please file a new bug about that.
Thanks
Comment 17 Arkadi Shishlov 2007-10-31 21:37:45 UTC
The ebuilds are not keyworded for sparc. Please add ~sparc keyword to 1.4.4-r2 and 1.4.5_pre1.

util-linux 2.13 deprecated /bin/arch
http://www.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13-ReleaseNotes
New acinclude patch use uname -m.

openafs-osi_module.patch fixes openafs-kernel sparc module compilation problem. There is no linux/ioctl32.h header in current 2.6 kernel. This change is dated 2005.

Please push patches upstream.
Comment 18 Arkadi Shishlov 2007-10-31 21:39:46 UTC
Created attachment 134841 [details, diff]
autoconfigure platform detect fix due to /bin/arch deprecation in util-linux-2.13
Comment 19 Arkadi Shishlov 2007-10-31 21:40:53 UTC
Created attachment 134845 [details, diff]
remove old kernel kludge
Comment 20 Ferris McCormick (RETIRED) gentoo-dev 2007-11-01 13:45:46 UTC
Sparc done for openafs[-kernel]-1.4.5_pre1; both client and server can start, set up /proc/fs/openafs.  There is no -1.4.4-r2 for us to do anything with.  I have not touched 1.5.19 --- please re-add us with a specific request if you want that.

I note that openafs-server does not appear to shutdown nicely, but it does shut down.  I suspect that
====================================
stackcheck = 66051: stack = 66051 
topstack = 0xefec372c: stackptr = 0x701f4008: stacksize = 0x48000
Thu Nov  1 13:31:08 2007 LWP: stack overflow in process IO MANAGER!./openafs-server: line 31: 11982 Aborted                 /usr/bin/bos shutdown localhost -localauth -wait
====================================
is not a good thing, and will investigate as time permits.  In the mean time, these can have ~sparc for further testing if anyone wishes.
Comment 21 SpanKY gentoo-dev 2011-01-25 21:04:00 UTC
sparc is in 1.4.14+