Page 1 of 3 123 LastLast
Results 1 to 15 of 49

Thread: cross compiling with the toolchain

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Question Cross-Compiling dif result

    Hi,

    Tried to build a Cross-Compiling platform to compile the firmware:

    -rw-r--r-- 1 root root 273177367 May 29 2005 GPL_1927.zip

    -rw-r--r-- 1 root root 2015762 Jun 24 2005 hndtools-mipsel-uclibc-3.2.3-full.tar.bz2

    -rw-r--r-- 1 root root 16200754 Jun 11 18:51 wl500g-1.9.2.7-7e.tar.bz2

    Files that I got from from oleg's Page http://wl500g.dyndns.org/
    Using
    Code:
    #!/bin/sh
    OLEG=wl500g-1.9.2.7-7e
    if [ -d broadcom ]; then
       echo "Removing old broadcom tree..."
       rm -rf broadcom
    fi
    echo "Unpacking Asus GPL source..."
    tar xzf GPL_1927.zip
    
    echo "Unpacking OLEG source..."
    tar -C broadcom/src/ -xjf ${OLEG}.tar.bz2
    
    if [ ! -G /opt ]; then
            echo "You should create /opt as root:"
            echo "mkdir /opt && chgrp users /opt && chmod g+w /opt"
            echo "Then continue as regular user!"
            exit 1
    fi
    
    if [ -d /opt/brcm ]; then
            echo "Removing old toolchain..."
            rm -rf /opt/brcm
    fi
    
    echo "Installing broadcom toolchain..."
    mv broadcom/opt/brcm /opt
    
    BRCM="/opt/brcm/hndtools-mipsel"
    PATH=${BRCM}-linux/bin:${BRCM}-uclibc/bin:${PATH}
    export PATH
    
    
    cd broadcom/src/${OLEG}
    echo "Creating uClibc..."
    make uClibc
    
    echo "Creating kernel..."
    make kernel
    
    echo "Creating gateway..."
    make
    
    echo "Compiling gateway..."
    cd ../gateway
    make
    
    echo "Creating firmware..."
    make image-WL500g
    No error but the result files are different from OLEG's
    11/22/2006 04:06a 3,489,792 WL500g-1.9.2.7-7e.trx mine
    06/11/2006 09:25p 3,751,936 WL500g-1.9.2.7-7e.trx Oleg’s

    I also tried to compile the http://code.ximeta.com/trac-ndas/wiki/OpenWRT
    ndas-1.0.1-23.tar.gz that compile without problems but them...

    The modules load OK but

    -r-xr-xr-x 1 root 46687 Nov 22 00:04 ndasadmin
    [@wl500g tmp]$ ./ndasadmin
    -sh: ./ndasadmin: not found

    Can someone help me on these 2 problems?

  2. #2
    Join Date
    Jun 2005
    Location
    Slovenia
    Posts
    736
    Oleg always post-include nmap binary in its firmwares.
    So you can never expect the same binary. Even if nmap would not be included, binaries would not be the same becaus of possible difference in direcory tree traversing during LZMA compression.

  3. #3
    Join Date
    Dec 2003
    Location
    Russian Federation
    Posts
    8,356
    tcpdump. not nmap.

  4. #4
    Join Date
    Jun 2005
    Location
    Slovenia
    Posts
    736
    Quote Originally Posted by Oleg View Post
    tcpdump. not nmap.
    OOps. Correct. My wheels. Out of the inner circle.


    Regarding kernel module and problem with admin I must say that you must export paths in a proper way. The best way is to start with Optware packaging for Oleg firmware ant then prepare make/ndas.mk to reflect this.

    See http://www.nslu2-linux.org/wiki/FAQ/Optware-uClibcBuild
    and http://www.nslu2-linux.org/wiki/FAQ/OptwareWl500gBuild

  5. #5
    Thanks for your help.

    I Installed the Toolchain and produced this ndas.mk file.

    I'm able to download the package but then the package is waiting for this :



    Code:
    export NDAS_KERNEL_PATH={kernel path}
    export NDAS_KERNEL_VERSION=2.4.20
    export NDAS_KERNEL_ARCH=mips
    export NDAS_CROSS_COMPILE=mipsel-linux-
    export NDAS_CROSS_UM_COMPILE=mipsel-linux-uclibc-gnu-
    export NDAS_EXTRA_CFLAGS="-mlong-calls -DNDAS_SIGPENDING_OLD"
    make ndas_version=1.0.1 ndas_build=23 all ndas-admin
    How do I include these in the ndas.mk file?

    Can you please help? This will be my first pakage .... is I get some support.
    Attached Files Attached Files

  6. #6
    Join Date
    Jun 2005
    Location
    Slovenia
    Posts
    736
    built target should look like
    Code:
    # This builds the actual binary.
    #
    $(NDAS_BUILD_DIR)/.built: $(NDAS_BUILD_DIR)/.configured
            rm -f $(NDAS_BUILD_DIR)/.built
             $(TARGET_CONFIGURE_OPTS) \
             CPPFLAGS="$(STAGING_CPPFLAGS) $(NDAS_CPPFLAGS)" \
             LDFLAGS="$(STAGING_LDFLAGS) $(NDAS_LDFLAGS)" \
             NDAS_KERNEL_PATH=/path/to/your/full/kernel/sources \
             NDAS_KERNEL_VERSION=2.4.20 \
             NDAS_KERNEL_ARCH=mips \
             NDAS_CROSS_COMPILE=$(TARGET_CROSS) \
             NDAS_EXTRA_CFLAGS="-mlong-calls -DNDAS_SIGPENDING_OLD" \
            $(MAKE) -C $(NDAS_BUILD_DIR)
            touch $(NDAS_BUILD_DIR)/.built

  7. #7
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767

    cross compiling with the toolchain

    allright, I have:
    asus toolchain for mips
    puppy linux
    an open source source package that needs to be compiled

    so, my question is: how do I use the toolchain to compile a source?
    I''ve looked all over the internet but I can only find things like "hey its not working".

    Does anyone knows something about this?
    even if you answer "look at this file"
    it''ll be helpfull

    I also still wonder why ppl write a readme without any [enters], so you get one big line

  8. #8
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    don't know exactly, but there is a howto in german:
    http://translate.google.at/translate...hl=de&ie=UTF-8

    hope it helps....

  9. #9
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    thanks, I''ll take a look at it

    I''m not really planning to do any IPKG packages, but I think it''s just the extra parameter that change it into an ipkg...
    I''m first going to test some simple packages, then i''ll write a full detailed how-to, hopefully for ubuntu and puppy-linux, because I believe those are a bit more open for the public

    I do want to try to get wine to work, maybe some windows programs will work with it
    probably some pocket pc applications... because "wine is not an emulater"

  10. #10
    Join Date
    Jul 2007
    Location
    Austria
    Posts
    1,336
    Quote Originally Posted by wpte View Post
    thanks, I''ll take a look at it

    I''m not really planning to do any IPKG packages, but I think it''s just the extra parameter that change it into an ipkg...
    Right.


    Well, would be nice to see a really good (complete) howto........

  11. #11
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    well, I guess it''s time to grab the cow at the horns (dutch say)
    I mean, things that aren''t clear are just rubbish, just like the wireless amp

    I mean open source, should be open, most real developments I''ve seen so far are in russian or german (wich I speak a little). that''s not really open.
    why not share importand things in english
    anyway, you got my word on the how-to

  12. #12
    Quote Originally Posted by wpte View Post
    I do want to try to get wine to work, maybe some windows programs will work with it
    Don't waste your time... Wine needs a x86 or x64 processor.
    (and i think it would otherwise be way to heavy)

  13. #13
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by DrChair View Post
    Don't waste your time... Wine needs a x86 or x64 processor.
    (and i think it would otherwise be way to heavy)
    yeh for running the programs... so it might be possible, some pocket pc applications will work, you got them in mips too

    I''m also going to try dosbox... might be a bit weird, but I still got loads of nice dos programs

  14. #14
    Quote Originally Posted by wpte View Post
    I also still wonder why ppl write a readme without any [enters], so you get one big line
    Try opening that readme in Wordpad (instead of notepad) or better Notepad++

  15. #15

    Question cannot cross compile toolchain

    hi people,

    i have problems compiling the toolchain. here is what i do and what problems i encounter

    my setup

    * distro MiniMe2008 (a minimal PcLinuxOs)
    * make (GNU Make 3.81)
    * gcc (gcc (GCC) 4.1.1 20060724 (prerelease) (4.1.1-4pclos2007))
    * ld 4.1.1 ( GNU ld version 2.16.91.0.7 20060317 )
    * bash (GNU bash, version 3.1.17(1)-release (i586-mandriva-linux-gnu))

    this is reported during the build

    Code:
    Checking build system dependencies:
    CC clean:                                       Ok
    CXX clean:                                      Ok
    CPP clean:                                      Ok
    CFLAGS clean:                                   Ok
    CXXFLAGS clean:                                 Ok
    sed works:                                      Ok
    which installed:                                Ok
    GNU make version '3.81':                        Ok
    C compiler '/usr/bin/gcc'
    C compiler version '4.1.1':                     Ok
    bison installed:                                Ok
    flex installed:                                 Ok
    gettext installed:                              Ok
    Build system dependencies:                      Ok
    I try to cross-compile the toolchain for OPTWARE_TARGET=oleg

    Code:
    mkdir -p /opt/slug
    cd /opt/slug
    svn co http://svn.nslu2-linux.org/svnroot/optware/trunk optware
    cd optware
    make oleg-target
    cd oleg
    make directories
    make ipkg-utils
    make toolchain
    when making oleg-target i see the following message printed to standard out

    Code:
    make: /opt/slug/optware/toolchain/armv5b-softfloat-linux/gcc-3.3.5-glibc-2.2.5/bin/armv5b-softfloat-linux-gcc: Command not found
    this may not be a problem as everything else goes well and i can proceed with making directories and ipkg-utils without problems. when I make this two targets i get a similar warning from make, but this time for the mipsel gcc version

    Code:
    make: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-gcc: Command not found
    the printed path is constructed in the root Makefile

    Code:
    TARGET_CC=$(TARGET_CROSS)gcc
    TARGET_CROSS is defined in make/toolchain-oleg.mk

    Code:
    TARGET_CROSS = $(TOOL_BUILD_DIR)/$(TARGET_ARCH)-$(TARGET_OS)/$(CROSS_CONFIGURATION)/bin/$(TARGET_ARCH)-$(TARGET_OS)-
    when building a target, all makefiles in the make directory are included in the root Makefile and one of them seems to use TARGET_CC variable even it is not used to build the corresponding package and complains about the non-existence of the directory and binary.

    ok, this is not a problem now but just polutes the log output a bit. the first serious problem occurs when making the toolchain. while building, the kernel headers for the oleg-kernel are downloaded from the wrong location http://www.uclibc.org/downloads/toolchain/

    Code:
    wget --passive-ftp -nd -P /opt/slug/optware/oleg/toolchain/buildroot/dl http://www.uclibc.org/downloads/toolchain/linux-libc-headers-oleg.tar.bz2
    --2008-06-02 17:37:49--  http://www.uclibc.org/downloads/toolchain/linux-libc-headers-oleg.tar.bz2
    Resolving www.uclibc.org... 140.211.166.42
    Connecting to www.uclibc.org|140.211.166.42|:80... connected.
    HTTP request sent, awaiting response... 404 Not Found
    i temporary work around this by inserting the following line in the kernel-headers.mk file which is located in oleg/toolchain/buildroot/toolchain/kernel-headers/

    Code:
    include toolchain/kernel-headers/kernel-headers-new.makefile
    include toolchain/kernel-headers/kernel-headers-old.makefile
    # the correct download location
    LINUX_HEADERS_SITE=http://www.wlan-sat.com/boleo/optware
    i specified the server where the oleg-headers can be found . now i can proceed with right(?) headers

    Code:
    ...
    wget --passive-ftp -nd -P /opt/slug/optware/oleg/toolchain/buildroot/dl http://www.wlan-sat.com/boleo/optware/linux-libc-headers-oleg.tar.bz2
    --2008-06-02 17:47:51--  http://www.wlan-sat.com/boleo/optware/linux-libc-headers-oleg.tar.bz2
    Resolving www.wlan-sat.com... 212.18.63.81
    Connecting to www.wlan-sat.com|212.18.63.81|:80... connected.
    ...
    but in the next step, the patching of uclibc fails

    Code:
    ...
    wget --passive-ftp -nd -P /opt/slug/optware/oleg/toolchain/buildroot/dl http://www.uclibc.org/downloads/snapshots/uClibc-snapshot.tar.bz2
    --2008-06-02 17:48:21--  http://www.uclibc.org/downloads/snapshots/uClibc-snapshot.tar.bz2
    Resolving www.uclibc.org... 140.211.166.42
    Connecting to www.uclibc.org|140.211.166.42|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 3534786 (3.4M) [application/x-tar]
    Saving to: `/opt/slug/optware/oleg/toolchain/buildroot/dl/uClibc-snapshot.tar.bz2'
    
    100%[=======================================================================================================================================>] 3,534,786   11.0K/s   in 6m 20s
    
    2008-06-02 17:54:42 (9.09 KB/s) - `/opt/slug/optware/oleg/toolchain/buildroot/dl/uClibc-snapshot.tar.bz2' saved [3534786/3534786]
    
    mkdir -p /opt/slug/optware/oleg/toolchain/buildroot/toolchain_build_mipsel
    bzcat /opt/slug/optware/oleg/toolchain/buildroot/dl/uClibc-snapshot.tar.bz2 | tar -C /opt/slug/optware/oleg/toolchain/buildroot/toolchain_build_mipsel   -xf -
    toolchain/patch-kernel.sh /opt/slug/optware/oleg/toolchain/buildroot/toolchain_build_mipsel/uClibc toolchain/uClibc/ uClibc-0.9.29\*.patch
    cat ../../sources/buildroot/uClibc-patches/*.patch | patch -d /opt/slug/optware/oleg/toolchain/buildroot/toolchain_build_mipsel/uClibc -p1
    patching file Makefile
    Hunk #1 FAILED at 163.
    1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej
    patching file libc/sysdeps/linux/mips/sigaction.c
    Hunk #1 FAILED at 49.
    1 out of 1 hunk FAILED -- saving rejects to file libc/sysdeps/linux/mips/sigaction.c.rej
    patching file libc/sysdeps/linux/mips/pipe.S
    Hunk #1 FAILED at 10.
    ...
    this comes due to the fact that the latest snapshot version of uclibc gets downloded. the snapshot seems to be version 0.9.29(?) but the patches are for version 0.9.28. while configuring the kernel, there was no possibility to select another uclibc version as the snapshot was pre-selected.

    Code:
    uClibc C library Version
      1. uClibc 0.9.28 (BR2_UCLIBC_VERSION_0_9_28)
    > 2. daily snapshot (BR2_UCLIBC_VERSION_SNAPSHOT)
    choice[1-2?]: 2
    Date (yyyymmdd) of snapshot or 'snapshot' for latest (BR2_USE_UCLIBC_SNAPSHOT) [snapshot] (NEW)
    i also worked around that problem by inserting the following line in buildroot.mk which is located in oleg/make/

    Code:
    247   ...
    247   #       change uclibc version from snapshot to 0.9.28
    248   sed -i -e 's|^# BR2_UCLIBC_VERSION_0_9_28 is not set|BR2_UCLIBC_VERSION_0_9_28=y|' $(BUILDROOT_BUILD_DIR)/.config
    249   sed -i -e 's|^BR2_UCLIBC_VERSION_SNAPSHOT=.*|# BR2_UCLIBC_VERSION_SNAPSHOT is not set|' $(BUILDROOT_BUILD_DIR)/.config
    250 #endif
    251 #	change toolchain staging dir
    now uclibc 0.9.28 is used and the build comes pretty far until uclibc++ has to be build. this fails with the following errors

    Code:
    ...
    make -C abi/libgcc_eh all
    make[3]: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-gcc: Command not found
    make[3]: Entering directory `/opt/slug/optware/oleg/builds/libuclibc++/src/abi/libgcc_eh'
    /bin/sh: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-gcc: No such file or directory
    /bin/sh: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-ld: No such file or directory
    /bin/sh: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-gcc: No such file or directory
    ../../../scripts/find_libgcc_eh.sh: line 8: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-gcc: No such file or directory
    /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-ar x
    make[3]: /opt/slug/optware/oleg/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-ar: Command not found
    make[3]: *** [unwind-c.o] Error 127
    make[3]: Leaving directory `/opt/slug/optware/oleg/builds/libuclibc++/src/abi/libgcc_eh'
    make[2]: *** [libgcc_eh] Error 2
    make[2]: Leaving directory `/opt/slug/optware/oleg/builds/libuclibc++/src'
    make[1]: *** [all] Error 2
    make[1]: Leaving directory `/opt/slug/optware/oleg/builds/libuclibc++'
    now one can see that the non existence of the path defined in TARGET_CC causes serious build failures. all the binaries like gcc, ld and ar were build along uclibc but just exist in the staging dir of uclibc

    Code:
    $ cd /opt/slug/optware/oleg/toolchain/buildroot/build_mipsel/staging_dir/mipsel-linux-uclibc/bin
    $ la
    > ./  ../  ar*  as*  cc@  gcc*  ld*  nm*  objdump*  ranlib*  strip*
    now i give up at this point as i have no idea why all this errors occur. maybe some of u people can help me further in getting the toolchain to compile as i would like to add some packages for the asus wl550g router.

    txs in advance and sorry for the long post.
    peace olo

Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 3
    Last Post: 05-02-2008, 08:59
  2. Compiling imageMagick with Magick++ support
    By neil in forum WL-500g Q&A
    Replies: 0
    Last Post: 04-02-2008, 12:14
  3. compiling the 1972 firmware sources
    By neweb in forum WL-500gP Firmware Discussion
    Replies: 1
    Last Post: 06-02-2007, 16:52
  4. compiling toolchain based on the latest uClibc
    By ja.ro in forum WL-500g Custom Development
    Replies: 4
    Last Post: 11-04-2005, 14:36

Tags for this Thread

Posting Permissions

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