Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
64bit userspace?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc
View previous topic :: View next topic  
Author Message
ThorstenHirsch
Tux's lil' helper
Tux's lil' helper


Joined: 25 Sep 2003
Posts: 111

PostPosted: Tue Jan 10, 2006 2:02 pm    Post subject: 64bit userspace? Reply with quote

Hi,

recently I ran some tests on different platforms and was a bit surprised, that Gentoo/sparc64 has only 32bit userspace. Why so? I can't even force gcc to compile in 64bit:
Quote:
$ gcc -m64 -o sizeof sizeof.c
cc1: error: -m64 is not supported by this configuration
cc1: error: -mlong-double-64 not allowed with -m64

_________________
alias bauerbob
Back to top
View user's profile Send private message
SilverDirk
n00b
n00b


Joined: 06 Aug 2004
Posts: 32

PostPosted: Fri Feb 24, 2006 10:33 pm    Post subject: Same here Reply with quote

I just ran into this problem as well. I'm trying to make an ebuild (well, just plain compile it, first) for OpenAFS 1.4.1 (the ebuild for 1.4.0 fails miserably) and the make system for the package only seems to support "linux26_sparc64". So I add a bunch of options, and then run into this...
Code:
gcc -O -I. -I/var/tmp/portage/openafs-1.4.1_rc8/work/openafs-1.4.1-rc8/src/config -I/var/tmp/portage/openafs-1.4.1_
rc8/work/openafs-1.4.1-rc8/include -O2 -D_LARGEFILE64_SOURCE -m64 -c -o cmd_errors64.o cmd_errors.c
gcc: -m64 detected on the command line overrides implicit -m32 added by the wrapper.
cc1: error: -m64 is not supported by this configuration
cc1: error: -mlong-double-64 not allowed with -m64
distcc[12784] ERROR: compile cmd_errors.c on localhost failed
make[3]: *** [cmd_errors64.o] Error 1
make[3]: Leaving directory `/var/tmp/portage/openafs-1.4.1_rc8/work/openafs-1.4.1-rc8/src/cmd'


A 'net search showed one newsgroup post saying this means gcc was compiled without 64-bit support. I'm using
Code:
[kon]:/var/tmp/portage/openafs-1.4.1_rc8/work/openafs-1.4.1-rc8># gcc -v
Reading specs from /usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.3.5-20050130/specs
Configured with: /var/tmp/portage/gcc-3.3.5.20050130-r1/work/gcc-3.3.5/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/sparc-unknown-linux-gnu/gcc-bin/3.3.5-20050130 --includedir=/usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.3.5-20050130/include --datadir=/usr/share/gcc-data/sparc-unknown-linux-gnu/3.3.5-20050130 --mandir=/usr/share/gcc-data/sparc-unknown-linux-gnu/3.3.5-20050130/man --infodir=/usr/share/gcc-data/sparc-unknown-linux-gnu/3.3.5-20050130/info --with-gxx-include-dir=/usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.3.5-20050130/include/g++-v3 --host=sparc-unknown-linux-gnu --build=sparc-unknown-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libgcj --enable-languages=c,c++,f77 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1)


Would upgrading to 3.4 help? Or does Gentoo just not support this?
Back to top
View user's profile Send private message
SilverDirk
n00b
n00b


Joined: 06 Aug 2004
Posts: 32

PostPosted: Fri Feb 24, 2006 10:38 pm    Post subject: Sorry Reply with quote

Well, I should read more posts before I reply ;-) Sorry.

http://forums.gentoo.org/viewtopic-t-383984-highlight-m64+supported.html
Back to top
View user's profile Send private message
stefaan
Retired Dev
Retired Dev


Joined: 31 Aug 2005
Posts: 35

PostPosted: Sun Feb 26, 2006 11:35 am    Post subject: Re: Same here Reply with quote

SilverDirk wrote:
I just ran into this problem as well. I'm trying to make an ebuild (well, just plain compile it, first) for OpenAFS 1.4.1 (the ebuild for 1.4.0 fails miserably) and the make system for the package only seems to support "linux26_sparc64".
---SNIP---


OpenAFS 1.4.1 is not in portage just because I'm trying to push 1.4.0 as stable. In your last post, it seemed like you solved the issue. Does this mean OpenAFS 1.4.1 now works on your sparc64? Does it also mean that OpenAFS 1.4.0 now works on your sparc64?
Thansk for your feedback already!
Stefaan
    Back to top
    View user's profile Send private message
    SilverDirk
    n00b
    n00b


    Joined: 06 Aug 2004
    Posts: 32

    PostPosted: Tue Feb 28, 2006 8:47 am    Post subject: Reply with quote

    Well, my personal opinion is that 1.4.0 is hopeles ;-) I was hoping to work with the OpenAFS people to get the next version to be more workable with Gentoo.

    First of all, their autoconf script (when run by hand) detects the machine as sparc64_linux26, which is correct. However, when gentoo runs econf, it mangles something and the script detects sparc_linux26. Later in the make process, it tries to include a header file by that name, (./src/config/param.sparc64_linux26.h) and param.sparc_linux26 doesn't exist. (sparc_linux22.h and sparc_linux24.h do exist, however, so I assume "sparc_..." isn't a glitch, its something unsupported on 2.6 kernels)

    Meanwhile, its interesting to note that when configuring some build flags, the script (this would probably be autoconf's fault) doesn't have any combinations of "sparc" and "linux26" in any of its 'case' patterns at line 6925. This results in some very important build variables not getting set, particularly
    Code:
    LEX="flex -l"
    which causes a nice cryptic compiler error when it tries running lex on some grammar file half way through the build.

    I use the following commands in my ebuild (src_unpack) to solve it:
    Code:
    cp configure configure.old
    cp configure-afslib configure-afslib.old
    sed "s/sparc64_linux24/sparc64_linux24|sparc64_linux26/" <configure.old >configure
    sed "s/sparc64_linux24/sparc64_linux24|sparc64_linux26/" <configure-afslib.old >configure-afslib


    Then, even after all that debugging and hassle, the thing dies with some nasty-looking compile errors that seemed to have something to do with the kernel sources, though i really don't remember. This was with the script configured as sparc64_linux26.

    SO. :x I gave up on all that, and started writing an ebuild for 1.4.1 hoping that it would have some fixes. (starting with net-fs/openafs-kernel)

    First, it was no longer necessary to patch the configure script. It has a case entry for "sparc64_linux*", so no problems.

    Next, gentoo was still mangling the system name to sparc_linux26, and there still isn't a param.sparc_linux26.h, so I replaced "econf" with "./configure" to get the default detection. It then compiled and linked!! And there was a kernel module in the work directory!! However it didn't install, because "linux-mod_src_install" was expecting a module named openafs, and this one was named libafs. I have no idea about this stuff, so I just added
    Code:
    cp ${MOD_SRCDIR}/libafs.${KV_OBJ} ${MOD_SRCDIR}/openafs.${KV_OBJ}

    and it installed successfully. I never loaded/ran it though, because I still needed net-fs/openafs, and that one failed to build with the aforementioned error from my previous post.

    My next approach was going to be to (in the ebuild) symlink param.sparc64_linux26.h -> param.sparc_linux26.h, and go from there. However, I'm getting really annoyed with all the time I'm spending on this (these old systems are painfully slow), and decided I'd head to the forums/mailing lists to get a 'professional opinion' on what should be done.
    Back to top
    View user's profile Send private message
    SilverDirk
    n00b
    n00b


    Joined: 06 Aug 2004
    Posts: 32

    PostPosted: Tue Feb 28, 2006 9:15 pm    Post subject: Reply with quote

    From the OpenAFS mailing list:
    Russ Allbery wrote:
    Michael Conrad wrote:
    Hi, I'm attempting to get OpenAFS compiled on Gentoo, kernel 2.6.15, on an UltraSparc. My problem *seems* to be that Gentoo doesn't officially support sparc64 by default (and doesn't have 64-bit mode in the compiler they supply), and openafs doesn't support linux 2.6 with ordinary 'sparc'.

    Is the kernel really a 32-bit kernel even for Linux 2.6?

    If so, then yes, OpenAFS doesn't support that configuration. Someone would need to write a Linux 2.6 configuration for 32-bit SPARC. It probably wouldn't be that difficult; most of the work would be merging the sparc_linux24 files with the sparc64_linux26 files in some appropriate fashion.

    Michael Conrad wrote:
    Now, in gentoo they have two ebuilds: one named openafs, and one named openafs-kernel which appears to just "make only_libafs". If I let the gentoo build system to its own configure, I end up with an error about a missing "param.sparc_linux26". If I let your autoconf system run naturally, I end up with a successful configuration that is using sparc64_linux26. When building "only_libafs" it actually compiles and gives me the kernel module. However when doing a normal build, it dies with the compile error above.

    I wonder if that kernel module actually works. Of course, without the userspace afsd, it's sort of hard to tell.


    I'm not sure what the answer is. Uname gives
    Code:
    Linux kon 2.6.15-gentoo-r1 #1 PREEMPT Tue Jan 24 21:22:44 EST 2006 sparc64 sun4u TI UltraSparc I   (SpitFire) GNU/Linux

    but that doesn't really tell me whether it will support 64-bit binaries or modules... The kernel was compiled with the machine's own compiler, so I'm pretty sure that means there's no 64-bit instructions in the kernel.
    Back to top
    View user's profile Send private message
    SilverDirk
    n00b
    n00b


    Joined: 06 Aug 2004
    Posts: 32

    PostPosted: Tue Feb 28, 2006 11:14 pm    Post subject: Reply with quote

    Ok, another update- I was talking to the guy who's been building our kernels, and it turns out that we have separate compiler toolchains for 32bit and 64bit. 8O So, it seems that all of userspace gets built using the 32-bit compiler, which invokes /usr/bin/sparc-unknown-linux-gnu-gcc, and the kernel gets built using /usr/bin/sparc64-unknown-linux-gnu-gcc.

    So, this means somehow the kernel module needs to be built with the 64-bit compiler, and the userspace daemon needs to be built with the 32-bit compiler. Which is exactly the opposite of what was about to work- the kernel module successfully compiles in 32bit, and the daemon seems to need the 64bit compiler.

    So... I guess the next step is to dig into the makefiles and see if I can get this straightened out.... :(
    -----------------------

    Another update: the kernel module was successfully compiled as 64bit... somehow. I guess autoconf or the ebuild system just automagicallly supplied the right compiler. But...
    Code:

    # looks like it's 64bit
    $ file /lib/modules/2.6.15-gentoo-r1/kernel/fs/openafs/openafs.ko
    /lib/modules/2.6.15-gentoo-r1/kernel/fs/openafs/openafs.ko: ELF 64-bit MSB relocatable, SPARC V9, version 1 (SYSV), not stripped

    # for reference (we use this one):
    $ file /lib/modules/2.6.15-gentoo-r1/kernel/fs/nfs/nfs.ko 
    /lib/modules/2.6.15-gentoo-r1/kernel/fs/nfs/nfs.ko: ELF 64-bit MSB relocatable, SPARC V9, version 1 (SYSV), not stripped

    # but...
    $ sudo modprobe openafs
    Password:
    FATAL: Error inserting openafs (/lib/modules/2.6.15-gentoo-r1/kernel/fs/openafs/openafs.ko): Invalid module format
    -----------------------------

    Another update: turns out that my kernel module was compiled using gcc 3.4, and the kernel was compiled with gcc3.3. I now declare Fubar.
    Adam (the guy playing with the kernels currently) should be getting us upgraded to a kernel /w gcc 3.4 soon, and I'll continue fiddling with this when he's done.
    Back to top
    View user's profile Send private message
    Display posts from previous:   
    Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc All times are GMT
    Page 1 of 1

     
    Jump to:  
    You cannot post new topics in this forum
    You cannot reply to topics in this forum
    You cannot edit your posts in this forum
    You cannot delete your posts in this forum
    You cannot vote in polls in this forum