PDA

View Full Version : Anybody been sucessful building a native gcc for wl500-gx?



mspriggs
05-02-2005, 00:30
Thanks to an earlier post I've managed to build Native binutils for the wl-500 but building a native gcc seems a whole different matter.

Techniclly this is call building a Canadian Cross compiler. Following all the Mips web pages that I found so far discussing the subject has failed at different parts of the compile process. I've also tried hacking Makefiles and all other sorts of hacks but so far have failed in the process. I'm beginning to think that there is a problem in the gcc-3.2.3 when building a Canadian cross.

The dificulity occurs because executables have to be built to generate more .c code to be compiled (these have to be x86 binaries) but the makefile then fails to build some parts for mips and someparts for x86.

The best configure command the I so far have been able to generate is this:-

cc=mipsel-linux-gcc CC_FOR_BUILD=gcc CC_FOR_TARGET=mipsel-linux-gcc AR=mipsel-linux-ar RANLIB=mipsel-linux-ranlib LD=mipsel-linux-ld ./configure --enable-langauge=c --host=mipsel-linux --target=mipsel-linux --build=i686-pc-linux-gnu

Has any one else attempted to build a mips native gcc and been sucessful?

mctiew
05-02-2005, 02:06
Has any one else attempted to build a mips native gcc and been sucessful?

I wonder why you want to build a mipsel-linux-gcc, perhaps what is more relevant is to build a mipsel-uclibc-gcc ! Ultimately in the context of WL500g, it's uclibc code that is going to be running. For example, you might want to use newever version of mipsel gcc and uclibc to support ipv6. Is this rationale reasonable ?

Cheers

mspriggs
05-02-2005, 02:11
I've now managed to build a native gcc for the wl-500gx and compiled a hello world program with it on the device. The only problem is the shell wont execute the a.out file. I've managed to build mips binaries that have a similar behaviour when cross compiling before so this problem shouldn't take too long to fix.

I'm off for the week end but I will put together a howto once I'm sure things are working in a few days.

It's only taken 16 hours to get this far!

mspriggs
05-02-2005, 02:19
I wonder why you want to build a mipsel-linux-gcc, perhaps what is more relevant is to build a mipsel-uclibc-gcc ! Ultimately in the context of WL500g, it's uclibc code that is going to be running. For example, you might want to use newever version of mipsel gcc and uclibc to support ipv6. Is this rationale reasonable ?

Cheers

I haven't really had a look at this uclibc stuff yet. I was assuming that uclibc supplys the same functionality as a normal libc but just in a more efficent way. The gcc I've built seems to link quite happily with the uclibc so things are look good so far. Once things are working well then building and testing a new uclibc can be done on the wl500. I'm using a external USB 2 harddrive and performance seems quite good, I'm am slightly worried about the limited memory, there is only about 17Megabytes free so that may cause problems when comping complex programs.

mctiew
05-02-2005, 03:15
I'm off for the week end but I will put together a howto once I'm sure things are working in a few days.


Cool. Looking forward to your howto.

Cheers.

hugo
05-02-2005, 08:39
Don't worry for memory, I'm compiling big project on my Wl hdd usind Debian, and only 16 meg physical and 64 meg swap.
A native gcc would help making small project out of debian big libs so I'm waiting for it with interest.

elpaso
11-03-2005, 10:51
Hi, I'm also trying to compile software on my WL-HDD, this is what I've done so far:

1 - download precompiled toolchain for mipsel from
http://www.uclibc.org/downloads/root_fs_mipsel.ext2.bz2

2 - mount with loop on my linux box
3 - taredd and gzipped all the root_fs
4 - ftp to WL-HDD
5 - ssh to WL-HDD
6 - untarred all in /home/toolchain/root_fs (it's on the hard disk partition)
7 - chroot /home/toolchain/root_fs /bin/bash
8 - start compilation of cvs with usual ./configure && make
9 - drink some coffe

cvs works perfectly on WL-HDD .... but only if I remain the chroot environment, the uclibs are not the same as those from oleg's firmware, so if I exit from chroot and run cvs I get a wonderful segfault.

This is hence only a partial success :( .

I'm still trying to figure out how to install a native toolchain that is compatible with libs used by oleg's .

Any hint?

BTW I also installed asus toolchain (this is not native mipsel but cross compiler) but I cannot successfully run an hello world on WL-HDD: compilation succedeed but then I get a
[admin@wl toolchain]$ ./ciao
-sh: ./ciao: not found
on my WL-HDD

... still trying ...

mctiew
15-03-2005, 01:18
Hi, I'm also trying to compile software on my WL-HDD, this is what I've done so far:

1 - download precompiled toolchain for mipsel from
http://www.uclibc.org/downloads/root_fs_mipsel.ext2.bz2

cvs works perfectly on WL-HDD .... but only if I remain the chroot environment, the uclibs are not the same as those from oleg's firmware, so if I exit from chroot and run cvs I get a wonderful segfault.

This is hence only a partial success :( .

I'm still trying to figure out how to install a native toolchain that is compatible with libs used by oleg's .

Any hint?


There is an easier way out since you have gotten so far, ie replace all the libraries in /lib with those in the uclibc root_fs. In order to do that, you could either modify from the makefile before a mksquashfs is done, or you could modify it from the external USB file system. After doing this, you uclibc is compatible with those in the build root.

Cheers

elpaso
15-03-2005, 07:02
There is an easier way out since you have gotten so far, ie replace all the libraries in /lib with those in the uclibc root_fs. In order to do that, you could either modify from the makefile before a mksquashfs is done, or you could modify it from the external USB file system. After doing this, you uclibc is compatible with those in the build root.

Cheers

Thank you for your hint,

I was only afraid about compatibility with all other programs shipped with oleg's firmware, do they are compatible with newer uclibs from root_fs?

I don't want to risk lib (in)compatibility issues.

mctiew
15-03-2005, 07:52
Thank you for your hint,

I was only afraid about compatibility with all other programs shipped with oleg's firmware, do they are compatible with newer uclibs from root_fs?

I don't want to risk lib (in)compatibility issues.

Your concern is valid. But it is a question of how desperate you are. If you are desperate enough, you would want to give it a try. Certainly I will not want to endorse this operation but based on my limited experience on a wl500gx, I have not found any problem yet.

Cheers.

mctiew
15-03-2005, 07:58
Your concern is valid. But it is a question of how desperate you are. If you are desperate enough, you would want to give it a try. Certainly I will not want to endorse this operation but based on my limited experience on a wl500gx, I have not found any problem yet.

Cheers.

One important point is not to update on the currently use libraries. It should be done on the offline files.