zfsonlinux/spl — Issue #83: SPL build error on sparc
Author: forced-inductn
Created: 2012-01-29 04:04:01+00:00
State: open

I am trying to build spl-0.6.0-rc6 in Debian 6.0.3 on a Sun e4500 with 8x ultrasparc II, but the build fails with:

configure: creating ./config.status
config.status: creating Makefile
config.status: creating lib/Makefile
config.status: creating cmd/Makefile
config.status: creating module/Makefile
config.status: creating module/spl/Makefile
config.status: creating module/splat/Makefile
config.status: creating include/Makefile
config.status: creating scripts/Makefile
config.status: creating spl.spec
config.status: creating spl-modules.spec
config.status: creating spl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
+ make
make[2]: Entering directory `/tmp/spl-build-root-1C1l7MtT/BUILD/
spl-0.5.2'
make all-recursive
make[3]: Entering directory `/tmp/spl-build-root-1C1l7MtT/BUILD/
spl-0.5.2'
Making all in module
make[4]: Entering directory `/tmp/spl-build-root-1C1l7MtT/BUILD/
spl-0.5.2/module'
make -C /usr/src/linux-headers-2.6.32-5-sparc64-smp SUBDIRS=`pwd`
modules
make[5]: Entering directory `/usr/src/linux-headers-2.6.32-5-sparc64-
smp'
CC [M] /tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/
spl/../../module/spl/spl-debug.o
CC [M] /tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/
spl/../../module/spl/spl-proc.o
CC [M] /tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/
spl/../../module/spl/spl-kmem.o
CC [M] /tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/
spl/../../module/spl/spl-thread.o
/tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/spl/../../module/
spl/spl-thread.c: In function 'thread_generic_wrapper':
/tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/spl/../../module/
spl/spl-thread.c:62: error: implicit declaration of function
'get_current'
/tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/spl/../../module/
spl/spl-thread.c:62: warning: cast to pointer from integer of
different size
make[9]: *** [/tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/
spl/../../module/spl/spl-thread.o] Error 1
make[8]: *** [/tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/spl]
Error 2
make[7]: *** [_module_/tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/
module] Error 2
make[6]: *** [sub-make] Error 2
make[5]: *** [all] Error 2
make[5]: Leaving directory `/usr/src/linux-headers-2.6.32-5-sparc64-
smp'
make[4]: *** [modules] Error 2
make[4]: Leaving directory `/tmp/spl-build-root-1C1l7MtT/BUILD/
spl-0.5.2/module'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/tmp/spl-build-root-1C1l7MtT/BUILD/
spl-0.5.2'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/tmp/spl-build-root-1C1l7MtT/BUILD/
spl-0.5.2'
error: Bad exit status from /tmp/spl-build-root-1C1l7MtT/TMP/rpm-
tmp.CO2bDd (%build)

RPM build errors:
Bad exit status from /tmp/spl-build-root-1C1l7MtT/TMP/rpm-
tmp.CO2bDd (%build)
make[1]: *** [rpm-common] Error 1
make[1]: Leaving directory `/root/spl-0.5.2'
make: *** [rpm-modules] Error 2

I emailed the mailing list and adilger [at] dilger [dot] ca pointed something out:

On 2012-01-27, at 2:45 PM, FORCED-INDUCTN wrote:
> I have a Sun e4500 with 8x Ultrasparc II running Debian 6.0.3 when
> compiling SPL the build fails, this is the tail end of the console
> output:

It should work on a 2.6.32 kernel, but it may be that the SPL code is
using some kernel function that doesn't exist on Sparc.

> make -C /usr/src/linux-headers-2.6.32-5-sparc64-smp SUBDIRS=`pwd`
> modules
> CC [M] /tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/
> spl/../../module/spl/spl-thread.o
> /tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/spl/../../module/
> spl/spl-thread.c: In function 'thread_generic_wrapper':
> /tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/spl/../../module/
> spl/spl-thread.c:62: error: implicit declaration of function
> 'get_current'

This is defined in arch/x86/include/asm/current.h. In the sparc current.h:

/* We might want to consider using %g4 like sparc64 to shave a few cycles.
*
* Two stage process (inline + #define) for type-checking.
* We also obfuscate get_current() to check if anyone used that by mistake.
*/
struct task_struct;
static inline struct task_struct *__get_current(void)
{
return current_thread_info()->task;
}

Looking at other headers, it looks like SPL should be directly using:

current_thread_info()->task

> /tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/spl/../../module/
> spl/spl-thread.c:62: warning: cast to pointer from integer of
> different size
> make[9]: *** [/tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/
> spl/../../module/spl/spl-thread.o] Error 1
> make[8]: *** [/tmp/spl-build-root-1C1l7MtT/BUILD/spl-0.5.2/module/spl]
> Error 2
>
> I know this is an older server, is sparc just not supported? Any help
> is greatly appreciated!
>
> --Will

Let me know if you need any more info

--Will