Building a cross compiler for SlugOSBE-5.3-beta

View: New views
3 Messages — Rating Filter:   Alert me  

Building a cross compiler for SlugOSBE-5.3-beta

by Steve-425 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am posting here because nslu2-developers seems to have disappeared.

I have installed SlugOSBE-5.3-beta on a nslu2. I then tried to create a cross development environment using the instructions in http://www.nslu2-linux.org/wiki/Optware/AddAPackageToOptware. I had a couple of issues with glibc requiring optimization which I fixed with a hack to crosstool.sh and crosstool.mk.

The main problem I had was that the resulting binaries won't run.  A couple of things appear odd:

* file gives: 'ELF 32-bit MSB executable, ARM, version 1, for GNU/Linux 2.4.3', but on an installed ipkg binary it gives: 'ELF 32-bit MSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14'

* Digging into the ELF I found the loader needed was ld-linux.so.2 but the only one available was ld-linux.so.3.  Hacking the links got it a bit further but then the error was 'GLIBC_2.0 required'

It looks like the lib setup in the toolchain is broken.  I tried forcing a more recent kernel but the 2.4.3 settings seem fairly embedded.

Any help gratefully accepted







Re: Building a cross compiler for SlugOSBE-5.3-beta

by brian_zhou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't know why you want to use crosstool for slugos5be toolchain.

SlugOS5BE has its proven way of building toolchain (Openembedded and bitbake), optware just uses the resulting toolchain.

For a new platform that you want to build toolchain from scratch, you should look at crosstool-ng.

-Brian

--- In nslu2-linux@..., "Steve" <stevebleazard@...> wrote:

>
> I am posting here because nslu2-developers seems to have disappeared.
>
> I have installed SlugOSBE-5.3-beta on a nslu2. I then tried to create a cross development environment using the instructions in http://www.nslu2-linux.org/wiki/Optware/AddAPackageToOptware. I had a couple of issues with glibc requiring optimization which I fixed with a hack to crosstool.sh and crosstool.mk.
>
> The main problem I had was that the resulting binaries won't run.  A couple of things appear odd:
>
> * file gives: 'ELF 32-bit MSB executable, ARM, version 1, for GNU/Linux 2.4.3', but on an installed ipkg binary it gives: 'ELF 32-bit MSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14'
>
> * Digging into the ELF I found the loader needed was ld-linux.so.2 but the only one available was ld-linux.so.3.  Hacking the links got it a bit further but then the error was 'GLIBC_2.0 required'
>
> It looks like the lib setup in the toolchain is broken.  I tried forcing a more recent kernel but the 2.4.3 settings seem fairly embedded.
>
> Any help gratefully accepted
>



Re: Building a cross compiler for SlugOSBE-5.3-beta

by Steve-425 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Brian, thanks for the feedback.  I got sidetracked by the nslu2-linux.org web site's AddAPackageToOptware page.  Once I got onto the the OE track I was much better off! For the record I did the following:

1.  Span up a Ubuntu Karmic Koala (9.10) server on some slightly older hardware as this appears to be one the best platforms for this.

2.  Installed the openembedded-common and openembedded-minimal packages using aptitude. These added another 190 or so packages missing from the basic build

3.  As a normal user(!) ran oe-setup-minimal. This pulls / updates the git repositiries etc, sets the environment variables correctly and then starts a new shell.  This step needs to be run each time you want to develop.

4.  Created ~/.oe.conf with

MACHINE="nslu2be"
DISTRO="slugos"

For Bigendian slugos.

5.  Did 'bitbake meta-toolchain-slugos' and left it running for a day or so, after which, hey presto a nice clean build system that created SlugOS5BE compatible binaries.

The only minor issue was it created Debian packages rooted in / and not /opt. Anyone know how to tweak the install root to /usr/local

Steve

--- In nslu2-linux@..., "Brian" <b88zhou@...> wrote:

>
> I don't know why you want to use crosstool for slugos5be toolchain.
>
> SlugOS5BE has its proven way of building toolchain (Openembedded and bitbake), optware just uses the resulting toolchain.
>
> For a new platform that you want to build toolchain from scratch, you should look at crosstool-ng.
>
> -Brian
>
> --- In nslu2-linux@..., "Steve" <stevebleazard@> wrote:
> >
> > I am posting here because nslu2-developers seems to have disappeared.
> >
> > I have installed SlugOSBE-5.3-beta on a nslu2. I then tried to create a cross development environment using the instructions in http://www.nslu2-linux.org/wiki/Optware/AddAPackageToOptware. I had a couple of issues with glibc requiring optimization which I fixed with a hack to crosstool.sh and crosstool.mk.
> >
> > The main problem I had was that the resulting binaries won't run.  A couple of things appear odd:
> >
> > * file gives: 'ELF 32-bit MSB executable, ARM, version 1, for GNU/Linux 2.4.3', but on an installed ipkg binary it gives: 'ELF 32-bit MSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14'
> >
> > * Digging into the ELF I found the loader needed was ld-linux.so.2 but the only one available was ld-linux.so.3.  Hacking the links got it a bit further but then the error was 'GLIBC_2.0 required'
> >
> > It looks like the lib setup in the toolchain is broken.  I tried forcing a more recent kernel but the 2.4.3 settings seem fairly embedded.
> >
> > Any help gratefully accepted
> >
>