質問

私の最終目標は、古いActionTecモデム/ルーターのワイヤレスツールをコンパイルして、イーサネットブリッジへのワイヤレスとして構成できるようにすることです。現在、ワイヤレス機能は(一見)Webインターフェイスのほとんどを管理する同じバイナリによって(一見)制御されていますが、ライブラリワイヤレスツールを使用して少なくとも一部の機能に内部で使用しているようです。

私は以前に別のCPUアーキテクチャのためにクロスコンパイルしたことはありませんが、私がする必要があることを完全に身につける方法がわかりません。 UCLIBCはシステムの残りの部分で使用されているように見えるため、UCLIBCを使用しようとしていますが、Modems環境用にBuildRootを構成する方法はわかりません。私が作りました 最良の推測 構成は、以下のProcの情報に基づいている必要がありますが、コンパイルされた0のみを返す単純なCアプリケーションが適切に実行されないため、何かが間違っています。

# cat /proc/version 
Linux version 2.4.17_mvl21-malta-mips_fp_le (root@localhost.localdomain) (gcc version 2.95.3 20010315 (release/MontaVista)) #1 Thu Apr 21 18:04:37 PDT 2005
# cat /proc/cpuinfo 
processor               : 0
cpu model               : MIPS 4KEc V4.8
BogoMIPS                : 149.91
wait instruction        : no
microsecond timers      : yes
extra interrupt vector  : yes
hardware watchpoint     : yes
VCED exceptions         : not available
VCEI exceptions         : not available
役に立ちましたか?

解決

あなたは正しいです、あなたは適切なものが必要です MIPSツールチェーン あなたのアプリケーションを相互コンパイルするために buildroot それをすることができます。ただし、BuildRootを調整する必要がある場合があります Menuconfig オプション。の出力に応じて file, 、オプションが変更される場合があります。私のシステムでは、バイナリアプリが以下を通知します。

ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1 (SYSV)

これらは、私がbuildrootのmenuconfigで有効にしたオプションです。

Target Architecture (mips)  ---> 
Target Architecture Variant (mips 32r2)  --->                                                            
Target ABI (o32)  --->                                                                                   
Target options  --->                                                                                     
Build options  --->   
    (/opt/cross-mips-buildroot) Toolchain and header file location?                                                                                   
Toolchain  --->        
    Toolchain type (Buildroot toolchain)  ---> 
    Kernel Headers (Linux 2.6.34.x kernel headers)  --->
    uClibc C library Version (uClibc 0.9.31.x)  ---> 
    [*] Build/install a shared libgcc?
    [*] Enable compiler tls support       
    [*] Build gdb debugger for the Target
    [*] Build gdb server for the Target
    [*] Build gdb for the Host
        GDB debugger Version (gdb 6.8)  --->
    [*] Enable large file (files > 2 GB) support?
    [*] Enable WCHAR support
    [*] Use software floating point by default
    [*] Enable stack protection support
    [*] Build/install c++ compiler and libstdc++?
    [*] Include target utils in cross toolchain  
Package Selection for the target  --->   
    [*] BusyBox
    [*]   Run BusyBox's own full installation
    Libraries  ---> 
        Networking  ---> 
            [*] libcurl
        Text and terminal handling  ---> 
            [*] icu
            -*- ncurses    
Target filesystem options  --->                                                                          
Bootloaders  --->                                                                                        
Kernel  --->

ツールチェーン自体はにインストールされています /opt/cross-mips-buildroot. 。コンパイラやその他のツールを見つけることができます /opt/cross-mips-buildroot/usr/bin/

シンプルをコンパイルしてみてください こんにちは世界 アプリケーションと、MIPSシステム内で実行できるかどうかを確認します。

ノート: この構成は、C ++コンパイラを構築しません。必要に応じて、できます grep LIBSTDCPP .config そして、それが有効かどうかを確認し、それをあなたの好きなものに変更します。それで make menuconfig それを実現するために。

他のヒント

チェックアウト:

http://www.kegel.com/crosstool/

GCCの下でのクロスコンパイルの権威あるサイトです。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top