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

Compiler errors on latest shibby RT-N

Discussion in 'Tomato Firmware' started by Windy, Feb 15, 2013.

  1. Windy

    Windy Serious Server Member

    I have been compiling custom router images (needed to tweak the kernel) fine for quite some time (last updated around Aug. 2012) so I have decided to update to latest. However, I seem to be having some compile issues with the latest and greatest. I am using origin/tomato-shibby-RT-N as git checkout head.

    make e3200:
    Verified I already have libnfsidmap installed:

    make r64e:

    Anyone experience same issue(s)? I'm using ubuntu LTS 12.04 x86_64 if it matters.
    Thanks.
     
  2. shibby20

    shibby20 Network Guru Member

    2nd ) problem with openvpn it`s true, because gitignore file include *.in files and all Makefile.in files was not pushed to git. Before i will push changes to GIT you can download this file http://tomato.groov.pl/download/K26/src/openvpn.tar.gz , uncompres and replace router/openvpn directory.

    1st) strange. i didn`t touch nfs-tools package for a long time... try do " make distclean" first.
     
  3. Windy

    Windy Serious Server Member

    Thank you. I have started the environment from scratch and put that in, here is where I am stuck on currently:

    Code:
    ...
    shlib_target=; if [ -n "libcrypto.so.1.0.0 libssl.so.1.0.0" ]; then \
    shlib_target="linux-shared"; \
    elif [ -n "" ]; then \
    FIPSLD_CC="mipsel-uclibc-gcc"; CC=/usr/local/ssl/fips-2.0/bin/fipsld; export CC FIPSLD_CC; \
    fi; \
    #LIBRARIES="-L.. -lssl -L.. -lcrypto" ; \
    #LIBRARIES="-L.. -lcrypto" ; \
    LIBRARIES="-L.. -lssl -L.. -lcrypto" ; \
    make -f ../Makefile.shared -e \
    APPNAME=openssl OBJECTS="openssl.o req.o rsa.o x509.o apps.o app_rand.o enc.o version.o speed.o" \
    LIBDEPS=" $LIBRARIES -Wl,--gc-sections -ldl" \
    link_app.${shlib_target}
    make[7]: Entering directory `/root/tomato/release/src/router/openssl/apps'
    openssl.o:(.data.rel.functions+0x8): undefined reference to `verify_main'
    openssl.o:(.data.rel.functions+0x14): undefined reference to `asn1parse_main'
    openssl.o:(.data.rel.functions+0x2c): undefined reference to `dgst_main'
    openssl.o:(.data.rel.functions+0x38): undefined reference to `dh_main'
    openssl.o:(.data.rel.functions+0x44): undefined reference to `dhparam_main'
    openssl.o:(.data.rel.functions+0x5c): undefined reference to `passwd_main'
    openssl.o:(.data.rel.functions+0x68): undefined reference to `gendh_main'
    openssl.o:(.data.rel.functions+0x74): undefined reference to `errstr_main'
    openssl.o:(.data.rel.functions+0x80): undefined reference to `ca_main'
    openssl.o:(.data.rel.functions+0x8c): undefined reference to `crl_main'
    openssl.o:(.data.rel.functions+0xa4): undefined reference to `rsautl_main'
    openssl.o:(.data.rel.functions+0xb0): undefined reference to `dsa_main'
    openssl.o:(.data.rel.functions+0xbc): undefined reference to `dsaparam_main'
    openssl.o:(.data.rel.functions+0xd4): undefined reference to `genrsa_main'
    openssl.o:(.data.rel.functions+0xe0): undefined reference to `gendsa_main'
    openssl.o:(.data.rel.functions+0xec): undefined reference to `genpkey_main'
    openssl.o:(.data.rel.functions+0xf8): undefined reference to `s_server_main'
    openssl.o:(.data.rel.functions+0x104): undefined reference to `s_client_main'
    openssl.o:(.data.rel.functions+0x11c): undefined reference to `s_time_main'
    openssl.o:(.data.rel.functions+0x134): undefined reference to `pkcs7_main'
    openssl.o:(.data.rel.functions+0x140): undefined reference to `crl2pkcs7_main'
    openssl.o:(.data.rel.functions+0x14c): undefined reference to `sess_id_main'
    openssl.o:(.data.rel.functions+0x158): undefined reference to `ciphers_main'
    openssl.o:(.data.rel.functions+0x164): undefined reference to `nseq_main'
    openssl.o:(.data.rel.functions+0x170): undefined reference to `pkcs12_main'
    openssl.o:(.data.rel.functions+0x17c): undefined reference to `pkcs8_main'
    openssl.o:(.data.rel.functions+0x188): undefined reference to `pkey_main'
    openssl.o:(.data.rel.functions+0x194): undefined reference to `pkeyparam_main'
    openssl.o:(.data.rel.functions+0x1a0): undefined reference to `pkeyutl_main'
    openssl.o:(.data.rel.functions+0x1ac): undefined reference to `spkac_main'
    openssl.o:(.data.rel.functions+0x1b8): undefined reference to `smime_main'
    openssl.o:(.data.rel.functions+0x1c4): undefined reference to `rand_main'
    openssl.o:(.data.rel.functions+0x1d0): undefined reference to `engine_main'
    openssl.o:(.data.rel.functions+0x1dc): undefined reference to `ocsp_main'
    openssl.o:(.data.rel.functions+0x1e8): undefined reference to `prime_main'
    openssl.o:(.data.rel.functions+0x1f4): undefined reference to `ts_main'
    openssl.o:(.data.rel.functions+0x200): undefined reference to `srp_main'
    openssl.o:(.data.rel.functions+0x20c): undefined reference to `dgst_main'
    openssl.o:(.data.rel.functions+0x218): undefined reference to `dgst_main'
    openssl.o:(.data.rel.functions+0x224): undefined reference to `dgst_main'
    openssl.o:(.data.rel.functions+0x230): undefined reference to `dgst_main'
    collect2: ld returned 1 exit status
    make[7]: *** [link_app.gnu] Error 1
    make[7]: Leaving directory `/root/tomato/release/src/router/openssl/apps'
    make[6]: *** [openssl] Error 2
    make[6]: Leaving directory `/root/tomato/release/src/router/openssl/apps'
    make[5]: *** [build_apps] Error 1
    make[5]: Leaving directory `/root/tomato/release/src/router/openssl'
    make[4]: *** [openssl] Error 2
    make[4]: Leaving directory `/root/tomato/release/src/router'
    make[3]: *** [all] Error 2
    make[3]: Leaving directory `/root/tomato/release/src-rt'
    make[2]: *** [bin] Error 2
    make[2]: Leaving directory `/root/tomato/release/src-rt'
    make[1]: *** [e] Error 2
    make[1]: Leaving directory `/root/tomato/release/src-rt'
    make: *** [r64e] Error 2
    
     
  4. Kevin Darbyshire-Bryant

    Kevin Darbyshire-Bryant Networkin' Nut Member

    Hi Windy,

    I've only recently tried building the firmware myself and fell into lots of traps, some of them similar to yourself. I was unable to get a 64bit Ubuntu build environment working and ended up with a 32bit 12.04 LTS Ubuntu.

    I'm sorry I can't provide any more concrete information than that.

    Kevin
     
  5. Windy

    Windy Serious Server Member

    Thanks for the suggestion. I have been building for a while under both 32 bit and 64 bit fine, but it is only until recently that I started to have compile issues (had to use the latest for newer routers). Unfortunately, I still couldn't compile under 32 bit either. Maybe you could see if it works for you?

    make e3200:
    Code:
    ...
    checking for crypt in -lcrypt... yes
    checking for event_dispatch in -levent... yes
    checking for nfs4_init_name_mapping in -lnfsidmap... no
    configure: error: libnfsidmap needed for nfsv4 support
    make[5]: *** [nfs-utils/stamp-h1] Error 1
    make[5]: Leaving directory `/root/tomato/release/src/router'
    make[4]: *** [all] Error 2
    make[4]: Leaving directory `/root/tomato/release/src-rt'
    make[3]: *** [bin] Error 2
    make[3]: Leaving directory `/root/tomato/release/src-rt'
    make[2]: *** [z] Error 2
    make[2]: Leaving directory `/root/tomato/release/src-rt'
    make[1]: *** [r2z] Error 2
    make[1]: Leaving directory `/root/tomato/release/src-rt'
    make: *** [e3200] Error 2
    make r64e:
    Code:
    ...
    checking which syslog facility to use... LOG_DAEMON
    checking for inet_ntop in -lc... yes
    ./configure: line 4441: syntax error near unexpected token `DAEMON,'
    ./configure: line 4441: `PKG_CHECK_MODULES(DAEMON, libdaemon)'
    make[5]: *** [config.status] Error 2
    make[5]: Leaving directory `/root/tomato/release/src/router/radvd'
    make[4]: *** [radvd/stamp-h1] Error 2
    make[4]: Leaving directory `/root/tomato/release/src/router'
    make[3]: *** [all] Error 2
    make[3]: Leaving directory `/root/tomato/release/src-rt'
    make[2]: *** [bin] Error 2
    make[2]: Leaving directory `/root/tomato/release/src-rt'
    make[1]: *** [e] Error 2
    make[1]: Leaving directory `/root/tomato/release/src-rt'
    make: *** [r64e] Error 2
     
  6. koitsu

    koitsu Network Guru Member

    beatnik likes this.
  7. Kevin Darbyshire-Bryant

    Kevin Darbyshire-Bryant Networkin' Nut Member

    Successful compiles of both on Ubuntu 12.04 LTS 32bit - all the usual warnings included :)

    I'm trying to think what I did when I saw similar issue to yours, and I basically think it was to re-clone the git, re-checkout the source needed 'tomato/shibby-RT-N' and then use the folder GUI to copy everything to a working directory for compilation purposes (not forgetting to re-extract openvpn source 'cos of the missing .in files in the git)
     
  8. Windy

    Windy Serious Server Member

    Thanks. I tried your method for 11.10 and 11.04. I still got the same error on 11.10, and I was not able to install some packages on 11.04 (maybe due to it's EOL?).



    Thanks for trying. At least that gives me some hope. Overall, I think what you described is what I did, but perhaps I am missing some finer details. The weird thing is, I could compile code from months ago, but due to some updates (not sure which, OS and/or tomato) recently, I have not been able to compile successfully. I have tried with a fresh OS install + git clone. I don't know if using the different desktop/server version of ubuntu makes a difference. This is basically what I did to reproduce the problem:

    Install fresh OS, run bash as root, then run the following:
    Code:
    apt-get update
    apt-get upgrade
     
    apt-get install libncurses5 libncurses5-dev m4 bison flex libstdc++6-4.4-dev g++-4.4 g++ libtool gcc g++ binutils patch bzip2 flex bison make gettext unzip zlib1g-dev libc6 libncurses5-dev automake automake1.7 automake1.9 git nano asciidoc
     
    #When I was using 64 bit OS, I also ran:
    #apt-get install libc6-i386 lib32z-dev
     
    git clone -b tomato-shibby-RT-N git://repo.or.cz/tomato.git tomato
    #I've also used this instead:
    #git clone git://repo.or.cz/tomato.git tomato; cd ~/tomato; git checkout origin/tomato-shibby-RT-N
     
    ln -s ~/tomato/tools/brcm /opt/brcm
    export PATH=$PATH:/opt/brcm/hndtools-mipsel-linux/bin:/opt/brcm/hndtools-mipsel-uclibc/bin
     
    cd ~/tomato/release/src-rt
    make e3200
     
  9. Kevin Darbyshire-Bryant

    Kevin Darbyshire-Bryant Networkin' Nut Member

    Hmm, I'm sure that's pretty much the recipe I followed. One difference I can think of, I put the brcm utils first in the path rather than last.
     
  10. koitsu

    koitsu Network Guru Member

    Try Debian 6.0.6 (x86)? I can assure you all the packages mentioned on my blog are what's needed. But I should also note I have not tried building e3200 nor r64e -- only r2e and r2m.

    I completely understand both errors you get (for e3200, and for r64e), but the information you've provided is not enough to troubleshoot. I'll try to build them on my Debian 6.0.6 (x86) system and see what comes of it; if I can reproduce the issue, I can advise further.
     
  11. Windy

    Windy Serious Server Member

    Thanks. I tried that, the result seems the same though.
    Code:
    PATH=/opt/brcm/hndtools-mipsel-linux/bin:/opt/brcm/hndtools-mipsel-uclibc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
    I will try Debian next.
     
  12. koitsu

    koitsu Network Guru Member

    I see no build support for types "e3200" nor "r64e". They are not defined in tomato/Makefile as targets, nor listed in the Makefile help section.

    Of course, I'm also using -b Toastman-RT-N (branch) during git pull, but I would be very surprised if that mattered; I can change to another branch if need be. And yes, my git pull is the latest.

    Code:
    jdc@debian:~/tomato$ git status
    # On branch Toastman-RT-N
    nothing to commit (working directory clean)
    
     
  13. Windy

    Windy Serious Server Member

    Well, this is interesting, tried Debian 6.0.6 32 bit and ended up with the same errors. I would appreciate greatly if you could try the branch tomato-shibby-RT-N, where I seem to be having issues with.
     
  14. koitsu

    koitsu Network Guru Member

    I can confirm that branch tomato-shibby-RT-N has targets e3200 and r64e (and are also reflected in the help status). Not sure why these haven't been merged with the main branch, but whatever. I'll give e3200 a try.
     
  15. koitsu

    koitsu Network Guru Member

    That improved things a bit.

    I had to add /sbin to my $PATH. apcupsd's configure script iterates over all members in $PATH and looks for either shutdown or shutdown.bsd. I could lecture about this nonsense but I won't bother.

    I was left with a failure in openvpn of config.status: error: cannot find input file: `build/Makefile.in', which is because there is no Makefile.in in that directory -- see for yourself:

    http://repo.or.cz/w/tomato.git/tree/tomato-shibby-RT-N:/release/src/router/openvpn/build

    One could be generated by running automake inside of that directory, except that isn't necessarily wise -- the version of automake used matters tremendously (massive changes between minor versions is common). Proof in question:

    Code:
    jdc@debian:~/tomato$ automake<tab><tab>
    automake       automake-1.11  automake-1.7   automake-1.9
    
    I either need to be told exactly what automake version to use (automake = 1.11.1), or Shibby needs to commit proper Makefile.in bits (possibly more than just in router/openvpn/build) to the repo followed by a git pull once he's done that.

    Shibby, insights?
     
  16. shadowken

    shadowken Networkin' Nut Member

    Isn't there any tomato build compiled with string match module yet ?
     
  17. Windy

    Windy Serious Server Member

    I should have reminded you of that. It is one of the issues I encountered in the original post. You will need to grab the uncommited openvpn source as mentioned by shibby above. The link is: http://tomato.groov.pl/download/K26/src/openvpn.tar.gz
     
  18. koitsu

    koitsu Network Guru Member

    Stick to the existing thread. See my last post, which contains a diff -- you're welcome to use it. Don't just pick a hot/active thread and throw in two cents that's irrelevant to the topic at hand. Thanks.
     
  19. koitsu

    koitsu Network Guru Member

    Ugh. Just ugh ugh ugh.
     
  20. koitsu

    koitsu Network Guru Member

    Another caveat: pkg-config (e.g. aptitude install pkg-config) is a required dependency for libcurl to build. This is not a requirement on Toastman (at least for r2e or r2m builds), so this may be a Shibby-specific thing.

    Anyway, result:

    Code:
    gcc -O3 -Wall -o fpkg fpkg.c
    make[5]: Leaving directory `/home/jdc/tomato/release/src/btools'
    # Linksys E3200(60k Nvram) image
    
    Creating Linksys 3200: image/tomato-E3200USB-NVRAM60K-1.28.--defMIPSR2-AIO.bin
    
    TRX Image:
     Total Size .... : 10190848 (9952.0 KB) (9.7 MB)
       Images ...... : 10187052 (0x009b712c)
       Padding ..... : 3768
     Avail. for jffs :
       4MB, 128K CFE : 0 EBs + 0
       4MB, 256K CFE : 0 EBs + 0
       8MB, 256K CFE : 0 EBs + 0
                Note : Netgear routers have 6 EBs less available!
     CRC-32 ........ : 72C8E8C6
     128K Blocks ... : 78 (0x0000004E)
      64K Blocks ... : 156 (0x0000009C)
     Offsets:
       0: 0x0000001C  lzma-loader/loader.gz
       1: 0x00000AD8  /home/jdc/tomato/release/src-rt/linux/linux-2.6/arch/mips/brcm-boards/bcm947xx/
       2: 0x000F9C00  router/mipsel-uclibc/target.image
    
    # Create generic TRX image
    
    Creating TRX: image/tomato-K26USB-NVRAM60K-1.28.--defMIPSR2-AIO.trx
    
    TRX Image:
     Total Size .... : 10190848 (9952.0 KB) (9.7 MB)
       Images ...... : 10187052 (0x009b712c)
       Padding ..... : 3768
     Avail. for jffs :
       4MB, 128K CFE : 0 EBs + 0
       4MB, 256K CFE : 0 EBs + 0
       8MB, 256K CFE : 0 EBs + 0
                Note : Netgear routers have 6 EBs less available!
     CRC-32 ........ : 72C8E8C6
     128K Blocks ... : 78 (0x0000004E)
      64K Blocks ... : 156 (0x0000009C)
     Offsets:
       0: 0x0000001C  lzma-loader/loader.gz
       1: 0x00000AD8  /home/jdc/tomato/release/src-rt/linux/linux-2.6/arch/mips/brcm-boards/bcm947xx/
       2: 0x000F9C00  router/mipsel-uclibc/target.image
    
    
    -----------------
    1.28.0000 MIPSR2 K26 USB AIO  ready
    -----------------
    make[4]: Leaving directory `/home/jdc/tomato/release/src-rt'
    make[3]: Leaving directory `/home/jdc/tomato/release/src-rt'
    make[2]: Leaving directory `/home/jdc/tomato/release/src-rt'
    make[1]: Leaving directory `/home/jdc/tomato/release/src-rt'
    
     
  21. koitsu

    koitsu Network Guru Member

    Expanding a bit more on the nfs-utils build failure previously reported:

    Code:
    ...
    checking for crypt in -lcrypt... yes
    checking for event_dispatch in -levent... yes
    checking for nfs4_init_name_mapping in -lnfsidmap... no
    configure: error: libnfsidmap needed for nfsv4 support
    make[5]: *** [nfs-utils/stamp-h1] Error 1
    make[5]: Leaving directory `/root/tomato/release/src/router'
    make[4]: *** [all] Error 2
    make[4]: Leaving directory `/root/tomato/release/src-rt'
    make[3]: *** [bin] Error 2
    make[3]: Leaving directory `/root/tomato/release/src-rt'
    make[2]: *** [z] Error 2
    make[2]: Leaving directory `/root/tomato/release/src-rt'
    make[1]: *** [r2z] Error 2
    make[1]: Leaving directory `/root/tomato/release/src-rt'
    make: *** [e3200] Error 2
    
    This expands from the autoconf bits, which pertain to NFSv4 support:

    Code:
    AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"])
    if test "$enable_nfsv4" = yes; then
        AC_CHECK_LIB(event, event_dispatch, [libevent=1], AC_MSG_ERROR([libevent needed for nfsv4 support]))
        AC_CHECK_LIB(nfsidmap, nfs4_init_name_mapping, [libnfsidmap=1], AC_MSG_ERROR([libnfsidmap needed for nfsv4 support]))
        AC_CHECK_HEADERS(event.h, ,AC_MSG_ERROR([libevent needed for nfsv4 support]))
        AC_CHECK_HEADERS(nfsidmap.h, ,AC_MSG_ERROR([libnfsidmap needed for nfsv4 support]))
        dnl librpcsecgss already has a dependency on libgssapi,
        dnl but we need to make sure we get the right version
        if test "$enable_gss" = yes; then
         PKG_CHECK_MODULES(RPCSECGSS, librpcsecgss >= 0.16, ,
          [AC_MSG_ERROR([Unable to locate information required to use librpcsecgss.  If you have pkgconfig installed, you might try setting environment variable PKG_CONFIG_PATH to /usr/local/lib/pkgconfig])
          ]
         )
        PKG_CHECK_MODULES(GSSGLUE, libgssglue >= 0.1)
        fi
    
    fi
    
    So the AC_CHECK_LIB() macro is what fails; it's specifically looking for the symbol called nfs4_init_name_mapping within libnfsidmap.so (the library), as well as nfsidmap.h within whatever the include directories specified are (probably via CFLAGS).

    libnfsidmap is not the "system-wide" libnfsidmap (for those wondering) -- it's built as part of the firmware under release/src/router/libnfsidmap. The same goes for nfsidmap.h.

    My relevant compiler flags/bits per config.log within nfs-utils, which show quite clearly what's being referenced (libraries are scanned per -L directory and include files are scanned per -I directory). I've bolded the ones relevant:

    configure:3419: mipsel-uclibc-gcc -Os -Wall -fno-delete-null-pointer-checks -funit-at-a-time -I/home/jdc/tomato/release/src-rt/router/libevent/staged/usr/local/include -I/home/jdc/tomato/release/src-rt/router/e2fsprogs/lib -I/home/jdc/tomato/release/src-rt/router/libnfsidmap/staged/usr/include -ffunction-sections -fdata-sections -L/home/jdc/tomato/release/src-rt/router/libevent/staged/usr/local/lib -L/home/jdc/tomato/release/src-rt/router/e2fsprogs/lib -L/home/jdc/tomato/release/src-rt/router/libnfsidmap/staged/usr/lib -ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC conftest.c >&5

    My router/libnfsidmap after the above build is here as an attachment (DOS CR format, sorry).

    You can see quite clearly that /home/jdc/tomato/release/src-rt/router/libnfsidmap/staged/usr/lib/libnfsidmap.so exists (it's a symlink to libnfsidmap.so.0.3.0 which is the true/full library) as well as /home/jdc/tomato/release/src-rt/router/libnfsidmap/staged/usr/include/nfsidmap.h.

    So I would recommend you start there. My guess is that libnfsidmap is failing to build on your system for some reason.

    I would not be surprised if some automake bits screwed this up for you. Again, on Debian 6.0.6 (x86), automake defaults to 1.11.1. Older versions will behave differently. Alternately, you could just use Debian 6.0.6 (x86) -- Ubuntu is such a piece of garbage, including the Server "product" (if you can even call it that). Sorry, just my opinion. Do not bother with x64 w/ 32-bit compat shims -- just use x86 (32-bit) and take no risks.

    Oh, finally, if you want to know what packages I have installed on my Debian box for the above build, I've attached it as a file (DOS CR format again) since it's quite long. For extra packages to install, see my blog post (and add pkg-config to that list for Shibby builds). That's literally all you need.
     

    Attached Files:

    Windy likes this.
  22. Windy

    Windy Serious Server Member

    Thank you for the great detailed explanation and assistance! I am not sure what happened or what I did differently. Today I installed pkg-config and grabbed the source from scratch again, extracted uncommited openvpn, added /sbin to the $PATH (for apcupsd) and I was able to build the image again! I can confirm it works under Debian 6.0.6 (32 bit) as well as Ubuntu 12.04, both 32 bit and suprisingly 64 bits! Now I just have to test if the images would brick the routers...
     
  23. koitsu

    koitsu Network Guru Member

    One thing to check is that your system clock on the Debian/Ubuntu/whatever host is not excessively drifting; it should be using ntpdate at boot-up to sync the clock, then use ntpd to keep the clock in sync (this is not the same thing as a cronjob that calls ntpdate -- don't do that!!). Clock skew can cause make to skip over certain things transparently, causing breakage. Seen this many times over during my career as a UNIX admin, on all flavours of OSes and hardware.

    Otherwise the only other thing I can think of is leftover cruft in your tomato/ directory. make clean and make distclean don't actually clean up everything -- try it yourself, then run git status in the tomato/ directory afterwards and read carefully. You'll be surprised at all the deletions and pending modifications. I can understand some modifications to some files (I know some of the makefiles manually patch some stuff, thus make clean isn't going to de-patch those), but the other stuff is depressing. Even git reset --hard does not fix this stuff up. (I will gladly admit that I am not a "git master", I have much more familiarity with RCS, CVS, and bits/pieces of SVN).

    This is why I advocate right after doing git clone git://repo.or.cz/tomato.git that you do cp -pR tomato tomato.orig, which allows you to keep a "fresh" or "truely clean/stock" tomato directory laying around and not have to continually run git clone and waste repo.or.cz's bandwidth; rm -fr tomato && cp -pR tomato.orig tomato then gets you back to a clean slate.
     
    beatnik likes this.
  24. Windy

    Windy Serious Server Member

    Thanks for the reminder. I was using different OSes to start off with a clean state in terms of not only the repository, but also the installed packages, so I inadvertently wasted some of their bandwidth.

    I think (if you would like to verify) what actually caused my compile errors was by my wrong way of using git. In post #8 I wrote above, I have been using git checkout origin/tomato-shibby-RT-N after cloning the main branch. It did grab the files (at least I could verify with make help to see e3200 and r64e as options), just not all the files correctly I assume. Using git clone -b tomato-shibby-RT-N instead on the remote repository seems to have done the trick.
     
  25. koitsu

    koitsu Network Guru Member

    No, you're still grasping at straws. The reason for the build failure is what I described above -- instead you're speculating rather than providing evidence of missing files, etc.. My successful builds above were done using this:

    git clone git://repo.or.cz/tomato.git
    cd tomato
    git checkout remotes/origin/tomato-shibby-RT-N

    You can see the branches available to "switch" between by using git branch -a (the -a flag is important) while in the tomato directory. You can switch between whatever branches you want. git is very different (vs. CVS or SVN) in this regard.

    The reason in my instructions I recommended git clone -b Toastman-RT-N is because it effectively does the same thing, saving some extra commands. So as I said: the reason for the build failure is one of the reasons I mentioned or something along those lines, and not the result of your git commands. :)
     
  26. jerrm

    jerrm Network Guru Member

    Did anyone track down the nfs build issues?

    I finally broke down and tried getting an environment running last night. Followed koitsu's how-to (thanks), got Shibby RT-N from git, extracted the openvpn tar, made sure pkg-config was there, sbin was in the path and tools directories were first in path.

    Did a make for r64z target (AIO build) and got the same nfs error as Windy in post 5. Deleted the tomato directory, pulled down from git again (and applied openvpn tar), ran the r64z target again, got the same error again. The /home/xxx/tomato/release/src-rt/router/libnfsidmap/staged/ files were there.

    Then tried the r64e target (because it doesn't have the nfs server) and it completed. Went back and tried r64z again and then it completed.

    I don't really like when things start working for no apparent reason. First guess is maybe the r64z target is skipping something or has something out of sequence that running r64e first fixes. Last night was a first run/shotgun approach, before I had to get some sleep. I plan on doing a little more methodical testing tonight, but don't want to waste the time if someone has already figured it out.
     
  27. ataga

    ataga Serious Server Member

    I found the problem with building nfs-util. In config.log I had:

    configure:23029: checking for nfs4_init_name_mapping in -lnfsidmap
    configure:23064: mipsel-uclibc-gcc -o conftest -Os -Wall -fno-delete-null-pointer-checks -funit-at-a-time -I/mnt/build/tomato/source/release/src-rt/router/libevent/staged/usr/local/include -I/mnt/build/tomato/source/release/src-rt/router/e2fsprogs/lib -I/mnt/build/tomato/source/release/src-rt/router/libnfsidmap/staged/usr/include -ffunction-sections -fdata-sections -D_GNU_SOURCE -L/mnt/build/tomato/source/release/src-rt/router/libevent/staged/usr/local/lib -L/mnt/build/tomato/source/release/src-rt/router/e2fsprogs/lib -L/mnt/build/tomato/source/release/src-rt/router/libnfsidmap/staged/usr/lib -ffunction-sections -fdata-sections -Wl,--gc-sections -fPIC conftest.c -lnfsidmap >&5
    /mnt/build/tomato/source/release/src-rt/router/libnfsidmap/staged/usr/lib/libnfsidmap.so: undefined reference to `rpl_malloc'

    Shibby has already tried to fix this problem by manually editing the configure script (see commit ba8e3130b8c29676432139bf5cc3479bc97cd0b7). But during the build process configure is re-generated from configure.in, therefore breaking his fix.

    I found a better way to do this. Apparently 'rpl_malloc' is there because a configure variable ac_cv_func_malloc_0_nonnull was set to 'no', which in turn comes from the expansion of an autoconf macro, AC_FUNC_MALLOC.

    I commented out the line AC_FUNC_MALLOC in router/libnfsidmap/configure.in and now the build works.
     
  28. koitsu

    koitsu Network Guru Member

    The commit ataga is talking about:

    http://repo.or.cz/w/tomato.git/commitdiff/ba8e3130b8c29676432139bf5cc3479bc97cd0b7

    This whole situation stems from autoconf being run automatically (thus configure is re-generated), which means that the version of autoconf being used matters greatly and will also vary from system to system. The GNU autoconf and automake tools are so horribly broken at all times; they're just horrible.

    With regards to this, look what I found:

    http://wiki.buici.com/xwiki/bin/view/Programing C and C++/Autoconf and RPL_MALLOC
    http://lists.gnu.org/archive/html/autoconf/2003-05/msg00021.html
    https://groups.google.com/forum/?fromgroups=#!topic/ikarus-users/_R0QHqwyYz8
    http://changetheworldwithyourpassion.blogspot.com/2009/09/fix-undefined-rplmalloc-on-autoconf.html

    So the "semi-clean workaround" would be, somewhere in the Makefile structure for all this 3rd-party software (not libnfsidmap itself but one level up, for example), to add export ac_cv_func_malloc_0_nonnull=yes to that Makefile before iterating over all the directories and running autoconf or make or whatever else.

    This would solve this problem for not only libnfsidmap but any other software using AC_FUNC_MALLOC as well, as I imagine this problem could affect multiple softwares given the large number of 3rd-party tools included in TomatoUSB.
     
  29. Jacky444

    Jacky444 Addicted to LI Member

    I keep getting this

    Code:
    mv -f .deps/strlcpy.Tpo .deps/strlcpy.Po
    /bin/bash ../../libtool --tag=CC  --mode=link mipsel-uclibc-gcc -Wall -Wstrict-                                                                                                                                                            prototypes  -pipe -Os -Wall -fno-delete-null-pointer-checks -funit-at-a-time -I/                                                                                                                                                            home/jacky/tomato-rt-n/release/src-rt/router/libevent/staged/usr/local/include -                                                                                                                                                            I/home/jacky/tomato-rt-n/release/src-rt/router/e2fsprogs/lib -I/home/jacky/tomat                                                                                                                                                            o-rt-n/release/src-rt/router/libnfsidmap/staged/usr/include -ffunction-sections                                                                                                                                                              -fdata-sections  -L/home/jacky/tomato-rt-n/release/src-rt/router/libevent/staged                                                                                                                                                            /usr/local/lib -L/home/jacky/tomato-rt-n/release/src-rt/router/e2fsprogs/lib -L/                                                                                                                                                            home/jacky/tomato-rt-n/release/src-rt/router/libnfsidmap/staged/usr/lib -ffuncti                                                                                                                                                            on-sections -fdata-sections -Wl,--gc-sections -fPIC -o idmapd atomicio.o cfg.o i                                                                                                                                                            dmapd.o strlcat.o strlcpy.o -levent -lnfsidmap ../../support/nfs/libnfs.a
    mkdir .libs
    libtool: link: warning: library `/home/jacky/tomato-rt-n/release/src-rt/router/l                                                                                                                                                            ibevent/staged/usr/local/lib/libevent.la' was moved.
    libtool: link: warning: library `/home/jacky/tomato-rt-n/release/src-rt/router/l                                                                                                                                                            ibevent/staged/usr/local/lib/libevent.la' was moved.
    mipsel-uclibc-gcc -Wall -Wstrict-prototypes -pipe -Os -Wall -fno-delete-null-poi                                                                                                                                                            nter-checks -funit-at-a-time -I/home/jacky/tomato-rt-n/release/src-rt/router/lib                                                                                                                                                            event/staged/usr/local/include -I/home/jacky/tomato-rt-n/release/src-rt/router/e                                                                                                                                                            2fsprogs/lib -I/home/jacky/tomato-rt-n/release/src-rt/router/libnfsidmap/staged/                                                                                                                                                            usr/include -ffunction-sections -fdata-sections -ffunction-sections -fdata-secti                                                                                                                                                            ons -Wl,--gc-sections -fPIC -o idmapd atomicio.o cfg.o idmapd.o strlcat.o strlcp                                                                                                                                                            y.o  -L/home/jacky/tomato-rt-n/release/src-rt/router/libevent/staged/usr/local/l                                                                                                                                                            ib -L/home/jacky/tomato-rt-n/release/src-rt/router/e2fsprogs/lib -L/home/jacky/t                                                                                                                                                            omato-rt-n/release/src-rt/router/libnfsidmap/staged/usr/lib /home/jacky/tomato-r                                                                                                                                                            t-n/release/src-rt/router/libevent/staged/usr/local/lib/libevent.so /usr/lib/lib                                                                                                                                                            nfsidmap.so -ldl ../../support/nfs/libnfs.a  -Wl,--rpath -Wl,/home/jacky/tomato                                                                                                                                                            -rt-n/release/src-rt/router/libevent/staged/usr/local/lib -Wl,--rpath -Wl,/home/                                                                                                                                                            jacky/tomato-rt-n/release/src-rt/router/libevent/staged/usr/local/lib
    /usr/lib/libnfsidmap.so: could not read symbols: File in wrong format
    collect2: ld returned 1 exit status
    make[7]: *** [idmapd] Error 1
    make[7]: Leaving directory `/home/jacky/tomato-rt-n/release/src/router/nfs-utils                                                                                                                                                            /utils/idmapd'
    make[6]: *** [all-recursive] Error 1
    make[6]: Leaving directory `/home/jacky/tomato-rt-n/release/src/router/nfs-utils                                                                                                                                                            /utils'
    make[5]: *** [all-recursive] Error 1
    make[5]: Leaving directory `/home/jacky/tomato-rt-n/release/src/router/nfs-utils                                                                                                                                                            '
    make[4]: *** [nfs-utils] Error 2
    make[4]: Leaving directory `/home/jacky/tomato-rt-n/release/src/router'
    make[3]: *** [all] Error 2
    make[3]: Leaving directory `/home/jacky/tomato-rt-n/release/src-rt'
    make[2]: *** [bin] Error 2
    make[2]: Leaving directory `/home/jacky/tomato-rt-n/release/src-rt'
    make[1]: *** [z] Error 2
    make[1]: Leaving directory `/home/jacky/tomato-rt-n/release/src-rt'
    make: *** [r64z] Error 2
    jacky@defikon:~/tomato-rt-n/release/src-rt$
    
    I tried so many things to fix it :/ nothing works really.

    Building N66U Shibby Tomato AIO on Ubuntu 12.10 32bit
     
  30. JugsteR

    JugsteR Serious Server Member

    I commented out the line AC_FUNC_MALLOC in router/libnfsidmap/configure.in and now the build works.

    This was using Linux mint 14 32bit.

    Signature? Signature!
     
  31. Jacky444

    Jacky444 Addicted to LI Member

    I did that as well, but didn't fix error. =/
     
  32. Jacky444

    Jacky444 Addicted to LI Member

    lol, what fixed err was "sudo rm /usr/lib/libnfsidmap.so" I guess compiler shouldn't be using system libs? why does this happen to me?
     
  33. Kevin Darbyshire-Bryant

    Kevin Darbyshire-Bryant Networkin' Nut Member

    And this is in src-rt/router/Makefile

    libnfsidmap/stamp-h1:
    cd libnfsidmap && \
    CFLAGS="-Os -Wall $(EXTRACFLAGS)" \
    ac_cv_func_malloc_0_nonnull=yes \
    ac_cv_func_realloc_0_nonnull=yes \
    $(CONFIGURE) --prefix=/usr --enable-shared --enable-static
    touch libnfsidmap/stamp-h1
    So it looks like this approach has been taken already. Hmmmm. And now I've just had a build go through all ok, first in a little while and I've no idea what I've done to fix it.
     
  34. koitsu

    koitsu Network Guru Member

    Here's the commit , and supposedly (according to other Internet sources) this should work, however if any other part of the make/build infrastructure rebuilds configure (i.e. autoconf is run somewhere, regenerating configure on the machine per configure.in), and the autoconf version on that users' system does not work with these variables, then I can see that being a probelm.

    Also, supposedly all of this stuff is supposed to be passed as an argument directly to configure itself, according to the autoconf folks:

    http://lists.gnu.org/archive/html/autoconf/2011-04/msg00019.html

    E.g. configure ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes --prefix=...

    I also see a logic problem with the above Makefile lines: it assumes blindly that configure ran successfully, and touches libnfsidmap/stamp-h1 blindly regardless of the result. I really think that command should become configure ... && touch ... to ensure that if configure fails the touch never gets executed. I'm not sure what stamp-h1 is about anyway. All of this smells very suspicious and awful; when I see "stamp" files being used, I get the impression these are used to try and work around build or autotools "oddities", and they never quite work right. This might explain why a build fails for some people the first time, but subsequent times work. I don't know.

    Overall the entire build/configure structure could be reworked to use config.site as well, which would significantly speed things up and provide a single point of consistent "informational" details for all subsequent configure runs. Setting $CONFIG_SITE to a path would be useful, but it needs to be a static/fully-qualified path and not something relative.
     

Share This Page