Page 1 of 2 12 LastLast
Results 1 to 15 of 28

Thread: making toolchain fails

  1. #1

    making toolchain fails

    Hi, because I need the swftools http://www.swftools.org I want to build it via the wl500g-repo openwrt buildroot. (thx ryzhov_al)

    http://code.google.com/p/wl500g-repo.../trunk/INSTALL
    http://code.google.com/p/wl500g-repo...trunk/Makefile

    but instead of just make - at first I need to make .toolchain_installed
    (I'll do the Makefile steps manually, because of integrating the swftools via this guide: http://wiki.openwrt.org/doc/devel/packages)

    the build-system is an ubuntu-virtual machine

    ok, a title says the make of toolchain fails:

    Code:
    Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h)
    Build dependency: Please install zlib. (Missing libz.so or zlib.h)
    uhmm, I don't know, whats wrong, because I allready have the ncurses and zlib developer-libs:
    Code:
    gm@ubuntu:~/openwrt/rtn$ sudo apt-get install libncurses-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Note, selecting 'libncurses5-dev' instead of 'libncurses-dev'
    libncurses5-dev is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
    and

    Code:
    gm@ubuntu:~/openwrt/rtn$ sudo apt-get install libz-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Note, selecting 'zlib1g-dev' instead of 'libz-dev'
    zlib1g-dev is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
    anyone an Idea?
    RT-N66U TomatoUSB 1.28.0000 MIPSR2-135 K26AC USB AIO-64K running Entware-NG
    pyload 0.4.9
    minidlna 1.1.2
    samba 3.6.5
    openvpn 2.3.10
    ̶W̶L̶5̶0̶0̶g̶P̶ ̶1̶.̶9̶.̶2̶.̶7̶-̶r̶t̶n̶-̶r̶4̶7̶5̶0 retired

  2. #2
    Quote Originally Posted by !gm View Post
    anyone an Idea?
    Ubuntu, yes? The same bug on my Ubuntu 11.10 x64.

    Find ./toolchain-1.9.2.7-rtn-r3988/src/include/prereq-build.mk file and fix these lines:
    Code:
    ...
    define Require/ncurses
            echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \
                    echo -include ncurses.h -x c -o $(TMP_DIR)/a.out -lncurses -
    endef
    
    $(eval $(call Require,ncurses, \
            Please install ncurses. (Missing libncurses.so or ncurses.h) \
    ))
    
    
    define Require/zlib
            echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' | \
                    echo -include zlib.h -x c -o $(TMP_DIR)/a.out -lz -
    endef
    Yes, i know its dirty hack, but works. I have no time to fix toolchain buildroot script.

    BTW, toolchain buildroot is taken from OpenWRT too^)

  3. #3
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    3,640
    Quote Originally Posted by ryzhov_al View Post
    Ubuntu, yes? The same bug on my Ubuntu 11.10 x64.
    ...

    Yes, i know its dirty hack, but works. I have no time to fix toolchain buildroot script.
    To fix it we must know exact error message, can you post it?

    Just execute following command in default shell (bash??):
    Code:
    echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \
    gcc -include ncurses.h -x c -o /tmp/a.out -lncurses -

  4. #4
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    the error
    Code:
    /tmp/ccbNsdgJ.o: In function `main':
    :(.text+0x10): undefined reference to `initscr'
    collect2: ld returned 1 exit status
    I ended up with "echo 1", since I knew I had everything correctly installed on my mint box

  5. #5
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    3,640
    Quote Originally Posted by wpte View Post
    the error
    Code:
    /tmp/ccbNsdgJ.o: In function `main':
    :(.text+0x10): undefined reference to `initscr'
    collect2: ld returned 1 exit status
    It means that libncurses.so library cannot be found by gcc
    Where is it located? OpenSUSE store it in /usr/lib (/usr/lib64)

    Is library contains initscr():
    Code:
    readelf -s libncurses.so | grep initscr
    ?

  6. #6
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    yeah, that's the weird thing...
    I've had other problems with finding libraries on previous versions of ubuntu's gcc, like libusb.

    The current version I have:
    gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
    libncurses.so is on my 64bit machine just in /lib/

    Code:
    readelf -s /lib/libncurses.so.5 | grep initscr
       399: 000000000000c6d0   179 FUNC    GLOBAL DEFAULT   11 initscr
    the packages I use: http://packages.ubuntu.com/search?ke...ic&section=all
    you can just open the deb files with an archive manager

    In the end, all other programs I've compiled so far, including some other toolchains for my uni projects did find ncurses without any problem

  7. #7
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    3,640
    Quote Originally Posted by wpte View Post
    yeah, that's the weird thing...
    I've had other problems with finding libraries on previous versions of ubuntu's gcc, like libusb.
    All seems to be ok, but gcc can't find library...
    I can't imagine whats wrong in such simple test-case. Have you another gcc version installed, 4.5.3 or 4.6.3 for example?

    In the end, all other programs I've compiled so far, including some other toolchains for my uni projects did find ncurses without any problem
    Probably, they seek for library path via package manager. But I'm not sure.

  8. #8
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by lly View Post
    All seems to be ok, but gcc can't find library...
    I can't imagine whats wrong in such simple test-case. Have you another gcc version installed, 4.5.3 or 4.6.3 for example?


    Probably, they seek for library path via package manager. But I'm not sure.
    I have only 1 gcc installed, and some toolchains, but those have different names obviously, so shouldn't intefere

    I could look in some ./configure scripts perhaps? to find out how they test it?

  9. #9
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    3,640
    Quote Originally Posted by wpte View Post
    I have only 1 gcc installed, and some toolchains, but those have different names obviously, so shouldn't intefere
    Actually, gcc 4.6.1 is unstable. I suspect that compiler incorrectly processes options passed. If you have extra time, you can play with "-include ncurses.h" & "-x c", take source from filesystem rather than stdin, reorder gcc options.

    I could look in some ./configure scripts perhaps? to find out how they test it?
    For now I'm not ready to migrate from simple checks to huge autoconf/automake scripts.

  10. #10
    Quote Originally Posted by lly View Post
    If you have extra time, you can play with "-include ncurses.h" & "-x c", take source from filesystem rather than stdin, reorder gcc options.
    Yes, you are right again^)
    Code:
    $ echo 'int main(int argc, char **argv) { initscr(); return 0; }' > ./ncurses_test.c
    $ gcc -include ncurses.h -x c  ./ncurses_test.c -o /tmp/a.out -lncurses
    runs without any issues.

  11. #11
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    3,640
    Quote Originally Posted by ryzhov_al View Post
    runs without any issues.
    Well, if wpte confirm that solution too, we will modify prereq-build.mk

    P.S. I suspect that autoconf creators know about this issue - configure script always create "conftest.c" file.

  12. #12
    Quote Originally Posted by ryzhov_al View Post
    Yes, you are right again^)
    Code:
    $ echo 'int main(int argc, char **argv) { initscr(); return 0; }' > ./ncurses_test.c
    $ gcc -include ncurses.h -x c  ./ncurses_test.c -o /tmp/a.out -lncurses
    runs without any issues.

    same here.

    Ubuntu 11.10 (GNU/Linux 3.0.0-17-generic i686)
    RT-N66U TomatoUSB 1.28.0000 MIPSR2-135 K26AC USB AIO-64K running Entware-NG
    pyload 0.4.9
    minidlna 1.1.2
    samba 3.6.5
    openvpn 2.3.10
    ̶W̶L̶5̶0̶0̶g̶P̶ ̶1̶.̶9̶.̶2̶.̶7̶-̶r̶t̶n̶-̶r̶4̶7̶5̶0 retired

  13. #13
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by lly View Post
    Well, if wpte confirm that solution too, we will modify prereq-build.mk

    P.S. I suspect that autoconf creators know about this issue - configure script always create "conftest.c" file.
    I use mint 12, they use the very same deb repository as ubuntu does
    so yeah, it works (I even tested it)
    mint just has a slightly better interface

    so what about zlib? same solution?

  14. #14
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    3,640
    Quote Originally Posted by wpte View Post
    so what about zlib? same solution?
    Hope, yes. Please try r4014

  15. #15

    Thumbs up

    Quote Originally Posted by lly View Post
    Hope, yes. Please try r4014
    tonight - after Champions League


    edit: nah got some time now... wait a minute


    Code:
    Compiling toolchain, revision r4014...
    make -C "../../toolchain-1.9.2.7-rtn-r4014/src" V=99
    make[2]: Entering directory `/home/gm/openwrt/toolchain-1.9.2.7-rtn-r4014/src'
    make[2]: Leaving directory `/home/gm/openwrt/toolchain-1.9.2.7-rtn-r4014/src'
    make[2]: Entering directory `/home/gm/openwrt/toolchain-1.9.2.7-rtn-r4014/src'
    make[3]: Entering directory `/home/gm/openwrt/toolchain-1.9.2.7-rtn-r4014/src'
    Checking 'working-make'... ok.
    Checking 'case-sensitive-fs'... ok.
    Checking 'working-gcc'... ok.
    Checking 'working-g++'... ok.
    Checking 'ncurses'... failed.
    Checking 'zlib'... failed.
    nope

    after checkout rtn I altered config.mk to match the reversion
    Code:
    TOOLCHAIN_REVISION:=r4014
    FIRMWARE_REVISION:=r4014
    it was tested via make .toolchain_installed
    Last edited by !gm; 28-03-2012 at 19:00.
    RT-N66U TomatoUSB 1.28.0000 MIPSR2-135 K26AC USB AIO-64K running Entware-NG
    pyload 0.4.9
    minidlna 1.1.2
    samba 3.6.5
    openvpn 2.3.10
    ̶W̶L̶5̶0̶0̶g̶P̶ ̶1̶.̶9̶.̶2̶.̶7̶-̶r̶t̶n̶-̶r̶4̶7̶5̶0 retired

Page 1 of 2 12 LastLast

Similar Threads

  1. Подскажите, что этот лог значит? (syslog)
    By VadimVB in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 479
    Last Post: 23-05-2013, 08:47
  2. Strange problem compiling toolchain
    By QMax in forum WL-500gP Q&A
    Replies: 1
    Last Post: 27-09-2009, 17:54
  3. Replies: 1
    Last Post: 09-01-2008, 12:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •