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
Created attachment 117280 [details, diff] autoconfigure platform detect fix
Created attachment 117281 [details, diff] syscal table gpl hack
Created attachment 117282 [details, diff] openafs ebuild
Created attachment 117283 [details, diff] openafs-kernel ebuild
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
Created attachment 117463 [details, diff] jmp_buf pointer mangling
Created attachment 117465 [details, diff] openafs ebuild
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
Created attachment 117712 [details, diff] jmp_buf pointer mangling try2 corrected #ifdef
Could I get a status report on this? I've only recently discovered this bug report. Thanks!
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.
(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?
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'
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?
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.
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
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.
Created attachment 134841 [details, diff] autoconfigure platform detect fix due to /bin/arch deprecation in util-linux-2.13
Created attachment 134845 [details, diff] remove old kernel kludge
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.
sparc is in 1.4.14+