Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Changing over to new ARM EABI
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
bpoint
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2008
Posts: 81
Location: Japan

PostPosted: Thu Jul 22, 2010 6:25 am    Post subject: Changing over to new ARM EABI Reply with quote

Following on the revelation that my NAS box is still using the legacy ABI (arm-unknown-linux-gnu), I'd like to convert it over to use the new ARM EABI (armv5tel-softfloat-linux-gnueabi).

I've handled manual glibc updates before (explicitly executing /lib/ld-2.xx /bin/ln to fix libc.so links), but changing over to a new ABI seems rather... risky, to put it lightly.

As a test though, I downloaded a stage3 tarball, unpacked it, and was able to chroot into it and everything seemed to work fine within the chroot. So at least my kernel already has support for running executables compiled with the new EABI.

I'm willing to do a complete world rebuild once the new EABI is in place, and I'm currently compiling a crossdev environment for the new EABI target on a separate x86 PC. But I'm not really sure on the best way to go about doing this changeover...

Does anyone have any tips or suggestions on how to handle this? Preferably while keeping my sanity. :)
Back to top
View user's profile Send private message
bpoint
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2008
Posts: 81
Location: Japan

PostPosted: Thu Jul 22, 2010 2:20 pm    Post subject: Reply with quote

So I decided to test this in a chroot environment, just to see how difficult it's going to be...

I first took my existing legacy ABI glibc libs in /lib, and some test executables (ls, cp, mv, etc) from /bin and copied them over to a test directory on my NAS. I then took the newly built EABI cross-compiled glibc libs and put them in /lib/eabi (inside the chroot).

As /bin/ln only has a single dependency on libc.so, I decided to try to see if I could get it to work first.

Code:
kuro-pro armv5tel-softfloat-linux-gnueabi # chroot /home/bpoint/newglibc/armv5tel-softfloat-linux-gnueabi
bash-4.1# /lib/ld-2.11.2.so --list /bin/ln
        libc.so.6 => /lib/libc.so.6 (0x40001000)
        ld-linux.so.2 => /lib/ld-linux.so.2 (0x4012f000)
bash-4.1# /bin/ln -s -f /lib/eabi/libc-2.11.2.so libc.so.6
bash-4.1# /lib/eabi/ld-2.11.2.so /bin/ln
/bin/ln: /lib/libc.so.6: version `GLIBC_2.3' not found (required by /bin/ln)
/bin/ln: /lib/libc.so.6: version `GLIBC_2.2' not found (required by /bin/ln)
/bin/ln: /lib/libc.so.6: version `GLIBC_2.1' not found (required by /bin/ln)
/bin/ln: /lib/libc.so.6: version `GLIBC_2.1.3' not found (required by /bin/ln)
/bin/ln: /lib/libc.so.6: version `GLIBC_2.0' not found (required by /bin/ln)
bash-4.1#

Sooo.... I'm guessing that it's not possible to run existing legacy ABI executables with the new EABI glibc. Which, well, kinda makes sense, but I was hoping it would work.

The only other options I can see from here is to either do a custom unpack of a stage3 tarball onto a running system (somehow without overwriting the libc.so in use), or find some way to have multiple glibcs installed so I can continue to use my legacy ABI executables until I can rebuild world.

Any ideas on how to proceed would be greatly appreciated. :)
Back to top
View user's profile Send private message
ssvb
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2003
Posts: 96

PostPosted: Thu Jul 22, 2010 10:29 pm    Post subject: Reply with quote

Is it really necessary to do this upgrade on a running system? How did you get gentoo there in the first place?
Back to top
View user's profile Send private message
bpoint
Tux's lil' helper
Tux's lil' helper


Joined: 07 Oct 2008
Posts: 81
Location: Japan

PostPosted: Fri Jul 23, 2010 4:37 am    Post subject: Reply with quote

ssvb wrote:
Is it really necessary to do this upgrade on a running system? How did you get gentoo there in the first place?

It would be nice to be able to do the upgrade while keeping the system running, but I suppose it's not a requirement.

The system has a serial console and can boot to it's internal flash memory rather than the hard disk. I originally installed Gentoo on it by using a stage3 tarball that way, but unfortunately over the years, the serial console hardware has become a bit unreliable -- which is why I'd prefer to keep it running, if at all possible.

So as far as I can tell, I'm pretty much down to only three options:
    1) Do a customized unpack of a stage3 tarball, overwriting /bin and binutils/gcc/python with new EABI versions, and doing a safe EABI glibc changeover in /lib -- all with one single executable. Very easy to make a simple mistake, and quite risky.

    2) Temporarily use multiple glibcs. Install the new EABI glibc into /lib/eabi, then change both CHOST and LDFLAGS in make.conf specifying -Wl,-rpath and -Wl,-dynamic-linker to point to the new EABI. All new emerges should then use the new EABI glibc while existing executables will still use the legacy ABI in /lib. This looks to be the safest option.

    3) Just shutdown the system, remove the HDD, hook it up to a different PC and unpack a new stage3 tarball onto it...

#3 is obviously the most effective, but if #2 works as described, then I should be able to keep the system running the whole time while doing the changeover.

Any last ideas or suggestions? I'm probably going to give it a shot in a few days when I have some time.
Back to top
View user's profile Send private message
ssvb
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2003
Posts: 96

PostPosted: Sat Jul 24, 2010 5:14 pm    Post subject: Reply with quote

bpoint wrote:

3) Just shutdown the system, remove the HDD, hook it up to a different PC and unpack a new stage3 tarball onto it...

This looks like the best option. Especially considering that you can actually backup everything before messing up with it :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures 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