Menu

compiling for OpenWRT MIPS

Help
danja
2011-12-13
2013-04-25
  • danja

    danja - 2011-12-13

    getting this error and assuming that stdlib.h bundled with mips-uclibs is the reason:

    mips-openwrt-linux-uclibc-gcc -Wl,-gc-sections -o hexinject hexinject.c -lpcap
    cc1: note: someone does not honour COPTS correctly, passed 0 times
    In file included from /home/danja/bits/openwrt/wap2102/staging_dir/toolchain-mips_gcc-4.5-linaro_uClibc-0.9.32/lib/gcc/mips-openwrt-linux-uclibc/4.5.4/../../../../mips-openwrt-linux-uclibc/sys-include/stdlib.h:209:0,
                     from hexinject.h:13,
                     from hexinject.c:8:
    /home/danja/bits/openwrt/wap2102/staging_dir/toolchain-mips_gcc-4.5-linaro_uClibc-0.9.32/lib/gcc/mips-openwrt-linux-uclibc/4.5.4/../../../../mips-openwrt-linux-uclibc/sys-include/sys/types.h:151:27: error: duplicate 'unsigned'
    /home/danja/bits/openwrt/wap2102/staging_dir/toolchain-mips_gcc-4.5-linaro_uClibc-0.9.32/lib/gcc/mips-openwrt-linux-uclibc/4.5.4/../../../../mips-openwrt-linux-uclibc/sys-include/sys/types.h:152:28: error: duplicate 'unsigned'
    /home/danja/bits/openwrt/wap2102/staging_dir/toolchain-mips_gcc-4.5-linaro_uClibc-0.9.32/lib/gcc/mips-openwrt-linux-uclibc/4.5.4/../../../../mips-openwrt-linux-uclibc/sys-include/sys/types.h:152:28: error: duplicate 'short'
    /home/danja/bits/openwrt/wap2102/staging_dir/toolchain-mips_gcc-4.5-linaro_uClibc-0.9.32/lib/gcc/mips-openwrt-linux-uclibc/4.5.4/../../../../mips-openwrt-linux-uclibc/sys-include/sys/types.h:153:22: error: duplicate 'unsigned'
    /home/danja/bits/openwrt/wap2102/staging_dir/toolchain-mips_gcc-4.5-linaro_uClibc-0.9.32/lib/gcc/mips-openwrt-linux-uclibc/4.5.4/../../../../mips-openwrt-linux-uclibc/sys-include/sys/types.h:153:22: error: two or more data types in declaration specifiers
    hexinject.c:210:23: error: expected ')' before '*' token
    hexinject.c:232:26: error: expected ')' before '*' token
    hexinject.c:254:27: error: expected ')' before '*' token
    hexinject.c:276:24: error: expected ')' before '*' token
    hexinject.c:349:31: error: expected ')' before '*' token
    hexinject.c:373:28: error: expected ')' before '*' token
    hexinject.c:396:30: error: expected ')' before '*' token
    hexinject.c:430:27: error: expected ')' before '*' token
    hexinject.c:467:31: error: expected ')' before '*' token
    hexinject.c: In function 'main':
    hexinject.c:521:5: error: 'pcap_t' undeclared (first use in this function)
    hexinject.c:521:5: note: each undeclared identifier is reported only once for each function it appears in
    hexinject.c:521:13: error: 'fp' undeclared (first use in this function)
    hexinject.c:522:24: error: storage size of 'bpf' isn't known
    hexinject.c:548:13: warning: assignment makes pointer from integer without a cast

    any help anyone?

     
  • Acri Emanuele

    Acri Emanuele - 2011-12-14

    Hello,

    seems an uClibc problem…

    However I’ve tried to compile without stdlib.h:

    In file included from hexinject.c:9:0:
    hexstring.h: In function ‘hexstr_to_raw’:
    hexstring.h:128:17: warning: incompatible implicit declaration of built-in function ‘malloc’
    hexstring.h: In function ‘raw_to_hexstr’:
    hexstring.h:171:20: warning: incompatible implicit declaration of built-in function ‘malloc’

    But, as you can see, it gives a warning for the implicit declaration of ‘malloc’. It should works if you don’t care about the warnings…
    Otherwise you can try to delete some headers from hexinject.h, and leave only:

    #include "pcap.h"
    #include "stdio.h"
    #include "stdlib.h"
    #include "stdint.h"
    #include "getopt.h"
    #include "assert.h"
    #include "arpa/inet.h"

    I don’t know how the compilation for openwrt is supposed to work, so it may be better to ask in openwrt forum/list…

     

Log in to post a comment.