Cross Compiler Problems

Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions
Author Message
jorsborn
DD-WRT Novice


Joined: 19 Nov 2013
Posts: 2

PostPosted: Wed Nov 20, 2013 1:11    Post subject: Cross Compiler Problems Reply with quote
I posted this earlier today in the Broadcom chip specific forum not realizing there was a developer forum for which this question is better suited... apologies.

I am running dd-wrt.v24-14929_NEWD-2_K2.6_big.bin on a Asus RT-N16. I believe this to be the proper binary based on the RT-N16 wiki and other forum posts. Things are great, however, there are a few additions I'd like to make and so it was necessary to learn to cross compile. The first addition was to compile FTDI serial support for this router.

So, for starters I downloaded the kernel from dd-wrt (Using /brcm/linux.v24)...

Code:

svn co -r 14929 svn://svn.dd-wrt.com/DD-WRT/


I then got the toolchain from...

Code:

ftp://dd-wrt.com/others/sourcecode/toolchains/current-toolchains.tar.bz2


I modified my PATH variable to point to the binaries in my selected toolchain....

Code:

toolchain-mipsel_4.1.1_BRCM24


This appeared to be the closest match to me given the output of /proc/cpuinfo.

Then, I ran a make config and added in USB serial (FTDI) support. Running make modules it builds with no errors and I find a 'ftdi_sio.o' module in my /drivers/usb/serial/ directory.

However, moving this to the router and attempting to install the mod with insmod results in nothing. There is no feedback on the terminal and it's not listed after when using lsmod.

Since this didn't work I attempted to use the toolchain to produce a simple hello world application. This also doesn't run. There is no output (error or otherwise). Finally I compiled the same hello world source on the router and it runs just fine.

So, a hello world application compiled on the router runs but the same application cross compiled does nothing. Running a file on both binaries yields the same output:

Code:

test: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked (uses shared libs), not stripped


Doing a hexdump of both shows that they are definitely not the same.

I suspected that I am simply using the wrong toolchain. I tried the older version (toolchain-mipsel_3.3.6_BRCM24). The result was the same for the ftdi module but the cross compiled hello world seems to work with it.

Any suggestions?
Sponsor
blackdd
DD-WRT Novice


Joined: 01 Dec 2013
Posts: 6

PostPosted: Mon Dec 02, 2013 20:16    Post subject: Reply with quote
I am not an expert, but if you do following:
cat /proc/version
and you will get something like this:
Linux version 2.6.24.111 (root@dd-wrt) (gcc version 4.1.2)

In my case I have to use gcc 4.1.1.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions 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 can attach files in this forum
You can download files in this forum