Changes between Initial Version and Version 1 of TipAndDoc/Linux/OpenWRT/CrossCompile


Ignore:
Timestamp:
Jun 17, 2012 8:41:16 PM (12 years ago)
Author:
mitty
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TipAndDoc/Linux/OpenWRT/CrossCompile

    v1 v1  
     1[[PageOutline]] 
     2 
     3 * [http://wiki.openwrt.org/about/toolchain OpenWrt Buildroot – About - OpenWrt Wiki] 
     4 * [http://d.hatena.ne.jp/sdkt4a/20080814/1218655463 OpenWrtのクロスコンパイル環境をDebianに構築してhello,worldするよ! - sdkt4aの日記] 
     5 * [https://wiki.projectmeshnet.org/Build_for_OpenWRT Build for OpenWRT - meshwiki] 
     6 * [http://d.hatena.ne.jp/nyaxt/20120212#1329014697 FON2100E openwrt backfire 10.03.1用クロスコンパイル環境の構築 2012-02-12 - nyaxtのPC作業ログ] 
     7 
     8 = buildroot = 
     9 * Ubuntu 12.04 LTS x86_64 
     10 
     11 * mitty@precise:~$ sudo aptitude install subversion build-essential libncurses5-dev zlib1g-dev gawk gcc-multilib flex git-core gettext libssl-dev xsltproc bison 
     12 
     13 * mitty@precise:~$ mkdir openwrt 
     14 
     15 * mitty@precise:~/openwrt$ svn co svn://svn.openwrt.org/openwrt/trunk/ 
     16{{{ 
     17(snip) 
     18 
     19 U   trunk 
     20Checked out revision 32026. 
     21}}} 
     22 
     23 * mitty@precise:~/openwrt/trunk$ wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/config 
     24 * mitty@precise:~/openwrt$ cp config trunk/.config 
     25 
     26 * mitty@precise:~/openwrt/trunk$ make prereq 
     27{{{ 
     28Collecting package info: done 
     29Collecting target info: done 
     30Checking 'working-make'... ok. 
     31Checking 'case-sensitive-fs'... ok. 
     32Checking 'getopt'... ok. 
     33Checking 'fileutils'... ok. 
     34Checking 'working-gcc'... ok. 
     35Checking 'working-g++'... ok. 
     36Checking 'ncurses'... ok. 
     37Checking 'zlib'... ok. 
     38Checking 'gawk'... ok. 
     39Checking 'flex'... ok. 
     40Checking 'unzip'... ok. 
     41Checking 'bzip2'... ok. 
     42Checking 'patch'... ok. 
     43Checking 'perl'... ok. 
     44Checking 'python'... ok. 
     45Checking 'wget'... ok. 
     46Checking 'git'... ok. 
     47Checking 'gnutar'... ok. 
     48Checking 'svn'... ok. 
     49Checking 'gnu-find'... ok. 
     50Checking 'getopt-extended'... ok. 
     51Checking 'non-root'... ok. 
     52}}} 
     53 
     54 * mitty@precise:~/openwrt/trunk$ make -j 5 V=99 2>&1 | tee build.log | grep -i error 
     55{{{ 
     56(snip) 
     57 
     58make[2]: [package/rootfs-prepare] Error 2 (ignored) 
     59Compression errors: 0 
     60[mkmylofw] Error: file /home/mitty/openwrt/trunk/build_dir/linux-ar71xx_generic/tmp/vmlinux-wp543.bin.lzma is too big 
     61make[5]: [install] Error 1 (ignored) 
     62[mkmylofw] Error: file /home/mitty/openwrt/trunk/build_dir/linux-ar71xx_generic/tmp/vmlinux-wp543.bin.lzma is too big 
     63make[5]: [install] Error 1 (ignored) 
     64[mkmylofw] Error: file /home/mitty/openwrt/trunk/build_dir/linux-ar71xx_generic/tmp/vmlinux-wp543.bin.lzma is too big 
     65make[5]: [install] Error 1 (ignored) 
     66[mkmylofw] Error: file /home/mitty/openwrt/trunk/build_dir/linux-ar71xx_generic/tmp/vmlinux-wp543.bin.lzma is too big 
     67make[5]: [install] Error 1 (ignored) 
     68[mkmylofw] Error: file /home/mitty/openwrt/trunk/build_dir/linux-ar71xx_generic/tmp/vmlinux-wpe72.bin.lzma is too big 
     69make[5]: [install] Error 1 (ignored) 
     70Compression errors: 0 
     71[mkmylofw] Error: file /home/mitty/openwrt/trunk/build_dir/linux-ar71xx_generic/tmp/vmlinux-wp543.bin.lzma is too big 
     72make[5]: [install] Error 1 (ignored) 
     73[mkmylofw] Error: file /home/mitty/openwrt/trunk/build_dir/linux-ar71xx_generic/tmp/vmlinux-wp543.bin.lzma is too big 
     74make[5]: [install] Error 1 (ignored) 
     75[mkmylofw] Error: file /home/mitty/openwrt/trunk/build_dir/linux-ar71xx_generic/tmp/vmlinux-wp543.bin.lzma is too big 
     76make[5]: [install] Error 1 (ignored) 
     77[mkmylofw] Error: file /home/mitty/openwrt/trunk/build_dir/linux-ar71xx_generic/tmp/vmlinux-wp543.bin.lzma is too big 
     78make[5]: [install] Error 1 (ignored) 
     79[mkmylofw] Error: file /home/mitty/openwrt/trunk/build_dir/linux-ar71xx_generic/tmp/vmlinux-wpe72.bin.lzma is too big 
     80make[5]: [install] Error 1 (ignored) 
     81make[3]: [/home/mitty/openwrt/trunk/bin/ar71xx/OpenWrt-ImageBuilder-ar71xx_generic-for-Linux-x86_64.tar.bz2] Error 1 (ignored) 
     82make[3]: [/home/mitty/openwrt/trunk/bin/ar71xx/OpenWrt-ImageBuilder-ar71xx_generic-for-Linux-x86_64.tar.bz2] Error 1 (ignored) 
     83}}} 
     84 
     85 * mitty@precise:~/openwrt$ cat > test.c 
     86{{{#!cc 
     87#include <stdio.h> 
     88 
     89int main(void) { 
     90        printf("char        -> %ld\n", sizeof(char)); 
     91        printf("short       -> %ld\n", sizeof(short)); 
     92        printf("int         -> %ld\n", sizeof(int)); 
     93        printf("long        -> %ld\n", sizeof(long)); 
     94        printf("long long   -> %ld\n", sizeof(long long)); 
     95        printf("float       -> %ld\n", sizeof(float)); 
     96        printf("double      -> %ld\n", sizeof(double)); 
     97        printf("long double -> %ld\n", sizeof(long double)); 
     98 
     99        return 0; 
     100} 
     101}}} 
     102 * mitty@precise:~/openwrt$ gcc test.c -o test.x86 
     103 * mitty@precise:~/openwrt$ ./trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-gcc test.c -o test 
     104{{{ 
     105mips-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined 
     106mips-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined 
     107mips-openwrt-linux-gcc: warning: environment variable 'STAGING_DIR' not defined 
     108}}} 
     109 
     110 * mitty@precise:~/openwrt$ file test test.x86 
     111{{{ 
     112test:     ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, not stripped 
     113test.x86: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x53177842cbc614b1f4c71bae24df294892906443, not stripped 
     114}}} 
     115 
     116 * mitty@precise:~/openwrt$ ./test.x86 
     117{{{ 
     118char        -> 1 
     119short       -> 2 
     120int         -> 4 
     121long        -> 8 
     122long long   -> 8 
     123float       -> 4 
     124double      -> 8 
     125long double -> 16 
     126}}} 
     127 
     128 * mitty@precise:~/openwrt$ ./test 
     129{{{ 
     130bash: ./test: cannot execute binary file 
     131}}} 
     132 
     133 * mitty@starseed:~$ uname -a 
     134{{{ 
     135Linux starseed 3.3.6 #1 Thu May 17 02:19:20 PDT 2012 mips GNU/Linux 
     136}}} 
     137 * mitty@starseed:~$ ./test 
     138{{{ 
     139char        -> 1 
     140short       -> 2 
     141int         -> 4 
     142long        -> 4 
     143long long   -> 8 
     144float       -> 4 
     145double      -> 8 
     146long double -> 8 
     147}}} 
     148 
     149 = build others = 
     150 
     151 == zlib == 
     152 * [http://www.crosscompile.org/static/pages/ZLib.html How to Cross Compile Zlib Compression Library - Step by Step Guide (crosscompile.org)] 
     153 
     154 == openssl == 
     155 * [http://www.crosscompile.org/static/pages/OpenSSL.html How to Cross Compile OpenSSL a Step by Step Guide (crosscompile.org)]