OpenWrt Forum Archive

Topic: OpenWRT SVN for AR7 incompatible with a Linksys PAP2v2

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I compiled asterisk-1.4.21 on my OpenWRT SVN trunk for AR7 platform. Just for testing purposes, I copied the asterisk binary file compiled for AR7 platform to my Linksys PAP2v2 (also an AR7 platform) and it gives me the following error when I executed this asterisk binary for AR7 platform:

# /var/tmp/asterisk 
/var/tmp/asterisk: 8: Syntax error: "(" unexpected

How can I fix this?

Compile uClibc for the MIPS-I target and do the same for asterisk.

Wodin wrote:

Compile uClibc for the MIPS-I target and do the same for asterisk.

Can you please help me on how to do this? I could not find this option through make menuconfig.

I do not believe there is an option to do that through the OpenWrt build system. I did it before by compiling uclibc manually. In the menuconfig for uclibc there is an option to specify the target. Then when you compile asterisk you will probably have to edit the Makefile to specify the right gcc option. I can't remember the exact option.

IC your point and you are right that under the uClibc make menuconfig, there is an option to choose MIPS-I. I think this can be specified this through the main make menuconfig.

Wodin wrote:

I do not believe there is an option to do that through the OpenWrt build system. I did it before by compiling uclibc manually. In the menuconfig for uclibc there is an option to specify the target.

Can the uClibc target not be set in the OpenWrt build system?
I have no clue personally, but would love to help test Asterisk on an RTP300 or PAP2v2.

The options I see in the OpenWrt build system are as follows:

Advanced configuration options (for developers) --->
    Toolchain Options --->
        Enable an extra toolchain target architecture --->
              Extra architecture name

Advanced configuration options (for developers) --->
     Toolchain Options --->
         (-Os -pipe -mips32 -mtune=mips32 -funut-at-a-time) Target Optimizations

That looks useful for the asterisk bit. Not sure about the uclibc bit. I don't know how the kamikaze build system interacts with the uclibc build system if at all. I am not near a kamikaze checkout at the moment. Anyway I think mazilo is trying to run it on the default firmware. Building for mips-I should not be necessary on openwrt.

Wodin wrote:

That looks useful for the asterisk bit. Not sure about the uclibc bit. I don't know how the kamikaze build system interacts with the uclibc build system if at all.

I compiled OpenWRT SV source for both MIPS-I and default (MIPS32). Their respective uClibc libraries are shown below to reflect their architectures:

libuClibc++-0.2.2.so: ELF 32-bit LSB shared object, MIPS, MIPS-I version 1 (SYSV), corrupted section header size
libuClibc++-0.2.2.so: ELF 32-bit MSB shared object, MIPS, version 1 (SYSV), corrupted section header size

The compiled binary files also reflect to MIPS-I architecture.

Anyway I think mazilo is trying to run it on the default firmware.

You are definitely right. I need to put asterisk on a Linksys WRTP54G/RTP300/PAP2v2 and/or a TI AR7 based VoIP device that mostly based on MIPS-I.

OT, does anyone here know what are the benefits of MIPS32 over MIPS-I? I know most TI AR7 based VoIP devices are based on a MIPS-I architecture. If OpenWRT is going to support any of these TI AR7 based VoIP devices, i.e. WRTP54G, why change to a MIPS32 architecture while the original firmware still runs on a MIPS-I architecture? If we stick with the same MIPS-I architecture, there is a chance we can still re-use the existing Linux kernel drivers for its FXS ports as well as the G729 binary CoDec.

Not sure why you compiled the MIPS32 version as big endian, but the MIPS-I version looks right, I think.

(I thought we were talking about uClibc, not uClibc++, though wink

As for why OpenWrt doesn't compile for MIPS-I by default, I suppose it's because OpenWrt is supposed to be a Free and standalone distribution.  Not a modified Linksys/whatever distribution.  Since the hardware supports the MIPS32 instruction set, why not support it?  Do you compile for i386 on your desktop? wink  That's just my guess, though.

Wodin wrote:

Not sure why you compiled the MIPS32 version as big endian, but the MIPS-I version looks right, I think.

For MIPS32, I just used the default settings from OpenWRT SVN.

(I thought we were talking about uClibc, not uClibc++, though wink

You are right and we were talking about uClibc. I just quoted the wrong ones. Sorry about this.

The discussion might have continued from here.