MIPS/ Atheros Toolchain

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Atheros WiSOC based Hardware
Author Message
Haros
DD-WRT Novice


Joined: 16 Mar 2009
Posts: 13

PostPosted: Fri Nov 13, 2009 17:14    Post subject: MIPS/ Atheros Toolchain Reply with quote
Hello,

could you point me to a link where I can download the dd-wrt MIPS/Atheros toolchain for linux cross compiling?

Thank you.
Sponsor
Haros
DD-WRT Novice


Joined: 16 Mar 2009
Posts: 13

PostPosted: Sat Nov 14, 2009 22:06    Post subject: Reply with quote
noone? Is there a chance of using the classic mipsel debian toolchain with a TARGET or something for big endian compiling?
Haros
DD-WRT Novice


Joined: 16 Mar 2009
Posts: 13

PostPosted: Sun Nov 15, 2009 21:51    Post subject: Reply with quote
Ok finally I managed to get it ran. Took me a day, so in case anyone searches for the same thing and hits this thread I wrote a small walkthrough.





How to install a cross-compiler toolchain and compile a C(++) program for beginners


STEP 1.

First of all we download the suitable toolchain for our processor. For MIPS you can use the debian package located in the ddwrt ftp

Code:
wget ftp://ftp.dd-wrt.com/others/sourcecode/toolchains/toolchains.x86.debian.sp1.tar.bz2



*NOTE: The above package is for MIPS Little Endian routers! If you own a MIPS Big Endian based router (Fonera for example) this package is not suitable for you. You need to download this one (I didn’t found any B.E MIPS toolchain in dd wrt’s server so I used the open wrt’s toolchain)
Code:
wget http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/OpenWrt-SDK-atheros-2.6-for-Linux-i686.tar.bz2


or the
Code:
wget http://downloads.openwrt.org/kamikaze/7.09/atheros-2.6/OpenWrt-SDK-atheros-2.6-for-Linux-x86_64.tar.bz2


(the last one is for 64bit CPUs, if you don’t have one don’t use it!)


STEP 2.

Now it’s time to config the toolchain.
First we extract the bz2 file we downloaded.
Code:
tar –jxf [NAME OF THE DOWNLOADED FILE]



STEP 3.

Case 1:

Well if you downloaded the toolchain from ddwrt’s you don’t have a case. Skip to the next step Razz


Case 2:

If you have downloaded the open wrt’s toolchain just rename the folder so we can handle it better.
Code:
mv atheros-2.6-for-Linux-i686 toolchains



STEP 4.

It’s time to configure the PATH variable in our system to point to the toolchain’s bin folder.

Case 1.

If you have downloaded the toolchain from dd wrt’s site
Code:
export PATH=~/toolchains/4.1.0-uclibc-0.9.28/bin:$PATH


Case 2.

If you have downloaded the open wrt’s toolchain
Code:
export PATH=~/toolchains/staging_dir_mips/bin/:$PATH



Now confirm that you have entered the path correctly
Code:
echo $PATH



STEP 5.

Now that everything is set we are ready to compile!

Case 1.

We type
Code:
mipsel-linux-uclibc-gcc test.c –static –s –o test

*test is a name given for the example. Use your own name Razz


Case 2.

For MIPS big Endian compiling we use
Code:
mips-linux-uclibc-gcc test.c –static –s –o test


Notice that we use –static for static links (that is needed for the executable to work standalone properly, it will increase its size) and –s to strip down the executable (it will reduce the size a bit)




That’s all…
I hope someone would find help by reading this walkthrough. Very Happy



*In case I have any mistakes please point them to me so I can edit.
myeyre
DD-WRT Novice


Joined: 26 Mar 2009
Posts: 31

PostPosted: Mon Nov 23, 2009 14:10    Post subject: Reply with quote
Thanks for the tip, I'll give it a try another day.
telecobokeron
DD-WRT Novice


Joined: 02 Feb 2010
Posts: 16

PostPosted: Fri Feb 19, 2010 10:31    Post subject: Reply with quote
Hi! First of all sorry if I do a stupid question but I'm starting at this world....I want to make a C++ aplication, I got the currently toolchain from dd wrt site, and what I wonder is if have these steps maden in the desktop pc or in the router? I mean the "step1, step 2, ..." Once I make it, I must copy to the router and execute?

Thank you!
MrFidget
DD-WRT User


Joined: 15 Jul 2010
Posts: 377

PostPosted: Sun Sep 25, 2011 7:11    Post subject: Reply with quote
Thanks for this.

Its helped me with my challenge trying to get some of my things to compile on a broadcom chip.

Chris
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
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
You cannot attach files in this forum
You cannot download files in this forum