.titleBar { margin-bottom: 5px!important; }

Stuck with custom compile... can't load library 'libevent-2.0.so.5'

Dieses Thema im Forum "Freetz" wurde erstellt von zyrill, 17 Nov. 2011.

  1. zyrill

    zyrill Neuer User

    Registriert seit:
    29 Juli 2009
    Beiträge:
    87
    Zustimmungen:
    0
    Punkte für Erfolge:
    6
    Ort:
    Frankfurt
    Hi guys,

    I noticed transmission is still on version 2.32 when version 2.42 is actually out and I wondered why. Well, I'm not wondering anymore: it's a major pain to get it even compiling. And apparently, I'm doing something wrong even though there are no errors during the make anymore.

    But first things first: I changed the make/transmission/transmission.mk file to not complain about the latest nightly tar I downloaded and made it fetch that instead of the 2.32 - see Den Anhang 61243 betrachten and I deleted the make/transmission/patches folder - no use trying to fine tune when it's not working at all. Since the nightly tarball has to be configured using ./autogen.sh I changed that part of the transmission.mk file as well.

    Since transmission wouldn't compile I checked what the problem was: apparently, if I choose
    Code:
    $(PKG)_CONFIGURE_OPTIONS += --disable-utp
    it works, so it must be that 3rd party lib. Right. Reenabled it and ran make, the following error popped up:
    Code:
    checking µTP... configure: error: "Unable to build uTP support -- C++ compiler not found"
    Now that's stupid since g++ is installed and working so I checked where that error message comes from: the configure script of transmission (or configure.ac respectively), located in "/home/pk/trunk/source/target-mipsel_uClibc-0.9.31.1/transmission-2.42+" so then I tried figuring out why that stupid check fails and since I still don't understand what exactly it's checking for there I threw out the whole if clause and forced the check to succeed by changing
    Code:
    if test "x$want_utp" = "xyes" ; then
        if test "x$have_utp" = "xyes"; then
            LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
            LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a"
            if test "x$libutp_extra_libs" != "x" ; then
                LIBUTP_LIBS="$LIBUTP_LIBS $libutp_extra_libs"
            fi
            $as_echo "#define WITH_UTP 1" >>confdefs.h
    
            build_utp="yes"
        else
          as_fn_error $? "\"Unable to build uTP support -- C++ compiler not found\"" "$LINENO" 5
        fi
    fi
    
    into
    Code:
    if test "x$want_utp" = "xyes" ; then
            LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
            LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a"
            if test "x$libutp_extra_libs" != "x" ; then
                LIBUTP_LIBS="$LIBUTP_LIBS $libutp_extra_libs"
            fi
            $as_echo "#define WITH_UTP 1" >>confdefs.h
    
            build_utp="yes"
    fi
    
    and I also did the same in configure.ac since I don't know if autogen.sh always calls it. Wouldn't want my dirty little hack to be overridden. So now it should always try to build libutp (and it goes "checking µTP... yes" so that's good!).

    So now it actually goes on compiling and runs all the way through. It did do some compiling in "source/target-mipsel_uClibc-0.9.31.1/transmission-2.42+/third-party/libutp" as well since there are the new files "libutp.a", "utp.o" and "utp_utils.o".

    But now when I flash the image and try to start the transmission-daemon, I get the following error:
    Code:
    transmission-daemon: can't load library 'libevent-2.0.so.5'
    Starting transmission daemon ... without password protection.. failed.
    Apparently, I haven't fully understood what's happening - where is that libevent error coming from? The library is included in the image, I checked on my box... So maybe I forgot to link it or what? I'm lost. If somebody with more knowledge about cross-compiling and freetz could give me a hint, I'd be very grateful. Thanks in advance!
     
  2. RalfFriedl

    RalfFriedl IPPF-Urgestein

    Registriert seit:
    22 Apr. 2007
    Beiträge:
    12,343
    Zustimmungen:
    0
    Punkte für Erfolge:
    0
    Is the library on the box?
    What does the command "file" say about that library (on the host system)?

    You should better check why test for g++ doesn't work instead of removing the test.
     
  3. zyrill

    zyrill Neuer User

    Registriert seit:
    29 Juli 2009
    Beiträge:
    87
    Zustimmungen:
    0
    Punkte für Erfolge:
    6
    Ort:
    Frankfurt
    #3 zyrill, 17 Nov. 2011
    Zuletzt bearbeitet: 17 Nov. 2011
    You are of course right: it's better to find out why that check fails. But I reasoned that when I remove it, I'd find the place where g++ was missing and check there what exactly is wrong. Alas, that isn't working so well.

    And yes, the file is on the box, in: "usr/lib/freetz/libevent-2.0.so.5" (as is "usr/lib/freetz/libevent-2.0.so.5.2.0")

    On the debian where I compile, the following info was obtained:
    Code:
    a@debian:~/trunk$ file build/modified/filesystem/usr/lib/freetz/libevent-2.0.so.5
    build/modified/filesystem/usr/lib/freetz/libevent-2.0.so.5: symbolic link to `libevent-2.0.so.5.2.0'
    a@debian:~/trunk$ file build/modified/filesystem/usr/lib/freetz/libevent-2.0.so.5.2.0
    build/modified/filesystem/usr/lib/freetz/libevent-2.0.so.5.2.0: ELF 32-bit LSB shared object, MIPS, MIPS32 version 1 (SYSV), dynamically linked, with unknown capability 0xf41 = 0x756e6700, with unknown capability 0x70100 = 0x3040000, stripped
    So the test in configure before the actual error that apparently fails is
    Code:
    if test "x$HAVE_CXX" = "xyes" ; then
        have_utp="yes"
    else
        have_utp="no"
    fi
    Where can I find this "x$HAVE_CXX" test? It's not in configure...
     
  4. RalfFriedl

    RalfFriedl IPPF-Urgestein

    Registriert seit:
    22 Apr. 2007
    Beiträge:
    12,343
    Zustimmungen:
    0
    Punkte für Erfolge:
    0
    The output from file seems good, although I don't know whether these messages about unknown capability are normal for debain. What is the output from file for a normal, working library.

    Can you try on the box
    Code:
    LD_TRACE_LOADED_OBJECTS=1 transmission-daemon
    
    And if you have strace in the box
    Code:
    strace -f transmission-daemon
    
     
  5. zyrill

    zyrill Neuer User

    Registriert seit:
    29 Juli 2009
    Beiträge:
    87
    Zustimmungen:
    0
    Punkte für Erfolge:
    6
    Ort:
    Frankfurt
    It took me a while longer since I was at work. Now I compiled a new image with strace and ltrace. Following the output of
    Code:
    LD_TRACE_LOADED_OBJECTS=1 transmission-daemon
    Here goes:
    Code:
            librt.so.0 => /lib/librt.so.0 (0x2aabe000)
            libevent-2.0.so.5 => not found
            libcurl.so.4 => not found
            libssl.so.0.9.8 => /lib/libssl.so.0.9.8 (0x2aacf000)
            libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x2ab0d000)
            libz.so.1 => /lib/libz.so.1 (0x2abff000)
            libm.so.0 => /lib/libm.so.0 (0x2ac24000)
            libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2ac49000)
            libpthread.so.0 => /lib/libpthread.so.0 (0x2ac67000)
            libc.so.0 => /lib/libc.so.0 (0x2ac8a000)
            libdl.so.0 => /lib/libdl.so.0 (0x2ad06000)
            ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x2aaa8000)
    
    And also the strace -f transmission-daemon:
    Code:
    execve("/usr/bin/transmission-daemon", ["transmission-daemon"], [/* 226 vars */]) = 0
    old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2aaad000
    open("/home/pk/trunk/toolchain/build/mipsel_gcc-4.6.2_uClibc-0.9.31.1/mipsel-linux-uclibc/usr/lib/librt.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/mod/lib/librt.so.0", O_RDONLY)   = -1 ENOENT (No such file or directory)
    open("/lib/librt.so.0", O_RDONLY)       = 3
    fstat(3, {st_mode=S_IFREG|0755, st_size=4592, ...}) = 0
    old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2aaae000
    read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0000\6\0\0004\0\0\0"..., 4096) = 4096
    old_mmap(NULL, 69632, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aabe000
    old_mmap(0x2aabe000, 3828, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2aabe000
    old_mmap(0x2aace000, 3896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2aace000
    close(3)                                = 0
    munmap(0x2aaae000, 4096)                = 0
    open("/home/pk/trunk/toolchain/build/mipsel_gcc-4.6.2_uClibc-0.9.31.1/mipsel-linux-uclibc/usr/lib/libevent-2.0.so.5", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/mod/lib/libevent-2.0.so.5", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libevent-2.0.so.5", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libevent-2.0.so.5", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/lib/libevent-2.0.so.5", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/X11R6/lib/libevent-2.0.so.5", O_RDONLY) = -1 ENOENT (No such file or directory)
    old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000
    write(2, "", 0)                         = 0
    write(2, "transmission-daemon", 19transmission-daemon)     = 19
    write(2, ": can't load library '", 22: can't load library ')  = 22
    write(2, "libevent-2.0.so.5", 17libevent-2.0.so.5)       = 17
    write(2, "'\n", 2'
    )                      = 2
    munmap(0x2aaae000, 4096)                = 0
    exit(16)                                = ?
    
    Well I'll be... how did those paths NOT get replaced? I'm baffled. How do I fix this?
     
  6. olistudent

    olistudent IPPF-Urgestein

    Registriert seit:
    19 Okt. 2004
    Beiträge:
    14,761
    Zustimmungen:
    5
    Punkte für Erfolge:
    38
    Beruf:
    Softwareentwickler
    Ort:
    Kaiserslautern
    Did you remove the following line from transmission.mk?
    Code:
    $(PKG)_CONFIGURE_PRE_CMDS += $(call PKG_PREVENT_RPATH_HARDCODING,./configure)
    Or did you alter one of this lines?
    Code:
    	$(SUBMAKE) -C $(TRANSMISSION_DIR) \
    		LDFLAGS="$(TARGET_LDFLAGS) $(TRANSMISSION_LDFLAGS)"

    Regards
    Oliver
     
  7. er13

    er13 Aktives Mitglied

    Registriert seit:
    20 Dez. 2005
    Beiträge:
    984
    Zustimmungen:
    18
    Punkte für Erfolge:
    18
    #7 er13, 18 Nov. 2011
    Zuletzt bearbeitet: 18 Nov. 2011
    because of a lot of the web-interface errors it has (IE9 & opera don't work at all)

    try adding PKG_CONFIGURE_ENV += HAVE_CXX=yes to the transmission.mk
    It's actually a "freetz vs. autoconf" incompatibility. freetz initalizes TARGET_CXX-variable with the absolute path to the c++-compiler whereas the autoconf-generated-test expects a name without any path.

     

    Anhänge:

  8. zyrill

    zyrill Neuer User

    Registriert seit:
    29 Juli 2009
    Beiträge:
    87
    Zustimmungen:
    0
    Punkte für Erfolge:
    6
    Ort:
    Frankfurt
    #8 zyrill, 18 Nov. 2011
    Zuletzt bearbeitet: 18 Nov. 2011
    Noticed the intermediate post, look at the bottom for response.

    Well yes and no: I did change that first line since the tarball needs autogen.sh instead of configure and after running autogen.sh running configure isn't needed anymore - it read:
    Code:
    $(PKG)_CONFIGURE_PRE_CMDS += $(call PKG_PREVENT_RPATH_HARDCODING,./autogen.sh)
    A straight and honest no to the second part! Still reads:
    Code:
    $($(PKG)_BINARIES_BUILD_DIR): $($(PKG)_DIR)/.configured
            $(SUBMAKE) -C $(TRANSMISSION_DIR) \
                    LDFLAGS="$(TARGET_LDFLAGS) $(TRANSMISSION_LDFLAGS)"
    :)

    Well, I went and downloaded the latest release tarball because I think I read somewhere that I don't need to run autogen there. So I did the following:
    Code:
    rm -rf make/transmission
    svn up
    make transmission-clean
    make transmission-dirclean
    
    The only thing I touched afterwards was the transmission.mk where I changed the filename of the package... and I deleted that check in configure and configure.ac. Still that same error!
    Code:
    execve("/usr/bin/transmission-daemon", ["transmission-daemon"], [/* 226 vars */]) = 0
    old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2aaad000
    open("/home/pk/trunk/toolchain/build/mipsel_gcc-4.6.2_uClibc-0.9.31.1/mipsel-linux-uclibc/usr/lib/librt.so.0", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/mod/lib/librt.so.0", O_RDONLY)   = -1 ENOENT (No such file or directory)
    open("/lib/librt.so.0", O_RDONLY)       = 3
    fstat(3, {st_mode=S_IFREG|0755, st_size=4592, ...}) = 0
    old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2aaae000
    read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0000\6\0\0004\0\0\0"..., 4096) = 4096
    old_mmap(NULL, 69632, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aabe000
    old_mmap(0x2aabe000, 3828, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2aabe000
    old_mmap(0x2aace000, 3896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0) = 0x2aace000
    close(3)                                = 0
    munmap(0x2aaae000, 4096)                = 0
    open("/home/pk/trunk/toolchain/build/mipsel_gcc-4.6.2_uClibc-0.9.31.1/mipsel-linux-uclibc/usr/lib/libevent-2.0.so.5", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/mod/lib/libevent-2.0.so.5", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libevent-2.0.so.5", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/lib/libevent-2.0.so.5", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/lib/libevent-2.0.so.5", O_RDONLY) = -1 ENOENT (No such file or directory)
    open("/usr/X11R6/lib/libevent-2.0.so.5", O_RDONLY) = -1 ENOENT (No such file or directory)
    old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2aaae000
    write(2, "", 0)                         = 0
    write(2, "transmission-daemon", 19transmission-daemon)     = 19
    write(2, ": can't load library '", 22: can't load library ')  = 22
    write(2, "libevent-2.0.so.5", 17libevent-2.0.so.5)       = 17
    write(2, "'\n", 2'
    )                      = 2
    munmap(0x2aaae000, 4096)                = 0
    exit(16)                                = ?
    
    I noticed you replied in the meantime. So let me get up to date:

    Thanks for the explanation, I didn't notice the problems with the webinterface. Now let me try your suggestions!
     
  9. zyrill

    zyrill Neuer User

    Registriert seit:
    29 Juli 2009
    Beiträge:
    87
    Zustimmungen:
    0
    Punkte für Erfolge:
    6
    Ort:
    Frankfurt
    Ok well... I stupidly went ahead and used that patch. I think I'm going to do a distclean now :) Something went seriously wrong. What's that patch for anyway? Latest freetz-trunk? Or what version does it work on?
     
  10. er13

    er13 Aktives Mitglied

    Registriert seit:
    20 Dez. 2005
    Beiträge:
    984
    Zustimmungen:
    18
    Punkte für Erfolge:
    18
    #10 er13, 18 Nov. 2011
    Zuletzt bearbeitet: 18 Nov. 2011
    It's for the latest unmodified freetz-trunk. It updates transmission in freetz to its latest svn revision.

    You don't have to distclean anything, try the following
    Code:
    rm -rf make/transmission make/transmission-cgi
    svn up
    patch -p0 < transmission-from-svn.patch
    

    this change is the reason, why it doesn't find the libraries (libevent & libcurl). autogen.sh generates the configure-script and calls it automatically. It doesn't make any sense to modify autogen.sh with the PKG_PREVENT_RPATH_HARDCODING-macro. You have to prevent autogen.sh from automatically calling the configure-script, modify the generated configure using the macro and call configure after that (see my patch for all the changes required).
     
  11. zyrill

    zyrill Neuer User

    Registriert seit:
    29 Juli 2009
    Beiträge:
    87
    Zustimmungen:
    0
    Punkte für Erfolge:
    6
    Ort:
    Frankfurt
    Well, thanks er13 for clearing that up. I'd never have gotten it right. It works now but it's kind of frustrating to see what was needed since I'd never have gotten it working. So thanks again.