1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

compilation error

Discussion in 'Tomato Firmware' started by ginasas, Dec 11, 2007.

  1. ginasas

    ginasas LI Guru Member

    after harh hard work with linux :biggrin: I have almoust compilled sources, but I have problem with /release/src/router/shared compining.
    This is what I have :thumbdown:
    -e

    G Profile
    Version: 1.13.0000 (An, 11 Grd 2007 09:59:14 +0200)
    -e


    make[1]: Entering directory `/home/tomato/release/src/router'
    rm -rf /home/tomato/release/src/router/mipsel-uclibc/target
    rm -rf /home/tomato/release/src/router/mipsel-uclibc/install
    rm -f /home/tomato/release/src/router/mipsel-uclibc/linux.trx /home/tomato/release/src/router/mipsel-uclibc/vmlinuz /home/tomato/release/src/router/mipsel-uclibc/target.image
    rm -rf /home/tomato/release/src/router/mipsel-uclibc/extras
    make[2]: Entering directory `/home/tomato/release/src/router/shared'
    [shared] CC shutils.o
    In file included from shared.h:4,
    from shutils.c:32:
    tomato_profile.h:1: parse error before '-' token
    tomato_profile.h:1: syntax error at '#' token
    In file included from shared.h:4,
    from shutils.c:32:
    tomato_profile.h:9:2: #endif without #if
    In file included from shared.h:6,
    from shutils.c:32:
    /opt/brcm/hndtools-mipsel-uclibc-0.9.19/include/netinet/in.h:194: parse error before "uint8_t"
    /opt/brcm/hndtools-mipsel-uclibc-0.9.19/include/netinet/in.h:197: parse error before '}' token
    /opt/brcm/hndtools-mipsel-uclibc-0.9.19/include/netinet/in.h:201: parse error before '}' token
    In file included from shared.h:6,
    from shutils.c:32:
    /opt/brcm/hndtools-mipsel-uclibc-0.9.19/include/netinet/in.h:235: field `sin6_addr' has incomplete type
    /opt/brcm/hndtools-mipsel-uclibc-0.9.19/include/netinet/in.h:243: field `ipv6mr_multiaddr' has incomplete type
    In file included from shared.h:6,
    from shutils.c:32:
    /opt/brcm/hndtools-mipsel-uclibc-0.9.19/include/netinet/in.h:366: field `ipi6_addr' has incomplete type
    make[2]: *** [shutils.o] Error 1
    make[2]: Leaving directory `/home/tomato/release/src/router/shared'
    make[1]: *** [shared] Error 2
    make[1]: Leaving directory `/home/tomato/release/src/router'

    Any help?
     
  2. mstombs

    mstombs Network Guru Member

    Hi,

    Please confirm which version you are compiling - the latest V1.13? (which I haven't tried yet).

    Have you edited that problem file from windows? I've seen syntax errors due to windows not unix line endings in the past on other things.
     
  3. ginasas

    ginasas LI Guru Member

    I have the some error with 1.11 and with 1.13. Strange that in others dirs make command work ok.
     
  4. roadkill

    roadkill Super Moderator Staff Member Member

    you should run make at tomato/release/src
     
  5. ginasas

    ginasas LI Guru Member

    I know this. But last error show in what dir is the problem, than you can test this dir only.
     
  6. mstombs

    mstombs Network Guru Member

    Sorry, V13 has just built fine for me

    Code:
    root:# ls image -laF
    total 16228
    drwxr-xr-x  2 root root    4096 2007-12-11 22:07 ./
    drwxrwxrwx 13 root root    4096 2007-12-11 22:07 ../
    -rw-r--r--  1 root root 2760712 2007-12-11 22:07 WR850G.bin
    -rw-r--r--  1 root root 2761728 2007-12-11 22:07 WRT54GS.bin
    -rw-r--r--  1 root root 2761728 2007-12-11 22:07 WRT54GSv4.bin
    -rw-r--r--  1 root root 2761728 2007-12-11 22:07 WRT54G_WRT54GL.bin
    -rw-r--r--  1 root root 2761728 2007-12-11 22:07 WRTSL54GS.bin
    -rw-r--r--  1 root root 2760704 2007-12-11 22:07 tomato.trx
    with only one issue - same as before - the PC util mksquashfs would not compile with my PC's gcc
    Code:
    root:# gcc --version
    gcc (GCC) 3.4.6
    unless I remove the "-Wno-pointer-sign" CFLAG

    so I am reluctant to try any image (I didn't make any deliberate changes!) they seem 4k too small!
     
  7. ggmm1985

    ggmm1985 LI Guru Member

    I am using ubunt 7.10 and have the same compilation error when compiling 'tomato/release/src/router/shared'
     
  8. ginasas

    ginasas LI Guru Member

    Yes, I think that problem is UBUNTU. Original WRT54GL soft (from linksys) compilation is without any error. mstombs what linux distro you using?
     
  9. ginasas

    ginasas LI Guru Member

    root@GintisNamu:~# gcc --version
    gcc (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
    Copyright (C) 2006 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     
  10. roadkill

    roadkill Super Moderator Staff Member Member

    I'm using Ubuntu 7.04,7.10,8.04 to compile Tomato and I have no problems.
     
  11. ginasas

    ginasas LI Guru Member

    This is very strange, I know that I have paths, symlinks 100% ok. I have downloaded your modified version with VPN and still the some song. I'm using
    WRT54GL_v4.30.11_11_US.tgz from linksys. Did you using this version?
     
  12. mstombs

    mstombs Network Guru Member

    There aren't that many to chose from are there? I wouldn't try something that isn't in the top 100 -

    http://distrowatch.com/stats.php?section=popularity

    I have tried debian stable but that had none of the tools needed by default and my 2 DVD's didn't either!

    I currently have a beta vectorlinux 5.8 soho (single CD), it worked without needing any additional packages so I haven't upgraded to the latest, there's now a newer version rc beta based on Slackware 12 which may include the gcc v4+ which Jon must be using - which I'll try at some point.
     
  13. ginasas

    ginasas LI Guru Member

    I will test with vectorlinux soho. But this is very strange, that for Roadkill ubuntu 7.10 work without problems. (I'm using ubuntu 7.10). Maybe problem is that gcc is other version.
     
  14. mstombs

    mstombs Network Guru Member

    I think most of the build uses the toolchain gcc, it is only when building tools such as mksquashfs that the PC compiler is used. Good luck with vector - the only issue I recall was that I had to crudely kill the firewall to get samba and/or ssh to work.
     
  15. ginasas

    ginasas LI Guru Member

    Can You explain pls how to remove the "-Wno-pointer-sign" CFLAG ?
     
  16. mstombs

    mstombs Network Guru Member

    does that mean you compiled everything and have got to the create filesystem stage?

    edit the makefile in the mksquashfs directory and remove it or comment it out. I usually edit from Windows notepad++ via samba but sometimes resort to "vi" ("i" to insert, "<ESC>:wq" to save, "<ESC>:q!" to quit, that's all I know!).
     
  17. Sunspark

    Sunspark LI Guru Member

    Does the size change when you try various compiler options like -O, -O2, -O3?
     
  18. ginasas

    ginasas LI Guru Member

    What you mean compiled everything? I run make from /tomato/release/src. Do I need compile tools-src? I'm repeating, that Linksys original firmware compilation is without error, so I'm, thinking that PATH's is ok. I'm not using other toolchain, I'm using from WRT54GL-US_v4.30.11_11 tools/brcm folder.
     
  19. mstombs

    mstombs Network Guru Member

    No I do not mean any extra tools compile, mksquashfs is in the Tomato distribution. Yes I use the Linksys source as per the readme, from 'fresh' for each attempt

    The commands I use (never tested all in one go!) are:-

    Code:
    cd /home/user
    tar -xzf WRT54GL_v4.30.11_US.tgz
    mv WRT54GL-US_v4.30.11_11 tomato
    cd tomato/release/src/
    rm -r et
    rm -r et.4702
    rm -r wl
    rm -r rts
    rm -r tools
    rm .model
    cd router
    rm -r busybox
    rm -r cron
    rm -r dnsmasq
    rm -r httpd
    rm -r iproute2
    rm -r iptables
    rm -r ipupdate
    rm -r lib
    rm -r libnet
    rm -r libpcap
    rm -r mipsel-uclibc
    rm -r misc
    rm -r nas
    rm -r netconf
    rm -r ntpclient
    rm -r nvram
    rm -r others
    rm -r rc
    rm -r ses
    rm -r shared
    rm -r traceroute
    rm -r udhcpd
    rm -r upnp
    rm -r utils
    rm -r www
    cd /home/user
    bunzip2 TomatoSource_1_13.tar.bz2
    tar -xf tomato.tar
    # toolkit already installed
    cd tomato/release/src
    export PATH=$(PATH):/opt/brcm/hndtools-mipsel-uclibc/bin:/opt/brcm/hndtools-mipsel-linux/bin
    make
     
  20. mikester

    mikester Network Guru Member

    Try checking and re-checking your paths and links.

    Delete everything you have and try starting from scratch.

    I had a similar problem getting the compile scripts to work initially under Suse. On my third try it worked - probably made a typo somewhere in the first 2 tries.

    l1|pqi0O

    Have fun!
     
  21. ginasas

    ginasas LI Guru Member

    Yes, I'm doing exatly like you. I have removed Flag that you told, and the some problem. I think that I need recompile tools folder. Because tomato sources come with tools-scr.
     
  22. ginasas

    ginasas LI Guru Member

    I have tried this 1000 times :biggrin: Have you compiled with ubuntu 7.10 without problems?
     
  23. thecarp

    thecarp Guest

    some progess from your problem

    Yup, I had the same problem. See the first error "parse error before '-' token"

    Well I found the file tomato_profile.h and sure enough the first line was:
    Code:
    -e #ifndef TOMATO_PROFILE
    
    Thats wrong. I removed the -e so the line started with the # and it compiled fine on my ubunti 7.10 box.

    Then I needed bison, then I needed flex.... apt-get installed them both... now I make i tvery far and it almost works.... looks like maybe a bogus error? Not sure yet, maybe I am missing a tool and its not catching a previous error?

    Code:
    --------------------------------------------------
    You will probably need to make your busybox binary
    setuid root to ensure all configured applets will
    work properly.
    --------------------------------------------------
    
    make[2]: Leaving directory `/home/sjc/Desktop/tsrc/tomato/release/src/router/busybox'
    make[2]: Entering directory `/home/sjc/Desktop/tsrc/tomato/release/src/router/httpd'
     [httpd] Installing to /home/sjc/Desktop/tsrc/tomato/release/src/router/mipsel-uclibc/install/httpd
    make[2]: Leaving directory `/home/sjc/Desktop/tsrc/tomato/release/src/router/httpd'
    make[2]: Entering directory `/home/sjc/Desktop/tsrc/tomato/release/src/router/www'
    rm -rf /home/sjc/Desktop/tsrc/tomato/release/src/router/mipsel-uclibc/install/www/www
    mkdir -p /home/sjc/Desktop/tsrc/tomato/release/src/router/mipsel-uclibc/install/www/www
    cp *.gif *.png *.ico robots.txt /home/sjc/Desktop/tsrc/tomato/release/src/router/mipsel-uclibc/install/www/www
    for F in *.{js,jsx}; do \
                    sed '/^\/\*\s*$/,/\*\//! { s/^\s\+//; s/\s\+$//; /^\/\/ --\+\s*/d; /^$/d }' < $F > /home/sjc/Desktop/tsrc/tomato/release/src/router/mipsel-uclibc/install/www/www/$F; \
            done
    /bin/sh: cannot open *.{js,jsx}: No such file
    make[2]: *** [install] Error 2
    make[2]: Leaving directory `/home/sjc/Desktop/tsrc/tomato/release/src/router/www'
    make[1]: *** [www-install] Error 2
    make[1]: Leaving directory `/home/sjc/Desktop/tsrc/tomato/release/src/router'
    make: *** [all] Error 2
    [sjc@vulcan src]$ find . -name tomato_profile.h
    ./router/shared/tomato_profile.h
    
    anyone know how to pass this one?

    -Steve
     
  24. mstombs

    mstombs Network Guru Member

  25. dfred

    dfred Guest

    Posting to this old thread as I encountered a number of these problems when attempting a compile under Ubuntu 8.04 and the thread is a first page Google match...

    [EDIT: clarifying...]

    This final problem can be fixed by starting the compile over with a fresh source tree after fixing the issues detailed in this thread. The build process doesn't seem to deal with failed partial builds too well -- and a make clean didn't seem to do the trick either.

    One other thing the build host needs installed is the zlib development package: zlib1g-dev
     

Share This Page