Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
64-bit build progress
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
adam613
n00b
n00b


Joined: 25 Jun 2003
Posts: 21
Location: The Big Apple

PostPosted: Fri Jul 18, 2003 6:16 am    Post subject: 64-bit build progress Reply with quote

So I haven't actually gotten any closer to making a 64-bit build, but I've learned a lot :)

I built cross-binutils and cross-gcc with a sparc64 target, and glibc64. When I tried to rebuild gcc as a native compiler, I realized that it requires multilib, which requires the presence of glibc32. gcc -m32 will fail unless there is a 32-bit libc installed, so I guess complete purity must be sacrified for compatibility. If I install a new glibc, it will overwrite my current glibc, so I'm going to start over.

There are four big tricks I've discovered so far:

1) You need to symlink the startfiles (crt1.o, crti.o, and crtstart.o) from $prefix/lib to $prefix/$target/lib, or ld won't find them after glibc64 is installed.

2) You need to specify CC to the glibc configure script in order to get it to use the right compiler, and you need to put $prefix/$target/bin at the beginning of your path to get it to use the right binutils.

3) the gcc specfile is your friend. More details when I figure out exactly what I did that worked :) But that's how you differentiate between 32-bit and 64-bit builds, and you need to hack it to build a native toolchain. There's a nice doc at http://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html#Spec%20Files. I think the key is to build both 32-bit and 64-bit toolchains, have the 64-bit gcc be the default, and use the specfile to make everything link against /lib64/* unless -m32 is specified.

4) glibc-2.3.2 requires a patch to build on sparc64. http://adamtrilling.homelinux.org/glibc-pause.patch Please don't kill my cable modem :)

Once I get it to work flawlessly, I'll post a commented shell script. For now, just notes.
Back to top
View user's profile Send private message
xming
Guru
Guru


Joined: 02 Jul 2002
Posts: 434

PostPosted: Fri Jul 18, 2003 8:02 am    Post subject: Reply with quote

maybe this will help https://forums.gentoo.org/viewtopic.php?t=29434&highlight=xming+gcc
Back to top
View user's profile Send private message
adam613
n00b
n00b


Joined: 25 Jun 2003
Posts: 21
Location: The Big Apple

PostPosted: Fri Jul 18, 2003 1:54 pm    Post subject: Reply with quote

I had thought of that. But do we know how disabling multilib is going to affect things later?
Back to top
View user's profile Send private message
adam613
n00b
n00b


Joined: 25 Jun 2003
Posts: 21
Location: The Big Apple

PostPosted: Fri Jul 18, 2003 3:40 pm    Post subject: Reply with quote

Nope, doesn't work. libgcc.so also requires a 32-bit glibc and 32-bit startfiles, and we definitely can't live without a dynamic libgcc. So the new plan is to make a pure 64-bit system with 32-bit backward compatibility :)

I figured I was going to have to maintain backward compatibility anyway, just because of binary packages that are compiled in 32-bit mode.

Good thought though.
Back to top
View user's profile Send private message
xming
Guru
Guru


Joined: 02 Jul 2002
Posts: 434

PostPosted: Fri Jul 18, 2003 7:19 pm    Post subject: Reply with quote

Quote:
libgcc.so also requires a 32-bit glibc and 32-bit startfiles


I thinks this means your gcc is still a cross compiler (32 bit bin generating 64 executables)

Quote:
So the new plan is to make a pure 64-bit system with 32-bit backward compatibility


I thought that was always the plan, basically I think pure 64-bit is easier then hybrid system

xming
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